Struct capsules::virtual_spi::VirtualSpiSlaveDevice
[−]
[src]
pub struct VirtualSpiSlaveDevice<'a, Spi: SpiSlave + 'a> { spi: &'a Spi, client: Cell<Option<&'a SpiSlaveClient>>, }
Fields
spi: &'a Spi
client: Cell<Option<&'a SpiSlaveClient>>
Methods
impl<'a, Spi: SpiSlave> VirtualSpiSlaveDevice<'a, Spi>
[src]
pub const fn new(spi: &'a Spi) -> VirtualSpiSlaveDevice<'a, Spi>
[src]
pub fn set_client(&'a self, client: &'a SpiSlaveClient)
[src]
Trait Implementations
impl<'a, Spi: SpiSlave> SpiSlaveClient for VirtualSpiSlaveDevice<'a, Spi>
[src]
fn read_write_done(
&self,
write_buffer: Option<&'static mut [u8]>,
read_buffer: Option<&'static mut [u8]>,
len: usize
)
[src]
&self,
write_buffer: Option<&'static mut [u8]>,
read_buffer: Option<&'static mut [u8]>,
len: usize
)
This is called as a DMA interrupt when a transfer has completed
fn chip_selected(&self)
[src]
This is called whenever the slave is selected by the master
impl<'a, Spi: SpiSlave> SpiSlaveDevice for VirtualSpiSlaveDevice<'a, Spi>
[src]
fn configure(&self, cpol: ClockPolarity, cpal: ClockPhase)
[src]
Setup the SPI settings and speed of the bus.
fn read_write_bytes(
&self,
write_buffer: Option<&'static mut [u8]>,
read_buffer: Option<&'static mut [u8]>,
len: usize
) -> ReturnCode
[src]
&self,
write_buffer: Option<&'static mut [u8]>,
read_buffer: Option<&'static mut [u8]>,
len: usize
) -> ReturnCode
Perform an asynchronous read/write operation, whose completion is signaled by invoking SpiSlaveClient.read_write_done on the provided client. Either write_buffer or read_buffer may be None. If read_buffer is Some, the length of the operation is the minimum of the size of the two buffers. Read more