Trait embedded_storage::nor_flash::NorFlash [−][src]
pub trait NorFlash: ReadNorFlash { const WRITE_SIZE: usize; const ERASE_SIZE: usize; fn try_erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error>; fn try_write(
&mut self,
offset: u32,
bytes: &[u8]
) -> Result<(), Self::Error>; }
Expand description
NOR flash trait.
Associated Constants
const WRITE_SIZE: usize
[src]
Expand description
The minumum number of bytes the storage peripheral can write
const ERASE_SIZE: usize
[src]
Expand description
The minumum number of bytes the storage peripheral can erase
Required methods
fn try_erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error>
[src]
Expand description
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
.
fn try_write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Self::Error>
[src]
Expand description
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
.