eLab Team / Mbed 2 deprecated myRobot

Dependencies:   mbed WS2812

Embed: (wiki syntax)

« Back to documentation index

VL53L0X Class Reference

VL53L0X Class Reference

Class representing a VL53L0 sensor component. More...

#include <VL53L0X.h>

Public Member Functions

 VL53L0X (I2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr=VL53L0X_DEFAULT_ADDRESS)
 Constructor.
virtual ~VL53L0X ()
 Destructor.
void VL53L0X_on (void)
 PowerOn the sensor.
void VL53L0X_off (void)
 PowerOff the sensor.
int init_sensor (uint8_t new_addr=VL53L0X_DEFAULT_ADDRESS)
 Initialize the sensor with default values.
int start_measurement (OperatingMode operating_mode, void(*fptr)(void), VL53L0X_RangingConfig rangingConfig)
 Start the measure indicated by operating mode.
int get_measurement (OperatingMode operating_mode, VL53L0X_RangingMeasurementData_t *p_data)
 Get results for the measure indicated by operating mode.
int stop_measurement (OperatingMode operating_mode)
 Stop the currently running measure indicate by operating_mode.
int handle_irq (OperatingMode operating_mode, VL53L0X_RangingMeasurementData_t *data)
 Interrupt handling func to be called by user after an INT is occourred.
void enable_interrupt_measure_detection_irq (void)
 Enable interrupt measure IRQ.
void disable_interrupt_measure_detection_irq (void)
 Disable interrupt measure IRQ.
void attach_interrupt_measure_detection_irq (void(*fptr)(void))
 Attach a function to call when an interrupt is detected, i.e.
int prepare ()
 Prepare device for operation.
int range_start_continuous_mode ()
 Start continuous ranging mode.
int get_distance (uint32_t *p_data)
 Get ranging result and only that.
int set_device_address (int new_addr)
 Set new device i2c address.
int clear_interrupt (uint8_t int_clear)
 Clear given system interrupt condition.
VL53L0X_Error VL53L0X_data_init (void)
 One time device initialization.
VL53L0X_Error VL53L0X_static_init (void)
 Do basic device init (and eventually patch loading) This function will change the VL53L0X_State from VL53L0X_STATE_WAIT_STATICINIT to VL53L0X_STATE_IDLE.
VL53L0X_Error VL53L0X_perform_ref_calibration (uint8_t *p_vhv_settings, uint8_t *p_phase_cal)
 Perform Reference Calibration.
VL53L0X_Error VL53L0X_get_ref_calibration (uint8_t *p_vhv_settings, uint8_t *p_phase_cal)
 Get Reference Calibration Parameters.
VL53L0X_Error VL53L0X_perform_ref_spad_management (uint32_t *ref_spad_count, uint8_t *is_aperture_spads)
 Performs Reference Spad Management.
VL53L0X_Error VL53L0X_set_reference_spads (uint32_t refSpadCount, uint8_t is_aperture_spads)
 Applies Reference SPAD configuration.
VL53L0X_Error VL53L0X_get_reference_spads (uint32_t *p_spad_count, uint8_t *p_is_aperture_spads)
 Retrieves SPAD configuration.
VL53L0X_Error VL53L0X_get_offset_calibration_data_micro_meter (int32_t *p_offset_calibration_data_micro_meter)
 Get part to part calibration offset.
VL53L0X_Error VL53L0X_set_offset_calibration_data_micro_meter (int32_t offset_calibration_data_micro_meter)
 Set or over-hide part to part calibration offset.
VL53L0X_Error VL53L0X_set_x_talk_compensation_rate_MHz (FixPoint1616_t x_talk_compensation_rate_MHz)
 Set Cross talk compensation rate.
VL53L0X_Error VL53L0X_get_x_talk_compensation_rate_MHz (FixPoint1616_t *p_xtalk_compensation_rate_MHz)
 Get Cross talk compensation rate.
VL53L0X_Error VL53L0X_get_x_talk_compensation_enable (uint8_t *p_x_talk_compensation_enable)
 Get Cross talk enable.
VL53L0X_Error VL53L0X_set_device_mode (VL53L0X_DeviceModes device_mode)
 Set a new device mode.
VL53L0X_Error VL53L0X_get_gpio_config (uint8_t pin, VL53L0X_DeviceModes *p_device_mode, VL53L0X_GpioFunctionality *p_functionality, VL53L0X_InterruptPolarity *p_polarity)
 Get current configuration for GPIO pin for a given device.
VL53L0X_Error VL53L0X_set_gpio_config (uint8_t pin, VL53L0X_DeviceModes device_mode, VL53L0X_GpioFunctionality functionality, VL53L0X_InterruptPolarity polarity)
 Set the configuration of GPIO pin for a given device.
VL53L0X_Error VL53L0X_start_measurement (void)
 Start device measurement.
VL53L0X_Error VL53L0X_stop_measurement (void)
 Stop device measurement.
VL53L0X_Error VL53L0X_get_stop_completed_status (uint32_t *p_stop_status)
 Return device stop completion status.
VL53L0X_Error VL53L0X_get_measurement_data_ready (uint8_t *p_measurement_data_ready)
 Return Measurement Data Ready.
VL53L0X_Error VL53L0X_get_ranging_measurement_data (VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data)
 Retrieve the measurements from device for a given setup.
VL53L0X_Error VL53L0X_clear_interrupt_mask (uint32_t interrupt_mask)
 Clear given system interrupt condition.
VL53L0X_Error VL53L0X_get_interrupt_mask_status (uint32_t *p_interrupt_mask_status)
 Return device interrupt status.
