pub struct BmsStatus(/* private fields */);Implementations§
Source§impl BmsStatus
impl BmsStatus
Sourcepub const fn state(&self) -> u8
pub const fn state(&self) -> u8
The system state
BOOT=0,READY=1,CHARGING=2,BALANCING=3,FAULTED=4
Bits: 0..8
Sourcepub const fn with_state_checked(self, value: u8) -> Result<Self, ()>
pub const fn with_state_checked(self, value: u8) -> Result<Self, ()>
The system state
BOOT=0,READY=1,CHARGING=2,BALANCING=3,FAULTED=4
Bits: 0..8
Sourcepub const fn with_state(self, value: u8) -> Self
pub const fn with_state(self, value: u8) -> Self
The system state
BOOT=0,READY=1,CHARGING=2,BALANCING=3,FAULTED=4
Bits: 0..8
Sourcepub const fn set_state(&mut self, value: u8)
pub const fn set_state(&mut self, value: u8)
The system state
BOOT=0,READY=1,CHARGING=2,BALANCING=3,FAULTED=4
Bits: 0..8
Sourcepub const fn set_state_checked(&mut self, value: u8) -> Result<(), ()>
pub const fn set_state_checked(&mut self, value: u8) -> Result<(), ()>
The system state
BOOT=0,READY=1,CHARGING=2,BALANCING=3,FAULTED=4
Bits: 0..8
Sourcepub const fn temp_average(&self) -> f32
pub const fn temp_average(&self) -> f32
Average of all thermistor readings
Units: C
Bits: 8..16
Sourcepub const fn with_temp_average_checked(self, value: f32) -> Result<Self, ()>
pub const fn with_temp_average_checked(self, value: f32) -> Result<Self, ()>
Average of all thermistor readings
Units: C
Bits: 8..16
Sourcepub const fn with_temp_average(self, value: f32) -> Self
pub const fn with_temp_average(self, value: f32) -> Self
Average of all thermistor readings
Units: C
Bits: 8..16
Sourcepub const fn set_temp_average(&mut self, value: f32)
pub const fn set_temp_average(&mut self, value: f32)
Average of all thermistor readings
Units: C
Bits: 8..16
Source§impl BmsStatus
impl BmsStatus
Sourcepub fn try_with_temp_average(self, v: f32) -> Result<Self, OutOfRange>
pub fn try_with_temp_average(self, v: f32) -> Result<Self, OutOfRange>
Like Self::with_temp_average but returns
OutOfRange instead of saturating an unrepresentable value.
Sourcepub fn try_set_temp_average(&mut self, v: f32) -> Result<(), OutOfRange>
pub fn try_set_temp_average(&mut self, v: f32) -> Result<(), OutOfRange>
Like Self::set_temp_average but returns
OutOfRange instead of saturating an unrepresentable value.