mbed compatible API for the VL53L0X Time-of-Flight sensor

Dependents:   VL53L0X_SingleRanging_Example robot_sm VL53L0X_SingleRanging_HighAccuracy_HANSL ENGR6002_P001unk

Embed: (wiki syntax)

« Back to documentation index

VL53L0X General Functions

VL53L0X General Functions
[VL53L0X cut1.1 Function Definition]

General functions and definitions. More...

Functions

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

Detailed Description

General functions and definitions.


Function Documentation

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

Definition at line 114 of file vl53l0x_api.c.

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

Definition at line 132 of file vl53l0x_api.c.

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

Definition at line 102 of file vl53l0x_api.c.

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

Definition at line 300 of file vl53l0x_api.c.

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

Definition at line 264 of file vl53l0x_api.c.

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

Definition at line 158 of file vl53l0x_api.c.

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

Definition at line 68 of file vl53l0x_api.c.

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

Definition at line 182 of file vl53l0x_api.c.

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

Definition at line 170 of file vl53l0x_api.c.

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

Definition at line 228 of file vl53l0x_api.c.

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

Definition at line 84 of file vl53l0x_api.c.

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

Definition at line 145 of file vl53l0x_api.c.

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

Definition at line 335 of file vl53l0x_api.c.

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

Definition at line 323 of file vl53l0x_api.c.

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

Definition at line 53 of file vl53l0x_api.c.

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

Definition at line 312 of file vl53l0x_api.c.

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

Definition at line 277 of file vl53l0x_api.c.

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

Definition at line 251 of file vl53l0x_api.c.

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

Definition at line 193 of file vl53l0x_api.c.