Struct stm32_hal2::flash::Flash
source · [−]pub struct Flash {
pub regs: FLASH,
}
Fields
regs: FLASH
Implementations
sourceimpl Flash
impl Flash
sourcepub fn unlock(&mut self) -> Result<(), Error>
pub fn unlock(&mut self) -> Result<(), Error>
Unlock the flash memory, allowing writes. See L4 Reference manual, section 3.3.5. (G4 RM sectino 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)
sourcepub fn erase_sector(&mut self, bank: Bank, sector: usize) -> Result<(), Error>
pub fn erase_sector(&mut self, bank: Bank, sector: usize) -> Result<(), Error>
Erase a 128kb sector. See H743 RM, section 4.3.10: FLASH erase operations; subsection Flash sector erase sequence. Note that this is similar to the procedure for other families, but has a different name “sector” vice “page”, and the RM instructions are phrased differently.
sourcepub fn erase_bank(&mut self, bank: Bank) -> Result<(), Error>
pub fn erase_bank(&mut self, bank: Bank) -> Result<(), Error>
Erase one or both banks. Called “Mass erase” on single-bank variants like G4.
sourcepub fn write_sector(
&mut self,
bank: Bank,
page: usize,
data: &[u8]
) -> Result<(), Error>
pub fn write_sector(
&mut self,
bank: Bank,
page: usize,
data: &[u8]
) -> Result<(), Error>
Write the contents of a page. Must be erased first. See H742 RM, section 4.3.9
Auto Trait Implementations
impl RefUnwindSafe for Flash
impl Send for Flash
impl !Sync for Flash
impl Unpin for Flash
impl UnwindSafe for Flash
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