Struct gyuvl53l0x::VL53L0X[][src]

pub struct VL53L0X<I2C> { /* fields omitted */ }
Expand description

Struct for VL53L0X

Implementations

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

pub fn default(i2c: I2C) -> Result<VL53L0X<I2C>, Error<E>>[src]

Creates a sensor with default configuration

pub fn new(
    i2c: I2C,
    address: u8,
    io_mode2v8: bool
) -> Result<VL53L0X<I2C>, Error<E>>
[src]

Creates a sensor with specific configuration

pub fn set_device_address(&mut self, address: u8) -> Result<bool, E>[src]

Set new address for device

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

Start continuous ranging measurements Ranging is performed in a continuous way after the API function is called. As soon as the measurement is finished, another one is started without delay. User has to stop the ranging to return to SW standby. The last measurement is completed before stopping

If period_millis is 0, continuous back-to-back mode is used (the sensor takes measurements as often as possible); otherwise, continuous timed mode is used, with the given inter-measurement period in milliseconds determining how often the sensor takes a measurement

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

Stop continuous measurements

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

Reads and returns range measurement in millimiters

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

Returns a range reading in millimeters when continuous mode is active

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

Returns a single reading in millimeters

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

Returns WHO_AM_I register

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

Set the measurement timing budget in microseconds, which is the time allowed for one measurement; the ST API and this library take care of splitting the timing budget among the sub-steps in the ranging sequence. A longer timing budget allows for more accurate measurements. Increasing the budget by a factor of N decreases the range measurement standard deviation by a factor of sqrt(N). Defaults to about 33 milliseconds; the minimum is 20 ms

Trait Implementations

impl<I2C: Clone> Clone for VL53L0X<I2C>[src]

fn clone(&self) -> VL53L0X<I2C>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<I2C: Debug> Debug for VL53L0X<I2C>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<I2C: Copy> Copy for VL53L0X<I2C>[src]

Auto Trait Implementations

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.