[][src]Struct tof10120::TOF10120

pub struct TOF10120<TI2C> { /* fields omitted */ }

Wrapper for a TOF10120, specific for an I2C peripheral, so that it cannot be written to from multiple peripherals, which would not make sense.

Implementations

impl<TI2C, E> TOF10120<TI2C> where
    TI2C: WriteRead<Error = E>, 
[src]

pub fn init(_i2c: &mut TI2C) -> Self[src]

Initialize the driver, binding it to an I2C peripheral

pub fn read_sample(&self, i2c: &mut TI2C) -> Result<u16, E>[src]

Read a sample and fetch the result in millimeters

Auto Trait Implementations

impl<TI2C> Send for TOF10120<TI2C> where
    TI2C: Send
[src]

impl<TI2C> Sync for TOF10120<TI2C> where
    TI2C: Sync
[src]

impl<TI2C> Unpin for TOF10120<TI2C> where
    TI2C: Unpin
[src]

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> Same<T> for T

type Output = T

Should always be Self

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.