Struct stm32_hal2::flash::Flash [−][src]
Implementations
impl Flash
[src]
The Flash memory is organized as 72-bit wide memory cells (64 bits plus 8 ECC bits) that can be used for storing both code and data constants.
pub fn new(regs: FLASH) -> Self
[src]
pub fn unlock(&mut self) -> Result<(), Error>
[src]
Unlock the flash memory, allowing writes. See L4 Reference manual, section 3.3.5
pub fn lock(&mut self)
[src]
Lock the flash memory, allowing writes.
pub fn erase_page(&mut self, page: usize) -> Result<(), Error>
[src]
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).”
pub fn erase_bank(&mut self, banks: BanksToErase) -> Result<(), Error>
[src]
pub fn write_page(&mut self, page: usize, data: &[u64]) -> Result<(), Error>
[src]
Write the contents of a page. Must be erased first. See L4 RM, section 3.3.7.
pub fn read(&self, page: usize, offset: isize) -> u64
[src]
Read a single 64-bit memory cell, indexed by its page, and an offset from the page.
pub fn read_to_buffer(&self, page: usize, offset: isize, buff: &mut [u8])
[src]
Read flash memory at a given page and offset into a buffer.
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,