WriteErase

Trait WriteErase 

Source
pub trait WriteErase {
    type NativeType;

    // Required methods
    fn status(&self) -> Result;
    fn erase_page(&mut self, page: FlashPage) -> Result;
    fn write_native(
        &mut self,
        address: usize,
        array: &[Self::NativeType],
    ) -> Result;
    fn write(&mut self, address: usize, data: &[u8]) -> Result;
}

Required Associated Types§

Source

type NativeType

Native type of the flash for writing with the correct alignment and size

Can be u8, u16, u32, …, or any user defined type

Required Methods§

Source

fn status(&self) -> Result

check flash status

Source

fn erase_page(&mut self, page: FlashPage) -> Result

Erase specified flash page.

Source

fn write_native(&mut self, address: usize, array: &[Self::NativeType]) -> Result

The smallest possible write, depends on platform

Source

fn write(&mut self, address: usize, data: &[u8]) -> Result

Read a buffer of bytes to memory, this uses the native writes internally and if it’s not the same length and a set of native writes the write will be padded to fill a native write.

Implementors§