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: VL53L1CB_noshield_1sensor_polls_auton VL53L1CB_noshield_1sensor_interrupt_auton X_NUCLEO_53L1A2
VL53L1 Parameters Functions
[VL53L1 cut1.1 Function Definition]
Functions used to prepare and setup the device. More...
Functions | |
| VL53L1_Error | VL53L1_SetPresetMode (VL53L1_DEV Dev, VL53L1_PresetModes PresetMode) |
| Set a new Preset Mode. | |
| VL53L1_Error | VL53L1_GetPresetMode (VL53L1_DEV Dev, VL53L1_PresetModes *pPresetMode) |
| Get current Preset Mode. | |
| VL53L1_Error | VL53L1_SetDistanceMode (VL53L1_DEV Dev, VL53L1_DistanceModes DistanceMode) |
| Set the distance mode. | |
| VL53L1_Error | VL53L1_GetDistanceMode (VL53L1_DEV Dev, VL53L1_DistanceModes *pDistanceMode) |
| Get the distance mode. | |
| VL53L1_Error | VL53L1_SetOutputMode (VL53L1_DEV Dev, VL53L1_OutputModes OutputMode) |
| Set the output mode. | |
| VL53L1_Error | VL53L1_GetOutputMode (VL53L1_DEV Dev, VL53L1_OutputModes *pOutputMode) |
| Get the output mode. | |
| VL53L1_Error | VL53L1_SetMeasurementTimingBudgetMicroSeconds (VL53L1_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds) |
| Set Ranging Timing Budget in microseconds. | |
| VL53L1_Error | VL53L1_GetMeasurementTimingBudgetMicroSeconds (VL53L1_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds) |
| Get Ranging Timing Budget in microseconds. | |
| VL53L1_Error | VL53L1_SetInterMeasurementPeriodMilliSeconds (VL53L1_DEV Dev, uint32_t InterMeasurementPeriodMilliSeconds) |
| Program continuous mode Inter-Measurement period in milliseconds. | |
| VL53L1_Error | VL53L1_GetInterMeasurementPeriodMilliSeconds (VL53L1_DEV Dev, uint32_t *pInterMeasurementPeriodMilliSeconds) |
| Get continuous mode Inter-Measurement period in milliseconds. | |
| VL53L1_Error | VL53L1_SetDmaxReflectance (VL53L1_DEV Dev, FixPoint1616_t DmaxReflectance) |
| target reflectance for Dmax setting | |
| VL53L1_Error | VL53L1_GetDmaxReflectance (VL53L1_DEV Dev, FixPoint1616_t *pDmaxReflectance) |
| Get target reflectance for Dmax. | |
| VL53L1_Error | VL53L1_SetDmaxMode (VL53L1_DEV Dev, VL53L1_DeviceDmaxModes DmaxMode) |
| Set function for ambient Dmax mode. | |
| VL53L1_Error | VL53L1_GetDmaxMode (VL53L1_DEV Dev, VL53L1_DeviceDmaxModes *pDmaxMode) |
| Get function for ambient Dmax mode. | |
Detailed Description
Functions used to prepare and setup the device.
Function Documentation
| VL53L1_Error VL53L1_GetDistanceMode | ( | VL53L1_DEV | Dev, |
| VL53L1_DistanceModes * | pDistanceMode | ||
| ) |
Get the distance mode.
- Function Description
- Get the distance mode used for the next ranging.
- Parameters:
-
Dev Device Handle *pDistanceMode Pointer to Distance mode
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 805 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetDmaxMode | ( | VL53L1_DEV | Dev, |
| VL53L1_DeviceDmaxModes * | pDmaxMode | ||
| ) |
Get function for ambient Dmax mode.
- Parameters:
-
Dev Device Handle pDmaxMode output pointer to DMAX mode currently in use
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 1186 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetDmaxReflectance | ( | VL53L1_DEV | Dev, |
| FixPoint1616_t * | pDmaxReflectance | ||
| ) |
Get target reflectance for Dmax.
- Function Description
- Retrieves the value for target reflectance @ 940nm to calculate the ambient DMAX values for. Set to 50% by default by VL53L1_DataInit()
- Parameters:
-
Dev Device Handle pDmaxReflectance pointer to Reflectance % in 16.16 fixed point
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 1134 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetInterMeasurementPeriodMilliSeconds | ( | VL53L1_DEV | Dev, |
| uint32_t * | pInterMeasurementPeriodMilliSeconds | ||
| ) |
Get continuous mode Inter-Measurement period in milliseconds.
- Function Description
- Parameters:
-
Dev Device Handle pInterMeasurementPeriodMilliSeconds Pointer to programmed Inter-Measurement Period in milliseconds.
- Returns:
- VL53L1_ERROR_NONE
Definition at line 1089 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetMeasurementTimingBudgetMicroSeconds | ( | VL53L1_DEV | Dev, |
| uint32_t * | pMeasurementTimingBudgetMicroSeconds | ||
| ) |
Get Ranging Timing Budget in microseconds.
- Function Description
- Returns the programmed the maximum time allowed by the user to the device to run a full ranging sequence for the current mode (ranging, histogram, ASL ...)
- Parameters:
-
Dev Device Handle pMeasurementTimingBudgetMicroSeconds Max measurement time in microseconds.
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 978 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetOutputMode | ( | VL53L1_DEV | Dev, |
| VL53L1_OutputModes * | pOutputMode | ||
| ) |
Get the output mode.
- Function Description
- Get the output mode used for the next ranging.
- Parameters:
-
Dev Device Handle *pOutputMode Pointer to Output mode
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 835 of file vl53l1_api.c.
| VL53L1_Error VL53L1_GetPresetMode | ( | VL53L1_DEV | Dev, |
| VL53L1_PresetModes * | pPresetMode | ||
| ) |
Get current Preset Mode.
- Function Description
- Get actual mode of the device(ranging, histogram ...)
- Note:
- This function doesn't Access to the device
- Parameters:
-
Dev Device Handle pPresetMode Pointer to current apply mode value
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when DeviceMode is not in the supported list
Definition at line 730 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetDistanceMode | ( | VL53L1_DEV | Dev, |
| VL53L1_DistanceModes | DistanceMode | ||
| ) |
Set the distance mode.
- Function Description
- Set the distance mode to be used for the next ranging.
The modes Short, Medium and Long are used to optimize the ranging accuracy in a specific range of distance.
The user select one of these modes to select the distance range.
Two additional modes are supported: AUTO and AUTO_LITE the difference between these modes is the following.
The mode AUTO take into account both the ranging distance (RangeMilliMeter) and the dmax distance (DmaxMilliMeter).
The algorithm uses the ranging distance when the range status is ok and uses the dmax distance when the range status is not ok.
The AUTO_LITE take into account only the ranging distance, so nothing is done in case of range error i.e. the distance mode will not be changed.
- Note:
- This function doesn't Access to the device
- Warning:
- This function should be called after VL53L1_SetPresetMode().
- Parameters:
-
Dev Device Handle DistanceMode Distance mode to apply valid values are: - VL53L1_DISTANCEMODE_SHORT
- VL53L1_DISTANCEMODE_MEDIUM
- VL53L1_DISTANCEMODE_LONG
- VL53L1_DISTANCEMODE_AUTO_LITE
- VL53L1_DISTANCEMODE_AUTO
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when DistanceMode is not in the supported list
- "Other error code" See VL53L1_Error
Definition at line 743 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetDmaxMode | ( | VL53L1_DEV | Dev, |
| VL53L1_DeviceDmaxModes | DmaxMode | ||
| ) |
Set function for ambient Dmax mode.
- Parameters:
-
Dev Device Handle DmaxMode DMAX mode to be used in ranging
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 1154 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetDmaxReflectance | ( | VL53L1_DEV | Dev, |
| FixPoint1616_t | DmaxReflectance | ||
| ) |
target reflectance for Dmax setting
- Function Description
- Allow user to set the value for target reflectance @ 940nm to calculate the ambient DMAX values for. Set to 50% by default by VL53L1_DataInit()
- Parameters:
-
Dev Device Handle DmaxReflectance Reflectance % in 16.16 fixed point
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_INVALID_PARAMS in case input value is not in range from 0 to 100. Note that this is a fix point value so the max value is 100 * 65536.
- "Other error code" See VL53L1_Error
Definition at line 1107 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetInterMeasurementPeriodMilliSeconds | ( | VL53L1_DEV | Dev, |
| uint32_t | InterMeasurementPeriodMilliSeconds | ||
| ) |
Program continuous mode Inter-Measurement period in milliseconds.
- Function Description
- When trying to set too short time return INVALID_PARAMS minimal value
- Parameters:
-
Dev Device Handle InterMeasurementPeriodMilliSeconds Inter-Measurement Period in ms. this value should be greater than the duration set in VL53L1_SetMeasurementTimingBudgetMicroSeconds() to ensure smooth ranging operation.
- Returns:
- VL53L1_ERROR_NONE Success
- "Other error code" See VL53L1_Error
Definition at line 1070 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetMeasurementTimingBudgetMicroSeconds | ( | VL53L1_DEV | Dev, |
| uint32_t | MeasurementTimingBudgetMicroSeconds | ||
| ) |
Set Ranging Timing Budget in microseconds.
- Function Description
- Defines the maximum time allowed by the user to the device to run a full ranging sequence for the current mode (ranging, histogram, ASL ...)
- Parameters:
-
Dev Device Handle MeasurementTimingBudgetMicroSeconds Max measurement time in microseconds.
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_INVALID_PARAMS Error timing parameter not supported. The maximum accepted value for the computed timing budget is 10 seconds the minimum value depends on the preset mode selected.
- "Other error code" See VL53L1_Error
Definition at line 850 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetOutputMode | ( | VL53L1_DEV | Dev, |
| VL53L1_OutputModes | OutputMode | ||
| ) |
Set the output mode.
- Function Description
- Set the output mode to be used for the next ranging. The output mode is used to select, in case of multiple objects, which one will be used in function VL53L1_GetRangingMeasurementData(). VL53L1_SetOutputMode also sets the object used by automatic distance mode algorithm when VL53L1_SetDistanceMode() is set to automatic mode.
- Note:
- This function doesn't Access to the device
- Warning:
- This function should be called after VL53L1_SetPresetMode().
- Parameters:
-
Dev Device Handle OutputMode Output mode to apply valid values are: - VL53L1_OUTPUTMODE_NEAREST
- VL53L1_OUTPUTMODE_STRONGEST
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when OutputMode is not in the supported list
- "Other error code" See VL53L1_Error
Definition at line 818 of file vl53l1_api.c.
| VL53L1_Error VL53L1_SetPresetMode | ( | VL53L1_DEV | Dev, |
| VL53L1_PresetModes | PresetMode | ||
| ) |
Set a new Preset Mode.
- Function Description
- Set device to a new Operating Mode (High speed ranging, Multi objects ...)
- Note:
- This function doesn't Access to the device
- Warning:
- This function change the timing budget to 16 ms and the inter- measurement period to 1000 ms. Also the VL53L1_DISTANCEMODE_LONG is used.
- Parameters:
-
Dev Device Handle PresetMode New Preset mode to apply
Valid values are:- VL53L1_PRESETMODE_MULTIZONES_SCANNING
- VL53L1_PRESETMODE_RANGING
- VL53L1_PRESETMODE_AUTONOMOUS
- VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS
- VL53L1_PRESETMODE_LITE_RANGING
- VL53L1_PRESETMODE_OLT
- Returns:
- VL53L1_ERROR_NONE Success
- VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when PresetMode is not in the supported list
Definition at line 690 of file vl53l1_api.c.
Generated on Thu Jul 14 2022 10:14:48 by
1.7.2