pub struct VirtualSpiMasterDevice<'a, Spi: SpiMaster<'a>> { /* private fields */ }
Implementations§
source§impl<'a, Spi: SpiMaster<'a>> VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi: SpiMaster<'a>> VirtualSpiMasterDevice<'a, Spi>
pub fn new( mux: &'a MuxSpiMaster<'a, Spi>, chip_select: Spi::ChipSelect, ) -> VirtualSpiMasterDevice<'a, Spi>
Trait Implementations§
source§impl<'a, Spi: SpiMaster<'a>> ListNode<'a, VirtualSpiMasterDevice<'a, Spi>> for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi: SpiMaster<'a>> ListNode<'a, VirtualSpiMasterDevice<'a, Spi>> for VirtualSpiMasterDevice<'a, Spi>
fn next(&'a self) -> &'a ListLink<'a, VirtualSpiMasterDevice<'a, Spi>>
source§impl<'a, Spi: SpiMaster<'a>> SpiMasterClient for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi: SpiMaster<'a>> SpiMasterClient for VirtualSpiMasterDevice<'a, Spi>
source§fn read_write_done(
&self,
write_buffer: SubSliceMut<'static, u8>,
read_buffer: Option<SubSliceMut<'static, u8>>,
status: Result<usize, ErrorCode>,
)
fn read_write_done( &self, write_buffer: SubSliceMut<'static, u8>, read_buffer: Option<SubSliceMut<'static, u8>>, status: Result<usize, ErrorCode>, )
Callback issued when a read/write operation finishes. Read more
source§impl<'a, Spi: SpiMaster<'a>> SpiMasterDevice<'a> for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi: SpiMaster<'a>> SpiMasterDevice<'a> for VirtualSpiMasterDevice<'a, Spi>
source§fn set_client(&self, client: &'a dyn SpiMasterClient)
fn set_client(&self, client: &'a dyn SpiMasterClient)
Set the callback for read_write operations.
source§fn configure(
&self,
cpol: ClockPolarity,
cpal: ClockPhase,
rate: u32,
) -> Result<(), ErrorCode>
fn configure( &self, cpol: ClockPolarity, cpal: ClockPhase, rate: u32, ) -> Result<(), ErrorCode>
Configure the bus for this chip select.
source§fn read_write_bytes(
&self,
write_buffer: SubSliceMut<'static, u8>,
read_buffer: Option<SubSliceMut<'static, u8>>,
) -> Result<(), (ErrorCode, SubSliceMut<'static, u8>, Option<SubSliceMut<'static, u8>>)>
fn read_write_bytes( &self, write_buffer: SubSliceMut<'static, u8>, read_buffer: Option<SubSliceMut<'static, u8>>, ) -> Result<(), (ErrorCode, SubSliceMut<'static, u8>, Option<SubSliceMut<'static, u8>>)>
Same as
SpiMaster::read_write_bytes
.source§fn set_polarity(&self, cpol: ClockPolarity) -> Result<(), ErrorCode>
fn set_polarity(&self, cpol: ClockPolarity) -> Result<(), ErrorCode>
Same as
SpiMaster::set_polarity
.source§fn set_phase(&self, cpal: ClockPhase) -> Result<(), ErrorCode>
fn set_phase(&self, cpal: ClockPhase) -> Result<(), ErrorCode>
Same as
SpiMaster::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
Get the current bus phase for the current chip select.
Auto Trait Implementations§
impl<'a, Spi> !Freeze for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi> !RefUnwindSafe for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi> !Send for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi> !Sync for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi> Unpin for VirtualSpiMasterDevice<'a, Spi>
impl<'a, Spi> !UnwindSafe for VirtualSpiMasterDevice<'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