CRINSA-team2025 V1
Documentation du Club Robot INSA Rennes 2025
Chargement...
Recherche...
Aucune correspondance
Référence de la classe VL53L5CX
Graphe de collaboration de VL53L5CX:

Fonctions membres publiques

 VL53L5CX (i2c_t *i2c)
 
virtual ~VL53L5CX ()
 
int init_sensor (uint8_t addr=VL53L5CX_DEFAULT_I2C_ADDRESS)
 Initialize the sensor.
 
uint8_t vl53l5cx_is_alive (uint8_t *p_is_alive)
 This function is used to check if the sensor is alive.
 
uint8_t vl53l5cx_init ()
 Mandatory function used to initialize the sensor. This function must be called after a power on, to load the firmware into the VL53L5CX. It takes a few hundred milliseconds.
 
uint8_t vl53l5cx_set_i2c_address (uint16_t i2c_address)
 This function is used to change the I2C address of the sensor. If multiple VL53L5 sensors are connected to the same I2C line, all other LPn pins needs to be set to Low. The default sensor address is 0x52.
 
uint8_t vl53l5cx_get_power_mode (uint8_t *p_power_mode)
 This function is used to get the current sensor power mode.
 
uint8_t vl53l5cx_set_power_mode (uint8_t power_mode)
 This function is used to set the sensor in Low Power mode, for example if the sensor is not used during a long time. The macro VL53L5CX_POWER_MODE_SLEEP can be used to enable the low power mode. When user want to restart the sensor, he can use macro VL53L5CX_POWER_MODE_WAKEUP. Please ensure that the device is not streaming before calling the function.
 
uint8_t vl53l5cx_start_ranging ()
 This function starts a ranging session. When the sensor streams, host cannot change settings 'on-the-fly'.
 
uint8_t vl53l5cx_stop_ranging ()
 This function stops the ranging session. It must be used when the sensor streams, after calling vl53l5cx_start_ranging().
 
uint8_t vl53l5cx_check_data_ready (uint8_t *p_isReady)
 This function checks if a new data is ready by polling I2C. If a new data is ready, a flag will be raised.
 
uint8_t vl53l5cx_get_ranging_data (VL53L5CX_ResultsData *p_results)
 This function gets the ranging data, using the selected output and the resolution.
 
uint8_t vl53l5cx_get_resolution (uint8_t *p_resolution)
 This function gets the current resolution (4x4 or 8x8).
 
uint8_t vl53l5cx_set_resolution (uint8_t resolution)
 This function sets a new resolution (4x4 or 8x8).
 
uint8_t vl53l5cx_get_ranging_frequency_hz (uint8_t *p_frequency_hz)
 This function gets the current ranging frequency in Hz. Ranging frequency corresponds to the time between each measurement.
 
uint8_t vl53l5cx_set_ranging_frequency_hz (uint8_t frequency_hz)
 This function sets a new ranging frequency in Hz. Ranging frequency corresponds to the measurements frequency. This setting depends of the resolution, so please select your resolution before using this function.
 
uint8_t vl53l5cx_get_integration_time_ms (uint32_t *p_time_ms)
 This function gets the current integration time in ms.
 
uint8_t vl53l5cx_set_integration_time_ms (uint32_t integration_time_ms)
 This function sets a new integration time in ms. Integration time must be computed to be lower than the ranging period, for a selected resolution. Please note that this function has no impact on ranging mode continuous.
 
uint8_t vl53l5cx_get_sharpener_percent (uint8_t *p_sharpener_percent)
 This function gets the current sharpener in percent. Sharpener can be changed to blur more or less zones depending of the application.
 
uint8_t vl53l5cx_set_sharpener_percent (uint8_t sharpener_percent)
 This function sets a new sharpener value in percent. Sharpener can be changed to blur more or less zones depending of the application. Min value is 0 (disabled), and max is 99.
 
uint8_t vl53l5cx_get_target_order (uint8_t *p_target_order)
 This function gets the current target order (closest or strongest).
 
uint8_t vl53l5cx_set_target_order (uint8_t target_order)
 This function sets a new target order. Please use macros VL53L5CX_TARGET_ORDER_STRONGEST and VL53L5CX_TARGET_ORDER_CLOSEST to define the new output order. By default, the sensor is configured with the strongest output.
 
uint8_t vl53l5cx_get_ranging_mode (uint8_t *p_ranging_mode)
 This function is used to get the ranging mode. Two modes are available using ULD : Continuous and autonomous. The default mode is Autonomous.
 