VL53L0X_Error VL53L0X_perform_single_ranging_measurement (VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data)
 Performs a single ranging measurement and retrieve the ranging measurement data.
VL53L0X_Error VL53L0X_perform_single_measurement (void)
 Single shot measurement.
VL53L0X_Error VL53L0X_get_measurement_timing_budget_us (uint32_t *p_measurement_timing_budget_us)
 Get Ranging Timing Budget in us.
VL53L0X_Error VL53L0X_set_measurement_timing_budget_us (uint32_t measurement_timing_budget_us)
 Set Ranging Timing Budget in us.
VL53L0X_Error VL53L0X_get_limit_check_enable (uint16_t limit_check_id, uint8_t *p_limit_check_enable)
 Get specific limit check enable state.
VL53L0X_Error VL53L0X_set_limit_check_enable (uint16_t limit_check_id, uint8_t limit_check_enable)
 Enable/Disable a specific limit check.
VL53L0X_Error VL53L0X_get_limit_check_value (uint16_t limit_check_id, FixPoint1616_t *p_limit_check_value)
 Get a specific limit check value.
VL53L0X_Error VL53L0X_set_limit_check_value (uint16_t limit_check_id, FixPoint1616_t limit_check_value)
 Set a specific limit check value.
VL53L0X_Error VL53L0X_get_limit_check_current (uint16_t limit_check_id, FixPoint1616_t *p_limit_check_current)
 Get the current value of the signal used for the limit check.
VL53L0X_Error VL53L0X_get_limit_check_status (uint16_t limit_check_id, uint8_t *p_limit_check_status)
 Return a the Status of the specified check limit.
VL53L0X_Error VL53L0X_get_inter_measurement_period_ms (uint32_t *p_inter_measurement_period_ms)
 Get continuous mode Inter-Measurement period in _ms.
VL53L0X_Error VL53L0X_set_inter_measurement_period_ms (uint32_t inter_measurement_period_ms)
 Program continuous mode Inter-Measurement period in _ms.
VL53L0X_Error VL53L0X_set_device_address (uint8_t device_address)
 Set new device address.
VL53L0X_Error VL53L0X_reset_device (void)
 Do an hard reset or soft reset (depending on implementation) of the device call of this function, device must be in same state as right after a power-up sequence.This function will change the VL53L0X_State to VL53L0X_STATE_POWERDOWN.
VL53L0X_Error VL53L0X_get_wrap_around_check_enable (uint8_t *p_wrap_around_check_enable)
 Get setup of Wrap around Check.
VL53L0X_Error VL53L0X_set_wrap_around_check_enable (uint8_t wrap_around_check_enable)
 Enable (or disable) Wrap around Check.
VL53L0X_Error VL53L0X_get_vcsel_pulse_period (VL53L0X_VcselPeriod vcsel_period_type, uint8_t *p_vcsel_pulse_period_pclk)
 Gets the VCSEL pulse period.
VL53L0X_Error VL53L0X_set_vcsel_pulse_period (VL53L0X_VcselPeriod vcsel_period_type, uint8_t vcsel_pulse_period)
 Sets the VCSEL pulse period.
VL53L0X_Error VL53L0X_set_interrupt_thresholds (VL53L0X_DeviceModes device_mode, FixPoint1616_t threshold_low, FixPoint1616_t threshold_high)
 Set low and high Interrupt thresholds for a given mode (ranging, ALS, ...) for a given device.
VL53L0X_Error VL53L0X_get_interrupt_thresholds (VL53L0X_DeviceModes device_mode, FixPoint1616_t *p_threshold_low, FixPoint1616_t *p_threshold_high)
 Get high and low Interrupt thresholds for a given mode (ranging, ALS, ...) for a given device.
VL53L0X_Error VL53L0X_get_device_info ()
 Reads the Device information for given Device.
VL53L0X_Error VL53L0X_get_sequence_step_enables (VL53L0X_SchedulerSequenceSteps_t *p_scheduler_sequence_steps)
 Gets the (on/off) state of all sequence steps.
VL53L0X_Error VL53L0X_set_sequence_step_enable (VL53L0X_SequenceStepId sequence_step_id, uint8_t sequence_step_enabled)
 Sets the (on/off) state of a requested sequence step.
VL53L0X_Error VL53L0X_get_fraction_enable (uint8_t *p_enabled)
 Gets the fraction enable parameter indicating the resolution of range measurements.
VL53L0X_Error VL53L0X_set_range_fraction_enable (uint8_t enable)
 Sets the resolution of range measurements.
VL53L0X_Error VL53L0X_get_device_parameters (VL53L0X_DeviceParameters_t *p_device_parameters)
 Retrieve current device parameters.
uint8_t VL53L0X_decode_vcsel_period (uint8_t vcsel_period_reg)
uint32_t VL53L0X_decode_timeout (uint16_t encoded_timeout)
uint16_t VL53L0X_encode_timeout (uint32_t timeout_macro_clks)
uint8_t lv53l0x_encode_vcsel_period (uint8_t vcsel_period_pclks)
VL53L0X_Error VL53L0X_polling_delay (void)
 execute delay in all polling API call
int32_t VL53L0X_cycle_power (void)
 Cycle Power to Device.
VL53L0X_Error VL53L0X_get_sequence_steps_info (VL53L0X_SequenceStepId sequence_step_id, char *p_sequence_steps_string)
 Gets the name of a given sequence step.
int32_t VL53L0X_get_timer_frequency (int32_t *p_timer_freq_hz)
 Get the frequency of the timer used for ranging results time stamps.
int32_t VL53L0X_get_timer_value (int32_t *p_timer_count)
 Get the timer value in units of timer_freq_hz (see VL53L0X_get_timestamp_frequency())
