PebbleOS v4.47.0-505-g4bbc630fa
Loading...
Searching...
No Matches
Simulator

Simulated charger, with a full battery and no external power until pbl_charger_sim_set() changes it. More...

Macros

#define SIM_CHARGER   (&pbl_charger_sim)
 The simulated charger.
 

Functions

void pbl_charger_sim_set (uint8_t percent, int32_t voltage_mv, bool online)
 Set the battery state.
 
uint8_t pbl_charger_sim_get_percent (void)
 Get the charge percentage last set.
 

Detailed Description

Simulated charger, with a full battery and no external power until pbl_charger_sim_set() changes it.

Macro Definition Documentation

◆ SIM_CHARGER

#define SIM_CHARGER   (&pbl_charger_sim)

The simulated charger.

Function Documentation

◆ pbl_charger_sim_get_percent()

uint8_t pbl_charger_sim_get_percent ( void  )

Get the charge percentage last set.

Lets the battery service skip the lossy voltage curve round trip.

Returns
Charge percentage, 0 to 100.

◆ pbl_charger_sim_set()

void pbl_charger_sim_set ( uint8_t  percent,
int32_t  voltage_mv,
bool  online 
)

Set the battery state.

An external power change is reported to the listener.

Parameters
percentCharge percentage, capped at 100.
voltage_mvBattery voltage in mV.
onlineWhether external power is present.