|
|
@@ -55,6 +55,16 @@ typedef struct{
|
|
|
SlotState slot_state;
|
|
|
}BatteryMeasurement;
|
|
|
|
|
|
+typedef enum __attribute__((__packed__)){
|
|
|
+ STATE_IDLE,
|
|
|
+ STATE_PRE_CHARGE,
|
|
|
+ STATE_CC_CHARGING,
|
|
|
+ STATE_CV_CHARGING,
|
|
|
+ STATE_DISCHARGING,
|
|
|
+ STATE_FINAL_DISCHARGE,
|
|
|
+ STATE_ERROR,
|
|
|
+}BatteryChargingState;
|
|
|
+
|
|
|
typedef struct{
|
|
|
uint8_t slot_id;
|
|
|
uint16_t pwm_value; //for Power Burning PWM
|
|
|
@@ -66,11 +76,14 @@ typedef struct{
|
|
|
uint8_t cut_off_current;
|
|
|
uint16_t capacitance;
|
|
|
uint8_t charge_fraction;
|
|
|
+ uint8_t cycle_number;
|
|
|
+ uint8_t previous_cycle_number;
|
|
|
+ BatteryChargingState battery_charging_state;
|
|
|
bool batteryLimitReceived;
|
|
|
} BatteryInfo;
|
|
|
|
|
|
extern BatteryInfo battery_data[NUM_SLOTS];
|
|
|
void Battery_Init();
|
|
|
-void Battery_ReadState(uint8_t slot_id);
|
|
|
+void Battery_StateCondition(uint8_t slot_id);
|
|
|
|
|
|
#endif
|