1 #ifndef _TWR_MODULE_BATTERY_H
2 #define _TWR_MODULE_BATTERY_H
void twr_module_battery_set_event_handler(void(*event_handler)(twr_module_battery_event_t, void *), void *event_param)
Set callback function.
void twr_module_battery_init(void)
Initialize Battery Module.
bool twr_module_battery_is_present(void)
Get Battery Module is pressent, can use without twr_module_battery_init.
twr_module_battery_format_t twr_module_battery_get_format()
Get Battery Module format.
bool twr_module_battery_get_voltage(float *voltage)
Get Battery Module voltage.
twr_module_battery_event_t
Battery Module event.
void twr_module_battery_set_update_interval(twr_tick_t interval)
Set update interval.
twr_module_battery_format_t
Battery Module format.
void twr_module_battery_set_threshold_levels(float level_low_threshold, float level_critical_threshold)
Set voltage levels.
bool twr_module_battery_get_charge_level(int *percentage)
Get Battery Module charge in percents.
bool twr_module_battery_measure(void)
Start mesurement.
@ TWR_MODULE_BATTERY_EVENT_LEVEL_LOW
Event low level.
@ TWR_MODULE_BATTERY_EVENT_ERROR
Event error.
@ TWR_MODULE_BATTERY_EVENT_UPDATE
Event update.
@ TWR_MODULE_BATTERY_EVENT_LEVEL_CRITICAL
Event critical level.
@ TWR_MODULE_BATTERY_FORMAT_UNKNOWN
Format is unknown.
@ TWR_MODULE_BATTERY_FORMAT_STANDARD
Format is standard 4xAAA.
@ TWR_MODULE_BATTERY_FORMAT_MINI
Format is mini 2xAAA.
uint64_t twr_tick_t
Timestamp data type.