54typedef enum : uint8_t {
68typedef enum : uint8_t {
ra8_batt_threshold_t
Nag thresholds and hysteresis margin, in whole percent.
@ k_ra8_batt_pct_max
SOC clamp ceiling.
@ k_ra8_batt_critical_pct
Critical threshold (inclusive).
@ k_ra8_batt_low_pct
Low-battery threshold (inclusive).
@ k_ra8_batt_rearm_margin
Hysteresis above a band to re-arm it.
ra8_err_t ra8_batt_update(ra8_batt_monitor_t *mon, uint8_t soc_pct, bool charging, ra8_batt_nag_t *out_nag)
Fold one SOC reading into the monitor and report the nag to raise.
ra8_batt_nag_t
The low-battery warning a single ra8_batt_update step raises.
@ k_ra8_batt_nag_none
No new warning this step.
@ k_ra8_batt_nag_critical
SOC fell to the critical band (<=10%).
@ k_ra8_batt_nag_low
SOC fell to the low band (<=20%).
ra8_err_t ra8_batt_monitor_init(ra8_batt_monitor_t *mon)
Reset a nag monitor to the un-nagged, fully-armed state.
const char * ra8_batt_nag_str(ra8_batt_nag_t nag)
Map a nag level to a short, stable upper-case label.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Caller-owned nag state carried across ra8_batt_update calls.
bool low_raised
Low nag raised and not yet re-armed.
bool critical_raised
Critical nag raised and not yet re-armed.