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: impl Peripheral<P = FLASH> + 'd) -> Self
pub fn new_blocking(p: impl Peripheral<P = FLASH> + 'd) -> 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 into_blocking_regions(self) -> FlashLayout<'d, Blocking>
pub fn into_blocking_regions(self) -> FlashLayout<'d, Blocking>
Split this flash driver into one instance per flash memory region.
See module-level documentation for details on how memory regions work.
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
.
Trait Implementations§
Source§impl<MODE> NorFlash for Flash<'_, MODE>
impl<MODE> NorFlash for Flash<'_, MODE>
Source§const WRITE_SIZE: usize = 32usize
const WRITE_SIZE: usize = 32usize
The minumum number of bytes the storage peripheral can write
Source§const ERASE_SIZE: usize = 8_192usize
const ERASE_SIZE: usize = 8_192usize
The minumum number of bytes the storage peripheral can erase
Auto Trait Implementations§
impl<'d, MODE> Freeze for Flash<'d, MODE>
impl<'d, MODE> RefUnwindSafe for Flash<'d, MODE>where
MODE: RefUnwindSafe,
impl<'d, MODE> Send for Flash<'d, MODE>where
MODE: Send,
impl<'d, MODE> Sync for Flash<'d, MODE>where
MODE: Sync,
impl<'d, MODE> Unpin for Flash<'d, MODE>where
MODE: Unpin,
impl<'d, MODE = Async> !UnwindSafe for Flash<'d, MODE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more