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