Struct avr_oxide::hal::generic::twi::Command

source ·
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>

source§

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

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>

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>

Get the byte to transmit at the given packet index, or return an error if there is no such byte.
source§

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> 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.