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

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.

Set the bitrange corresponding to the FlashTargetToRead of the target bitfield.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The message type.

The message name.

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Get the message name.

Get the message type.

Get the sender_id if it is set.

Set the sender id.

Number of bytes this message will take on the wire.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.