pub struct Flash<'d, MODE = Async> { /* private fields */ }Expand description
Internal flash memory driver.
Implementations§
Source§impl<'d> Flash<'d, Blocking>
impl<'d> Flash<'d, Blocking>
Sourcepub fn new_blocking(p: Peri<'d, FLASH>) -> Self
pub fn new_blocking(p: Peri<'d, FLASH>) -> Self
Create a new flash driver, usable in blocking mode.
Source§impl<'d, MODE> Flash<'d, MODE>
impl<'d, MODE> Flash<'d, MODE>
Sourcepub fn blocking_read(
&mut self,
offset: u32,
bytes: &mut [u8],
) -> Result<(), Error>
pub fn blocking_read( &mut self, offset: u32, bytes: &mut [u8], ) -> Result<(), Error>
Blocking read.
NOTE: offset is an offset from the flash start, NOT an absolute address.
For example, to read address 0x0800_1234 you have to use offset 0x1234.
Sourcepub fn blocking_write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Error>
pub fn blocking_write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Error>
Blocking write.
NOTE: offset is an offset from the flash start, NOT an absolute address.
For example, to write address 0x0800_1234 you have to use offset 0x1234.
Sourcepub fn blocking_erase(&mut self, from: u32, to: u32) -> Result<(), Error>
pub fn blocking_erase(&mut self, from: u32, to: u32) -> Result<(), Error>
Blocking erase.
NOTE: from and to are offsets from the flash start, NOT an absolute address.
For example, to erase address 0x0801_0000 you have to use offset 0x1_0000.
Trait Implementations§
Source§impl<MODE> NorFlash for Flash<'_, MODE>
impl<MODE> NorFlash for Flash<'_, MODE>
Source§const WRITE_SIZE: usize = WRITE_SIZE
const WRITE_SIZE: usize = WRITE_SIZE
The minumum number of bytes the storage peripheral can write
Source§const ERASE_SIZE: usize = WRITE_SIZE
const ERASE_SIZE: usize = WRITE_SIZE
The minumum number of bytes the storage peripheral can erase
Source§impl<MODE> ReadNorFlash for Flash<'_, MODE>
impl<MODE> ReadNorFlash for Flash<'_, MODE>
Source§const READ_SIZE: usize = READ_SIZE
const READ_SIZE: usize = READ_SIZE
The minumum number of bytes the storage peripheral can read