pub struct MISOFrame { /* private fields */ }
Expand description
The Master In Slave Out frame or the response from the device starts with a start byte. Follwed by the slave adress of the responding device, the command number byte, the State byte, the data length, followed by the data, the checksum and finslly, a stop byte.
Implementations§
Source§impl MISOFrame
impl MISOFrame
Sourcepub fn from_bytes(data: &[u8]) -> Self
pub fn from_bytes(data: &[u8]) -> Self
Parses the data from raw bytes should come from a bytestream of the device
Sourcepub fn get_checksum(&self) -> u8
pub fn get_checksum(&self) -> u8
Returns the checksum
Sourcepub fn calculate_check_sum(&self) -> u8
pub fn calculate_check_sum(&self) -> u8
Calculates the checksum of the MOSI frame
Sourcepub fn validate_checksum(&self) -> bool
pub fn validate_checksum(&self) -> bool
Validates the checksum from the device
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MISOFrame
impl RefUnwindSafe for MISOFrame
impl Send for MISOFrame
impl Sync for MISOFrame
impl Unpin for MISOFrame
impl UnwindSafe for MISOFrame
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