User Manual

Ranging UM2039
16/26 DocID029105 Rev 1
5.3 Get a result
5.3.1 Host polling to get the result status
VL53L0X_GetMeasurementDataReady() function allows the Host to get a status on the
ongoing measurement.
5.3.2 Get measurement
VL53L0X_GetRangingMeasurementData() function returns the ranging data.
The function returns a buffer which contains the following:
RangeMilliMeter
RangeDMaxMilliMeter:
SignalRateRtnMegaCps
AmbientRateRtnMegaCps
EffectiveSpadRtnCount
RangeStatus: Refer to Table 1
Ranging status string is available by calling VL53L0X_GetRangeStatusString()
function
Note: VL53L0X_GetDeviceErrorStatus()function shall be called only for debug purposes. It
should not be used, unless requested by ST to customer.
Note: SignalRateRtnMegaCps includes the crosstalk correction (if the correction is enabled). If the
user wants to get the signal rate without crosstalk correction, they can call
VL53L0X_GetTotalSignalRate() function.
Table 1. Range Status
RangeStatus
value
RangeStatus
String
Comment
0 Range Valid Ranging measurement is valid
1 Sigma Fail
Sigma fail will trigger particularly in ambient light, when the amount of ambient
light is adding too much noise onto the ranging measurement.
2 Signal Fail
Signal fail will trigger when the return signal is too low to give enough
confidence on the range measured. The limit will be given by either the signal
limit or the RIT (Range Ignore Threshold).
3 Min Range Fail Not enabled as default.
4Phase Fail
Phase fail will trigger when wraparound conditions are detected or when noise
on signal is too high.
5 Hardware Fail Hardware Fail will trigger if a VCSEL failure, or VHV fail are detected.
255 No Update This error should not trigger.