uint8_t vl53l5cx_set_ranging_mode (uint8_t ranging_mode)
 This function is used to set the ranging mode. Two modes are available using ULD : Continuous and autonomous. The default mode is Autonomous.
 
uint8_t vl53l5cx_dci_read_data (uint8_t *data, uint32_t index, uint16_t data_size)
 This function can be used to read 'extra data' from DCI. Using a known index, the function fills the casted structure passed in argument.
 
uint8_t vl53l5cx_dci_write_data (uint8_t *data, uint32_t index, uint16_t data_size)
 This function can be used to write 'extra data' to DCI. The data can be simple data, or casted structure.
 
uint8_t vl53l5cx_dci_replace_data (uint8_t *data, uint32_t index, uint16_t data_size, uint8_t *new_data, uint16_t new_data_size, uint16_t new_data_pos)
 
void SwapBuffer (uint8_t *buffer, uint16_t size)
 
uint8_t get_stream_count (void)
 

Attributs publics

VL53L5CX_Configuration _dev
 
VL53L5CX_Configurationp_dev
 

Fonctions membres protégées

uint8_t _vl53l5cx_poll_for_answer (uint8_t size, uint8_t pos, uint16_t address, uint8_t mask, uint8_t expected_value)
 Inner function, not available outside this file. This function is used to wait for an answer from VL53L5CX sensor.
 
uint8_t _vl53l5cx_poll_for_mcu_boot ()
 
uint8_t _vl53l5cx_send_offset_data (uint8_t resolution)
 Inner function, not available outside this file. This function is used to set the offset data gathered from NVM.
 
uint8_t _vl53l5cx_send_xtalk_data (uint8_t resolution)
 Inner function, not available outside this file. This function is used to set the Xtalk data from generic configuration, or user's calibration.
 
uint8_t _vl53l5cx_poll_for_answer_xtalk (uint16_t address, uint8_t expected_value)
 Inner function, not available outside this file. This function is used to wait for an answer from VL53L5 sensor.
 
uint8_t _vl53l5cx_program_output_config ()
 Inner function, not available outside this file. This function is used to program the output using the macro defined into the 'platform.h' file.
 
uint8_t RdByte (VL53L5CX_Platform *p_platform, uint16_t RegisterAddress, uint8_t *p_value)
 
uint8_t WrByte (VL53L5CX_Platform *p_platform, uint16_t RegisterAddress, uint8_t value)
 Mandatory function used to write one single byte.
 
uint8_t RdMulti (VL53L5CX_Platform *p_platform, uint16_t RegisterAddress, uint8_t *p_values, uint32_t size)
 Mandatory function used to read multiples bytes.
 
uint8_t WrMulti (VL53L5CX_Platform *p_platform, uint16_t RegisterAddress, uint8_t *p_values, uint32_t size)
 Mandatory function used to write multiples bytes.
 
uint8_t WaitMs (VL53L5CX_Platform *p_platform, uint32_t TimeMs)
 Mandatory function, used to wait during an amount of time. It must be filled as it's used into the API.
 
uint8_t vl53l5cx_set_VHV_repeat_count (uint32_t repeat_count)
 
uint8_t vl53l5cx_get_VHV_repeat_count (uint32_t *p_repeat_count)
 
uint8_t vl53l5cx_disable_internal_cp ()
 
uint8_t vl53l5cx_enable_internal_cp ()
 

Documentation des constructeurs et destructeur

◆ VL53L5CX()

VL53L5CX::VL53L5CX ( i2c_t * i2c)
inline

Constructor

Paramètres
[in]i2cdevice I2C to be used for communication
[in]lpn_pinpin to be used as component LPn
[in]i2c_rst_pinpin to be used as component I2C_RST

◆ ~VL53L5CX()

virtual VL53L5CX::~VL53L5CX ( )
inlinevirtual

Destructor

Documentation des fonctions membres

◆ _vl53l5cx_poll_for_answer()

uint8_t VL53L5CX::_vl53l5cx_poll_for_answer ( uint8_t size,
uint8_t pos,
uint16_t address,
uint8_t mask,
uint8_t expected_value )
protected

Inner function, not available outside this file. This function is used to wait for an answer from VL53L5CX sensor.

Copyright (c) 2021 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ init_sensor()

int VL53L5CX::init_sensor ( uint8_t addr = VL53L5CX_DEFAULT_I2C_ADDRESS)
inline

Initialize the sensor.

