Struct sbp::messages::flash::msg_flash_erase::MsgFlashErase
source · [−]Expand description
Erase sector of device flash memory (host => device)
The flash erase message from the host erases a sector of either the STM or M25 onboard flash memory. The device will reply with a MSG_FLASH_DONE message containing the return code - FLASH_OK (0) on success or FLASH_INVALID_FLASH (1) if the flash specified is invalid.
Fields
sender_id: Option<u16>
The message sender_id
target: u8
Target flags
sector_num: u32
Flash sector number to erase (0-11 for the STM, 0-15 for the M25)
Implementations
sourceimpl MsgFlashErase
impl MsgFlashErase
sourcepub fn flash_target_to_read(&self) -> Result<FlashTargetToRead, u8>
pub fn flash_target_to_read(&self) -> Result<FlashTargetToRead, u8>
Gets the FlashTargetToRead stored in the target
bitfield.
Returns Ok
if the bitrange contains a known FlashTargetToRead
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of FlashTargetToRead
were added.
sourcepub fn set_flash_target_to_read(
&mut self,
flash_target_to_read: FlashTargetToRead
)
pub fn set_flash_target_to_read(
&mut self,
flash_target_to_read: FlashTargetToRead
)
Set the bitrange corresponding to the FlashTargetToRead of the target
bitfield.
Trait Implementations
sourceimpl Clone for MsgFlashErase
impl Clone for MsgFlashErase
sourcefn clone(&self) -> MsgFlashErase
fn clone(&self) -> MsgFlashErase
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ConcreteMessage for MsgFlashErase
impl ConcreteMessage for MsgFlashErase
sourceconst MESSAGE_TYPE: u16 = 226u16
const MESSAGE_TYPE: u16 = 226u16
The message type.
sourceconst MESSAGE_NAME: &'static str = "MSG_FLASH_ERASE"
const MESSAGE_NAME: &'static str = "MSG_FLASH_ERASE"
The message name.
sourceimpl Debug for MsgFlashErase
impl Debug for MsgFlashErase
sourceimpl From<MsgFlashErase> for Sbp
impl From<MsgFlashErase> for Sbp
sourcefn from(msg: MsgFlashErase) -> Self
fn from(msg: MsgFlashErase) -> Self
Converts to this type from the input type.
sourceimpl SbpMessage for MsgFlashErase
impl SbpMessage for MsgFlashErase
sourcefn message_name(&self) -> &'static str
fn message_name(&self) -> &'static str
Get the message name.
sourcefn message_type(&self) -> u16
fn message_type(&self) -> u16
Get the message type.
sourcefn set_sender_id(&mut self, new_id: u16)
fn set_sender_id(&mut self, new_id: u16)
Set the sender id.
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Number of bytes this message will take on the wire.
Auto Trait Implementations
impl RefUnwindSafe for MsgFlashErase
impl Send for MsgFlashErase
impl Sync for MsgFlashErase
impl Unpin for MsgFlashErase
impl UnwindSafe for MsgFlashErase
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more