I2cExpanderDevice

Struct I2cExpanderDevice 

Source
pub struct I2cExpanderDevice<I, D, P> { /* private fields */ }
Available on crate features i2c-expander-device or i2c-expander-device-async only.

Implementations§

Source§

impl<I, D, P> I2cExpanderDevice<I, D, P>

Source

pub fn new(i2c: I, i2c_address: u8, delay: D) -> Self

Source

pub fn release(self) -> (I, D)

Source

pub fn i2c_address(&self) -> u8

Trait Implementations§

Source§

impl<I, D, P> AsyncDevice for I2cExpanderDevice<I, D, P>
where I: I2c, D: DelayNs, P: I2cPacketAssembler,

Available on crate features async and i2c-expander-device-async only.
Source§

type Err = <I as ErrorType>::Error

Source§

async fn delay_us_async(&mut self, us: u32)

Source§

async fn flush_async(&mut self) -> Result<(), Self::Err>

Source§

async fn write_nibble_async( &mut self, mode: RegisterSelectMode, data: u8, ) -> Result<(), Self::Err>

Source§

async fn write_byte_async( &mut self, mode: RegisterSelectMode, byte: u8, ) -> Result<(), Self::Err>

Source§

impl<I, D, P> Device for I2cExpanderDevice<I, D, P>

Source§

fn set_register_select(&mut self, mode: RegisterSelectMode)

Source§

fn set_rw(&mut self, mode: RWMode)

Source§

fn set_enable(&mut self, enabled: bool)

Source§

fn set_backlight(&mut self, enabled: bool)

Source§

fn set_data_nibble(&mut self, data: u8)

Source§

impl<I, D, P> SyncDevice for I2cExpanderDevice<I, D, P>
where I: I2c, D: DelayNs, P: I2cPacketAssembler,

Available on crate feature i2c-expander-device only.
Source§

type Err = <I as ErrorType>::Error

Source§

fn delay_us(&mut self, us: u32)

Source§

fn flush(&mut self) -> Result<(), Self::Err>

Source§

fn write_nibble( &mut self, mode: RegisterSelectMode, data: u8, ) -> Result<(), Self::Err>

Source§

fn write_byte( &mut self, mode: RegisterSelectMode, byte: u8, ) -> Result<(), Self::Err>

Auto Trait Implementations§

§

impl<I, D, P> Freeze for I2cExpanderDevice<I, D, P>
where I: Freeze, D: Freeze,

§

impl<I, D, P> RefUnwindSafe for I2cExpanderDevice<I, D, P>

§

impl<I, D, P> Send for I2cExpanderDevice<I, D, P>
where I: Send, D: Send, P: Send,

§

impl<I, D, P> Sync for I2cExpanderDevice<I, D, P>
where I: Sync, D: Sync, P: Sync,

§

impl<I, D, P> Unpin for I2cExpanderDevice<I, D, P>
where I: Unpin, D: Unpin, P: Unpin,

§

impl<I, D, P> UnwindSafe for I2cExpanderDevice<I, D, P>
where I: UnwindSafe, D: UnwindSafe, P: UnwindSafe,

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<D> CommandExtAsync for D
where D: AsyncDevice,

Source§

async fn execute_command_async<C, R, E>(&mut self, cmd: &C) -> Result<R, E>
where C: AsyncCommand<Ret = R, Err = E>,

Available on crate feature async only.
Source§

async fn execute_commands_async<C, E>(&mut self, cmd: &[C]) -> Result<(), E>
where C: AsyncCommand<Err = E>,

Available on crate feature async only.
Source§

impl<D> CommandExtSync for D
where D: SyncDevice,

Source§

fn execute_command<C, R, E>(&mut self, cmd: &C) -> Result<R, E>
where C: SyncCommand<Ret = R, Err = E>,

Source§

fn execute_commands<C, E>(&mut self, cmd: &[C]) -> Result<(), E>
where C: SyncCommand<Err = E>,

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

Source§

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

Source§

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.