VL53L0X_Error VL53L0X_get_dmax_cal_parameters (uint16_t *p_range_milli_meter, FixPoint1616_t *p_signal_rate_rtn_MHz)
 Get Dmax Calibration Parameters for a given device.
VL53L0X_Error VL53L0X_get_dmax_cal_parameters (uint16_t range_milli_meter, FixPoint1616_t signal_rate_rtn_MHz)
 Set Dmax Calibration Parameters for a given device When one of the parameter is zero, this function will get parameter from NVM.
VL53L0X_Error VL53L0X_get_limit_check_info (uint16_t limit_check_id, char *p_limit_check_string)
 Return a description string for a given limit check number.
VL53L0X_Error VL53L0X_get_linearity_corrective_gain (uint16_t *p_linearity_corrective_gain)
 Get the linearity corrective gain.
VL53L0X_Error VL53L0X_set_linearity_corrective_gain (int16_t linearity_corrective_gain)
 Set the linearity corrective gain.
VL53L0X_Error VL53L0X_get_max_number_of_roi_zones (uint8_t *p_max_number_of_roi_zones)
 Get the Maximum number of ROI Zones managed by the Device.
VL53L0X_Error VL53L0X_get_measurement_ref_signal (FixPoint1616_t *p_measurement_ref_signal)
 Retrieve the Reference Signal after a measurements.
VL53L0X_Error VL53L0X_get_number_of_limit_check (uint16_t *p_number_of_limit_check)
 Get the number of the check limit managed by a given Device.
VL53L0X_Error VL53L0X_get_number_of_sequence_steps (uint8_t *p_number_of_sequence_steps)
 Gets number of sequence steps managed by the API.
VL53L0X_Error VL53L0X_get_power_mode (VL53L0X_PowerModes *p_power_mode)
 Get the power mode for a given Device.
VL53L0X_Error VL53L0X_set_power_mode (VL53L0X_PowerModes power_mode)
 Set the power mode for a given Device The power mode can be Standby or Idle.
VL53L0X_Error wrapped_VL53L0X_get_reference_spads (uint32_t *p_spad_count, uint8_t *p_is_aperture_spads)
 Retrieves SPAD configuration.
VL53L0X_Error VL53L0X_get_sequence_step_enable (VL53L0X_SequenceStepId sequence_step_id, uint8_t *p_sequence_step_enabled)
 Gets the (on/off) state of a requested sequence step.
VL53L0X_Error VL53L0X_get_sequence_step_timeout (VL53L0X_SequenceStepId sequence_step_id, FixPoint1616_t *p_time_out_milli_secs)
 Gets the timeout of a requested sequence step.
VL53L0X_Error VL53L0X_set_sequence_step_timeout (VL53L0X_SequenceStepId sequence_step_id, FixPoint1616_t time_out_milli_secs)
 Sets the timeout of a requested sequence step.
VL53L0X_Error VL53L0X_get_tuning_setting_buffer (uint8_t **pp_tuning_setting_buffer, uint8_t *p_use_internal_tuning_settings)
 Get the tuning settings pointer and the internal external switch value.
VL53L0X_Error VL53L0X_set_tuning_setting_buffer (uint8_t *p_tuning_setting_buffer, uint8_t use_internal_tuning_settings)
 Set the tuning settings pointer.
VL53L0X_Error vl53L0x_set_device_parameters (const VL53L0X_DeviceParameters_t *pDeviceParameters)
 Prepare device for operation.
VL53L0X_Error VL53L0X_write_byte (uint8_t index, uint8_t data)
 Write single byte register.
VL53L0X_Error VL53L0X_write_word (uint8_t index, uint16_t data)
 Write word register.
VL53L0X_Error VL53L0X_write_dword (uint8_t index, uint32_t data)
 Write double word (4 byte) register.
VL53L0X_Error VL53L0X_read_byte (uint8_t index, uint8_t *p_data)
 Read single byte register.
VL53L0X_Error VL53L0X_read_word (uint8_t index, uint16_t *p_data)
 Read word (2byte) register.
VL53L0X_Error VL53L0X_read_dword (uint8_t index, uint32_t *p_data)
 Read dword (4byte) register.
VL53L0X_Error VL53L0X_update_byte (uint8_t index, uint8_t and_data, uint8_t or_data)
 Thread safe Update (read/modify/write) single byte register.
VL53L0X_Error VL53L0X_read_multi (uint8_t index, uint8_t *p_data, uint32_t count)
 Reads the requested number of bytes from the device.
VL53L0X_Error VL53L0X_i2c_write (uint8_t index, uint8_t *p_data, uint16_t number_of_bytes)
 Writes a buffer towards the I2C peripheral device.
VL53L0X_Error VL53L0X_i2c_read (uint8_t index, uint8_t *p_data, uint16_t number_of_bytes)
 Reads a buffer from the I2C peripheral device.

Data Fields

VL53L0X_DeviceParameters_t CurrentParameters
VL53L0X_RangingMeasurementData_t LastRangeMeasure
uint8_t I2cDevAddr
uint8_t comms_type
uint16_t comms_speed_khz

Detailed Description

Class representing a VL53L0 sensor component.

Definition at line 41 of file VL53L0X.h.


Constructor & Destructor Documentation

VL53L0X ( I2C *  i2c,
DigitalOut *  pin,
PinName  pin_gpio1,
uint8_t  dev_addr = VL53L0X_DEFAULT_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]dev_addrdevice address, 0x29 by default

Definition at line 49 of file VL53L0X.h.

virtual ~VL53L0X (  ) [virtual]

Destructor.

