Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otVL53L0X Class Reference
[VL53L0X - Time-of-Flight ranging sensorVL53L0X - Time-of-Flight ranging sensor]

Time-of-Flight ranging sensor.

#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 ()


Member Enumeration Documentation

enum otVL53L0X::vcselPeriodType
 

Enumeration values:
VcselPeriodPreRange 
VcselPeriodFinalRange 


Constructor & Destructor Documentation

otVL53L0X.otVL53L0X  ) 
 

Create the class.


Member Function Documentation

U32 otVL53L0X.getMeasurementTimingBudget  ) 
 

Get the measurement timing budget in microseconds

Returns:
Measurement timing budget in microseconds

F32 otVL53L0X.getSignalRateLimit  ) 
 

Get the return signal rate limit check value in MCPS

Returns:
The return signal rate

U8 otVL53L0X.getVcselPulsePeriod vcselPeriodType  type  ) 
 

Get the VCSEL (vertical cavity surface emitting laser) pulse period for the given period type.

Returns:
VCSEL

bool otVL53L0X.init U8  timer  ) 
 

Initialize sensor. This function does not perform reference SPAD calibration

Parameters:
timer Used timer for timeout sync.
Returns:
True on success

bool otVL53L0X.readRangeContinuousCheck  ) 
 

Check if a continuous measurements is ready

Returns:
True on measurement ready

U16 otVL53L0X.readRangeContinuousMillimeters  ) 
 

Returns a range reading in millimeters when continuous mode is active (readRangeSingleMillimeters() also calls this function after starting a single-shot range measurement)

Returns:
Detected distance as mm

U16 otVL53L0X.readRangeContinuousValue  ) 
 

Read a measurement

Returns:
Detected distance as mm

U16 otVL53L0X.readRangeSingleMillimeters  ) 
 

Performs a single-shot range measurement and returns the reading in millimeters

Returns:
Detected distance as mm

bool otVL53L0X.setMeasurementTimingBudget U32  budget_us  ) 
 

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.

Parameters:
budget_us Measurement timing budget in microseconds
Returns:
True on success

bool otVL53L0X.setSignalRateLimit F32  limit_Mcps  ) 
 

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.

Parameters:
limit_Mcps Set the return signal rate
Returns:
True on success

void otVL53L0X.setTimeout U16  timeout  ) 
 

Set timeout used in read operations.

Parameters:
timeout Timeout as ms

bool otVL53L0X.setVcselPulsePeriod vcselPeriodType  type,
U8  period_pclks
 

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)

Parameters:
type Set the vertical cavity surface emitting laser
period_pclks Number of clocks

void otVL53L0X.startContinuous U32  period_ms = 0  ) 
 

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.

Parameters:
period_ms Sampling period

void otVL53L0X.stopContinuous  ) 
 

Stop continuous measurements

bool otVL53L0X.timeoutOccurred  ) 
 

Check if timeout is occurred

Returns:
True if a timeout is occurred


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0