Trait kernel::hil::spi::SpiMasterDevice
[−]
[src]
pub trait SpiMasterDevice {
fn configure(&self, cpol: ClockPolarity, cpal: ClockPhase, rate: u32);
fn read_write_bytes(
&self,
write_buffer: &'static mut [u8],
read_buffer: Option<&'static mut [u8]>,
len: usize
) -> ReturnCode;
fn set_polarity(&self, cpol: ClockPolarity);
fn set_phase(&self, cpal: ClockPhase);
fn set_rate(&self, rate: u32);
fn get_polarity(&self) -> ClockPolarity;
fn get_phase(&self) -> ClockPhase;
fn get_rate(&self) -> u32;
}SPIMasterDevice provides a chip-specific interface to the SPI Master hardware. The interface wraps the chip select line so that chip drivers cannot communicate with different SPI devices.
Required Methods
fn configure(&self, cpol: ClockPolarity, cpal: ClockPhase, rate: u32)
Setup the SPI settings and speed of the bus.
fn read_write_bytes(
&self,
write_buffer: &'static mut [u8],
read_buffer: Option<&'static mut [u8]>,
len: usize
) -> ReturnCode
&self,
write_buffer: &'static mut [u8],
read_buffer: Option<&'static mut [u8]>,
len: usize
) -> ReturnCode
Perform an asynchronous read/write operation, whose completion is signaled by invoking SpiMasterClient.read_write_done on the provided client. write_buffer must be Some, 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.