pub struct Flash {
pub regs: FLASH,
}
Fields§
§regs: FLASH
Implementations§
Source§impl Flash
impl Flash
Sourcepub fn unlock(&mut self) -> Result<()>
pub fn unlock(&mut self) -> Result<()>
Unlock the flash memory, allowing writes. See L4 Reference manual, section 3.3.5. (G4 RM section 5.3.5) “After reset, write is not allowed in the Flash control register (FLASH_CR) to protect the Flash memory against possible unwanted operations due, for example, to electric disturbances.”
pub fn lock(&mut self) -> Result<()>
Sourcepub fn erase_page(&mut self, bank: Bank, page: usize) -> Result<()>
pub fn erase_page(&mut self, bank: Bank, page: usize) -> Result<()>
Erase an entire page. See L4 Reference manual, section 3.3.5. For why this is required, reference L4 RM, section 3.3.7: “Programming in a previously programmed address is not allowed except if the data to write is full zero, and any attempt will set PROGERR flag in the Flash status register (FLASH_SR).”
Sourcepub fn erase_bank(&mut self, bank: Bank) -> Result<()>
pub fn erase_bank(&mut self, bank: Bank) -> Result<()>
Erase one or both banks. Called “Mass erase” on single-bank variants like G4.
Auto Trait Implementations§
impl Freeze for Flash
impl !RefUnwindSafe for Flash
impl Send for Flash
impl !Sync for Flash
impl Unpin for Flash
impl UnwindSafe for Flash
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