-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
686daec
commit 61fe9d5
Showing
13 changed files
with
194 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
cheali-charger - open source firmware for a variety of LiPo chargers | ||
Copyright (C) 2014 Paweł Stawicki. All right reserved. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef PINS_H_ | ||
#define PINS_H_ | ||
|
||
#define V_IN_PIN 1 | ||
|
||
#define OUTPUT_VOLTAGE_POLARITY_PIN 36 | ||
#define OUTPUT_VOLTAGE_PIN 43 | ||
#define OUTPUT_DISABLE_PIN 32 | ||
|
||
#define DISCHARGE_CURRENT_PIN 45 | ||
#define DISCHARGE_VALUE_PIN 23 | ||
#define DISCHARGE_DISABLE_PIN 33 | ||
|
||
#define SMPS_VALUE_BOOST_PIN 23 | ||
#define SMPS_VALUE_BUCK_PIN 22 | ||
#define SMPS_DISABLE_PIN 25 | ||
#define SMPS_BOOST_DISABLE_PIN 24 | ||
#define SMPS_CURRENT_PIN 44 | ||
|
||
#define UART_TX_PIN 7 | ||
#define BUZZER_PIN 12 | ||
#define BACKLIGHT_PIN 21 | ||
#define FAN_ENABLE 26 | ||
|
||
#define LCD_D0_PIN 10 | ||
#define LCD_D1_PIN 11 | ||
#define LCD_D2_PIN 13 | ||
#define LCD_D3_PIN 14 | ||
#define LCD_ENABLE_PIN 19 | ||
#define LCD_RS_PIN 20 | ||
|
||
#define BUTTON_STOP_PIN 28 | ||
#define BUTTON_DEC_PIN 29 | ||
#define BUTTON_INC_PIN 30 | ||
#define BUTTON_START_PIN 31 | ||
|
||
#define BALANCER1_LOAD_PIN 40 | ||
#define BALANCER2_LOAD_PIN 39 | ||
#define BALANCER3_LOAD_PIN 38 | ||
#define BALANCER4_LOAD_PIN 37 | ||
#define BALANCER5_LOAD_PIN 35 | ||
#define BALANCER6_LOAD_PIN 34 | ||
|
||
#define MUX_ADR0_PIN 9 | ||
#define MUX_ADR1_PIN 8 | ||
#define MUX_ADR2_PIN 48 | ||
#define MUX0_Z_D_PIN 47 | ||
|
||
#define MADDR_V_BALANSER1 0 | ||
#define MADDR_V_BALANSER2 1 | ||
#define MADDR_V_BALANSER3 2 | ||
#define MADDR_V_BALANSER4 3 | ||
#define MADDR_V_BALANSER5 4 | ||
#define MADDR_V_BALANSER6 5 | ||
#define MADDR_V_GND_REF 6 | ||
#define MADDR_V_OUTMUX 7 | ||
|
||
#define T_EXTERNAL_PIN 3 | ||
#define T_INTERNAL_PIN 3+128 | ||
|
||
#endif /* PINS_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,6 @@ | |
#ifndef HARDWARE_H_ | ||
#define HARDWARE_H_ | ||
|
||
#include "CQ3.h" | ||
#include "C3.h" | ||
|
||
#endif /* HARDWARE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
|
||
set(GENERIC_SOURCE | ||
CQ3.cpp | ||
CQ3.h | ||
CQ3-pins.h | ||
C3.cpp | ||
C3.h | ||
C3-pins.h | ||
SMPS_PID.h | ||
SMPS_PID.cpp | ||
AnalogInputsADC.cpp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/hardware/nuvoton-M051/targets/ev-peak-c3/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
set(hardware ev-peak-c3) | ||
|
||
set(SOURCE_FILES | ||
defaultCalibration.cpp | ||
HardwareConfig.h | ||
) | ||
|
||
CHEALI_CPU(nuvoton-M051) | ||
CHEALI_GENERIC_CHARGER(ev-peak-c3) | ||
|
||
add_definitions(-D__HXT=12000000UL) # External Crystal Clock Frequency | ||
|
||
CHEALI_GENERATE_ARM_EXEC() |
47 changes: 47 additions & 0 deletions
47
src/hardware/nuvoton-M051/targets/ev-peak-c3/HardwareConfig.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
cheali-charger - open source firmware for a variety of LiPo chargers | ||
Copyright (C) 2013 Paweł Stawicki. All right reserved. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef HARDWARE_CONFIG_H_ | ||
#define HARDWARE_CONFIG_H_ | ||
|
||
#include "GlobalConfig.h" | ||
#include "HardwareConfigGeneric.h" | ||
#include "C3-pins.h" | ||
|
||
// workaround for building, remove | ||
#ifndef PINS_H_ | ||
#define PINS_H_ | ||
#endif | ||
|
||
// #define ENABLE_HELPER | ||
// #define ENABLE_HELPER_ANALOG_INPUTS_ANALYZER | ||
|
||
#define MAX_CHARGE_V ANALOG_VOLT(27.000) | ||
#define MAX_CHARGE_I ANALOG_AMP(5.000) | ||
#define MAX_CHARGE_P ANALOG_WATT(50.000) | ||
|
||
#define MAX_DISCHARGE_P ANALOG_WATT(5.000) | ||
#define MAX_DISCHARGE_I ANALOG_AMP(1.000) | ||
|
||
//1-13? correlation | ||
#define SMPS_UPPERBOUND_VALUE (60000) | ||
//TODO: ?? pwm_n in outputPWM.cpp | ||
#define DISCHARGER_UPPERBOUND_VALUE 32760 | ||
|
||
|
||
|
||
#endif /* HARDWARE_CONFIG_H_ */ |
46 changes: 46 additions & 0 deletions
46
src/hardware/nuvoton-M051/targets/ev-peak-c3/defaultCalibration.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
cheali-charger - open source firmware for a variety of LiPo chargers | ||
Copyright (C) 2014 Paweł Stawicki. All right reserved. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "AnalogInputsPrivate.h" | ||
#include "memory.h" | ||
#include "Utils.h" | ||
|
||
const AnalogInputs::DefaultValues AnalogInputs::inputsP_[] PROGMEM = { | ||
{{0, 50}, {25540, 23735}}, // Vout_plus_pin | ||
{{0, 50}, {25540, 23735}}, // Vout_minus_pin | ||
{{417, 100}, {5062, 1000}}, // Ismps | ||
{{1983, 100}, {5839, 300}}, // Idischarge | ||
|
||
{{0, 0}, {1, 1}}, // VoutMux | ||
{{8000, 5940}, {8642, 3479}}, // Tintern | ||
{{0, 0}, {23492, 14052}}, // Vin | ||
{{4701, 3660}, {0, 0}}, // Textern | ||
|
||
{{0, 0}, {25219, 3946}}, // Vb0_pin | ||
{{0, 0}, {25219, 3946}}, // Vb1_pin | ||
{{0, 0}, {50664, 7892}}, // Vb2_pin | ||
{{0, 0}, {26372, 4082}}, // Vb3_pin | ||
{{0, 0}, {25184, 3912}}, // Vb4_pin | ||
{{0, 0}, {25169, 3916}}, // Vb5_pin | ||
{{0, 0}, {25405, 3933}}, // Vb6_pin | ||
|
||
{{415, 100}, {5066, 1000}}, // IsmpsSet | ||
{{3175, 100}, {9278, 300}}, // IdischargeSet | ||
}; | ||
|
||
STATIC_ASSERT(sizeOfArray(AnalogInputs::inputsP_) == AnalogInputs::PHYSICAL_INPUTS); |