Struct stm32_hal2::flash::Flash [−][src]
pub struct Flash { /* fields omitted */ }
Implementations
impl Flash
[src]
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]
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]
pub fn erase_page(&mut self, page: usize) -> Result<(), Error>
[src]
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]
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]
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]
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.