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 Measurement Functions
[VL53L1 cut1.1 Function Definition]
  Functions used for the measurements. More...
| Functions | |
| VL53L1_Error | VL53L1_StartMeasurement (VL53L1_DEV Dev) | 
| Start device measurement. | |
| VL53L1_Error | VL53L1_StopMeasurement (VL53L1_DEV Dev) | 
| Stop device measurement. | |
| VL53L1_Error | VL53L1_ClearInterruptAndStartMeasurement (VL53L1_DEV Dev) | 
| Clear the Interrupt flag and start new measurement | |
| VL53L1_Error | VL53L1_GetMeasurementDataReady (VL53L1_DEV Dev, uint8_t *pMeasurementDataReady) | 
| Return Measurement Data Ready. | |
| VL53L1_Error | VL53L1_WaitMeasurementDataReady (VL53L1_DEV Dev) | 
| Wait for measurement data ready. | |
| VL53L1_Error | VL53L1_GetRangingMeasurementData (VL53L1_DEV Dev, VL53L1_RangingMeasurementData_t *pRangingMeasurementData) | 
| Retrieve the measurements from device for a given setup. | |
| VL53L1_Error | VL53L1_GetMultiRangingData (VL53L1_DEV Dev, VL53L1_MultiRangingData_t *pMultiRangingData) | 
| Retrieve all ROI's measurements from device for a given setup. | |
| VL53L1_Error | VL53L1_GetAdditionalData (VL53L1_DEV Dev, VL53L1_AdditionalData_t *pAdditionalData) | 
| Get Additional Data. | |
Detailed Description
Functions used for the measurements.
Function Documentation
| VL53L1_Error VL53L1_ClearInterruptAndStartMeasurement | ( | VL53L1_DEV | Dev ) | 
Clear the Interrupt flag and start new measurement
- 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 1804 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetAdditionalData | ( | VL53L1_DEV | Dev, | 
| VL53L1_AdditionalData_t * | pAdditionalData | ||
| ) | 
Get Additional Data.
- Function Description
- This function is used to get lld debugging data on the last histogram measurement. shall be called when a new measurement is ready (interrupt or positive VL53L1_GetMeasurementDataReady() polling) and before a call to VL53L1_ClearInterruptAndStartMeasurement(). Depending on the PresetMode currently set parts of the returned data structure may be not relevant.
- Parameters:
- 
  Dev Device Handle pAdditionalData Pointer to Additional data 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2743 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetMeasurementDataReady | ( | VL53L1_DEV | Dev, | 
| uint8_t * | pMeasurementDataReady | ||
| ) | 
Return Measurement Data Ready.
- Function Description
- This function indicate that a measurement data is ready. This function is used for non-blocking capture.
- Note:
- This function Access to the device
- Parameters:
- 
  Dev Device Handle pMeasurementDataReady Pointer to Measurement Data Ready. 0 = data not ready, 1 = data ready 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 1821 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetMultiRangingData | ( | VL53L1_DEV | Dev, | 
| VL53L1_MultiRangingData_t * | pMultiRangingData | ||
| ) | 
Retrieve all ROI's measurements from device for a given setup.
- Function Description
- Get data from last successful Ranging measurement
- Warning:
- USER should take care about VL53L1_GetNumberOfROI() before get data. Bare driver will fill a NumberOfROI times the corresponding data structure used in the measurement function.
- USER must call VL53L1_ClearInterruptAndStartMeasurement() prior to call again this function
- Note:
- This function Access to the device
- The first valid value returned by this function will have a range status equal to VL53L1_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK which means that the data is valid but no wrap around check have been done. User should take care about that.
- Parameters:
- 
  Dev Device Handle pMultiRangingData Pointer to the data structure to fill up. 
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 2696 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetRangingMeasurementData | ( | VL53L1_DEV | Dev, | 
| VL53L1_RangingMeasurementData_t * | pRangingMeasurementData | ||
| ) | 
Retrieve the measurements from device for a given setup.
- Function Description
- Get data from last successful Ranging measurement
- Warning:
- this function will return only the first ROI data and only the first object. For multi objects or multi ROI use: Vl53L1_GetMultiRangingData. In case of RANGING only one output is given, this can be selected with the help of VL53L1_SetOutputMode() In case of MULTIZONES_SCANNING and error will be raised because not supported in that function.
- USER must call VL53L1_ClearInterruptAndStartMeasurement() prior to call again this function
- Note:
- This function Access to the device
- The first valid value returned by this function will have a range status equal to VL53L1_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK which means that the data is valid but no wrap around check have been done. User should take care about that.
- Parameters:
- 
  Dev Device Handle pRangingMeasurementData Pointer to the data structure to fill up. 
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_MODE_NOT_SUPPORTED in case of MULTIZONES_SCANNING
- "Other error code" See VL53L1_Error
Definition at line 2573 of file vl53l1_api.c.
| VL53L1_Error VL53L1_StartMeasurement | ( | VL53L1_DEV | Dev ) | 
Start device measurement.
Started measurement will depend on preset parameters set through VL53L1_SetPreseMode() This function will change the VL53L1_State from VL53L1_STATE_IDLE to VL53L1_STATE_RUNNING.
- Note:
- This function Access to the device
- Parameters:
- 
  Dev Device Handle 
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when PresetMode programmed with VL53L1_SetPresetMode
- VL53L1_ERROR_TIME_OUT Time out on start measurement
- VL53L1_ERROR_INVALID_PARAMS This error might occur in timed mode when inter measurement period is smaller or too close to the timing budget. In such case measurements are not started and user must correct the timings passed to VL53L1_SetMeasurementTimingBudgetMicroSeconds() and VL53L1_SetInterMeasurementPeriodMilliSeconds() functions.
- "Other error code" See VL53L1_Error
Definition at line 1717 of file vl53l1_api.c.
| VL53L1_Error VL53L1_StopMeasurement | ( | VL53L1_DEV | Dev ) | 
Stop device measurement.
Will set the device in standby mode at end of current measurement
 Not necessary in single mode as device shall return automatically in standby mode at end of measurement. This function will change the VL53L1_State from VL53L1_STATE_RUNNING to VL53L1_STATE_IDLE.
- 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 1787 of file vl53l1_api.c.
| VL53L1_Error VL53L1_WaitMeasurementDataReady | ( | VL53L1_DEV | Dev ) | 
Wait for measurement data ready.
Blocking function. Note that the timeout is given by: VL53L1_RANGE_COMPLETION_POLLING_TIMEOUT_MS defined in def.h
- Note:
- This function Access to the device
- Parameters:
- 
  Dev Device Handle 
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_TIME_OUT In case of timeout
Definition at line 1834 of file vl53l1_api.c.
Generated on Tue Jul 12 2022 20:07:15 by
 1.7.2
 1.7.2