ST Expansion SW Team / VL53L1CB

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   VL53L1CB_noshield_1sensor_polls_auton VL53L1CB_noshield_1sensor_interrupt_auton X_NUCLEO_53L1A2

Embed: (wiki syntax)

« Back to documentation index

VL53L1 Parameters Functions

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:
DevDevice Handle
*pDistanceModePointer 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:
DevDevice Handle
pDmaxModeoutput 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:
DevDevice Handle
pDmaxReflectancepointer 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:
DevDevice Handle
pInterMeasurementPeriodMilliSecondsPointer 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:
DevDevice Handle
pMeasurementTimingBudgetMicroSecondsMax 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:
DevDevice Handle
*pOutputModePointer 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:
DevDevice Handle
pPresetModePointer 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:
DevDevice Handle
DistanceModeDistance 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:
DevDevice Handle
DmaxModeDMAX 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:
DevDevice Handle
DmaxReflectanceReflectance % 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:
DevDevice Handle
InterMeasurementPeriodMilliSecondsInter-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:
DevDevice Handle
MeasurementTimingBudgetMicroSecondsMax 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:
DevDevice Handle
OutputModeOutput 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:
DevDevice Handle
PresetModeNew 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.