29 #define HW_POWER_CTX_SIZE 64 32 typedef struct hw_power_t hw_power_t;
65 uint32_t value,
void *user_data);
85 hw_power_t *
hw_power_init(uint8_t gpio_vsys, uint8_t gpio_vbus,
void hw_power_finalize(hw_power_t *power)
Finalize and release any resources.
System management functions.
hw_power_t * hw_power_init(uint8_t gpio_vsys, uint8_t gpio_vbus, hw_power_callback_t callback, void *user_data)
Initialize power management.
bool hw_power_valid(hw_power_t *power)
Determine if the power handle is initialized and usable.
void(* hw_power_callback_t)(hw_power_t *power, hw_power_flag_t flags, uint32_t value, void *user_data)
Power status callback prototype.
hw_power_flag_t
Power source capability / status flags.
uint8_t hw_power_battery_percent(hw_power_t *power)
Approximate battery state of charge.
hw_power_flag_t hw_power_source(hw_power_t *power)
Current detected power source(s).