Struct sbp::messages::flash::msg_flash_erase::MsgFlashErase
source · pub struct MsgFlashErase {
pub sender_id: Option<u16>,
pub target: u8,
pub sector_num: u32,
}
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§
source§impl 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§
source§impl Clone for MsgFlashErase
impl Clone for MsgFlashErase
source§fn clone(&self) -> MsgFlashErase
fn clone(&self) -> MsgFlashErase
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConcreteMessage for MsgFlashErase
impl ConcreteMessage for MsgFlashErase
source§const MESSAGE_TYPE: u16 = 226u16
const MESSAGE_TYPE: u16 = 226u16
source§const MESSAGE_NAME: &'static str = "MSG_FLASH_ERASE"
const MESSAGE_NAME: &'static str = "MSG_FLASH_ERASE"
source§impl Debug for MsgFlashErase
impl Debug for MsgFlashErase
source§impl<'de> Deserialize<'de> for MsgFlashErase
impl<'de> Deserialize<'de> for MsgFlashErase
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>,
source§impl FriendlyName for MsgFlashErase
impl FriendlyName for MsgFlashErase
fn friendly_name() -> &'static str
source§impl From<MsgFlashErase> for Sbp
impl From<MsgFlashErase> for Sbp
source§fn from(msg: MsgFlashErase) -> Self
fn from(msg: MsgFlashErase) -> Self
source§impl PartialEq for MsgFlashErase
impl PartialEq for MsgFlashErase
source§fn eq(&self, other: &MsgFlashErase) -> bool
fn eq(&self, other: &MsgFlashErase) -> bool
self
and other
values to be equal, and is used
by ==
.