Struct stm32f1xx_hal::flash::FlashWriter
source · pub struct FlashWriter<'a> { /* private fields */ }
Implementations§
source§impl<'a> FlashWriter<'a>
impl<'a> FlashWriter<'a>
sourcepub fn page_erase(&mut self, start_offset: u32) -> Result<()>
pub fn page_erase(&mut self, start_offset: u32) -> Result<()>
Erase sector which contains start_offset
sourcepub fn erase(&mut self, start_offset: u32, length: usize) -> Result<()>
pub fn erase(&mut self, start_offset: u32, length: usize) -> Result<()>
Erase the Flash Sectors from FLASH_START + start_offset
to length
sourcepub fn read(&self, offset: u32, length: usize) -> Result<&[u8]>
pub fn read(&self, offset: u32, length: usize) -> Result<&[u8]>
Retrieve a slice of data from FLASH_START + offset
sourcepub fn write(&mut self, offset: u32, data: &[u8]) -> Result<()>
pub fn write(&mut self, offset: u32, data: &[u8]) -> Result<()>
Write data to FLASH_START + offset
sourcepub fn change_verification(&mut self, verify: bool)
pub fn change_verification(&mut self, verify: bool)
Enable/disable verifying that each erase or write operation completed successfuly.
When enabled, after each erase operation every address is read to make sure it contains the erase value of 0xFFFF. After each write operation, every address written is read and compared to the value that should have been written. If any address does not contain the expected value, the function will return Err. When disabled, no verification is performed, erase/write operations are assumed to have succeeded.