[][src]Struct rust_i2c::I2CStream

pub struct I2CStream { /* fields omitted */ }

An implementation of i2c_hal::Stream which uses the i2c_linux crate for communication with actual I2C hardware.

Methods

impl I2CStream[src]

pub fn new(path: &str, slave: u16) -> Self[src]

Creates new I2CStream instance

Arguments

path - File system path to I2C device handle slave - Address of slave I2C device

Trait Implementations

impl Stream for I2CStream[src]

fn write(&self, command: Command) -> Result<()>[src]

Writing

fn read(&self, command: Command, rx_len: usize) -> Result<Vec<u8>>[src]

Reading

fn transfer(
    &self,
    command: Command,
    rx_len: usize,
    delay: Duration
) -> Result<Vec<u8>>
[src]

Read/Write transaction

Auto Trait Implementations

impl Send for I2CStream

impl Sync for I2CStream

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]