VL53L0X API Specification: VL53L0X General Functions

VL53L0X API

General functions and definitions. More...

Functions

VL53L0X_API VL53L0X_Error VL53L0X_GetVersion (VL53L0X_Version_t *pVersion)
 Return the VL53L0X PAL Implementation Version. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetPalSpecVersion (VL53L0X_Version_t *pPalSpecVersion)
 Return the PAL Specification Version used for the current implementation. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetProductRevision (VL53L0X_DEV Dev, uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor)
 Reads the Product Revision for a for given Device This function can be used to distinguish cut1.0 from cut1.1. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceInfo (VL53L0X_DEV Dev, VL53L0X_DeviceInfo_t *pVL53L0X_DeviceInfo)
 Reads the Device information for given Device. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceErrorStatus (VL53L0X_DEV Dev, VL53L0X_DeviceError *pDeviceErrorStatus)
 Read current status of the error register for the selected device. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetRangeStatusString (uint8_t RangeStatus, char *pRangeStatusString)
 Human readable Range Status string for a given RangeStatus. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceErrorString (VL53L0X_DeviceError ErrorCode, char *pDeviceErrorString)
 Human readable error string for a given Error Code. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetPalErrorString (VL53L0X_Error PalErrorCode, char *pPalErrorString)
 Human readable error string for current PAL error status. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetPalStateString (VL53L0X_State PalStateCode, char *pPalStateString)
 Human readable PAL State string. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetPalState (VL53L0X_DEV Dev, VL53L0X_State *pPalState)
 Reads the internal state of the PAL for a given Device. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_SetPowerMode (VL53L0X_DEV Dev, VL53L0X_PowerModes PowerMode)
 Set the power mode for a given Device The power mode can be Standby or Idle. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetPowerMode (VL53L0X_DEV Dev, VL53L0X_PowerModes *pPowerMode)
 Get the power mode for a given Device. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_SetOffsetCalibrationDataMicroMeter (VL53L0X_DEV Dev, int32_t OffsetCalibrationDataMicroMeter)
 Set or over-hide part to part calibration offset. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetOffsetCalibrationDataMicroMeter (VL53L0X_DEV Dev, int32_t *pOffsetCalibrationDataMicroMeter)
 Get part to part calibration offset. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_SetLinearityCorrectiveGain (VL53L0X_DEV Dev, int16_t LinearityCorrectiveGain)
 Set the linearity corrective gain. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetLinearityCorrectiveGain (VL53L0X_DEV Dev, uint16_t *pLinearityCorrectiveGain)
 Get the linearity corrective gain. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_SetGroupParamHold (VL53L0X_DEV Dev, uint8_t GroupParamHold)
 Set Group parameter Hold state. More...
 
VL53L0X_API VL53L0X_Error VL53L0X_GetUpperLimitMilliMeter (VL53L0X_DEV Dev, uint16_t *pUpperLimitMilliMeter)
 Get the maximal distance for actual setup. More...
 
VL53L0X_Error VL53L0X_GetTotalSignalRate (VL53L0X_DEV Dev, FixPoint1616_t *pTotalSignalRate)
 Get the Total Signal Rate. More...
 

Detailed Description

General functions and definitions.

Function Documentation

VL53L0X_API VL53L0X_Error VL53L0X_GetVersion ( VL53L0X_Version_t pVersion)

Return the VL53L0X PAL Implementation Version.

Note
This function doesn't access to the device
Parameters
pVersionPointer to current PAL Implementation Version
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetPalSpecVersion ( VL53L0X_Version_t pPalSpecVersion)

Return the PAL Specification Version used for the current implementation.

Note
This function doesn't access to the device
Parameters
pPalSpecVersionPointer to current PAL Specification Version
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetProductRevision ( VL53L0X_DEV  Dev,
uint8_t pProductRevisionMajor,
uint8_t pProductRevisionMinor 
)

Reads the Product Revision for a for given Device This function can be used to distinguish cut1.0 from cut1.1.

Note
This function Access to the device
Parameters
DevDevice Handle
pProductRevisionMajorPointer to Product Revision Major for a given Device
pProductRevisionMinorPointer to Product Revision Minor for a given Device
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceInfo ( VL53L0X_DEV  Dev,
VL53L0X_DeviceInfo_t pVL53L0X_DeviceInfo 
)

Reads the Device information for given Device.

Note
This function Access to the device
Parameters
DevDevice Handle
pVL53L0X_DeviceInfoPointer to current device info for a given Device
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceErrorStatus ( VL53L0X_DEV  Dev,
VL53L0X_DeviceError pDeviceErrorStatus 
)

Read current status of the error register for the selected device.

Note
This function Access to the device
Parameters
DevDevice Handle
pDeviceErrorStatusPointer to current error code of the device
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetRangeStatusString ( uint8_t  RangeStatus,
char *  pRangeStatusString 
)

Human readable Range Status string for a given RangeStatus.

Note
This function doesn't access to the device
Parameters
RangeStatusThe RangeStatus code as stored on VL53L0X_RangingMeasurementData_t
pRangeStatusStringThe returned RangeStatus string.
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceErrorString ( VL53L0X_DeviceError  ErrorCode,
char *  pDeviceErrorString 
)

