pub struct Flash<'d, MODE = Async> { /* private fields */ }
Expand description
Internal flash memory driver.
Implementations§
Source§impl<'d> Flash<'d, Async>
impl<'d> Flash<'d, Async>
Sourcepub fn new(
p: impl Peripheral<P = FLASH> + 'd,
_irq: impl Binding<FLASH, InterruptHandler> + 'd,
) -> Self
pub fn new( p: impl Peripheral<P = FLASH> + 'd, _irq: impl Binding<FLASH, InterruptHandler> + 'd, ) -> Self
Create a new flash driver with async capabilities.
Sourcepub fn into_regions(self) -> FlashLayout<'d, Async>
pub fn into_regions(self) -> FlashLayout<'d, Async>
Split this flash driver into one instance per flash memory region.
See module-level documentation for details on how memory regions work.
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 NorFlash for Flash<'_, Async>
impl NorFlash for Flash<'_, Async>
Source§const WRITE_SIZE: usize = 4usize
const WRITE_SIZE: usize = 4usize
The minumum number of bytes the storage peripheral can write
Source§const ERASE_SIZE: usize = 131_072usize
const ERASE_SIZE: usize = 131_072usize
The minumum number of bytes the storage peripheral can erase
Source§impl<MODE> NorFlash for Flash<'_, MODE>
impl<MODE> NorFlash for Flash<'_, MODE>
Source§const WRITE_SIZE: usize = 4usize
const WRITE_SIZE: usize = 4usize
The minumum number of bytes the storage peripheral can write
Source§const ERASE_SIZE: usize = 131_072usize
const ERASE_SIZE: usize = 131_072usize
The minumum number of bytes the storage peripheral can erase
Source§impl ReadNorFlash for Flash<'_, Async>
impl ReadNorFlash for Flash<'_, Async>
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