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>,
impl<I2C, E> VL53L0x<I2C>where
I2C: I2c<Error = E>,
Sourcepub fn new(i2c: I2C) -> Result<VL53L0x<I2C>, Error<E>>where
I2C: I2c<Error = E>,
pub fn new(i2c: I2C) -> Result<VL53L0x<I2C>, Error<E>>where
I2C: I2c<Error = E>,
Creates new driver with default address.
Sourcepub fn with_address(i2c: I2C, address: u8) -> Result<VL53L0x<I2C>, Error<E>>where
I2C: I2c<Error = E>,
pub fn with_address(i2c: I2C, address: u8) -> Result<VL53L0x<I2C>, Error<E>>where
I2C: I2c<Error = E>,
Creates new driver with given address.
Sourcepub fn set_address(&mut self, new_address: u8) -> Result<(), Error<E>>
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
Sourcepub fn start_continuous(&mut self, period_millis: u32) -> Result<(), E>
pub fn start_continuous(&mut self, period_millis: u32) -> Result<(), E>
startContinuous
Sourcepub fn stop_continuous(&mut self) -> Result<(), E>
pub fn stop_continuous(&mut self) -> Result<(), E>
stopContinuous()
Sourcepub fn read_range_mm(&mut self) -> Result<u16, Error<E>>
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
Sourcepub fn read_range_continuous_millimeters_blocking(
&mut self,
) -> Result<u16, Error<E>>
pub fn read_range_continuous_millimeters_blocking( &mut self, ) -> Result<u16, Error<E>>
readRangeContinuousMillimeters (blocking)
Sourcepub fn read_range_single_millimeters_blocking(
&mut self,
) -> Result<u16, Error<E>>
pub fn read_range_single_millimeters_blocking( &mut self, ) -> Result<u16, Error<E>>
readRangeSingleMillimeters (blocking)
Sourcepub fn set_measurement_timing_budget(
&mut self,
budget_microseconds: u32,
) -> Result<bool, E>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more