Human readable error string for a given Error Code.

Note
This function doesn't access to the device
Parameters
ErrorCodeThe error code as stored on VL53L0X_DeviceError
pDeviceErrorStringThe error string corresponding to the ErrorCode
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetPalErrorString ( VL53L0X_Error  PalErrorCode,
char *  pPalErrorString 
)

Human readable error string for current PAL error status.

Note
This function doesn't access to the device
Parameters
PalErrorCodeThe error code as stored on VL53L0X_Error
pPalErrorStringThe error string corresponding to the PalErrorCode
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetPalStateString ( VL53L0X_State  PalStateCode,
char *  pPalStateString 
)

Human readable PAL State string.

Note
This function doesn't access to the device
Parameters
PalStateCodeThe State code as stored on VL53L0X_State
pPalStateStringThe State string corresponding to the PalStateCode
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetPalState ( VL53L0X_DEV  Dev,
VL53L0X_State pPalState 
)

Reads the internal state of the PAL for a given Device.

Note
This function doesn't access to the device
Parameters
DevDevice Handle
pPalStatePointer to current state of the PAL for a given Device
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_SetPowerMode ( VL53L0X_DEV  Dev,
VL53L0X_PowerModes  PowerMode 
)

Set the power mode for a given Device The power mode can be Standby or Idle.

Different level of both Standby and Idle can exists. This function should not be used when device is in Ranging state.

Note
This function Access to the device
Parameters
DevDevice Handle
PowerModeThe value of the power mode to set. see VL53L0X_PowerModes Valid values are: VL53L0X_POWERMODE_STANDBY_LEVEL1, VL53L0X_POWERMODE_IDLE_LEVEL1
Returns
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when PowerMode is not in the supported list
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetPowerMode ( VL53L0X_DEV  Dev,
VL53L0X_PowerModes pPowerMode 
)

Get the power mode for a given Device.

Note
This function Access to the device
Parameters
DevDevice Handle
pPowerModePointer to the current value of the power mode. see VL53L0X_PowerModes Valid values are: VL53L0X_POWERMODE_STANDBY_LEVEL1, VL53L0X_POWERMODE_IDLE_LEVEL1
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_SetOffsetCalibrationDataMicroMeter ( VL53L0X_DEV  Dev,
int32_t  OffsetCalibrationDataMicroMeter 
)

Set or over-hide part to part calibration offset.

See also
VL53L0X_DataInit() VL53L0X_GetOffsetCalibrationDataMicroMeter()
Note
This function Access to the device
Parameters
DevDevice Handle
OffsetCalibrationDataMicroMeterOffset (microns)
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetOffsetCalibrationDataMicroMeter ( VL53L0X_DEV  Dev,
int32_t pOffsetCalibrationDataMicroMeter 
)

Get part to part calibration offset.

Function Description
Should only be used after a successful call to VL53L0X_DataInit to backup device NVM value
Note
This function Access to the device
Parameters
DevDevice Handle
pOffsetCalibrationDataMicroMeterReturn part to part calibration offset from device (microns)
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_SetLinearityCorrectiveGain ( VL53L0X_DEV  Dev,
int16_t  LinearityCorrectiveGain 
)

Set the linearity corrective gain.

Note
This function Access to the device
Parameters
DevDevice Handle
LinearityCorrectiveGainLinearity corrective gain in x1000 if value is 1000 then no modification is applied.
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_GetLinearityCorrectiveGain ( VL53L0X_DEV  Dev,
uint16_t pLinearityCorrectiveGain 
)

Get the linearity corrective gain.

Function Description
Should only be used after a successful call to VL53L0X_DataInit to backup device NVM value
Note
This function Access to the device
Parameters
DevDevice Handle
pLinearityCorrectiveGainPointer to the linearity corrective gain in x1000 if value is 1000 then no modification is applied.
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_API VL53L0X_Error VL53L0X_SetGroupParamHold ( VL53L0X_DEV  Dev,
uint8_t  GroupParamHold 
)

Set Group parameter Hold state.

Function Description
Set or remove device internal group parameter hold
Note
This function is not Implemented
Parameters
DevDevice Handle
GroupParamHoldGroup parameter Hold state to be set (on/off)
Returns
VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented
VL53L0X_API VL53L0X_Error VL53L0X_GetUpperLimitMilliMeter ( VL53L0X_DEV  Dev,
uint16_t pUpperLimitMilliMeter 
)

Get the maximal distance for actual setup.

Function Description
Device must be initialized through VL53L0X_SetParameters() prior calling this function.

Any range value more than the value returned is to be considered as "no target detected" or "no target in detectable range"

Warning
The maximal distance depends on the setup
Note
This function is not Implemented
Parameters
DevDevice Handle
pUpperLimitMilliMeterThe maximal range limit for actual setup (in millimeter)
Returns
VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented
VL53L0X_Error VL53L0X_GetTotalSignalRate ( VL53L0X_DEV  Dev,
FixPoint1616_t pTotalSignalRate 
)

Get the Total Signal Rate.

Function Description
This function will return the Total Signal Rate after a good ranging is done.
Note
This function access to Device
Parameters
DevDevice Handle
pTotalSignalRateTotal Signal Rate value in Mega count per second
Returns
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error