[−][src]Struct tof10120::TOF10120
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]
TI2C: WriteRead<Error = E>,
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]
TI2C: Send,
impl<TI2C> Sync for TOF10120<TI2C> where
TI2C: Sync,
[src]
TI2C: Sync,
impl<TI2C> Unpin for TOF10120<TI2C> where
TI2C: Unpin,
[src]
TI2C: Unpin,
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,
pub 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> Same<T> for T
type Output = T
Should always be Self
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.
pub 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>,