[−][src]Struct ezo_i2c_rs::EzoBoard
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: Read<Error = E> + Write<Error = E>,
E: Error,
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]
&mut self,
command: &[u8],
delay: Duration
) -> Result<(), EzoBoardError<E>>
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,
I2C: RefUnwindSafe,
impl<I2C> Send for EzoBoard<I2C> where
I2C: Send,
I2C: Send,
impl<I2C> Sync for EzoBoard<I2C> where
I2C: Sync,
I2C: Sync,
impl<I2C> Unpin for EzoBoard<I2C> where
I2C: Unpin,
I2C: Unpin,
impl<I2C> UnwindSafe for EzoBoard<I2C> where
I2C: UnwindSafe,
I2C: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,