12class Esp32Battery :
public IBattery {
15 explicit Esp32Battery(
const board::BatteryPins& pins);
16 ~Esp32Battery()
override =
default;
18 Result<void> init()
override;
19 void sample()
override;
20 uint16_t millivolts()
const override;
21 uint8_t percentage()
const override;
22 bool isConnected()
const override;
23 bool isCharging()
const override;
26 board::BatteryPins pins_;
27 uint16_t cachedMillivolts_{0};
28 uint8_t cachedPercentage_{0};
29 bool connected_{
false};
30 bool hasVoltageSample_{
false};
Definition application.h:10