User Manual
DocID029105 Rev 1 19/26
UM2039 API useful additional functions
26
6.5 API state and API error
VL53L0X_GetPalState() function gives the state of the API. All different states are
given in Table 3.
VL53L0X_GetPalStateString() function returns the status string.
An API error code is reported when any API function is called. Possible values for API errors
are described in Table 4.
VL53L0X_GetPalErrorString() function returns the error string.
Table 3. API state description
API state
value
API state string Comment
0 POWERDOWN state Device is in HW reset
1 Wait for StaticInit State Device is initialized and wait for static initialization
2 STANDBY State Device is in low power Standby mode
3 IDLE State Not used
4 RUNNING State Device is performing measurement
98 UNKNOWN State Device is in unknown state and needs to be rebooted
99 ERROR State Device is in error state and needs to be rebooted
Table 4. API error values and error strings description
API
error
value
API error string Occurrence Possible root cause
0No Error - -
-1
Calibration
warning error
Not implemented, cannot happen N/A
-2 Min clipped error Not implemented, cannot happen N/A
-3 Undefined error Not implemented, cannot happen N/A
-4
Invalid parameters
error
Parameter passed is invalid or
out of range
Wrong API programming (wrong setting used), or
I2C transaction corrupted
-5
Not supported
error
Function is not supported in
current mode or configuration
Wrong API programming (non implemented
function called), or I2C transaction corrupted
-6 Range error
Device reports a ranging error
interrupt status
Wrong API programming (syntax error), or no
target present during offset calibration, or I2C
transaction corrupted
-7 Time out error Aborted due to time out
Device is functionally failing, or I2C transaction
corrupted
-8
Mode not
supported error
Requested mode is not
supported by the device
Wrong API programming (non existent mode
called), or I2C transaction corrupted
-9 Buffer too small Cannot happen N/A