pub trait NorFlash: ReadNorFlash {
    const WRITE_SIZE: usize;
    const ERASE_SIZE: usize;

    fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error>;
    fn write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Self::Error>;
}
Expand description

NOR flash trait.

Required Associated Constants

The minumum number of bytes the storage peripheral can write

The minumum number of bytes the storage peripheral can erase

Required Methods

Erase the given storage range, clearing all data within [from..to]. The given range will contain all 1s afterwards.

This should return an error if the range is not aligned to a proper erase resolution If power is lost during erase, contents of the page are undefined. from and to must both be multiples of ERASE_SIZE and from <= to.

If power is lost during write, the contents of the written words are undefined, but the rest of the page is guaranteed to be unchanged. It is not allowed to write to the same word twice. offset and bytes.len() must both be multiples of WRITE_SIZE.

Implementors