Struct capsules::app_flash_driver::AppFlash
[−]
[src]
pub struct AppFlash<'a> { driver: &'a NonvolatileStorage, apps: Grant<App>, current_app: Cell<Option<AppId>>, buffer: TakeCell<'static, [u8]>, }
Fields
driver: &'a NonvolatileStorage
apps: Grant<App>
current_app: Cell<Option<AppId>>
buffer: TakeCell<'static, [u8]>
Methods
impl<'a> AppFlash<'a>
[src]
pub fn new(
driver: &'a NonvolatileStorage,
grant: Grant<App>,
buffer: &'static mut [u8]
) -> AppFlash<'a>
[src]
driver: &'a NonvolatileStorage,
grant: Grant<App>,
buffer: &'static mut [u8]
) -> AppFlash<'a>
fn enqueue_write(&self, flash_address: usize, appid: AppId) -> ReturnCode
[src]
Trait Implementations
impl<'a> NonvolatileStorageClient for AppFlash<'a>
[src]
fn read_done(&self, _buffer: &'static mut [u8], _length: usize)
[src]
read_done
is called when the implementor is finished reading in to the buffer. The callback returns the buffer and the number of bytes that were actually read. Read more
fn write_done(&self, buffer: &'static mut [u8], _length: usize)
[src]
write_done
is called when the implementor is finished writing from the buffer. The callback returns the buffer and the number of bytes that were actually written. Read more
impl<'a> Driver for AppFlash<'a>
[src]
fn allow(
&self,
appid: AppId,
allow_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
[src]
&self,
appid: AppId,
allow_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
Setup buffer to write from.
allow_num
0
: Set write buffer. This entire buffer will be written to flash.
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode
[src]
fn command(
&self,
command_num: usize,
arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode
[src]
&self,
command_num: usize,
arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode
App flash control.
command_num
0
: Driver check.1
: Write the memory from theallow
buffer to the address in flash.