pub struct MspAnalog {
pub battery_voltage: u8,
pub mah_drawn: u16,
pub rssi: u16,
pub amperage: i16,
}Fields§
§battery_voltage: u8§mah_drawn: u16§rssi: u16§amperage: i16Current in 0.01A steps, range is -320A to 320A
Implementations§
Source§impl MspAnalog
impl MspAnalog
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<'de> Deserialize<'de> for MspAnalog
impl<'de> Deserialize<'de> for MspAnalog
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 PackedStruct<[u8; 7]> for MspAnalog
Structure that can be packed an unpacked into 7 bytes.
impl PackedStruct<[u8; 7]> for MspAnalog
Structure that can be packed an unpacked into 7 bytes.
| Bit, MSB0 | Name | Type |
| 0:7 | battery_voltage | u8 |
| 8:23 | mah_drawn | u16 |
| 24:39 | rssi | u16 |
| 40:55 | amperage | i16 |
Source§impl PackedStructDebug for MspAnalog
impl PackedStructDebug for MspAnalog
Source§impl PackedStructInfo for MspAnalog
impl PackedStructInfo for MspAnalog
Source§fn packed_bits() -> usize
fn packed_bits() -> usize
Number of bits that this structure occupies when being packed.
Source§impl PackedStructSlice for MspAnalog
impl PackedStructSlice for MspAnalog
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.
impl Copy for MspAnalog
Auto Trait Implementations§
impl Freeze for MspAnalog
impl RefUnwindSafe for MspAnalog
impl Send for MspAnalog
impl Sync for MspAnalog
impl Unpin for MspAnalog
impl UnsafeUnpin for MspAnalog
impl UnwindSafe for MspAnalog
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