4 Ranging with VL53L4CX
On non-Linux hosts, the user of the bare driver sequences calls to the driver in a way that is appropriate to the
application needs, the platform capabilities and the bare driver call sequence rules.
4.1 Start a measurement
VL53LX_StartMeasurement() function must be called to start a measurement.
4.2 Wait for a result: polling or interrupt
There are 3 ways to know that a measurement is available. The host can:
1. call a polling function
2. poll on a driver function
3. wait for a physical interrupt
4.2.1 Driver polling to get the result status
The function VL53LX_WaitMeasurementDataReady() is polls the internal status until a measurement is ready.
Note: This function is blocking, as internal polling is performed.
4.2.2 Host polling to get the result status
Host can poll using the function VL53LX_GetMeasurementDataReady(), to know when a new measurement is
ready.
This function is not blocking.
4.2.3 Using physical interrupt
An alternative and preferred way to get the ranging status is to use the physical interrupt output. By default,
GPIO1 goes low when a new measurement is ready.
This pin is an output pin only, there is no input interrupt pin on this device.
Interrupt must be cleared by calling driver function VL53LX_ClearInterruptAndStartMeasurement().
4.3 Get measurement
Multiple objects can be detected per ranging, and measurement data is reported per object
VL53LX_GetMultiRangingData() can be used to get ranging data when multiple objects are in the field of view.
When calling this function to get the device multiple ranging results, a structure called
VL53LX_MultiRangingData_t is returned.
4.4 Stop a measurement
The host can stop the measurement by calling VL53LX_StopMeasurement() function.
If the stop request occurs during a range measurement, then the measurement is aborted immediately.
UM2923
Ranging with VL53L4CX
UM2923 - Rev 2
page 9/25