22 #define RAW_BATTERY_MULTIPLIER 0.0075196210
28 #define RAW_VOLTAGE_MAINS 3643u
35 #define RAW_VOLTAGE_ON_BATTERY_HIGH 3590u
41 #define RAW_VOLTAGE_HYSTERESIS 12u
47 #define RAW_VOLTAGE_ON_BATTERY 3085u
53 #define RAW_VOLTAGE_ON_BATTERY_LOW 3005u
59 #define RAW_VOLTAGE_ON_BATTERY_NOT_STARTING_THRESHOLD 3191u
65 #define RAW_VOLTAGE_ON_BATTERY_STOP_THRESHOLD 2660u
68 #define BATTERY_MAX_SAMPLES 20u
uint32_t getBatteryLevelX100()
Returns battery level x100 for better accuracy.
uint32_t getBatteryLevelX10()
Returns battery level x10 for better accuracy.
void updateBatteryState(uint32_t p_cycleNumber)
Updates battery states.
bool isBatteryDeepDischarged()
Check if battery is deeply discharged.
uint32_t getBatteryLevel()
Returns battery level.
void updateBatterySample()
Handle battery voltage calculation.
bool isMainsAvailable()
Check if the cable between power supply and expander input is connected.
bool isBatteryVeryLow()
Check if battery level is very low.
bool isMainsConnected()
Check if mains are connected.
void initBattery()
Initialize battery abstraction.
void batteryLoop(uint32_t p_cycleNumber)
Handle battery events.