PebbleOS
Loading...
Searching...
No Matches
Data Structures | Functions
battery_state.h File Reference
#include <pbl/services/new_timer/new_timer.h>
#include <stdbool.h>
#include <stdint.h>

Data Structures

struct  BatteryChargeState
 Structure for retrieval of the battery charge state. More...
 
struct  PreciseBatteryChargeState
 Structure for retrieval of the exact battery charge state. More...
 

Functions

BatteryChargeState battery_get_charge_state (void)
 Get the current battery charge state.
 
void battery_state_force_update (void)
 Sample the battery now instead of waiting for the next periodic update.
 
void battery_state_init (void)
 Initialize battery state tracking and take the first sample.
 
void battery_state_handle_connection_event (bool is_connected)
 Handle a charger connection change.
 
void battery_state_reset_filter (void)
 Reset the voltage filter to the current reading.
 
uint16_t battery_state_get_voltage (void)
 Get the last recorded battery voltage.
 
int32_t battery_state_get_temperature (void)
 Get the last recorded battery temperature.
 
TimerID battery_state_get_periodic_timer_id (void)
 Get the periodic sampling timer, for unit tests.