pub struct SpiSlaveDevice<'a, Spi: SpiSlave<'a>> { /* private fields */ }

Implementations§

source§

impl<'a, Spi: SpiSlave<'a>> SpiSlaveDevice<'a, Spi>

source

pub const fn new(spi: &'a Spi) -> SpiSlaveDevice<'a, Spi>

Trait Implementations§

source§

impl<'a, Spi: SpiSlave<'a>> SpiSlaveClient for SpiSlaveDevice<'a, Spi>

source§

fn read_write_done( &self, write_buffer: Option<&'static mut [u8]>, read_buffer: Option<&'static mut [u8]>, len: usize, status: Result<(), ErrorCode>, )

Callback issued when the controller completes an SPI operation to this peripheral. Read more
source§

fn chip_selected(&self)

Notification that the chip select has been brought low.
source§

impl<'a, Spi: SpiSlave<'a>> SpiSlaveDevice<'a> for SpiSlaveDevice<'a, Spi>

source§

fn set_client(&self, client: &'a dyn SpiSlaveClient)

Specify the callback of SpiSlaveDevice::read_write_bytes operations.
source§

fn configure( &self, cpol: ClockPolarity, cpal: ClockPhase, ) -> Result<(), ErrorCode>

Setup the SPI settings and speed of the bus.
source§

fn read_write_bytes( &self, write_buffer: Option<&'static mut [u8]>, read_buffer: Option<&'static mut [u8]>, len: usize, ) -> Result<(), (ErrorCode, Option<&'static mut [u8]>, Option<&'static mut [u8]>)>

source§

fn set_polarity(&self, cpol: ClockPolarity) -> Result<(), ErrorCode>

source§

fn set_phase(&self, cpal: ClockPhase) -> Result<(), ErrorCode>

source§

fn get_polarity(&self) -> ClockPolarity

Return the current bus polarity.
source§

fn get_phase(&self) -> ClockPhase

Return the current bus phase.

Auto Trait Implementations§

§

impl<'a, Spi> !Freeze for SpiSlaveDevice<'a, Spi>

§

impl<'a, Spi> !RefUnwindSafe for SpiSlaveDevice<'a, Spi>

§

impl<'a, Spi> !Send for SpiSlaveDevice<'a, Spi>

§

impl<'a, Spi> !Sync for SpiSlaveDevice<'a, Spi>

§

impl<'a, Spi> Unpin for SpiSlaveDevice<'a, Spi>

§

impl<'a, Spi> !UnwindSafe for SpiSlaveDevice<'a, Spi>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.