pub trait Flash {
type Page: AsMut<[u8]> + Default;
// Required methods
fn read_page(
&self,
page_number: usize,
buf: &'static mut Self::Page,
) -> Result<(), (ErrorCode, &'static mut Self::Page)>;
fn write_page(
&self,
page_number: usize,
buf: &'static mut Self::Page,
) -> Result<(), (ErrorCode, &'static mut Self::Page)>;
fn erase_page(&self, page_number: usize) -> Result<(), ErrorCode>;
}
Expand description
A page of writable persistent flash memory.
Required Associated Types§
Required Methods§
sourcefn read_page(
&self,
page_number: usize,
buf: &'static mut Self::Page,
) -> Result<(), (ErrorCode, &'static mut Self::Page)>
fn read_page( &self, page_number: usize, buf: &'static mut Self::Page, ) -> Result<(), (ErrorCode, &'static mut Self::Page)>
Read a page of flash into the buffer.