Struct stm32f4xx_hal::flash::LockedFlash
source · [−]pub struct LockedFlash { /* private fields */ }
Expand description
Read-only flash
Examples
use stm32f4xx_hal::pac::Peripherals;
use stm32f4xx_hal::flash::LockedFlash;
use embedded_storage::nor_flash::ReadNorFlash;
let dp = Peripherals::take().unwrap();
let mut flash = LockedFlash::new(dp.FLASH);
println!("Flash capacity: {}", ReadNorFlash::capacity(&flash));
let mut buf = [0u8; 64];
ReadNorFlash::read(&mut flash, 0x0, &mut buf).unwrap();
println!("First 64 bytes of flash memory: {:?}", buf);
Implementations
sourceimpl LockedFlash
impl LockedFlash
Trait Implementations
sourceimpl FlashExt for LockedFlash
impl FlashExt for LockedFlash
sourcefn unlocked(&mut self) -> UnlockedFlash<'_>
fn unlocked(&mut self) -> UnlockedFlash<'_>
Unlock flash for erasing/programming until this method’s result is dropped Read more
fn dual_bank(&self) -> bool
sourcefn sector(&self, offset: usize) -> Option<FlashSector>
fn sector(&self, offset: usize) -> Option<FlashSector>
Returns flash memory sector of a given offset. Returns none if offset is out of range.
Auto Trait Implementations
impl RefUnwindSafe for LockedFlash
impl Send for LockedFlash
impl !Sync for LockedFlash
impl Unpin for LockedFlash
impl UnwindSafe for LockedFlash
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more