Definition at line 59 of file VL53L0X.h.


Member Function Documentation

void attach_interrupt_measure_detection_irq ( void(*)(void)  fptr )

Attach a function to call when an interrupt is detected, i.e.

measurement is ready

Parameters:
[in]fptrpointer to call back function to be called whenever an interrupt occours
Returns:
"0" on success

Definition at line 143 of file VL53L0X.h.

int clear_interrupt ( uint8_t  int_clear )

Clear given system interrupt condition.

Function Description
Clear given interrupt cause by writing into register SYSTEM_INTERRUPT_CLEAR register.
Parameters:
int_clearWhich interrupt source to clear. Use any combinations of INTERRUPT_CLEAR_RANGING , INTERRUPT_CLEAR_ALS , INTERRUPT_CLEAR_ERROR.
Returns:
"0" on success

Definition at line 217 of file VL53L0X.h.

void disable_interrupt_measure_detection_irq ( void   )

Disable interrupt measure IRQ.

Returns:
"0" on success

Definition at line 135 of file VL53L0X.h.

void enable_interrupt_measure_detection_irq ( void   )

Enable interrupt measure IRQ.

Returns:
"0" on success

Definition at line 128 of file VL53L0X.h.

int get_measurement ( OperatingMode  operating_mode,
VL53L0X_RangingMeasurementData_t *  p_data 
)

Get results for the measure indicated by operating mode.

Parameters:
[in]operating_modespecifies requested measure results
[out]p_datapointer to the MeasureData_t structure to read data in to
Returns:
"0" on success

Definition at line 573 of file VL53L0X.cpp.

int handle_irq ( OperatingMode  operating_mode,
VL53L0X_RangingMeasurementData_t *  data 
)

Interrupt handling func to be called by user after an INT is occourred.

Parameters:
[in]opeating_modeindicating the in progress measure
[out]Datapointer to the MeasureData_t structure to read data in to
Returns:
"0" on success

Definition at line 628 of file VL53L0X.cpp.

int init_sensor ( uint8_t  new_addr = VL53L0X_DEFAULT_ADDRESS )

Initialize the sensor with default values.

Returns:
"0" on success

Definition at line 180 of file VL53L0X.cpp.

uint8_t lv53l0x_encode_vcsel_period ( uint8_t  vcsel_period_pclks )

Converts the encoded VCSEL period register value into the real period in PLL clocks

Definition at line 1202 of file VL53L0X.cpp.

int set_device_address ( int  new_addr )

Set new device i2c address.

After completion the device will answer to the new address programmed.

Parameters:
new_addrThe new i2c address (7bit)
Returns:
"0" on success

Definition at line 200 of file VL53L0X.h.

int start_measurement ( OperatingMode  operating_mode,
void(*)(void)  fptr,
VL53L0X_RangingConfig  rangingConfig 
)

Start the measure indicated by operating mode.

Parameters:
[in]operating_modespecifies requested measure
[in]fptrspecifies call back function must be !NULL in case of interrupt measure
Returns:
"0" on success

Definition at line 360 of file VL53L0X.cpp.

int stop_measurement ( OperatingMode  operating_mode )

Stop the currently running measure indicate by operating_mode.

Parameters:
[in]operating_modespecifies requested measure to stop
Returns:
"0" on success

Definition at line 602 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_clear_interrupt_mask ( uint32_t  interrupt_mask )

Clear given system interrupt condition.

Function Description
Clear given interrupt(s).
Note:
This function Access to the device
Parameters:
interrupt_maskMask of interrupts to clear
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INTERRUPT_NOT_CLEARED Cannot clear interrupts
"Other error code" See VL53L0X_Error

Definition at line 1840 of file VL53L0X.cpp.

int32_t VL53L0X_cycle_power ( void   )

Cycle Power to Device.

Returns:
status - status 0 = ok, 1 = error
VL53L0X_Error VL53L0X_data_init ( void   )

One time device initialization.

To be called once and only once after device is brought out of reset (Chip enable) and booted see VL53L0X_WaitDeviceBooted()

Function Description
When not used after a fresh device "power up" or reset, it may return VL53L0X_ERROR_CALIBRATION_WARNING meaning wrong calibration data may have been fetched from device that can result in ranging offset error
If application cannot execute device reset or need to run VL53L0X_DataInit multiple time then it must ensure proper offset calibration saving and restore on its own by using VL53L0X_GetOffsetCalibrationData() on first power up and then VL53L0X_SetOffsetCalibrationData() in all subsequent init This function will change the VL53L0X_State from VL53L0X_STATE_POWERDOWN to VL53L0X_STATE_WAIT_STATICINIT.
Note:
This function accesses to the device
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 218 of file VL53L0X.cpp.

uint32_t VL53L0X_decode_timeout ( uint16_t  encoded_timeout )

Decode 16-bit timeout register value - format (LSByte * 2^MSByte) + 1

Definition at line 1410 of file VL53L0X.cpp.

uint8_t VL53L0X_decode_vcsel_period ( uint8_t  vcsel_period_reg )

Converts the encoded VCSEL period register value into the real period in PLL clocks

Definition at line 1193 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_device_info (  )

Reads the Device information for given Device.

Note:
This function Access to the device _device_info structure is directly filled
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1710 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_device_parameters ( VL53L0X_DeviceParameters_t p_device_parameters )

Retrieve current device parameters.

Function Description
Get actual parameters of the device
  • Then start ranging operation.
Note:
This function Access to the device
Parameters:
p_device_parametersPointer to store current device parameters.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1609 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_dmax_cal_parameters ( uint16_t *  p_range_milli_meter,
FixPoint1616_t p_signal_rate_rtn_MHz 
)

