pub struct ArbiterDevice<'a, BUS> { /* private fields */ }
Expand description

Arbiter-based shared bus implementation for I2C.

Implementations§

source§

impl<'a, BUS> ArbiterDevice<'a, BUS>

source

pub fn new(bus: &'a Arbiter<BUS>) -> Self

Create a new ArbiterDevice for I2C.

Trait Implementations§

source§

impl<'a, BUS> ErrorType for ArbiterDevice<'a, BUS>
where BUS: ErrorType,

§

type Error = <BUS as ErrorType>::Error

Error type
source§

impl<'a, BUS, A> I2c<A> for ArbiterDevice<'a, BUS>
where BUS: I2c<A>, A: AddressMode,

source§

async fn read(&mut self, address: A, read: &mut [u8]) -> Result<(), Self::Error>

Reads enough bytes from slave with address to fill buffer. Read more
source§

async fn write(&mut self, address: A, write: &[u8]) -> Result<(), Self::Error>

Writes bytes to slave with address address. Read more
source§

async fn write_read( &mut self, address: A, write: &[u8], read: &mut [u8] ) -> Result<(), Self::Error>

Writes bytes to slave with address address and then reads enough bytes to fill read in a single transaction. Read more
source§

async fn transaction( &mut self, address: A, operations: &mut [Operation<'_>] ) -> Result<(), Self::Error>

Execute the provided operations on the I2C bus as a single transaction. Read more

Auto Trait Implementations§

§

impl<'a, BUS> Freeze for ArbiterDevice<'a, BUS>

§

impl<'a, BUS> !RefUnwindSafe for ArbiterDevice<'a, BUS>

§

impl<'a, BUS> Send for ArbiterDevice<'a, BUS>

§

impl<'a, BUS> Sync for ArbiterDevice<'a, BUS>

§

impl<'a, BUS> Unpin for ArbiterDevice<'a, BUS>

§

impl<'a, BUS> !UnwindSafe for ArbiterDevice<'a, BUS>

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.