pub struct Flash<'d, M: Mode> { /* private fields */ }Expand description
Internal flash memory driver.
Implementations§
Source§impl<'d> Flash<'d, Async>
impl<'d> Flash<'d, Async>
Sourcepub fn new(
p: Peri<'d, FLASH>,
_irq: impl Binding<FLASH, InterruptHandler> + 'd,
config: Config,
) -> Self
pub fn new( p: Peri<'d, FLASH>, _irq: impl Binding<FLASH, InterruptHandler> + 'd, config: Config, ) -> 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 async driver 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: Peri<'d, FLASH>, config: Config) -> Self
pub fn new_blocking(p: Peri<'d, FLASH>, config: Config) -> Self
Create a new flash driver, usable in blocking mode.
Source§impl<'d, M: Mode> Flash<'d, M>
impl<'d, M: Mode> Flash<'d, M>
Sourcepub fn into_blocking_regions(self) -> FlashLayout<'d, Blocking>
pub fn into_blocking_regions(self) -> FlashLayout<'d, Blocking>
Split this flash driver into one blocking driver 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 = WRITE_SIZE
const WRITE_SIZE: usize = WRITE_SIZE
The minumum number of bytes the storage peripheral can write
Source§const ERASE_SIZE: usize = MAX_ERASE_SIZE
const ERASE_SIZE: usize = MAX_ERASE_SIZE
The minumum number of bytes the storage peripheral can erase
Source§impl<M: Mode> NorFlash for Flash<'_, M>
impl<M: Mode> NorFlash for Flash<'_, M>
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 = MAX_ERASE_SIZE
const ERASE_SIZE: usize = MAX_ERASE_SIZE
The minumum number of bytes the storage peripheral can erase
Source§impl ReadNorFlash for Flash<'_, Async>
impl ReadNorFlash for Flash<'_, Async>
Source§const READ_SIZE: usize = READ_SIZE
const READ_SIZE: usize = READ_SIZE
The minumum number of bytes the storage peripheral can read
Source§impl<M: Mode> ReadNorFlash for Flash<'_, M>
impl<M: Mode> ReadNorFlash for Flash<'_, M>
Source§const READ_SIZE: usize = READ_SIZE
const READ_SIZE: usize = READ_SIZE
The minumum number of bytes the storage peripheral can read
Auto Trait Implementations§
impl<'d, M> !UnwindSafe for Flash<'d, M>
impl<'d, M> Freeze for Flash<'d, M>where
PhantomData<M>: Freeze,
impl<'d, M> RefUnwindSafe for Flash<'d, M>where
PhantomData<M>: RefUnwindSafe,
impl<'d, M> Send for Flash<'d, M>where
PhantomData<M>: Send,
impl<'d, M> Sync for Flash<'d, M>where
PhantomData<M>: Sync,
impl<'d, M> Unpin for Flash<'d, M>where
PhantomData<M>: Unpin,
impl<'d, M> UnsafeUnpin for Flash<'d, M>where
PhantomData<M>: UnsafeUnpin,
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