[][src]Trait rust_i2c::Stream

pub trait Stream {
    fn write(&self, command: Command) -> Result<()>;
fn read(&self, command: Command, rx_len: usize) -> Result<Vec<u8>>;
fn transfer(
        &self,
        command: Command,
        rx_len: usize,
        delay: Duration
    ) -> Result<Vec<u8>>; }
[]

High level read/write trait for I2C connections to implement

Required Methods

[]

Writes an I2C command

Arguments

command - Command to write

[]

Reads command result

Arguments

command - Command to read result from rx_len - Amount of data to read

[]

Writes I2C command and reads result

Arguments

command - Command to write and read from rx_len - Amount of data to read delay - Delay between writing and reading

Implementors

impl Stream for I2CStream
[src]
[]

[]

Writing

[]

Reading

[]

Read/Write transaction