|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <battery.h>

Public Member Functions | |
| virtual | ~IBattery ()=default |
| virtual Result< void > | init ()=0 |
| virtual void | sample ()=0 |
| virtual uint16_t | millivolts () const =0 |
| Return the latest measured voltage in millivolts. | |
| virtual uint8_t | percentage () const =0 |
| virtual bool | isConnected () const =0 |
| Report whether a usable battery is connected. | |
| virtual bool | isCharging () const =0 |
| Report whether external charging power is present. | |
Board-level battery telemetry and sampling contract.
Sampling is explicit so PowerManager can adapt its cadence to battery health instead of performing ADC work on every UI tick. Implementations cache the most recent measurement; getters therefore return a coherent last sample without initiating potentially expensive hardware conversions.
|
virtualdefault |
|
pure virtual |
Configure ADC/gauge resources and report whether the backend is usable.
Implemented in ersa::test::MockBattery.
|
pure virtual |
Report whether external charging power is present.
Implemented in ersa::test::MockBattery.
|
pure virtual |
Report whether a usable battery is connected.
Implemented in ersa::test::MockBattery.
|
pure virtual |
Return the latest measured voltage in millivolts.
Implemented in ersa::test::MockBattery.
|
pure virtual |
Return a bounded estimate; voltage-only boards must not imply precision.
Implemented in ersa::test::MockBattery.
|
pure virtual |
Refresh cached telemetry; implementations should keep this bounded.
Implemented in ersa::test::MockBattery.