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.
VL53L1 Calibration Functions
[VL53L1 cut1.1 Function Definition]
  Functions used for Calibration. More...
| Functions | |
| VL53L1_Error | VL53L1_SetTuningParameter (VL53L1_DEV Dev, uint16_t TuningParameterId, int32_t TuningParameterValue) | 
| Set Tuning Parameter value for a given parameter ID. | |
| VL53L1_Error | VL53L1_GetTuningParameter (VL53L1_DEV Dev, uint16_t TuningParameterId, int32_t *pTuningParameterValue) | 
| Get Tuning Parameter value for a given parameter ID. | |
| VL53L1_Error | VL53L1_PerformRefSpadManagement (VL53L1_DEV Dev) | 
| Performs Reference Spad Management. | |
| VL53L1_Error | VL53L1_SmudgeCorrectionEnable (VL53L1_DEV Dev, VL53L1_SmudgeCorrectionModes Mode) | 
| Enable/Disable dynamic Xtalk compensation feature. | |
| VL53L1_Error | VL53L1_SetXTalkCompensationEnable (VL53L1_DEV Dev, uint8_t XTalkCompensationEnable) | 
| Enable/Disable Cross talk compensation feature. | |
| VL53L1_Error | VL53L1_GetXTalkCompensationEnable (VL53L1_DEV Dev, uint8_t *pXTalkCompensationEnable) | 
| Get Cross talk compensation rate enable. | |
| VL53L1_Error | VL53L1_PerformXTalkCalibration (VL53L1_DEV Dev, uint8_t CalibrationOption) | 
| Perform XTalk Calibration. | |
| VL53L1_Error | VL53L1_SetOffsetCalibrationMode (VL53L1_DEV Dev, VL53L1_OffsetCalibrationModes OffsetCalibrationMode) | 
| Define the mode to be used for the offset calibration. | |
| VL53L1_Error | VL53L1_SetOffsetCorrectionMode (VL53L1_DEV Dev, VL53L1_OffsetCorrectionModes OffsetCorrectionMode) | 
| Define the mode to be used for the offset correction. | |
| VL53L1_Error | VL53L1_PerformOffsetCalibration (VL53L1_DEV Dev, int32_t CalDistanceMilliMeter, FixPoint1616_t CalReflectancePercent) | 
| Perform Offset Calibration. | |
| VL53L1_Error | VL53L1_PerformOffsetSimpleCalibration (VL53L1_DEV Dev, int32_t CalDistanceMilliMeter) | 
| Perform Offset simple Calibration. | |
| VL53L1_Error | VL53L1_PerformOffsetZeroDistanceCalibration (VL53L1_DEV Dev) | 
| Perform Offset simple Calibration with a "zero distance" target. | |
| VL53L1_Error | VL53L1_PerformOffsetPerVcselCalibration (VL53L1_DEV Dev, int32_t CalDistanceMilliMeter) | 
| Perform Offset per Vcsel Calibration. | |
| VL53L1_Error | VL53L1_SetCalibrationData (VL53L1_DEV Dev, VL53L1_CalibrationData_t *pCalibrationData) | 
| Sets the Calibration Data. | |
| VL53L1_Error | VL53L1_GetCalibrationData (VL53L1_DEV Dev, VL53L1_CalibrationData_t *pCalibrationData) | 
| Gets the Calibration Data. | |
| VL53L1_Error | VL53L1_SetZoneCalibrationData (VL53L1_DEV Dev, VL53L1_ZoneCalibrationData_t *pZoneCalibrationData) | 
| Sets the Zone Calibration Data. | |
| VL53L1_Error | VL53L1_GetZoneCalibrationData (VL53L1_DEV Dev, VL53L1_ZoneCalibrationData_t *pZoneCalibrationData) | 
| Gets the Zone Calibration Data. | |
| VL53L1_Error | VL53L1_GetOpticalCenter (VL53L1_DEV Dev, FixPoint1616_t *pOpticalCenterX, FixPoint1616_t *pOpticalCenterY) | 
| Gets the optical center. | |
Detailed Description
Functions used for Calibration.
Function Documentation
| VL53L1_Error VL53L1_GetCalibrationData | ( | VL53L1_DEV | Dev, | 
| VL53L1_CalibrationData_t * | pCalibrationData | ||
| ) | 
Gets the Calibration Data.
- Function Description
- This function get all the Calibration Data issued from the functions VL53L1_PerformRefSpadManagement(), VL53L1_PerformXTalkCalibration, VL53L1_PerformOffsetCalibration()
- Note:
- This function doesn't Accesses the device
- Parameters:
- 
  Dev Device Handle *pCalibrationData pointer where to store Calibration data. 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 3537 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetOpticalCenter | ( | VL53L1_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 VL53L1_Error
Definition at line 3696 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetTuningParameter | ( | VL53L1_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:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2787 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetXTalkCompensationEnable | ( | VL53L1_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:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2951 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetZoneCalibrationData | ( | VL53L1_DEV | Dev, | 
| VL53L1_ZoneCalibrationData_t * | pZoneCalibrationData | ||
| ) | 
Gets the Zone Calibration Data.
- Function Description
- This function get all the Zone Calibration Data issued from the functions VL53L1_PerformOffsetCalibration()
- Note:
- This function doesn't Accesses the device
- Parameters:
- 
  Dev Device Handle *pZoneCalibrationData pointer where to store Zone Calibration data. 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 3683 of file vl53l1_api.c.
| VL53L1_Error VL53L1_PerformOffsetCalibration | ( | VL53L1_DEV | Dev, | 
| int32_t | CalDistanceMilliMeter, | ||
| FixPoint1616_t | CalReflectancePercent | ||
| ) | 
Perform Offset Calibration.
Perform a Offset calibration of the Device. This function will launch a ranging measurement, if interrupts are enabled interrupts will be done. This function will program a new value for the Offset calibration value
- 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. CalReflectancePercent Calibration Target reflectance @ 940nm in percentage. 
- Returns:
- VL53L1_ERROR_NONE
- "Other error code" See VL53L1_Error
Definition at line 3120 of file vl53l1_api.c.
| VL53L1_Error VL53L1_PerformOffsetPerVcselCalibration | ( | VL53L1_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:
- VL53L1_ERROR_NONE
- VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by lack of valid measurements
- VL53L1_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 VL53L1_Error
Definition at line 3885 of file vl53l1_api.c.
| VL53L1_Error VL53L1_PerformOffsetSimpleCalibration | ( | VL53L1_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:
- VL53L1_ERROR_NONE
- VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by lack of valid measurements
- VL53L1_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 VL53L1_Error
Definition at line 3189 of file vl53l1_api.c.
| VL53L1_Error VL53L1_PerformOffsetZeroDistanceCalibration | ( | VL53L1_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:
- VL53L1_ERROR_NONE
- VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by lack of valid measurements
- VL53L1_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 VL53L1_Error
Definition at line 3289 of file vl53l1_api.c.
| VL53L1_Error VL53L1_PerformRefSpadManagement | ( | VL53L1_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:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2810 of file vl53l1_api.c.
| VL53L1_Error VL53L1_PerformXTalkCalibration | ( | VL53L1_DEV | Dev, | 
| uint8_t | CalibrationOption | ||
| ) | 
Perform XTalk Calibration.
Perform a XTalk calibration of the Device. This function will launch a ranging 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 CalibrationOption Select the Calibration to be run : CalibrationOption - VL53L1_XTALKCALIBRATIONMODE_SINGLE_TARGET the calibration uses current preset and distance mode without altering them.
 User must call VL53L1_SetPresetMode() with VL53L1_PRESETMODE_AUTONOMOUS, VL53L1_PRESETMODE_LITE_RANGING or VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS parameter prior to launch calibration
- VL53L1_XTALKCALIBRATIONMODE_NO_TARGET the calibration sets appropriate preset and distance mode and thus override existing ones
 User must call VL53L1_SetPresetMode() again after calibration to set the desired one. during this calibration mode no object must be put below a 80cm distance from the target
- VL53L1_XTALKCALIBRATIONMODE_FULL_ROI the calibration sets appropriate preset and distance mode and thus override existing ones
 User must call VL53L1_SetPresetMode() again after calibration to set the desired one. The ROI settings must define a single 16x16 ROI before to launch this function. 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
 
- VL53L1_XTALKCALIBRATIONMODE_SINGLE_TARGET the calibration uses current preset and distance mode without altering them.
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2967 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetCalibrationData | ( | VL53L1_DEV | Dev, | 
| VL53L1_CalibrationData_t * | pCalibrationData | ||
| ) | 
Sets the Calibration Data.
- Function Description
- This function set all the Calibration Data issued from the functions VL53L1_PerformRefSpadManagement(), VL53L1_PerformXTalkCalibration, VL53L1_PerformOffsetCalibration()
- Note:
- This function doesn't Accesses the device
- Parameters:
- 
  Dev Device Handle *pCalibrationData Pointer to Calibration data to be set. 
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_INVALID_PARAMS pCalibrationData points to an older version of the inner structure. Need for support to convert its content.
- "Other error code" See VL53L1_Error
Definition at line 3379 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetOffsetCalibrationMode | ( | VL53L1_DEV | Dev, | 
| VL53L1_OffsetCalibrationModes | OffsetCalibrationMode | ||
| ) | 
Define the mode to be used for the offset calibration.
Define the mode to be used for the offset calibration. This function should be called before run the VL53L1_PerformOffsetCalibration()
- Parameters:
- 
  Dev Device Handle OffsetCalibrationMode Offset Calibration Mode valid values are: - VL53L1_OFFSETCALIBRATIONMODE_STANDARD
- VL53L1_OFFSETCALIBRATIONMODE_PRERANGE_ONLY
- VL53L1_OFFSETCALIBRATIONMODE_MULTI_ZONE
 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 3058 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetOffsetCorrectionMode | ( | VL53L1_DEV | Dev, | 
| VL53L1_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: - VL53L1_OFFSETCORRECTIONMODE_STANDARD
- VL53L1_OFFSETCORRECTIONMODE_PERZONE
- VL53L1_OFFSETCORRECTIONMODE_PERVCSEL
 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 3089 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetTuningParameter | ( | VL53L1_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:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2761 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetXTalkCompensationEnable | ( | VL53L1_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:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2934 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetZoneCalibrationData | ( | VL53L1_DEV | Dev, | 
| VL53L1_ZoneCalibrationData_t * | pZoneCalibrationData | ||
| ) | 
Sets the Zone Calibration Data.
- Function Description
- This function set all the Zone nCalibration Data issued from the functions VL53L1_PerformOffsetCalibration() in multi zone
- Note:
- This function doesn't Accesses the device
- Parameters:
- 
  Dev Device Handle *pZoneCalibrationData Pointer to Zone Calibration data to be set. 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 3669 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SmudgeCorrectionEnable | ( | VL53L1_DEV | Dev, | 
| VL53L1_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 VL53L1_SmudgeCorrectionModes 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2886 of file vl53l1_api.c.
Generated on Tue Jul 12 2022 20:07:15 by
 1.7.2
 1.7.2