Paramètres
(uint8_t)addr : New I2C address.
Renvoie
(uint8_t) status : 0 if init_sensor is OK.
Voici le graphe d'appel pour cette fonction :

◆ RdByte()

uint8_t VL53L5CX::RdByte ( VL53L5CX_Platform * p_platform,
uint16_t RegisterAddress,
uint8_t * p_value )
protected
Paramètres
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of value to read.
(uint8_t)*p_values : Pointer of value to read.
Renvoie
(uint8_t) status : 0 if OK
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ RdMulti()

uint8_t VL53L5CX::RdMulti ( VL53L5CX_Platform * p_platform,
uint16_t RegisterAddress,
uint8_t * p_values,
uint32_t size )
protected

Mandatory function used to read multiples bytes.

Paramètres
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of values to read.
(uint8_t)*p_values : Buffer of bytes to read.
(uint32_t)size : Size of *p_values buffer.
Renvoie
(uint8_t) status : 0 if OK
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_check_data_ready()

uint8_t VL53L5CX::vl53l5cx_check_data_ready ( uint8_t * p_isReady)

This function checks if a new data is ready by polling I2C. If a new data is ready, a flag will be raised.

Paramètres
(uint8_t)*p_isReady : Value of this pointer be updated to 0 if data is not ready, or 1 if a new data is ready.
Renvoie
(uint8_t) status : 0 if I2C reading is OK
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_dci_read_data()

uint8_t VL53L5CX::vl53l5cx_dci_read_data ( uint8_t * data,
uint32_t index,
uint16_t data_size )

This function can be used to read 'extra data' from DCI. Using a known index, the function fills the casted structure passed in argument.

Paramètres
(uint8_t)*data : This field can be a casted structure, or a simple array. Please note that the FW only accept data of 32 bits. So field data can only have a size of 32, 64, 96, 128, bits ....
(uint32_t)index : Index of required value.
(uint16_t)*data_size: This field must be the structure or array size (using sizeof() function).
Renvoie
(uint8_t) status : 0 if OK
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_dci_replace_data()

uint8_t VL53L5CX::vl53l5cx_dci_replace_data ( uint8_t * data,
uint32_t index,
uint16_t data_size,
uint8_t * new_data,
uint16_t new_data_size,
uint16_t new_data_pos )
   @brief This function can be used to replace 'extra data' in DCI. The data can
   be simple data, or casted structure.
   @param (uint8_t) *data : This field can be a casted structure, or a simple
   array. Please note that the FW only accept data of 32 bits. So field data can
   only have a size of 32, 64, 96, 128, bits ..
   @param (uint32_t) index : Index of required value.
   @param (uint16_t)*data_size : This field must be the structure or array size
   (using sizeof() function).
   @param (uint8_t) *new_data : Contains the new fields.
   @param (uint16_t) new is

_po r_m ion tin st rt__data_size : New data size.

Paramètres
(uint16_t)new_data_pos : New data position into the buffer.
Renvoie
(uint8_t) status : 0 if OK
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_dci_write_data()

uint8_t VL53L5CX::vl53l5cx_dci_write_data ( uint8_t * data,
uint32_t index,
uint16_t data_size )

This function can be used to write 'extra data' to DCI. The data can be simple data, or casted structure.

Paramètres
(uint8_t)*data : This field can be a casted structure, or a simple array. Please note that the FW only accept data of 32 bits. So field data can only have a size of 32, 64, 96, 128, bits ..
(uint32_t)index : Index of required value.
(uint16_t)*data_size: This field must be the structure or array size (using sizeof() function).
Renvoie
(uint8_t) status : 0 if OK
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_get_integration_time_ms()

uint8_t VL53L5CX::vl53l5cx_get_integration_time_ms ( uint32_t * p_time_ms)

This function gets the current integration time in ms.

Paramètres
(uint32_t)*p_time_ms: Contains integration time in ms.
Renvoie
(uint8_t) status : 0 if integration time is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_get_power_mode()

uint8_t VL53L5CX::vl53l5cx_get_power_mode ( uint8_t * p_power_mode)

This function is used to get the current sensor power mode.

Paramètres
(uint8_t)*p_power_mode : Current power mode. The value of this pointer is equal to 0 if the sensor is in low power, (VL53L5CX_POWER_MODE_SLEEP), or 1 if sensor is in standard mode (VL53L5CX_POWER_MODE_WAKEUP).
Renvoie
(uint8_t) status : 0 if power mode is OK
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_get_ranging_data()

uint8_t VL53L5CX::vl53l5cx_get_ranging_data ( VL53L5CX_ResultsData * p_results)

