pub struct Vl53l1x<I2C, X> { /* private fields */ }
Expand description
A VL53L1X driver. Use the new
function to create a new instance, then
call range
to get the current range, if available.
Implementations§
Source§impl<I2C, X, EI2C, EX> Vl53l1x<I2C, X>
impl<I2C, X, EI2C, EX> Vl53l1x<I2C, X>
Sourcepub fn new(
i2c: I2C,
x_shut: X,
address: u8,
delay: &mut impl DelayNs,
) -> Result<Self, InitialisationError<EI2C, EX>>
pub fn new( i2c: I2C, x_shut: X, address: u8, delay: &mut impl DelayNs, ) -> Result<Self, InitialisationError<EI2C, EX>>
Create a new instance of the VL53L1X driver. This performs a reset of
the device and may fail if the device is not present. This will use the
x_shut
pin to select the device to be reset, then it will change that
devices’ address to the provided address.
If these sensors are being used in an array, set all the xshut pins low prior to calling this function which will allow this to only initialize a single sensor.
§Errors
Forwards any errors from the I2C bus and xshut pin, as well as any initialisation errors from the device itself.
Auto Trait Implementations§
impl<I2C, X> Freeze for Vl53l1x<I2C, X>
impl<I2C, X> RefUnwindSafe for Vl53l1x<I2C, X>where
I2C: RefUnwindSafe,
X: RefUnwindSafe,
impl<I2C, X> Send for Vl53l1x<I2C, X>
impl<I2C, X> Sync for Vl53l1x<I2C, X>
impl<I2C, X> Unpin for Vl53l1x<I2C, X>
impl<I2C, X> UnwindSafe for Vl53l1x<I2C, X>where
I2C: UnwindSafe,
X: 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