[][src]Struct ezo_i2c_rs::EzoBoard

pub struct EzoBoard<I2C> { /* fields omitted */ }

Newtype that encapsulates the I2C device and it's address.

Implementations

impl<I2C, E> EzoBoard<I2C> where
    I2C: Read<Error = E> + Write<Error = E>,
    E: Error
[src]

I2C must implement the embedded-hal traits for I2C. Specifically Read and Write are required.

https://docs.rs/embedded-hal/0.2.4/embedded_hal/blocking/i2c/index.html

pub fn new(i2c: I2C, address: u8) -> Self[src]

pub fn send_command(
    &mut self,
    command: &[u8],
    delay: Duration
) -> Result<(), EzoBoardError<E>>
[src]

Sends a command to the Ezo device and then sleep the specified delay. Does not sleep on delay if delay is Duration:new(0,0)

pub fn read_response(&mut self) -> Result<String, EzoBoardError<E>>[src]

Reads from ezo device, checks response code and returns the result as a string for convenience.

Auto Trait Implementations

impl<I2C> RefUnwindSafe for EzoBoard<I2C> where
    I2C: RefUnwindSafe

impl<I2C> Send for EzoBoard<I2C> where
    I2C: Send

impl<I2C> Sync for EzoBoard<I2C> where
    I2C: Sync

impl<I2C> Unpin for EzoBoard<I2C> where
    I2C: Unpin

impl<I2C> UnwindSafe for EzoBoard<I2C> where
    I2C: UnwindSafe

Blanket Implementations

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

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

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

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.