Struct stm32_hal2::flash::Flash[][src]

pub struct Flash { /* fields omitted */ }

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

impl Send for Flash

impl !Sync for Flash

impl Unpin for Flash

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.