Struct embassy_stm32::flash::Flash
source · 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 = 131_072usize
const ERASE_SIZE: usize = 131_072usize
The minumum number of bytes the storage peripheral can erase
Auto Trait Implementations§
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