[][src]Trait i2cdev::core::I2CTransfer

pub trait I2CTransfer<'a> {
    type Error: Error;
    type Message: I2CMessage<'a>;
    fn transfer(
        &mut self,
        msgs: &'a mut [Self::Message]
    ) -> Result<u32, Self::Error>; }

Interface to an I2C Bus from an I2C Master

This is used when the client wants to interact directly with the bus without specifying an I2C slave address up-front, either because it needs to communicate with multiple addresses without creatings separate I2CDevice objects, or because it wants to make used of the I2C_RDWR ioctl which allows the client to send and transmit multiple sets I2C data in a single operation, potentially to different I2C slave addresses.

Typical implementations will store state with references to the bus in use. The trait is based on the Linux i2cdev interface.

Associated Types

type Error: Error

type Message: I2CMessage<'a>

Loading content...

Required methods

fn transfer(
    &mut self,
    msgs: &'a mut [Self::Message]
) -> Result<u32, Self::Error>

Loading content...

Implementors

impl<'a> I2CTransfer<'a> for MockI2CDevice where
    MockI2CDevice: I2CDevice
[src]

type Error = Error

type Message = MockI2CMessage<'a>

fn transfer(
    &mut self,
    messages: &'a mut [Self::Message]
) -> Result<u32, Self::Error>
[src]

Issue the provided sequence of I2C transactions

Loading content...