Struct VL53L0x

Source
pub struct VL53L0x<I2C: I2c> {
    pub revision_id: u8,
    /* private fields */
}
Expand description

dummy

Fields§

§revision_id: u8

dummy

Implementations§

Source§

impl<I2C, E> VL53L0x<I2C>
where I2C: I2c<Error = E>,

Source

pub fn new(i2c: I2C) -> Result<VL53L0x<I2C>, Error<E>>
where I2C: I2c<Error = E>,

Creates new driver with default address.

Source

pub fn with_address(i2c: I2C, address: u8) -> Result<VL53L0x<I2C>, Error<E>>
where I2C: I2c<Error = E>,

Creates new driver with given address.

Source

pub fn set_address(&mut self, new_address: u8) -> Result<(), Error<E>>

Changes the I2C address of the sensor. Note that the address resets when the device is powered off. Only allows values between 0x08 and 0x77 as the device uses a 7 bit address and 0x00 - 0x07 and 0x78 - 0x7F are reserved

Source

pub fn start_continuous(&mut self, period_millis: u32) -> Result<(), E>

startContinuous

Source

pub fn stop_continuous(&mut self) -> Result<(), E>

stopContinuous()

Source

pub fn read_range_mm(&mut self) -> Result<u16, Error<E>>

reads and returns range measurement or nb::Error::WouldBlock if it’s not ready yet

Source

pub fn read_range_continuous_millimeters_blocking( &mut self, ) -> Result<u16, Error<E>>

readRangeContinuousMillimeters (blocking)

Source

pub fn read_range_single_millimeters_blocking( &mut self, ) -> Result<u16, Error<E>>

readRangeSingleMillimeters (blocking)

Source

pub fn who_am_i(&mut self) -> Result<u8, E>

Returns who am i

Source

pub fn set_measurement_timing_budget( &mut self, budget_microseconds: u32, ) -> Result<bool, E>

setMeasurementTimingBudget(budget_microseconds)

Auto Trait Implementations§

§

impl<I2C> Freeze for VL53L0x<I2C>
where I2C: Freeze,

§

impl<I2C> RefUnwindSafe for VL53L0x<I2C>
where I2C: RefUnwindSafe,

§

impl<I2C> Send for VL53L0x<I2C>
where I2C: Send,

§

impl<I2C> Sync for VL53L0x<I2C>
where I2C: Sync,

§

impl<I2C> Unpin for VL53L0x<I2C>
where I2C: Unpin,

§

impl<I2C> UnwindSafe for VL53L0x<I2C>
where I2C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.