Data Sheet

Ranging API function descriptions UM2356
8/28 DocID031478 Rev 1
2.4 Mandatory ranging functions
The following sections shows the API functions required to perform system initialization,
before starting a measurement.
2.4.1 Data init
The VL53L1_DataInit() function is called once. It performs device initialization.
It is called once and only once after the device is brought out of reset.
2.4.2 Static Init
The VL53L1_StaticInit() function allows loading of the device settings that are
specific for a given use case.
2.4.3 Start a measurement
The VL53L1_StartMeasurement() function must be called to start a measurement.
2.4.4 Waiting for a result: polling or interrupt
There are three ways to know that ranging data are available:
1. The host can call a polling function to wait until ranging data are available,
The function VL53L1_WaitMeasurementDataReady() polls on the device interrupt
status until ranging data are ready.
This function blocks all other operations on the host as long as the function is not
completed, because an internal polling is performed.
2. The host can poll on a function to ask if the ranging data are available,
The host can poll on the function VL53L1_GetMeasurementDataReady() to know if new
ranging data are ready.
This function does not block other operations. It is the preferred and recommended method
if the sensor is used in polling mode.
3. The host can wait for a physical interrupt
An alternative and preferred way to get the ranging status is to use the physical interrupt
output: by default, GPIO1 is pulled down when new ranging data are ready.
This pin is an output pin only, there is no input interrupt pin on this device.
2.4.5 Get measurement
The Vl53L1_GetRangingMeasurementData() can be used to get ranging data.
When calling this function to get the device ranging results, a structure called
VL53L1_RangingMeasurementData_t is returned.
This structure is described in Section 2.6: RangingMeasurementData structure.