pub struct BatteryState {
pub millivolts: u16,
pub milliamps: i16,
pub remaining_percent: u16,
pub remaining_capacity_milliamphours: u16,
pub remaining_runtime_minutes: u16,
pub time_to_full_minutes: u16,
}Expand description
Aggregate battery state of the UPS Hat E.
A negative milliamps value indicates the UPS is discharging the battery cells. A positive
milliamps value indicates the UPS has USB-C power and is charging.
The Waveshare wiki states it may take a few charge cycles for the UPS to calibrate the
remaining_* and time_to_full_minutes values correctly.
Fields§
§millivolts: u16§milliamps: i16§remaining_percent: u16§remaining_capacity_milliamphours: u16§remaining_runtime_minutes: u16§time_to_full_minutes: u16Trait Implementations§
Auto Trait Implementations§
impl Freeze for BatteryState
impl RefUnwindSafe for BatteryState
impl Send for BatteryState
impl Sync for BatteryState
impl Unpin for BatteryState
impl UnwindSafe for BatteryState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more