pub struct SpiSlaveDevice<'a, Spi: SpiSlave<'a>> { /* private fields */ }
Implementations§
Source§impl<'a, Spi: SpiSlave<'a>> SpiSlaveDevice<'a, Spi>
impl<'a, Spi: SpiSlave<'a>> SpiSlaveDevice<'a, Spi>
pub const fn new(spi: &'a Spi) -> SpiSlaveDevice<'a, Spi>
Trait Implementations§
Source§impl<'a, Spi: SpiSlave<'a>> SpiSlaveClient for SpiSlaveDevice<'a, Spi>
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>,
)
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)
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>
impl<'a, Spi: SpiSlave<'a>> SpiSlaveDevice<'a> for SpiSlaveDevice<'a, Spi>
Source§fn set_client(&self, client: &'a dyn SpiSlaveClient)
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>
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]>)>
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]>)>
Same as
SpiSlave::read_write_bytes
.Source§fn set_polarity(&self, cpol: ClockPolarity) -> Result<(), ErrorCode>
fn set_polarity(&self, cpol: ClockPolarity) -> Result<(), ErrorCode>
Same as
SpiSlave::set_polarity
.Source§fn set_phase(&self, cpal: ClockPhase) -> Result<(), ErrorCode>
fn set_phase(&self, cpal: ClockPhase) -> Result<(), ErrorCode>
Same as
SpiSlave::set_phase
.Source§fn get_polarity(&self) -> ClockPolarity
fn get_polarity(&self) -> ClockPolarity
Return the current bus polarity.
Source§fn get_phase(&self) -> ClockPhase
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more