Struct capsules::spi::Spi
[−]
[src]
pub struct Spi<'a, S: SpiMasterDevice + 'a> { spi_master: &'a S, busy: Cell<bool>, app: MapCell<App>, kernel_read: TakeCell<'static, [u8]>, kernel_write: TakeCell<'static, [u8]>, kernel_len: Cell<usize>, }
Fields
spi_master: &'a S
busy: Cell<bool>
app: MapCell<App>
kernel_read: TakeCell<'static, [u8]>
kernel_write: TakeCell<'static, [u8]>
kernel_len: Cell<usize>
Methods
impl<'a, S: SpiMasterDevice> Spi<'a, S>
[src]
pub fn new(spi_master: &'a S) -> Spi<'a, S>
[src]
pub fn config_buffers(
&mut self,
read: &'static mut [u8],
write: &'static mut [u8]
)
[src]
&mut self,
read: &'static mut [u8],
write: &'static mut [u8]
)
fn do_next_read_write(&self, app: &mut App)
[src]
Trait Implementations
impl<'a, S: SpiMasterDevice> Driver for Spi<'a, S>
[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
allow
lets an application give the driver access to a buffer in the application's memory. This returns ENOSUPPORT
if not used. Read more
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode
[src]
subscribe
lets an application pass a callback to the driver to be called later. This returns ENOSUPPORT
if not used. Read more
fn command(&self, cmd_num: usize, arg1: usize, _: usize, _: AppId) -> ReturnCode
[src]
command
instructs a driver to perform some action synchronously. This returns ENOSUPPORT
if not used. Read more
impl<'a, S: SpiMasterDevice> SpiMasterClient for Spi<'a, S>
[src]
fn read_write_done(
&self,
writebuf: &'static mut [u8],
readbuf: Option<&'static mut [u8]>,
length: usize
)
[src]
&self,
writebuf: &'static mut [u8],
readbuf: Option<&'static mut [u8]>,
length: usize
)
Called when a read/write operation finishes