[][src]Trait kernel::hil::nonvolatile_storage::NonvolatileStorage

pub trait NonvolatileStorage<'a> {
    fn set_client(&self, client: &'a dyn NonvolatileStorageClient<'a>);
fn read(
        &self,
        buffer: &'a mut [u8],
        address: usize,
        length: usize
    ) -> ReturnCode;
fn write(
        &self,
        buffer: &'a mut [u8],
        address: usize,
        length: usize
    ) -> ReturnCode; }

Simple interface for reading and writing nonvolatile memory. It is expected that drivers for nonvolatile memory would implement this trait.

Required methods

fn set_client(&self, client: &'a dyn NonvolatileStorageClient<'a>)

fn read(
    &self,
    buffer: &'a mut [u8],
    address: usize,
    length: usize
) -> ReturnCode

Read length bytes starting at address address in to the provided buffer. The buffer must be at least length bytes long. The address must be in the address space of the physical storage.

fn write(
    &self,
    buffer: &'a mut [u8],
    address: usize,
    length: usize
) -> ReturnCode

Write length bytes starting at address address from the provided buffer. The buffer must be at least length bytes long. This address must be in the address space of the physical storage.

Loading content...

Implementors

Loading content...