[−][src]Struct gyuvl53l0x::ConnectedVL53L0X
Actual implementation for VL53L0X functions (given an I2C bus)
Methods
impl<'a, I2C, E> ConnectedVL53L0X<'a, I2C> where
I2C: WriteRead<Error = E>,
[src]
I2C: WriteRead<Error = E>,
pub fn new(
i2c: &'a mut I2C,
io_mode2v8: bool,
address: u8
) -> ConnectedVL53L0X<'a, I2C>
[src]
i2c: &'a mut I2C,
io_mode2v8: bool,
address: u8
) -> ConnectedVL53L0X<'a, I2C>
Create chip data for the first time
pub fn from_state(
state: &VL53L0X,
i2c: &'a mut I2C
) -> ConnectedVL53L0X<'a, I2C>
[src]
state: &VL53L0X,
i2c: &'a mut I2C
) -> ConnectedVL53L0X<'a, I2C>
Create chip data from chip state
pub fn get_state(&self) -> VL53L0X
[src]
Get chip state
pub fn init(&mut self) -> Result<(), Error<E>>
[src]
Initialize chip
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]
&mut self
) -> Result<u16, Error<E>>
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]
&mut self
) -> Result<u16, Error<E>>
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]
&mut self,
budget_microseconds: u32
) -> Result<bool, E>
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<'a, I2C: Debug> Debug for ConnectedVL53L0X<'a, I2C>
[src]
Auto Trait Implementations
impl<'a, I2C> Unpin for ConnectedVL53L0X<'a, I2C>
impl<'a, I2C> Send for ConnectedVL53L0X<'a, I2C> where
I2C: Send,
I2C: Send,
impl<'a, I2C> Sync for ConnectedVL53L0X<'a, I2C> where
I2C: Sync,
I2C: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self