pub struct I2cDeviceAsync<I, A, C>{
pub bound_bus: I2cBoundBusAsync<I, A>,
pub default_codec: PhantomData<C>,
}
Expand description
This represents an I2C device on an I2C bus, including a default codec.
Fields§
§bound_bus: I2cBoundBusAsync<I, A>
I2c interface and device address
default_codec: PhantomData<C>
The default codec used to interface with registers that don’t explicitly specify a codec themselves. Usually this is a simple codec specifying address size and some metadata. See implementors of the Codec trait for more information on available codecs.
Implementations§
Source§impl<I, A, C> I2cDeviceAsync<I, A, C>
impl<I, A, C> I2cDeviceAsync<I, A, C>
Trait Implementations§
Source§impl<I, A, C> RegisterInterfaceAsync for I2cDeviceAsync<I, A, C>
impl<I, A, C> RegisterInterfaceAsync for I2cDeviceAsync<I, A, C>
Source§async fn read_register<R>(&mut self) -> Result<R, I::Error>where
R: ReadableRegister,
async fn read_register<R>(&mut self) -> Result<R, I::Error>where
R: ReadableRegister,
Read this register from this spi device using the codec specified by the register (if any) or otherwise the default codec of the device.
Source§async fn write_register<R>(
&mut self,
register: impl AsRef<R>,
) -> Result<(), I::Error>where
R: WritableRegister,
async fn write_register<R>(
&mut self,
register: impl AsRef<R>,
) -> Result<(), I::Error>where
R: WritableRegister,
Write this register to this i2c device using the codec specified by the register (if any) or otherwise the default codec of the device.
type Error = <I as ErrorType>::Error
Auto Trait Implementations§
impl<I, A, C> Freeze for I2cDeviceAsync<I, A, C>
impl<I, A, C> RefUnwindSafe for I2cDeviceAsync<I, A, C>
impl<I, A, C> Send for I2cDeviceAsync<I, A, C>
impl<I, A, C> Sync for I2cDeviceAsync<I, A, C>
impl<I, A, C> Unpin for I2cDeviceAsync<I, A, C>
impl<I, A, C> UnwindSafe for I2cDeviceAsync<I, A, 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