[][src]Struct stm32l0xx_hal::flash::FLASH

pub struct FLASH { /* fields omitted */ }

Entry point to the non-volatile memory (NVM) API

Methods

impl FLASH[src]

pub fn new(flash: FLASH, rcc: &mut Rcc) -> Self[src]

pub fn erase_flash_page(&mut self, address: *mut u32) -> Result<(), Error>[src]

Erases a page of flash memory

Attention: You must make sure that your program is not executed from the same Flash bank that the page is being erased in. Either make sure your program is executed from another Flash bank, or run it from main memory.

Panics

This method will panic, unless all of the following is true:

  • address points to Flash memory
  • address is aligned to a page boundary (32 words, 128 bytes)

pub fn write_word(&mut self, address: *mut u32, word: u32) -> Result<(), Error>[src]

Writes a word to Flash memory or EEPROM

Please note that any access to Flash or EEPROM on the same memory bank will be stalled until this operation completes.

If you use this method to write to Flash memory, the address must have been erased before, otherwise this method will return an error.

Panics

Panics, if address does not point to Flash memory or EEPROM.

pub fn write_flash_half_page(
    &mut self,
    address: *mut u32,
    words: &[u32]
) -> Result<(), Error>
[src]

Writes a half-page (16 words) of Flash memory

The memory written to must have been erased before, otherwise this method will return an error.

Panics

This method will panic, unless all of the following is true:

  • address points to Flash memory
  • address is aligned to a half-page boundary (16 words, 64 bytes)
  • words has a length of 16

pub fn check_errors(&self) -> Result<(), Error>[src]

Auto Trait Implementations

impl Unpin for FLASH

impl Send for FLASH

impl !Sync for FLASH

Blanket Implementations

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

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

type Error = !

The type returned in the event of a conversion error.

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

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self