This function gets the ranging data, using the selected output and the resolution.

Paramètres
(VL53L5CX_ResultsData)*p_results : VL53L5 results structure.
Renvoie
(uint8_t) status : 0 data are successfully get.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_get_ranging_frequency_hz()

uint8_t VL53L5CX::vl53l5cx_get_ranging_frequency_hz ( uint8_t * p_frequency_hz)

This function gets the current ranging frequency in Hz. Ranging frequency corresponds to the time between each measurement.

Paramètres
(uint8_t)*p_frequency_hz: Contains the ranging frequency in Hz.
Renvoie
(uint8_t) status : 0 if ranging frequency is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_get_ranging_mode()

uint8_t VL53L5CX::vl53l5cx_get_ranging_mode ( uint8_t * p_ranging_mode)

This function is used to get the ranging mode. Two modes are available using ULD : Continuous and autonomous. The default mode is Autonomous.

Paramètres
(uint8_t)*p_ranging_mode : current ranging mode
Renvoie
(uint8_t) status : 0 if get ranging mode is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_get_resolution()

uint8_t VL53L5CX::vl53l5cx_get_resolution ( uint8_t * p_resolution)

This function gets the current resolution (4x4 or 8x8).

Paramètres
(uint8_t)*p_resolution : Value of this pointer will be equal to 16 for 4x4 mode, and 64 for 8x8 mode.
Renvoie
(uint8_t) status : 0 if resolution is OK.
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_get_sharpener_percent()

uint8_t VL53L5CX::vl53l5cx_get_sharpener_percent ( uint8_t * p_sharpener_percent)

This function gets the current sharpener in percent. Sharpener can be changed to blur more or less zones depending of the application.

Paramètres
(uint32_t)*p_sharpener_percent: Contains the sharpener in percent.
Renvoie
(uint8_t) status : 0 if get sharpener is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_get_target_order()

uint8_t VL53L5CX::vl53l5cx_get_target_order ( uint8_t * p_target_order)

This function gets the current target order (closest or strongest).

Paramètres
(uint8_t)*p_target_order: Contains the target order.
Renvoie
(uint8_t) status : 0 if get target order is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_init()

uint8_t VL53L5CX::vl53l5cx_init ( )

Mandatory function used to initialize the sensor. This function must be called after a power on, to load the firmware into the VL53L5CX. It takes a few hundred milliseconds.

Renvoie
(uint8_t) status : 0 if initialization is OK.
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_is_alive()

uint8_t VL53L5CX::vl53l5cx_is_alive ( uint8_t * p_is_alive)

This function is used to check if the sensor is alive.

Paramètres
(uint8_t)*p_is_alive : 1 if the sensor is alive, 0 in case of error.
Renvoie
(uint8_t) status : 0 if is_alive is OK.
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_set_i2c_address()

uint8_t VL53L5CX::vl53l5cx_set_i2c_address ( uint16_t i2c_address)

This function is used to change the I2C address of the sensor. If multiple VL53L5 sensors are connected to the same I2C line, all other LPn pins needs to be set to Low. The default sensor address is 0x52.

Paramètres
(uint16_t)i2c_address : New I2C address.
Renvoie
(uint8_t) status : 0 if new address is OK
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ vl53l5cx_set_integration_time_ms()

uint8_t VL53L5CX::vl53l5cx_set_integration_time_ms ( uint32_t integration_time_ms)

This function sets a new integration time in ms. Integration time must be computed to be lower than the ranging period, for a selected resolution. Please note that this function has no impact on ranging mode continuous.

Paramètres
(uint32_t)time_ms : Contains the integration time in ms. For all resolutions and frequency, the minimum value is 2ms, and the maximum is 1000ms.
Renvoie
(uint8_t) status : 0 if set integration time is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_set_power_mode()

uint8_t VL53L5CX::vl53l5cx_set_power_mode ( uint8_t power_mode)

This function is used to set the sensor in Low Power mode, for example if the sensor is not used during a long time. The macro VL53L5CX_POWER_MODE_SLEEP can be used to enable the low power mode. When user want to restart the sensor, he can use macro VL53L5CX_POWER_MODE_WAKEUP. Please ensure that the device is not streaming before calling the function.

Paramètres
(uint8_t)power_mode : Selected power mode (VL53L5CX_POWER_MODE_SLEEP or VL53L5CX_POWER_MODE_WAKEUP)
Renvoie
(uint8_t) status : 0 if power mode is OK, or 127 if power mode requested by user is not valid.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_set_ranging_frequency_hz()

