Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: VL53L3CX_NoShield_1Sensor_poll_Mb06x VL53L3_NoShield_1Sensor_polling_Mb63 X_NUCLEO_53L3A2 53L3A2_Ranging
VL53LX Calibration Functions
[VL53LX Function Definition]
Functions used for Calibration. More...
Functions | |
| VL53LX_Error | VL53LX_SetTuningParameter (VL53LX_DEV Dev, uint16_t TuningParameterId, int32_t TuningParameterValue) |
| Set Tuning Parameter value for a given parameter ID. | |
| VL53LX_Error | VL53LX_GetTuningParameter (VL53LX_DEV Dev, uint16_t TuningParameterId, int32_t *pTuningParameterValue) |
| Get Tuning Parameter value for a given parameter ID. | |
| VL53LX_Error | VL53LX_PerformRefSpadManagement (VL53LX_DEV Dev) |
| Performs Reference Spad Management. | |
| VL53LX_Error | VL53LX_SmudgeCorrectionEnable (VL53LX_DEV Dev, VL53LX_SmudgeCorrectionModes Mode) |
| Enable/Disable dynamic Xtalk compensation feature. | |
| VL53LX_Error | VL53LX_SetXTalkCompensationEnable (VL53LX_DEV Dev, uint8_t XTalkCompensationEnable) |
| Enable/Disable Cross talk compensation feature. | |
| VL53LX_Error | VL53LX_GetXTalkCompensationEnable (VL53LX_DEV Dev, uint8_t *pXTalkCompensationEnable) |
| Get Cross talk compensation rate enable. | |
| VL53LX_Error | VL53LX_PerformXTalkCalibration (VL53LX_DEV Dev) |
| Perform XTalk Calibration. | |
| VL53LX_Error | VL53LX_SetOffsetCorrectionMode (VL53LX_DEV Dev, VL53LX_OffsetCorrectionModes OffsetCorrectionMode) |
| Define the mode to be used for the offset correction. | |
| VL53LX_Error | VL53LX_PerformOffsetSimpleCalibration (VL53LX_DEV Dev, int32_t CalDistanceMilliMeter) |
| Perform Offset simple Calibration. | |
| VL53LX_Error | VL53LX_PerformOffsetZeroDistanceCalibration (VL53LX_DEV Dev) |
| Perform Offset simple Calibration with a "zero distance" target. | |
| VL53LX_Error | VL53LX_PerformOffsetPerVcselCalibration (VL53LX_DEV Dev, int32_t CalDistanceMilliMeter) |
| Perform Offset per Vcsel Calibration. | |
| VL53LX_Error | VL53LX_SetCalibrationData (VL53LX_DEV Dev, VL53LX_CalibrationData_t *pCalibrationData) |
| Sets the Calibration Data. | |
| VL53LX_Error | VL53LX_GetCalibrationData (VL53LX_DEV Dev, VL53LX_CalibrationData_t *pCalibrationData) |
| Gets the Calibration Data. | |
| VL53LX_Error | VL53LX_GetOpticalCenter (VL53LX_DEV Dev, FixPoint1616_t *pOpticalCenterX, FixPoint1616_t *pOpticalCenterY) |
| Gets the optical center. | |
Detailed Description
Functions used for Calibration.
Function Documentation
| VL53LX_Error VL53LX_GetCalibrationData | ( | VL53LX_DEV | Dev, |
| VL53LX_CalibrationData_t * | pCalibrationData | ||
| ) |
Gets the Calibration Data.
- Function Description
- This function get all the Calibration Data issued from the functions VL53LX_PerformRefSpadManagement(), VL53LX_PerformXTalkCalibration, VL53LX_PerformOffsetCalibration()
- Note:
- This function doesn't Accesses the device
- Parameters:
-
Dev Device Handle *pCalibrationData pointer where to store Calibration data.
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1752 of file vl53lx_api.c.
| VL53LX_Error VL53LX_GetOpticalCenter | ( | VL53LX_DEV | Dev, |
| FixPoint1616_t * | pOpticalCenterX, | ||
| FixPoint1616_t * | pOpticalCenterY | ||
| ) |
Gets the optical center.
- Function Description
- This function get the optical center issued from the nvm set at FTM stage expressed in the same coordinate system as the ROI are
- Note:
- This function doesn't Accesses the device
- Parameters:
-
Dev Device Handle pOpticalCenterX pointer to the X position of center in 16.16 fix point pOpticalCenterY pointer to the Y position of center in 16.16 fix point
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 2008 of file vl53lx_api.c.
| VL53LX_Error VL53LX_GetTuningParameter | ( | VL53LX_DEV | Dev, |
| uint16_t | TuningParameterId, | ||
| int32_t * | pTuningParameterValue | ||
| ) |
Get Tuning Parameter value for a given parameter ID.
- Function Description
- This function is used to get the value of the parameter identified by an unique ID.
- Note:
- This function doesn't Access to the device
- Parameters:
-
Dev Device Handle TuningParameterId Tuning Parameter ID pTuningParameterValue Pointer to Tuning Parameter Value for a given TuningParameterId.
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1175 of file vl53lx_api.c.
| VL53LX_Error VL53LX_GetXTalkCompensationEnable | ( | VL53LX_DEV | Dev, |
| uint8_t * | pXTalkCompensationEnable | ||
| ) |
Get Cross talk compensation rate enable.
Get if the Cross Talk is Enabled or Disabled.
- Note:
- This function doesn't access to the device
- Parameters:
-
Dev Device Handle pXTalkCompensationEnable Pointer to the Cross talk compensation state 0=disabled or 1 = enabled
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1332 of file vl53lx_api.c.
| VL53LX_Error VL53LX_PerformOffsetPerVcselCalibration | ( | VL53LX_DEV | Dev, |
| int32_t | CalDistanceMilliMeter | ||
| ) |
Perform Offset per Vcsel Calibration.
i.e. per distance mode
Perform offset calibration of the Device depending on the three distance mode settings: short, medium and long. This function will launch few ranging measurements and computes offset calibration in each of the three distance modes. The preset mode MUST be set by the application before to call this function.
- Warning:
- This function is a blocking function
- Note:
- This function Access to the device
- Parameters:
-
Dev Device Handle CalDistanceMilliMeter Distance of the target used for the offset compensation calibration.
- Returns:
- VL53LX_ERROR_NONE
- VL53LX_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by lack of valid measurements
- VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target distance combined to the number of loops performed in the calibration lead to an internal overflow. Try to reduce the distance of the target (140 mm)
- "Other error code" See VL53LX_Error
Definition at line 1864 of file vl53lx_api.c.
| VL53LX_Error VL53LX_PerformOffsetSimpleCalibration | ( | VL53LX_DEV | Dev, |
| int32_t | CalDistanceMilliMeter | ||
| ) |
Perform Offset simple Calibration.
Perform a very simple offset calibration of the Device. This function will launch few ranging measurements and computes offset calibration. The preset mode and the distance mode MUST be set by the application before to call this function.
- Warning:
- This function is a blocking function
- Note:
- This function Access to the device
- Parameters:
-
Dev Device Handle CalDistanceMilliMeter Calibration distance value used for the offset compensation.
- Returns:
- VL53LX_ERROR_NONE
- VL53LX_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by lack of valid measurements
- VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target distance combined to the number of loops performed in the calibration lead to an internal overflow. Try to reduce the distance of the target (140 mm)
- "Other error code" See VL53LX_Error
Definition at line 1443 of file vl53lx_api.c.
| VL53LX_Error VL53LX_PerformOffsetZeroDistanceCalibration | ( | VL53LX_DEV | Dev ) |
Perform Offset simple Calibration with a "zero distance" target.
Perform a simple offset calibration of the Device. This function will launch few ranging measurements and computes offset calibration. The preset mode and the distance mode MUST be set by the application before to call this function. A target must be place very close to the device. Ideally the target shall be touching the coverglass.
- Warning:
- This function is a blocking function
- Note:
- This function Access to the device
- Parameters:
-
Dev Device Handle
- Returns:
- VL53LX_ERROR_NONE
- VL53LX_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by lack of valid measurements
- VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target distance is too large, try to put the target closer to the device
- "Other error code" See VL53LX_Error
Definition at line 1544 of file vl53lx_api.c.
| VL53LX_Error VL53LX_PerformRefSpadManagement | ( | VL53LX_DEV | Dev ) |
Performs Reference Spad Management.
- Function Description
- The reference SPAD initialization procedure determines the minimum amount of reference spads to be enables to achieve a target reference signal rate and should be performed once during initialization.
- Note:
- This function Access to the device
- Parameters:
-
Dev Device Handle
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1198 of file vl53lx_api.c.
| VL53LX_Error VL53LX_PerformXTalkCalibration | ( | VL53LX_DEV | Dev ) |
Perform XTalk Calibration.
Perform a XTalk calibration of the Device. This function will launch a measurement, if interrupts are enabled an interrupt will be done. This function will clear the interrupt generated automatically. This function will program a new value for the XTalk compensation and it will enable the cross talk before exit.
- Warning:
- This function is a blocking function
- Note:
- This function Access to the device
- Parameters:
-
Dev Device Handle the calibration sets appropriate distance mode and thus override existing one
The calibration uses a target which should be located at least @60cm from the device. The actual location of the target shall be passed through the bare driver tuning parameters table
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1347 of file vl53lx_api.c.
| VL53LX_Error VL53LX_SetCalibrationData | ( | VL53LX_DEV | Dev, |
| VL53LX_CalibrationData_t * | pCalibrationData | ||
| ) |
Sets the Calibration Data.
- Function Description
- This function set all the Calibration Data issued from the functions VL53LX_PerformRefSpadManagement(), VL53LX_PerformXTalkCalibration, VL53LX_PerformOffsetCalibration()
- Note:
- This function doesn't Accesses the device
- Parameters:
-
Dev Device Handle *pCalibrationData Pointer to Calibration data to be set.
- Returns:
- VL53LX_ERROR_NONE Success
- VL53LX_ERROR_INVALID_PARAMS pCalibrationData points to an older version of the inner structure. Need for support to convert its content.
- "Other error code" See VL53LX_Error
Definition at line 1636 of file vl53lx_api.c.
| VL53LX_Error VL53LX_SetOffsetCorrectionMode | ( | VL53LX_DEV | Dev, |
| VL53LX_OffsetCorrectionModes | OffsetCorrectionMode | ||
| ) |
Define the mode to be used for the offset correction.
Define the mode to be used for the offset correction.
- Parameters:
-
Dev Device Handle OffsetCorrectionMode Offset Correction Mode valid values are: - VL53LX_OFFSETCORRECTIONMODE_STANDARD
- VL53LX_OFFSETCORRECTIONMODE_PERVCSEL
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1415 of file vl53lx_api.c.
| VL53LX_Error VL53LX_SetTuningParameter | ( | VL53LX_DEV | Dev, |
| uint16_t | TuningParameterId, | ||
| int32_t | TuningParameterValue | ||
| ) |
Set Tuning Parameter value for a given parameter ID.
- Function Description
- This function is used to improve the performance of the device. It permit to change a particular value used for a timeout or a threshold or a constant in an algorithm. The function will change the value of the parameter identified by an unique ID.
- Note:
- This function doesn't Access to the device
- Parameters:
-
Dev Device Handle TuningParameterId Tuning Parameter ID TuningParameterValue Tuning Parameter Value
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1149 of file vl53lx_api.c.
| VL53LX_Error VL53LX_SetXTalkCompensationEnable | ( | VL53LX_DEV | Dev, |
| uint8_t | XTalkCompensationEnable | ||
| ) |
Enable/Disable Cross talk compensation feature.
Enable/Disable Cross Talk correction.
- Parameters:
-
Dev Device Handle XTalkCompensationEnable Cross talk compensation to be set 0 = disabled or 1 = enabled.
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1315 of file vl53lx_api.c.
| VL53LX_Error VL53LX_SmudgeCorrectionEnable | ( | VL53LX_DEV | Dev, |
| VL53LX_SmudgeCorrectionModes | Mode | ||
| ) |
Enable/Disable dynamic Xtalk compensation feature.
Enable/Disable dynamic Xtalk compensation (aka smudge correction).
- Parameters:
-
Dev Device Handle Mode Set the smudge correction mode See VL53LX_SmudgeCorrectionModes
- Returns:
- VL53LX_ERROR_NONE Success
- "Other error code" See VL53LX_Error
Definition at line 1266 of file vl53lx_api.c.
Generated on Mon Jul 18 2022 15:35:58 by
1.7.2