#include <otVL53L0X.h>
Public Types | |
enum | vcselPeriodType { VcselPeriodPreRange, VcselPeriodFinalRange } |
Public Member Functions | |
otVL53L0X () | |
bool | init (U8 timer) |
bool | setSignalRateLimit (F32 limit_Mcps) |
F32 | getSignalRateLimit () |
bool | setMeasurementTimingBudget (U32 budget_us) |
U32 | getMeasurementTimingBudget () |
bool | setVcselPulsePeriod (vcselPeriodType type, U8 period_pclks) |
U8 | getVcselPulsePeriod (vcselPeriodType type) |
void | startContinuous (U32 period_ms=0) |
void | stopContinuous () |
U16 | readRangeContinuousMillimeters () |
bool | readRangeContinuousCheck () |
U16 | readRangeContinuousValue () |
U16 | readRangeSingleMillimeters () |
void | setTimeout (U16 timeout) |
bool | timeoutOccurred () |
|
|
|
Create the class. |
|
Get the measurement timing budget in microseconds
|
|
Get the return signal rate limit check value in MCPS
|
|
Get the VCSEL (vertical cavity surface emitting laser) pulse period for the given period type.
|
|
Initialize sensor. This function does not perform reference SPAD calibration
|
|
Check if a continuous measurements is ready
|
|
Returns a range reading in millimeters when continuous mode is active (readRangeSingleMillimeters() also calls this function after starting a single-shot range measurement)
|
|
Read a measurement
|
|
Performs a single-shot range measurement and returns the reading in millimeters
|
|
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.
|
|
Set the return signal rate limit check value in units of MCPS (mega counts per second). "This represents the amplitude of the signal reflected from the target and detected by the device"; setting this limit presumably determines the minimum measurement necessary for the sensor to report a valid reading. Setting a lower limit increases the potential range of the sensor but also seems to increase the likelihood of getting an inaccurate reading because of unwanted reflections from objects other than the intended target. Defaults to 0.25 MCPS as initialized by the ST API and this library.
|
|
Set timeout used in read operations.
|
|
Set the VCSEL (vertical cavity surface emitting laser) pulse period for the given period type (pre-range or final range) to the given value in PCLKs. Longer periods seem to increase the potential range of the sensor. Valid values are (even numbers only): pre: 12 to 18 (initialized default: 14) final: 8 to 14 (initialized default: 10)
|
|
Start continuous ranging measurements. If period_ms (optional) is 0 or not given, 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.
|
|
Stop continuous measurements |
|
Check if timeout is occurred
|