uint8_t VL53L5CX::vl53l5cx_set_ranging_frequency_hz ( uint8_t frequency_hz)

This function sets a new ranging frequency in Hz. Ranging frequency corresponds to the measurements frequency. This setting depends of the resolution, so please select your resolution before using this function.

Paramètres
(uint8_t)frequency_hz : Contains the ranging frequency in Hz.
  • For 4x4, min and max allowed values are : [1;60]
  • For 8x8, min and max allowed values are : [1;15]
Renvoie
(uint8_t) status : 0 if ranging frequency is OK, or 127 if the value is not correct.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_set_ranging_mode()

uint8_t VL53L5CX::vl53l5cx_set_ranging_mode ( uint8_t ranging_mode)

This function is used to set the ranging mode. Two modes are available using ULD : Continuous and autonomous. The default mode is Autonomous.

Paramètres
(uint8_t)ranging_mode : Use macros VL53L5CX_RANGING_MODE_CONTINUOUS, VL53L5CX_RANGING_MODE_CONTINUOUS.
Renvoie
(uint8_t) status : 0 if set ranging mode is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_set_resolution()

uint8_t VL53L5CX::vl53l5cx_set_resolution ( uint8_t resolution)

This function sets a new resolution (4x4 or 8x8).

Paramètres
(uint8_t)resolution : Use macro VL53L5CX_RESOLUTION_4X4 or VL53L5CX_RESOLUTION_8X8 to set the resolution.
Renvoie
(uint8_t) status : 0 if set resolution is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_set_sharpener_percent()

uint8_t VL53L5CX::vl53l5cx_set_sharpener_percent ( uint8_t sharpener_percent)

This function sets a new sharpener value in percent. Sharpener can be changed to blur more or less zones depending of the application. Min value is 0 (disabled), and max is 99.

Paramètres
(uint32_t)sharpener_percent : Value between 0 (disabled) and 99%.
Renvoie
(uint8_t) status : 0 if set sharpener is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_set_target_order()

uint8_t VL53L5CX::vl53l5cx_set_target_order ( uint8_t target_order)

This function sets a new target order. Please use macros VL53L5CX_TARGET_ORDER_STRONGEST and VL53L5CX_TARGET_ORDER_CLOSEST to define the new output order. By default, the sensor is configured with the strongest output.

Paramètres
(uint8_t)target_order : Required target order.
Renvoie
(uint8_t) status : 0 if set target order is OK, or 127 if target order is unknown.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_start_ranging()

uint8_t VL53L5CX::vl53l5cx_start_ranging ( )

This function starts a ranging session. When the sensor streams, host cannot change settings 'on-the-fly'.

Renvoie
(uint8_t) status : 0 if start is OK.
Voici le graphe d'appel pour cette fonction :

◆ vl53l5cx_stop_ranging()

uint8_t VL53L5CX::vl53l5cx_stop_ranging ( )

This function stops the ranging session. It must be used when the sensor streams, after calling vl53l5cx_start_ranging().

Renvoie
(uint8_t) status : 0 if stop is OK
Voici le graphe d'appel pour cette fonction :

◆ WaitMs()

uint8_t VL53L5CX::WaitMs ( VL53L5CX_Platform * p_platform,
uint32_t TimeMs )
protected

Mandatory function, used to wait during an amount of time. It must be filled as it's used into the API.

Paramètres
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint32_t)TimeMs : Time to wait in ms.
Renvoie
(uint8_t) status : 0 if wait is finished.
Voici le graphe des appelants de cette fonction :

◆ WrByte()

uint8_t VL53L5CX::WrByte ( VL53L5CX_Platform * p_platform,
uint16_t RegisterAddress,
uint8_t value )
protected

Mandatory function used to write one single byte.

Paramètres
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of value to read.
(uint8_t)value : Pointer of value to write.
Renvoie
(uint8_t) status : 0 if OK
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ WrMulti()

uint8_t VL53L5CX::WrMulti ( VL53L5CX_Platform * p_platform,
uint16_t RegisterAddress,
uint8_t * p_values,
uint32_t size )
protected

Mandatory function used to write multiples bytes.

Paramètres
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of values to write.
(uint8_t)*p_values : Buffer of bytes to write.
(uint32_t)size : Size of *p_values buffer.
Renvoie
(uint8_t) status : 0 if OK
Voici le graphe des appelants de cette fonction :

La documentation de cette classe a été générée à partir des fichiers suivants :