pub struct MspBatteryConfig {
pub vbat_min_cell_voltage: u8,
pub vbat_max_cell_voltage: u8,
pub vbat_warning_cell_voltage: u8,
pub battery_capacity: u16,
pub voltage_meter_source: u8,
pub current_meter_source: u8,
}Fields§
§vbat_min_cell_voltage: u8§vbat_max_cell_voltage: u8§vbat_warning_cell_voltage: u8§battery_capacity: u16§voltage_meter_source: u8§current_meter_source: u8Implementations§
Source§impl MspBatteryConfig
impl MspBatteryConfig
Sourcepub fn packed_struct_display_formatter<'a>(
&'a self,
) -> PackedStructDisplay<'a, Self, [u8; 7]>
pub fn packed_struct_display_formatter<'a>( &'a self, ) -> PackedStructDisplay<'a, Self, [u8; 7]>
Display formatter for console applications
Trait Implementations§
Source§impl Clone for MspBatteryConfig
impl Clone for MspBatteryConfig
Source§fn clone(&self) -> MspBatteryConfig
fn clone(&self) -> MspBatteryConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MspBatteryConfig
Source§impl Debug for MspBatteryConfig
impl Debug for MspBatteryConfig
Source§impl<'de> Deserialize<'de> for MspBatteryConfig
impl<'de> Deserialize<'de> for MspBatteryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MspBatteryConfig
impl Display for MspBatteryConfig
Source§impl PackedStruct<[u8; 7]> for MspBatteryConfig
Structure that can be packed an unpacked into 7 bytes.
impl PackedStruct<[u8; 7]> for MspBatteryConfig
Structure that can be packed an unpacked into 7 bytes.
| Bit, MSB0 | Name | Type |
| 0:7 | vbat_min_cell_voltage | u8 |
| 8:15 | vbat_max_cell_voltage | u8 |
| 16:23 | vbat_warning_cell_voltage | u8 |
| 24:39 | battery_capacity | u16 |
| 40:47 | voltage_meter_source | u8 |
| 48:55 | current_meter_source | u8 |
Source§impl PackedStructDebug for MspBatteryConfig
impl PackedStructDebug for MspBatteryConfig
Source§impl PackedStructInfo for MspBatteryConfig
impl PackedStructInfo for MspBatteryConfig
Source§fn packed_bits() -> usize
fn packed_bits() -> usize
Number of bits that this structure occupies when being packed.
Source§impl PackedStructSlice for MspBatteryConfig
impl PackedStructSlice for MspBatteryConfig
Source§fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
Pack the structure into an output buffer.
Source§fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
Unpack the structure from a buffer.
Source§fn packed_bytes() -> usize
fn packed_bytes() -> usize
Number of bytes that this structure demands for packing or unpacking.
Source§fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError>
fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError>
Pack the structure into a new byte vector.
Auto Trait Implementations§
impl Freeze for MspBatteryConfig
impl RefUnwindSafe for MspBatteryConfig
impl Send for MspBatteryConfig
impl Sync for MspBatteryConfig
impl Unpin for MspBatteryConfig
impl UnsafeUnpin for MspBatteryConfig
impl UnwindSafe for MspBatteryConfig
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