John Alexander / VL53L3_Lib

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   VL53L3ExpansionBoard

Embed: (wiki syntax)

« Back to documentation index

VL53LX Class Reference

VL53LX Class Reference

Class representing a VL53LX sensor component. More...

#include <vl53lx_class.h>

Public Member Functions

 VL53LX (vl53L3_DevI2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr=VL53L1X_DEFAULT_DEVICE_ADDRESS)
 Constructor.
virtual ~VL53LX ()
 Destructor.
virtual void VL53LX_On (void)
 PowerOn the sensor.
virtual void VL53LX_Off (void)
 PowerOff the sensor.
VL53LX_Error InitSensor (uint8_t address)
 PowerOff the sensor.
virtual int init (void *init)
 One time device initialization.
virtual int get_distance (uint32_t *pi_data)
 Get ranging result and only that.
VL53LX_Error VL53LX_GetVersion (VL53LX_Version_t *pVersion)
 Return the VL53LX driver Version.
VL53LX_Error VL53LX_GetProductRevision (uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor)
 Reads the Product Revision for a for given Device This function can be used to distinguish cut1.0 from cut1.1.
VL53LX_Error VL53LX_GetDeviceInfo (VL53LX_DeviceInfo_t *pVL53LX_DeviceInfo)
 Reads the Device information for given Device.
VL53LX_Error VL53LX_GetUID (uint64_t *pUid)
 Reads the Device unique identifier.
VL53LX_Error VL53LX_SetDeviceAddress (uint8_t DeviceAddress)
 Set new device address.
VL53LX_Error VL53LX_DataInit ()
 One time device initialization.
VL53LX_Error VL53LX_WaitDeviceBooted ()
 Wait for device booted after chip enable (hardware standby)
VL53LX_Error VL53LX_SetDistanceMode (VL53LX_DistanceModes DistanceMode)
 Set the distance mode.
VL53LX_Error VL53LX_GetDistanceMode (VL53LX_DistanceModes *pDistanceMode)
 Get the distance mode.
VL53LX_Error VL53LX_SetMeasurementTimingBudgetMicroSeconds (uint32_t MeasurementTimingBudgetMicroSeconds)
 Set Ranging Timing Budget in microseconds.
VL53LX_Error VL53LX_GetMeasurementTimingBudgetMicroSeconds (uint32_t *pMeasurementTimingBudgetMicroSeconds)
 Get Ranging Timing Budget in microseconds.
VL53LX_Error VL53LX_StartMeasurement ()
 Start device measurement.
VL53LX_Error VL53LX_StopMeasurement ()
 Stop device measurement.
VL53LX_Error VL53LX_ClearInterruptAndStartMeasurement ()
 Clear the Interrupt flag and start new measurement
VL53LX_Error VL53LX_GetMeasurementDataReady (uint8_t *pMeasurementDataReady)
 Return Measurement Data Ready.
VL53LX_Error VL53LX_WaitMeasurementDataReady ()
 Wait for measurement data ready.
VL53LX_Error VL53LX_GetMultiRangingData (VL53LX_MultiRangingData_t *pMultiRangingData)
 Retrieve all measurements from device with the current setup.
VL53LX_Error VL53LX_SetTuningParameter (uint16_t TuningParameterId, int32_t TuningParameterValue)
 Set Tuning Parameter value for a given parameter ID.
VL53LX_Error VL53LX_GetTuningParameter (uint16_t TuningParameterId, int32_t *pTuningParameterValue)
 Get Tuning Parameter value for a given parameter ID.
VL53LX_Error VL53LX_PerformRefSpadManagement ()
 Performs Reference Spad Management.
VL53LX_Error VL53LX_SmudgeCorrectionEnable (VL53LX_SmudgeCorrectionModes Mode)
 Enable/Disable dynamic Xtalk compensation feature.
VL53LX_Error VL53LX_SetXTalkCompensationEnable (uint8_t XTalkCompensationEnable)
 Enable/Disable Cross talk compensation feature.
VL53LX_Error VL53LX_GetXTalkCompensationEnable (uint8_t *pXTalkCompensationEnable)
 Get Cross talk compensation rate enable.
VL53LX_Error VL53LX_PerformXTalkCalibration ()
 Perform XTalk Calibration.
VL53LX_Error VL53LX_SetOffsetCorrectionMode (VL53LX_OffsetCorrectionModes OffsetCorrectionMode)
 Define the mode to be used for the offset correction.
VL53LX_Error VL53LX_PerformOffsetSimpleCalibration (int32_t CalDistanceMilliMeter)
 Perform Offset simple Calibration.
VL53LX_Error VL53LX_PerformOffsetZeroDistanceCalibration ()
 Perform Offset simple Calibration with a "zero distance" target.
VL53LX_Error VL53LX_PerformOffsetPerVcselCalibration (int32_t CalDistanceMilliMeter)
 Perform Offset per Vcsel Calibration.
VL53LX_Error VL53LX_SetCalibrationData (VL53LX_CalibrationData_t *pCalibrationData)
 Sets the Calibration Data.
VL53LX_Error VL53LX_GetCalibrationData (VL53LX_CalibrationData_t *pCalibrationData)
 Gets the Calibration Data.

Detailed Description

Class representing a VL53LX sensor component.

Definition at line 127 of file vl53lx_class.h.


Constructor & Destructor Documentation

VL53LX ( vl53L3_DevI2C *  i2c,
DigitalOut *  pin,
PinName  pin_gpio1,
uint8_t  dev_addr = VL53L1X_DEFAULT_DEVICE_ADDRESS 
)

Constructor.

Parameters:
[in]&i2cdevice I2C to be used for communication
[in]&pin_gpio1pin Mbed InterruptIn PinName to be used as component GPIO_1 INT
[in]DevAddrdevice address, 0x52 by default

Definition at line 134 of file vl53lx_class.h.

virtual ~VL53LX (  ) [virtual]

Destructor.

Definition at line 171 of file vl53lx_class.h.


Member Function Documentation

virtual int get_distance ( uint32_t *  pi_data ) [virtual]

Get ranging result and only that.

Parameters:
pRange_mmPointer to range distance
Returns:
0 on success

Definition at line 299 of file vl53lx_class.h.

virtual int init ( void *  init ) [virtual]

One time device initialization.

Parameters:
void
Returns:
0 on success

Definition at line 272 of file vl53lx_class.h.

VL53LX_Error InitSensor ( uint8_t  address )

PowerOff the sensor.

Returns:
void Initialize the sensor with default values
0 on Success

Definition at line 245 of file vl53lx_class.h.

virtual void VL53LX_Off ( void   ) [virtual]

PowerOff the sensor.

Returns:
void

Definition at line 203 of file vl53lx_class.h.

virtual void VL53LX_On ( void   ) [virtual]

PowerOn the sensor.

Returns:
void

Definition at line 185 of file vl53lx_class.h.