Struct sbp::messages::flash::msg_flash_program::MsgFlashProgram
source · pub struct MsgFlashProgram {
pub sender_id: Option<u16>,
pub target: u8,
pub addr_start: [u8; 3],
pub addr_len: u8,
pub data: Vec<u8>,
}
Expand description
Program flash addresses
The flash program message programs a set of addresses of either the STM or M25 flash. The device replies with either a MSG_FLASH_DONE message containing the return code FLASH_OK (0) on success, or FLASH_INVALID_LEN (2) if the maximum write size is exceeded. Note that the sector-containing addresses must be erased before addresses can be programmed.
Fields§
§sender_id: Option<u16>
The message sender_id
target: u8
Target flags
addr_start: [u8; 3]
Starting address offset to program
addr_len: u8
Length of set of addresses to program, counting up from starting address
data: Vec<u8>
Data to program addresses with, with length N=addr_len
Implementations§
source§impl MsgFlashProgram
impl MsgFlashProgram
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 MsgFlashProgram
impl Clone for MsgFlashProgram
source§fn clone(&self) -> MsgFlashProgram
fn clone(&self) -> MsgFlashProgram
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConcreteMessage for MsgFlashProgram
impl ConcreteMessage for MsgFlashProgram
source§const MESSAGE_TYPE: u16 = 230u16
const MESSAGE_TYPE: u16 = 230u16
source§const MESSAGE_NAME: &'static str = "MSG_FLASH_PROGRAM"
const MESSAGE_NAME: &'static str = "MSG_FLASH_PROGRAM"
source§impl Debug for MsgFlashProgram
impl Debug for MsgFlashProgram
source§impl<'de> Deserialize<'de> for MsgFlashProgram
impl<'de> Deserialize<'de> for MsgFlashProgram
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 MsgFlashProgram
impl FriendlyName for MsgFlashProgram
fn friendly_name() -> &'static str
source§impl From<MsgFlashProgram> for Sbp
impl From<MsgFlashProgram> for Sbp
source§fn from(msg: MsgFlashProgram) -> Self
fn from(msg: MsgFlashProgram) -> Self
source§impl PartialEq for MsgFlashProgram
impl PartialEq for MsgFlashProgram
source§fn eq(&self, other: &MsgFlashProgram) -> bool
fn eq(&self, other: &MsgFlashProgram) -> bool
self
and other
values to be equal, and is used
by ==
.