Enum i2c::Message
[−]
[src]
pub enum Message<'a> { Read { address: u16, data: &'a mut [u8], flags: ReadFlags, }, Write { address: u16, data: &'a [u8], flags: WriteFlags, }, }
Part of a combined I2C transaction.
Variants
Read
I2C read command
Fields of Read
address: u16 | The slave address of the device to read from. |
data: &'a mut [u8] | A data buffer to read into. |
flags: ReadFlags | Additional flags can modify the operation to work around device quirks. |
Write
I2C write command
Fields of Write
address: u16 | The slave address of the device to write to. |
data: &'a [u8] | The data to write. |
flags: WriteFlags | Additional flags can modify the operation to work around device quirks. |
Methods
impl<'a> Message<'a>
[src]
pub fn len(&self) -> usize
[src]
Byte length of the message data buffer.
pub fn address(&self) -> u16
[src]
Address of the message's slave.
pub fn data(&self) -> &[u8]
[src]
The data buffer of the message.