pub struct Command<'c> { /* private fields */ }
Expand description
A TWI command. For simple writes and read, we can simply pass the driver a buffer (or set of buffers), which will then be transmitted/received-into with zero-copying. For more complex cases, it is possible to instead use a dynamic implementation of an object that implements the TwiTransaction trait.
Because commands are processed asynchronously from the interrupt context,
ownership must pass to the driver. The command will be given back
to the userland context when the command_complete
callback is
executed.
Trait Implementations§
source§impl<'c> TwiTransaction for Command<'c>
impl<'c> TwiTransaction for Command<'c>
source§fn get_retry_strategy(&self, _isotoken: Isolated) -> RetryStrategy
fn get_retry_strategy(&self, _isotoken: Isolated) -> RetryStrategy
Get the retry strategy to follow for this transaction
source§fn get_initial_addr_bin(&self, _isotoken: Isolated) -> u8
fn get_initial_addr_bin(&self, _isotoken: Isolated) -> u8
Get the initial address to use for this transaction, as an 8-bit
TWI address (i.e. including the read/write direction bit)
source§fn get_read_addr_bin(&self, _isotoken: Isolated) -> Option<u8>
fn get_read_addr_bin(&self, _isotoken: Isolated) -> Option<u8>
Get the read address for this transaction. Returns None if there is
no read address (i.e. this is a write-only transaction.)
source§fn get_tx_byte(
&self,
_isotoken: Isolated,
index: usize
) -> OxideResult<u8, IoError>
fn get_tx_byte( &self, _isotoken: Isolated, index: usize ) -> OxideResult<u8, IoError>
Get the byte to transmit at the given packet index, or return an error
if there is no such byte.
fn set_rx_byte( &mut self, _isotoken: Isolated, index: usize, byte: u8 ) -> OxideResult<usize, IoError>
Auto Trait Implementations§
impl<'c> Freeze for Command<'c>
impl<'c> RefUnwindSafe for Command<'c>
impl<'c> Send for Command<'c>
impl<'c> Sync for Command<'c>
impl<'c> Unpin for Command<'c>
impl<'c> !UnwindSafe for Command<'c>
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