CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
host_api_power.cpp File Reference

Real implementations of the power-state host API. More...

Go to the source code of this file.

Classes

class  IPowerManager

Functions

void * plg_get_active_plugin (void)
uint16_t host_battery_mv (void)
 Battery voltage in millivolts.
uint8_t host_battery_pct (void)
 Battery state of charge as 0..100 percent.
bool host_is_usb_connected (void)
 True when USB VBUS is detected.
uint8_t host_power_source (void)
 Active power source - one of POWER_SRC_*.
uint8_t host_charge_status (void)
 Charger state machine value - one of CHARGE_*.
bool host_is_battery_low (void)
 True when battery has crossed the low-warning threshold.
bool host_is_battery_critical (void)
 True when battery has crossed the critical-shutdown threshold.
void host_set_sleep_inhibit (uint32_t on)
 Hold or release a light-sleep inhibitor for the calling plugin. While any inhibitor is held the badge does not enter light sleep, so a background plugin keeps ticking. Keyed by the plugin id and released automatically when the plugin is unloaded.
IPowerManagergetPowerManagerInstance ()
 Returns the singleton power manager instance.

Detailed Description

Real implementations of the power-state host API.

Definition in file host_api_power.cpp.

Function Documentation

◆ getPowerManagerInstance()

Returns the singleton power manager instance.

Returns
Pointer to the global IPowerManager implementation.

Definition at line 636 of file BQ25895Power.cpp.

Referenced by host_battery_mv(), host_battery_pct(), host_charge_status(), host_is_battery_critical(), host_is_battery_low(), host_is_usb_connected(), and host_power_source().

◆ plg_get_active_plugin()

void * plg_get_active_plugin ( void )

Definition at line 24 of file plugin_log_bridge.cpp.

Referenced by host_set_sleep_inhibit().