Get Dmax Calibration Parameters for a given device.

Note:
This function Access to the device
Parameters:
p_range_milli_meterPointer to Calibration Distance
p_signal_rate_rtn_MHzPointer to Signal rate return
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_dmax_cal_parameters ( uint16_t  range_milli_meter,
FixPoint1616_t  signal_rate_rtn_MHz 
)

Set Dmax Calibration Parameters for a given device When one of the parameter is zero, this function will get parameter from NVM.

Note:
This function doesn't Access to the device
Parameters:
range_milli_meterCalibration Distance
signal_rate_rtn_MHzSignal rate return read at CalDistance
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_gpio_config ( uint8_t  pin,
VL53L0X_DeviceModes *  p_device_mode,
VL53L0X_GpioFunctionality *  p_functionality,
VL53L0X_InterruptPolarity *  p_polarity 
)

Get current configuration for GPIO pin for a given device.

Note:
This function Access to the device
Parameters:
pinID of the GPIO Pin
p_device_modePointer to Device Mode associated to the Gpio.
p_functionalityPointer to Pin functionality. Refer to VL53L0X_GpioFunctionality
p_polarityPointer to interrupt polarity. Active high or active low see VL53L0X_InterruptPolarity
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_GPIO_NOT_EXISTING Only Pin=0 is accepted.
VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED This error occurs when Funcionality programmed is not in the supported list: Supported value are: VL53L0X_GPIOFUNCTIONALITY_OFF, VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW, VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH, VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT, VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_inter_measurement_period_ms ( uint32_t *  p_inter_measurement_period_ms )

Get continuous mode Inter-Measurement period in _ms.

Function Description
When trying to set too short time return INVALID_PARAMS minimal value
Note:
This function Access to the device
Parameters:
p_inter_measurement_period_msPointer to programmed Inter-Measurement Period in _ms.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 981 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_interrupt_mask_status ( uint32_t *  p_interrupt_mask_status )

Return device interrupt status.

Function Description
Returns currently raised interrupts by the device. User shall be able to activate/deactivate interrupts through VL53L0X_SetGpioConfig()
Note:
This function Access to the device
Parameters:
p_interrupt_mask_statusPointer to status variable to update
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1760 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_interrupt_thresholds ( VL53L0X_DeviceModes  device_mode,
FixPoint1616_t p_threshold_low,
FixPoint1616_t p_threshold_high 
)

Get high and low Interrupt thresholds for a given mode (ranging, ALS, ...) for a given device.

Function Description
Get high and low Interrupt thresholds for a given mode (ranging, ALS, ...) for a given device
Note:
This function Access to the device
DeviceMode is ignored for the current device
Parameters:
device_modeDevice Mode from which read thresholds
p_threshold_lowLow threshold (mm, lux ..., depending on the mode)
p_threshold_highHigh threshold (mm, lux ..., depending on the mode)
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 2238 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_limit_check_current ( uint16_t  limit_check_id,
FixPoint1616_t p_limit_check_current 
)

Get the current value of the signal used for the limit check.

