Struct capsules::virtual_flash::FlashUser
[−]
[src]
pub struct FlashUser<'a, F: Flash + 'static> { mux: &'a MuxFlash<'a, F>, buffer: TakeCell<'static, F::Page>, operation: Cell<Op>, next: ListLink<'a, FlashUser<'a, F>>, client: Cell<Option<&'a Client<FlashUser<'a, F>>>>, }
Keep state for each flash user. All uses of the virtualized flash interface
need to create one of these to be a user of the flash. The new()
function
handles most of the work, a user only has to pass in a reference to the
MuxFlash object.
Fields
mux: &'a MuxFlash<'a, F>
buffer: TakeCell<'static, F::Page>
operation: Cell<Op>
next: ListLink<'a, FlashUser<'a, F>>
client: Cell<Option<&'a Client<FlashUser<'a, F>>>>
Methods
impl<'a, F: Flash + 'a> FlashUser<'a, F>
[src]
Trait Implementations
impl<'a, F: Flash + 'a, C: Client<Self>> HasClient<'a, C> for FlashUser<'a, F>
[src]
fn set_client(&'a self, client: &'a C)
[src]
Set the client for this flash peripheral. The client will be called when operations complete. Read more
impl<'a, F: Flash + 'a> Client<F> for FlashUser<'a, F>
[src]
fn read_complete(&self, pagebuffer: &'static mut F::Page, error: Error)
[src]
Flash read complete.
fn write_complete(&self, pagebuffer: &'static mut F::Page, error: Error)
[src]
Flash write complete.
fn erase_complete(&self, error: Error)
[src]
Flash erase complete.
impl<'a, F: Flash + 'a> ListNode<'a, FlashUser<'a, F>> for FlashUser<'a, F>
[src]
impl<'a, F: Flash + 'a> Flash for FlashUser<'a, F>
[src]
type Page = F::Page
Type of a single flash page for the given implementation.
fn read_page(
&self,
page_number: usize,
buf: &'static mut Self::Page
) -> ReturnCode
[src]
&self,
page_number: usize,
buf: &'static mut Self::Page
) -> ReturnCode
Read a page of flash into the buffer.
fn write_page(
&self,
page_number: usize,
buf: &'static mut Self::Page
) -> ReturnCode
[src]
&self,
page_number: usize,
buf: &'static mut Self::Page
) -> ReturnCode
Write a page of flash from the buffer.
fn erase_page(&self, page_number: usize) -> ReturnCode
[src]
Erase a page of flash.