[][src]Trait kernel::hil::spi::SpiSlaveDevice

pub trait SpiSlaveDevice {
    fn configure(&self, cpol: ClockPolarity, cpal: ClockPhase);
fn read_write_bytes(
        &self,
        write_buffer: Option<&'static mut [u8]>,
        read_buffer: Option<&'static mut [u8]>,
        len: usize
    ) -> ReturnCode;
fn set_polarity(&self, cpol: ClockPolarity);
fn get_polarity(&self) -> ClockPolarity;
fn set_phase(&self, cpal: ClockPhase);
fn get_phase(&self) -> ClockPhase; }

SPISlaveDevice provides a chip-specific interface to the SPI Slave 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)

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

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.

fn set_polarity(&self, cpol: ClockPolarity)

fn get_polarity(&self) -> ClockPolarity

fn set_phase(&self, cpal: ClockPhase)

fn get_phase(&self) -> ClockPhase

Loading content...

Implementors

Loading content...