ST Expansion SW Team / VL53L3CX_mbed

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   VL53L3CX_NoShield_1Sensor_poll_Mb06x VL53L3_NoShield_1Sensor_polling_Mb63 X_NUCLEO_53L3A2 53L3A2_Ranging

Embed: (wiki syntax)

« Back to documentation index

VL53LX Measurement Functions

VL53LX Measurement Functions
[VL53LX Function Definition]

Functions used for the measurements. More...

Functions

VL53LX_Error VL53LX_StartMeasurement (VL53LX_DEV Dev)
 Start device measurement.
VL53LX_Error VL53LX_StopMeasurement (VL53LX_DEV Dev)
 Stop device measurement.
VL53LX_Error VL53LX_ClearInterruptAndStartMeasurement (VL53LX_DEV Dev)
 Clear the Interrupt flag and start new measurement
VL53LX_Error VL53LX_GetMeasurementDataReady (VL53LX_DEV Dev, uint8_t *pMeasurementDataReady)
 Return Measurement Data Ready.
VL53LX_Error VL53LX_WaitMeasurementDataReady (VL53LX_DEV Dev)
 Wait for measurement data ready.
VL53LX_Error VL53LX_GetMultiRangingData (VL53LX_DEV Dev, VL53LX_MultiRangingData_t *pMultiRangingData)
 Retrieve all measurements from device with the current setup.
VL53LX_Error VL53LX_GetAdditionalData (VL53LX_DEV Dev, VL53LX_AdditionalData_t *pAdditionalData)
 Get Additional Data.

Detailed Description

Functions used for the measurements.


Function Documentation

VL53LX_Error VL53LX_ClearInterruptAndStartMeasurement ( VL53LX_DEV  Dev )

Clear the Interrupt flag and start new measurement

Note:
This function Access to the device
Parameters:
DevDevice Handle
Returns:
VL53LX_ERROR_NONE Success
"Other error code" See VL53LX_Error

Definition at line 716 of file vl53lx_api.c.

VL53LX_Error VL53LX_GetAdditionalData ( VL53LX_DEV  Dev,
VL53LX_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 VL53LX_GetMeasurementDataReady() polling) and before a call to VL53LX_ClearInterruptAndStartMeasurement().
Parameters:
DevDevice Handle
pAdditionalDataPointer to Additional data
Returns:
VL53LX_ERROR_NONE Success
"Other error code" See VL53LX_Error

Definition at line 1131 of file vl53lx_api.c.

VL53LX_Error VL53LX_GetMeasurementDataReady ( VL53LX_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:
DevDevice Handle
pMeasurementDataReadyPointer to Measurement Data Ready. 0 = data not ready, 1 = data ready
Returns:
VL53LX_ERROR_NONE Success
"Other error code" See VL53LX_Error

Definition at line 733 of file vl53lx_api.c.

VL53LX_Error VL53LX_GetMultiRangingData ( VL53LX_DEV  Dev,
VL53LX_MultiRangingData_t pMultiRangingData 
)

Retrieve all measurements from device with the current setup.

Function Description
Get data from last successful Ranging measurement
Warning:
USER must call VL53LX_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 VL53LX_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:
DevDevice Handle
pMultiRangingDataPointer to the data structure to fill up.
Returns:
VL53LX_ERROR_NONE Success
"Other error code" See VL53LX_Error

Definition at line 1102 of file vl53lx_api.c.

VL53LX_Error VL53LX_StartMeasurement ( VL53LX_DEV  Dev )

Start device measurement.

Started measurement will depend on distance parameter set through VL53LX_SetDistanceMode()

Note:
This function Access to the device
Parameters:
DevDevice Handle
Returns:
VL53LX_ERROR_NONE Success
VL53LX_ERROR_TIME_OUT Time out on start measurement
VL53LX_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 VL53LX_SetMeasurementTimingBudgetMicroSeconds() and VL53LX_SetInterMeasurementPeriodMilliSeconds() functions.
"Other error code" See VL53LX_Error

Definition at line 643 of file vl53lx_api.c.

VL53LX_Error VL53LX_StopMeasurement ( VL53LX_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.

Note:
This function Access to the device
Parameters:
DevDevice Handle
Returns:
VL53LX_ERROR_NONE Success
"Other error code" See VL53LX_Error

Definition at line 696 of file vl53lx_api.c.

VL53LX_Error VL53LX_WaitMeasurementDataReady ( VL53LX_DEV  Dev )

Wait for measurement data ready.

Blocking function. Note that the timeout is given by: VL53LX_RANGE_COMPLETION_POLLING_TIMEOUT_MS defined in def.h

Note:
This function Access to the device
Parameters:
DevDevice Handle
Returns:
VL53LX_ERROR_NONE Success
VL53LX_ERROR_TIME_OUT In case of timeout

Definition at line 746 of file vl53lx_api.c.