Function Description
This function get a the current value of the signal used for the limit check. To obtain the latest value you should run a ranging before. The value reported is linked to the limit check identified with the LimitCheckId.
Note:
This function Access to the device
Parameters:
limit_check_idLimit Check ID (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
p_limit_check_currentPointer to current Value for a given LimitCheckId.
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS This error is returned when LimitCheckId value is out of range.
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_limit_check_enable ( uint16_t  limit_check_id,
uint8_t *  p_limit_check_enable 
)

Get specific limit check enable state.

Function Description
This function get the enable state of a specific limit check. The limit check is identified with the LimitCheckId.
Note:
This function Access to the device
Parameters:
limit_check_idLimit Check ID (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
p_limit_check_enablePointer to the check limit enable value. if 1 the check limit corresponding to LimitCheckId is Enabled if 0 the check limit corresponding to LimitCheckId is disabled
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS This error is returned when LimitCheckId value is out of range.
"Other error code" See VL53L0X_Error

Definition at line 1100 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_limit_check_info ( uint16_t  limit_check_id,
char *  p_limit_check_string 
)

Return a description string for a given limit check number.

Function Description
This function returns a description string for a given limit check number. The limit check is identified with the LimitCheckId.
Note:
This function doesn't Access to the device
Parameters:
limit_check_idLimit Check ID (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
p_limit_check_stringPointer to the description string of the given check limit.
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS This error is returned when LimitCheckId value is out of range.
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_limit_check_status ( uint16_t  limit_check_id,
uint8_t *  p_limit_check_status 
)

Return a the Status of the specified check limit.

Function Description
This function returns the Status of the specified check limit. The value indicate if the check is fail or not. The limit check is identified with the LimitCheckId.
Note:
This function doesn't Access to the device
Parameters:
limit_check_idLimit Check ID (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
p_limit_check_statusPointer to the Limit Check Status of the given check limit. LimitCheckStatus : 0 the check is not fail 1 the check if fail or not enabled
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS This error is returned when LimitCheckId value is out of range.
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_limit_check_value ( uint16_t  limit_check_id,
FixPoint1616_t p_limit_check_value 
)

Get a specific limit check value.

Function Description
This function get a specific limit check value from device then it updates internal values and check enables. The limit check is identified with the LimitCheckId.
Note:
This function Access to the device
Parameters:
limit_check_idLimit Check ID (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
p_limit_check_valuePointer to Limit check Value for a given LimitCheckId.
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS This error is returned when LimitCheckId value is out of range.
"Other error code" See VL53L0X_Error

Definition at line 1030 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_linearity_corrective_gain ( uint16_t *  p_linearity_corrective_gain )

Get the linearity corrective gain.

Function Description
Should only be used after a successful call to VL53L0X_DataInit to backup device NVM value
Note:
This function Access to the device
Parameters:
p_linearity_corrective_gainPointer to the linearity corrective gain in x1000 if value is 1000 then no modification is applied.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_max_number_of_roi_zones ( uint8_t *  p_max_number_of_roi_zones )

Get the Maximum number of ROI Zones managed by the Device.

Function Description
Get Maximum number of ROI Zones managed by the Device.
Note:
This function doesn't Access to the device
Parameters:
p_max_number_of_roi_zonesPointer to the Maximum Number of ROI Zones value.
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_Error VL53L0X_get_measurement_data_ready ( uint8_t *  p_measurement_data_ready )

Return Measurement Data Ready.

Function Description
This function indicate that a measurement data is ready. This function check if interrupt mode is used then check is done accordingly. If perform function clear the interrupt, this function will not work, like in case of VL53L0X_PerformSingleRangingMeasurement(). The previous function is blocking function, VL53L0X_GetMeasurementDataReady is used for non-blocking capture.
Note:
This function Access to the device
Parameters:
p_measurement_data_readyPointer to Measurement Data Ready. 0=data not ready, 1 = data ready
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1772 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_measurement_ref_signal ( FixPoint1616_t p_measurement_ref_signal )

Retrieve the Reference Signal after a measurements.

Function Description
Get Reference Signal from last successful Ranging measurement This function return a valid value after that you call the VL53L0X_GetRangingMeasurementData().
Note:
This function Access to the device
Parameters:
p_measurement_ref_signalPointer to the Ref Signal to fill up.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_measurement_timing_budget_us ( uint32_t *  p_measurement_timing_budget_us )

Get Ranging Timing Budget in us.

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 ...)
Note:
This function Access to the device
Parameters:
p_measurement_timing_budget_usMax measurement time in us. Valid values are: >= 17000us when wraparound enabled >= 12000us when wraparound disabled
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1540 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_number_of_limit_check ( uint16_t *  p_number_of_limit_check )

Get the number of the check limit managed by a given Device.

Function Description
This function give the number of the check limit managed by the Device
Note:
This function doesn't Access to the device
Parameters:
p_number_of_limit_checkPointer to the number of check limit.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_number_of_sequence_steps ( uint8_t *  p_number_of_sequence_steps )

Gets number of sequence steps managed by the API.

Function Description
This function retrieves the number of sequence steps currently managed by the API
Note:
This function Accesses the device
Parameters:
p_number_of_sequence_stepsOut parameter reporting the number of sequence steps.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_offset_calibration_data_micro_meter ( int32_t *  p_offset_calibration_data_micro_meter )

Get part to part calibration offset.

Function Description
Should only be used after a successful call to VL53L0X_DataInit to backup device NVM value
Note:
This function Access to the device
Parameters:
p_offset_calibration_data_micro_meterReturn part to part calibration offset from device (microns)
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 895 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_power_mode ( VL53L0X_PowerModes *  p_power_mode )

Get the power mode for a given Device.

Note:
This function Access to the device
Parameters:
p_power_modePointer to the current value of the power mode. see VL53L0X_PowerModes Valid values are: VL53L0X_POWERMODE_STANDBY_LEVEL1, VL53L0X_POWERMODE_IDLE_LEVEL1
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_ref_calibration ( uint8_t *  p_vhv_settings,
uint8_t *  p_phase_cal 
)

Get Reference Calibration Parameters.

Function Description
Get Reference Calibration Parameters.
Note:
This function Access to the device
Parameters:
p_vhv_settingsPointer to VHV parameter
p_phase_calPointer to PhaseCal Parameter
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_reference_spads ( uint32_t *  p_spad_count,
uint8_t *  p_is_aperture_spads 
)

Retrieves SPAD configuration.

Function Description
This function retrieves the current number of applied reference spads and also their type : Aperture or Non-Aperture.
Note:
This function Access to the device
Parameters:
p_spad_countNumber ref Spad Count
p_is_aperture_spadsReports if spads are of type aperture or non-aperture. 1:=aperture, 0:=Non-Aperture
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_REF_SPAD_INIT Error in the in the reference spad configuration.
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_sequence_step_enable ( VL53L0X_SequenceStepId  sequence_step_id,
uint8_t *  p_sequence_step_enabled 
)

Gets the (on/off) state of a requested sequence step.

Function Description
This function retrieves the state of a requested sequence step, i.e. on/off.
Note:
This function Accesses the device
Parameters:
sequence_step_idSequence step identifier.
p_sequence_step_enabledOut parameter reporting if the sequence step is enabled {0=Off,1=On}.
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not supported.
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_sequence_step_enables ( VL53L0X_SchedulerSequenceSteps_t *  p_scheduler_sequence_steps )

Gets the (on/off) state of all sequence steps.

Function Description
This function retrieves the state of all sequence step in the scheduler.
Note:
This function Accesses the device
Parameters:
p_scheduler_sequence_stepsPointer to struct containing result.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1163 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_sequence_step_timeout ( VL53L0X_SequenceStepId  sequence_step_id,
FixPoint1616_t p_time_out_milli_secs 
)

Gets the timeout of a requested sequence step.

Function Description
This function retrieves the timeout of a requested sequence step.
Note:
This function Accesses the device
Parameters:
sequence_step_idSequence step identifier.
p_time_out_milli_secsTimeout value.
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not supported.
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_sequence_steps_info ( VL53L0X_SequenceStepId  sequence_step_id,
char *  p_sequence_steps_string 
)

Gets the name of a given sequence step.

Function Description
This function retrieves the name of sequence steps corresponding to SequenceStepId.
Note:
This function doesn't Accesses the device
Parameters:
sequence_step_idSequence step identifier.
p_sequence_steps_stringPointer to Info string
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
int32_t VL53L0X_get_timer_frequency ( int32_t *  p_timer_freq_hz )

Get the frequency of the timer used for ranging results time stamps.

Parameters:
[out]p_timer_freq_hz: pointer for timer frequency
Returns:
status : 0 = ok, 1 = error
int32_t VL53L0X_get_timer_value ( int32_t *  p_timer_count )

Get the timer value in units of timer_freq_hz (see VL53L0X_get_timestamp_frequency())

Parameters:
[out]p_timer_count: pointer for timer count value
Returns:
status : 0 = ok, 1 = error
VL53L0X_Error VL53L0X_get_tuning_setting_buffer ( uint8_t **  pp_tuning_setting_buffer,
uint8_t *  p_use_internal_tuning_settings 
)

Get the tuning settings pointer and the internal external switch value.

This function is used to get the Tuning settings buffer pointer and the value. of the switch to select either external or internal tuning settings.

Note:
This function Access to the device
Parameters:
pp_tuning_setting_bufferPointer to tuning settings buffer.
p_use_internal_tuning_settingsPointer to store Use internal tuning settings value.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_get_vcsel_pulse_period ( VL53L0X_VcselPeriod  vcsel_period_type,
uint8_t *  p_vcsel_pulse_period_pclk 
)

Gets the VCSEL pulse period.

Function Description
This function retrieves the VCSEL pulse period for the given period type.
Note:
This function Accesses the device
Parameters:
vcsel_period_typeVCSEL period identifier (pre-range|final).
p_vcsel_pulse_period_pclkPointer to VCSEL period value.
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS Error VcselPeriodType parameter not supported.
"Other error code" See VL53L0X_Error

Definition at line 1387 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_wrap_around_check_enable ( uint8_t *  p_wrap_around_check_enable )

Get setup of Wrap around Check.

Function Description
This function get the wrapAround check enable parameters
Note:
This function Access to the device
Parameters:
p_wrap_around_check_enablePointer to the Wrap around Check state 0=disabled or 1 = enabled
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1116 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_x_talk_compensation_enable ( uint8_t *  p_x_talk_compensation_enable )

Get Cross talk enable.

Enable/Disable Cross Talk by set to zero the Cross Talk value by using VL53L0X_SetXTalkCompensationRate_MHz().

Parameters:
devDevice Handle
p_x_talk_compensation_enablePointer to the Cross talk compensation state 0=disabled or 1 = enabled
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 2471 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_get_x_talk_compensation_rate_MHz ( FixPoint1616_t p_xtalk_compensation_rate_MHz )

Get Cross talk compensation rate.

Function Description
Get Cross talk compensation rate.
Note:
This function Access to the device
Parameters:
p_xtalk_compensation_rate_MHzPointer to Compensation rate in Mega counts per second (16.16 fix point) see datasheet for details
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1007 of file VL53L0X.cpp.

void VL53L0X_off ( void   )

PowerOff the sensor.

Returns:
void

Definition at line 79 of file VL53L0X.h.

void VL53L0X_on ( void   )

PowerOn the sensor.

Returns:
void

Definition at line 68 of file VL53L0X.h.

VL53L0X_Error VL53L0X_perform_single_measurement ( void   )

Single shot measurement.

Function Description
Perform simple measurement sequence (Start measure, Wait measure to end, and returns when measurement is done). Once function returns, user can get valid data by calling VL53L0X_GetRangingMeasurement or VL53L0X_GetHistogramMeasurement depending on defined measurement mode User should Clear the interrupt in case this are enabled by using the function VL53L0X_ClearInterruptMask().
Warning:
This function is a blocking function
Note:
This function Access to the device
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 2449 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_polling_delay ( void   )

execute delay in all polling API call

A typical multi-thread or RTOs implementation is to sleep the task for some 5ms (with 100Hz max rate faster polling is not needed) if nothing specific is need you can define it as an empty/void macro

 #define VL53L0X_PollingDelay(...) (void)0
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 1802 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_reset_device ( void   )

Do an hard reset or soft reset (depending on implementation) of the device call of this function, device must be in same state as right after a power-up sequence.This function will change the VL53L0X_State to VL53L0X_STATE_POWERDOWN.

Note:
This function Access to the device
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_device_mode ( VL53L0X_DeviceModes  device_mode )

Set a new device mode.

Function Description
Set device to a new mode (ranging, histogram ...)
Note:
This function doesn't Access to the device
Parameters:
device_modeNew device mode to apply Valid values are: VL53L0X_DEVICEMODE_SINGLE_RANGING VL53L0X_DEVICEMODE_CONTINUOUS_RANGING VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when DeviceMode is not in the supported list

Definition at line 2195 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_set_inter_measurement_period_ms ( uint32_t  inter_measurement_period_ms )

Program continuous mode Inter-Measurement period in _ms.

Function Description
When trying to set too short time return INVALID_PARAMS minimal value
Note:
This function Access to the device
Parameters:
inter_measurement_period_msInter-Measurement Period in ms.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_interrupt_thresholds ( VL53L0X_DeviceModes  device_mode,
FixPoint1616_t  threshold_low,
FixPoint1616_t  threshold_high 
)

Set low and high Interrupt thresholds for a given mode (ranging, ALS, ...) for a given device.

Function Description
Set low and high Interrupt thresholds for a given mode (ranging, ALS, ...) for a given device
Note:
This function Access to the device
DeviceMode is ignored for the current device
Parameters:
device_modeDevice Mode for which change thresholds
threshold_lowLow threshold (mm, lux ..., depending on the mode)
threshold_highHigh threshold (mm, lux ..., depending on the mode)
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 2216 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_set_limit_check_value ( uint16_t  limit_check_id,
FixPoint1616_t  limit_check_value 
)

Set a specific limit check value.

Function Description
This function set a specific limit check value. The limit check is identified with the LimitCheckId.
Note:
This function Access to the device
Parameters:
limit_check_idLimit Check ID (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
limit_check_valueLimit check Value for a given LimitCheckId
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS This error is returned when either LimitCheckId or LimitCheckValue value is out of range.
"Other error code" See VL53L0X_Error

Definition at line 1662 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_set_linearity_corrective_gain ( int16_t  linearity_corrective_gain )

Set the linearity corrective gain.

Note:
This function Access to the device
Parameters:
linearity_corrective_gainLinearity corrective gain in x1000 if value is 1000 then no modification is applied.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_offset_calibration_data_micro_meter ( int32_t  offset_calibration_data_micro_meter )

Set or over-hide part to part calibration offset.

See also:
VL53L0X_DataInit() VL53L0X_GetOffsetCalibrationData_um()
Note:
This function Access to the device
Parameters:
p_offset_calibration_data_micro_meterOffset (microns)
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 920 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_set_power_mode ( VL53L0X_PowerModes  power_mode )

Set the power mode for a given Device The power mode can be Standby or Idle.

Different level of both Standby and Idle can exists. This function should not be used when device is in Ranging state.

Note:
This function Access to the device
Parameters:
power_modeThe value of the power mode to set. see VL53L0X_PowerModes Valid values are: VL53L0X_POWERMODE_STANDBY_LEVEL1, VL53L0X_POWERMODE_IDLE_LEVEL1
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when PowerMode is not in the supported list
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_range_fraction_enable ( uint8_t  enable )

Sets the resolution of range measurements.

Function Description
Set resolution of range measurements to either 0.25mm if fraction enabled or 1mm if not enabled.
Note:
This function Accesses the device
Parameters:
enableEnable high resolution
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_sequence_step_timeout ( VL53L0X_SequenceStepId  sequence_step_id,
FixPoint1616_t  time_out_milli_secs 
)

Sets the timeout of a requested sequence step.

Function Description
This function sets the timeout of a requested sequence step.
Note:
This function Accesses the device
Parameters:
sequence_step_idSequence step identifier.
time_out_milli_secsDemanded timeout
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not supported.
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_tuning_setting_buffer ( uint8_t *  p_tuning_setting_buffer,
uint8_t  use_internal_tuning_settings 
)

Set the tuning settings pointer.

This function is used to specify the Tuning settings buffer to be used for a given device. The buffer contains all the necessary data to permit the API to write tuning settings. This function permit to force the usage of either external or internal tuning settings.

Note:
This function Access to the device
Parameters:
p_tuning_setting_bufferPointer to tuning settings buffer.
use_internal_tuning_settingsUse internal tuning settings value.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_vcsel_pulse_period ( VL53L0X_VcselPeriod  vcsel_period_type,
uint8_t  vcsel_pulse_period 
)

Sets the VCSEL pulse period.

Function Description
This function retrieves the VCSEL pulse period for the given period type.
Note:
This function Accesses the device
Parameters:
vcsel_period_typeVCSEL period identifier (pre-range|final).
vcsel_pulse_periodVCSEL period value
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_INVALID_PARAMS Error VcselPeriodType parameter not supported.
"Other error code" See VL53L0X_Error

Definition at line 1379 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_set_wrap_around_check_enable ( uint8_t  wrap_around_check_enable )

Enable (or disable) Wrap around Check.

Note:
This function Access to the device
Parameters:
wrap_around_check_enableWrap around Check to be set 0=disabled, other = enabled
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_x_talk_compensation_rate_MHz ( FixPoint1616_t  x_talk_compensation_rate_MHz )

Set Cross talk compensation rate.

Function Description
Set Cross talk compensation rate.
Note:
This function Access to the device
Parameters:
x_talk_compensation_rate_MHzCompensation rate in Mega counts per second (16.16 fix point) see datasheet for details
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_start_measurement ( void   )

Start device measurement.

Started measurement will depend on device parameters set through VL53L0X_SetParameters() This is a non-blocking function. This function will change the VL53L0X_State from VL53L0X_STATE_IDLE to VL53L0X_STATE_RUNNING.

Note:
This function Access to the device
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when DeviceMode programmed with VL53L0X_SetDeviceMode is not in the supported list: Supported mode are: VL53L0X_DEVICEMODE_SINGLE_RANGING, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING, VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
VL53L0X_ERROR_TIME_OUT Time out on start measurement
"Other error code" See VL53L0X_Error

Definition at line 2373 of file VL53L0X.cpp.

VL53L0X_Error wrapped_VL53L0X_get_reference_spads ( uint32_t *  p_spad_count,
uint8_t *  p_is_aperture_spads 
)

Retrieves SPAD configuration.

Function Description
This function retrieves the current number of applied reference spads and also their type : Aperture or Non-Aperture.
Note:
This function Access to the device
Parameters:
p_spad_countNumber ref Spad Count
p_is_aperture_spadsReports if spads are of type aperture or non-aperture. 1:=aperture, 0:=Non-Aperture
Returns:
VL53L0X_ERROR_NONE Success
VL53L0X_ERROR_REF_SPAD_INIT Error in the in the reference spad configuration.
"Other error code" See VL53L0X_Error