pub struct BatteryStatus {
pub voltage: u16,
pub connected: bool,
pub full: bool,
}Expand description
The battery status info.
Contains only stats that can be accessed from the hardware. It’s responsibility of firefly-runtime to calculate State of Charge and any other metrics it might need.
Fields§
§voltage: u16The current voltage of the battery.
A healthy li-ion battery voltage ranges from 3.0V fully discharged to 4.2V fully charged at 25°C. However, the range changes with age, temperature, and star alignment (the last one is a joke, probably).
Also, the firefly-hal Device implementation doesn’t define the units in which voltage is returned. it can be volts, microvolts, or anything else. The only promise is that it linearly correlates with voltage.
connected: boolIf true, the device is connected to a charger.
It indicates that the battery is charging, unless it’s full.
full: boolIf true, the device is fully charged.