[][src]Trait kernel::hil::flash::Flash

pub trait Flash {
    type Page: AsMut<[u8]> + Default;
    fn read_page(
        &self,
        page_number: usize,
        buf: &'static mut Self::Page
    ) -> Result<(), (ReturnCode, &'static mut Self::Page)>;
fn write_page(
        &self,
        page_number: usize,
        buf: &'static mut Self::Page
    ) -> Result<(), (ReturnCode, &'static mut Self::Page)>;
fn erase_page(&self, page_number: usize) -> ReturnCode; }

A page of writable persistent flash memory.

Associated Types

type Page: AsMut<[u8]> + Default

Type of a single flash page for the given implementation.

Loading content...

Required methods

fn read_page(
    &self,
    page_number: usize,
    buf: &'static mut Self::Page
) -> Result<(), (ReturnCode, &'static mut Self::Page)>

Read a page of flash into the buffer.

fn write_page(
    &self,
    page_number: usize,
    buf: &'static mut Self::Page
) -> Result<(), (ReturnCode, &'static mut Self::Page)>

Write a page of flash from the buffer.

fn erase_page(&self, page_number: usize) -> ReturnCode

Erase a page of flash.

Loading content...

Implementors

Loading content...