Struct capsules::fm25cl::FM25CL
[−]
[src]
pub struct FM25CL<'a, S: SpiMasterDevice + 'a> { spi: &'a S, state: Cell<State>, txbuffer: TakeCell<'static, [u8]>, rxbuffer: TakeCell<'static, [u8]>, client: Cell<Option<&'static NonvolatileStorageClient>>, client_custom: Cell<Option<&'static FM25CLClient>>, client_buffer: TakeCell<'static, [u8]>, client_write_address: Cell<u16>, client_write_len: Cell<u16>, }
Fields
spi: &'a S
state: Cell<State>
txbuffer: TakeCell<'static, [u8]>
rxbuffer: TakeCell<'static, [u8]>
client: Cell<Option<&'static NonvolatileStorageClient>>
client_custom: Cell<Option<&'static FM25CLClient>>
client_buffer: TakeCell<'static, [u8]>
client_write_address: Cell<u16>
client_write_len: Cell<u16>
Methods
impl<'a, S: SpiMasterDevice + 'a> FM25CL<'a, S>
[src]
pub fn new(
spi: &'a S,
txbuffer: &'static mut [u8],
rxbuffer: &'static mut [u8]
) -> FM25CL<'a, S>
[src]
spi: &'a S,
txbuffer: &'static mut [u8],
rxbuffer: &'static mut [u8]
) -> FM25CL<'a, S>
pub fn set_client<C: FM25CLClient>(&self, client: &'static C)
[src]
fn configure_spi(&self)
[src]
Setup SPI for this chip
pub fn write(
&self,
address: u16,
buffer: &'static mut [u8],
len: u16
) -> ReturnCode
[src]
&self,
address: u16,
buffer: &'static mut [u8],
len: u16
) -> ReturnCode
pub fn read(
&self,
address: u16,
buffer: &'static mut [u8],
len: u16
) -> ReturnCode
[src]
&self,
address: u16,
buffer: &'static mut [u8],
len: u16
) -> ReturnCode
Trait Implementations
impl<'a, S: SpiMasterDevice + 'a> SpiMasterClient for FM25CL<'a, S>
[src]
fn read_write_done(
&self,
write_buffer: &'static mut [u8],
read_buffer: Option<&'static mut [u8]>,
len: usize
)
[src]
&self,
write_buffer: &'static mut [u8],
read_buffer: Option<&'static mut [u8]>,
len: usize
)
Called when a read/write operation finishes
impl<'a, S: SpiMasterDevice + 'a> FM25CLCustom for FM25CL<'a, S>
[src]
fn read_status(&self) -> ReturnCode
[src]
impl<'a, S: SpiMasterDevice + 'a> NonvolatileStorage for FM25CL<'a, S>
[src]
Implement the generic NonvolatileStorage
interface common to chips that
provide nonvolatile memory.
fn set_client(&self, client: &'static NonvolatileStorageClient)
[src]
fn read(
&self,
buffer: &'static mut [u8],
address: usize,
length: usize
) -> ReturnCode
[src]
&self,
buffer: &'static 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. Read more
fn write(
&self,
buffer: &'static mut [u8],
address: usize,
length: usize
) -> ReturnCode
[src]
&self,
buffer: &'static 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. Read more