[][src]Struct vl53l1x::Vl53l1x

pub struct Vl53l1x { /* fields omitted */ }

The VL53L1X Time of Flight sensor.

Methods

impl Vl53l1x[src]

pub fn new(i2c_bus: i32, i2c_addr: Option<u8>) -> Result<Self, Vl53l1xError>[src]

Connects to VL53L1X.

If i2c_addr is None, defaults to 0x29.

pub fn soft_reset(&mut self) -> Result<(), Vl53l1xError>[src]

pub fn init(&mut self) -> Result<(), Vl53l1xError>[src]

pub fn start_ranging(&mut self, mode: DistanceMode) -> Result<(), Vl53l1xError>[src]

Defaults timing budget to 66ms and inter measurement period to 70ms. To change from defaults, call corresponding functions after this.

pub fn stop_ranging(&mut self) -> Result<(), Vl53l1xError>[src]

pub fn read_sample(&mut self) -> Result<Vl53l1xSample, Vl53l1xReadSampleError>[src]

pub fn set_device_address(
    &mut self,
    new_i2c_addr: u8
) -> Result<(), Vl53l1xError>
[src]

Change the i2c slave address of the device.

pub fn get_user_roi(&mut self) -> UserRoi[src]

pub fn set_user_roi(
    &mut self,
    top_left_x: u8,
    top_left_y: u8,
    bot_right_x: u8,
    bot_right_y: u8
) -> Result<(), Vl53l1xError>
[src]

Set region of interest. Minimum width and height is 3.

pub fn get_measurement_timing_budget(&mut self) -> u32[src]

Return value in microseconds.

pub fn set_measurement_timing_budget(
    &mut self,
    timing_budget: u32
) -> Result<(), Vl53l1xError>
[src]

20ms is the minimum timing budget for short distance mode. 33ms is the minimum timing budget that works for all distance modes. 140ms is the timing budget needed to measure up to the maximum distance of 4 meters in ideal conditions. timing_budget units are microseconds.

pub fn get_inter_measurement_period(&mut self) -> u32[src]

Return value in milliseconds.

pub fn set_inter_measurement_period(
    &mut self,
    inter_measurement_period: u32
) -> Result<(), Vl53l1xError>
[src]

Inter measurement period must be greater than timing budget. inter_measurement_period units are milliseconds.

Trait Implementations

impl Drop for Vl53l1x[src]

Auto Trait Implementations

impl Send for Vl53l1x

impl Unpin for Vl53l1x

impl Sync for Vl53l1x

impl UnwindSafe for Vl53l1x

impl RefUnwindSafe for Vl53l1x

Blanket Implementations

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

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

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.

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

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

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