Struct multiwii_serial_protocol::structs::MspBatteryState
[−]
[src]
pub struct MspBatteryState { pub battery_cell_count: u8, pub battery_capacity: u16, pub battery_voltage: u8, pub mah_drawn: u16, pub amperage: i16, pub alerts: u8, }
Fields
battery_cell_count: u8
battery_capacity: u16
mAh
battery_voltage: u8
mah_drawn: u16
amperage: i16
0.01A
alerts: u8
Methods
impl MspBatteryState
[src]
fn packed_struct_display_formatter<'a>(
&'a self
) -> PackedStructDisplay<'a, Self, [u8; 9]>
[src]
&'a self
) -> PackedStructDisplay<'a, Self, [u8; 9]>
Display formatter for console applications
Trait Implementations
impl PackedStruct<[u8; 9]> for MspBatteryState
[src]
Structure that can be packed an unpacked into 9 bytes.
Bit, MSB0 | Name | Type |
0:7 | battery_cell_count | u8 |
8:23 | battery_capacity | u16 |
24:31 | battery_voltage | u8 |
32:47 | mah_drawn | u16 |
48:63 | amperage | i16 |
64:71 | alerts | u8 |
fn pack(&self) -> [u8; 9]
[src]
Packs the structure into a byte array.
fn unpack(src: &[u8; 9]) -> Result<MspBatteryState, PackingError>
[src]
Unpacks the structure from a byte array.
impl PackedStructInfo for MspBatteryState
[src]
fn packed_bits() -> usize
[src]
Number of bits that this structure occupies when being packed.
impl PackedStructSlice for MspBatteryState
[src]
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
[src]
Pack the structure into an output buffer.
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
[src]
Unpack the structure from a buffer.
fn packed_bytes() -> usize
[src]
Number of bytes that this structure demands for packing or unpacking.
fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError>
[src]
Pack the structure into a new byte vector.
impl PackedStructDebug for MspBatteryState
[src]
fn fmt_fields(&self, fmt: &mut Formatter) -> Result<(), Error>
[src]
fn packed_struct_display_header() -> &'static str
[src]
impl Display for MspBatteryState
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Debug for MspBatteryState
[src]
impl Copy for MspBatteryState
[src]
impl Clone for MspBatteryState
[src]
fn clone(&self) -> MspBatteryState
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more