pub struct I2cDev<I>(pub I);
Expand description
A wrapper around an I2CDevice
type that impls the i2c traits.
This is required due to Rust’s orphan rules.
Tuple Fields§
§0: I
Trait Implementations§
Source§impl Address for I2cDev<LinuxI2CDevice>
impl Address for I2cDev<LinuxI2CDevice>
Source§impl<I: I2CDevice> BlockTransfer for I2cDev<I>
impl<I: I2CDevice> BlockTransfer for I2cDev<I>
Source§impl<I: I2CDevice> Smbus for I2cDev<I>
impl<I: I2CDevice> Smbus for I2cDev<I>
Source§fn smbus_write_quick(&mut self, value: bool) -> Result<(), Self::Error>
fn smbus_write_quick(&mut self, value: bool) -> Result<(), Self::Error>
Sends a single bit to the device, in the place of the rd/wr address bit.
Source§fn smbus_read_byte(&mut self) -> Result<u8, Self::Error>
fn smbus_read_byte(&mut self) -> Result<u8, Self::Error>
Reads a single byte from a device without specifying a register.
Source§fn smbus_write_byte(&mut self, value: u8) -> Result<(), Self::Error>
fn smbus_write_byte(&mut self, value: u8) -> Result<(), Self::Error>
Sends a single byte to the device
Source§fn smbus_read_byte_data(&mut self, command: u8) -> Result<u8, Self::Error>
fn smbus_read_byte_data(&mut self, command: u8) -> Result<u8, Self::Error>
Reads a byte from the designated register.
Source§fn smbus_write_byte_data(
&mut self,
command: u8,
value: u8,
) -> Result<(), Self::Error>
fn smbus_write_byte_data( &mut self, command: u8, value: u8, ) -> Result<(), Self::Error>
Writes a byte to the designated register.
Source§fn smbus_read_word_data(&mut self, command: u8) -> Result<u16, Self::Error>
fn smbus_read_word_data(&mut self, command: u8) -> Result<u16, Self::Error>
Reads a 16-bit word from the designated register.
Source§fn smbus_write_word_data(
&mut self,
command: u8,
value: u16,
) -> Result<(), Self::Error>
fn smbus_write_word_data( &mut self, command: u8, value: u16, ) -> Result<(), Self::Error>
Writes a 16-bit word to the designated register.
Source§fn smbus_process_call(
&mut self,
command: u8,
value: u16,
) -> Result<u16, Self::Error>
fn smbus_process_call( &mut self, command: u8, value: u16, ) -> Result<u16, Self::Error>
Writes a 16-bit word to the specified register, then reads a 16-bit word
in response.
Auto Trait Implementations§
impl<I> Freeze for I2cDev<I>where
I: Freeze,
impl<I> RefUnwindSafe for I2cDev<I>where
I: RefUnwindSafe,
impl<I> Send for I2cDev<I>where
I: Send,
impl<I> Sync for I2cDev<I>where
I: Sync,
impl<I> Unpin for I2cDev<I>where
I: Unpin,
impl<I> UnwindSafe for I2cDev<I>where
I: UnwindSafe,
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