Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the source code of this file.
Functions | |
static uint8_t | _vl53l5cx_poll_for_answer (VL53L5CX_Configuration *p_dev, uint8_t size, uint8_t pos, uint16_t address, uint8_t mask, uint8_t expected_value) |
Copyright (c) 2021 STMicroelectronics. More... | |
static uint8_t | _vl53l5cx_poll_for_mcu_boot (VL53L5CX_Configuration *p_dev) |
static uint8_t | _vl53l5cx_send_offset_data (VL53L5CX_Configuration *p_dev, uint8_t resolution) |
Inner function, not available outside this file. More... | |
static uint8_t | _vl53l5cx_send_xtalk_data (VL53L5CX_Configuration *p_dev, uint8_t resolution) |
Inner function, not available outside this file. More... | |
uint8_t | vl53l5cx_is_alive (VL53L5CX_Configuration *p_dev, uint8_t *p_is_alive) |
uint8_t | vl53l5cx_init (VL53L5CX_Configuration *p_dev) |
Mandatory function used to initialize the sensor. More... | |
uint8_t | vl53l5cx_set_i2c_address (VL53L5CX_Configuration *p_dev, uint16_t i2c_address) |
This function is used to change the I2C address of the sensor. More... | |
uint8_t | vl53l5cx_get_power_mode (VL53L5CX_Configuration *p_dev, uint8_t *p_power_mode) |
This function is used to get the current sensor power mode. More... | |
uint8_t | vl53l5cx_set_power_mode (VL53L5CX_Configuration *p_dev, 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. More... | |
uint8_t | vl53l5cx_start_ranging (VL53L5CX_Configuration *p_dev) |
This function starts a ranging session. More... | |
uint8_t | vl53l5cx_stop_ranging (VL53L5CX_Configuration *p_dev) |
This function stops the ranging session. More... | |
uint8_t | vl53l5cx_check_data_ready (VL53L5CX_Configuration *p_dev, uint8_t *p_isReady) |
This function checks if a new data is ready by polling I2C. More... | |
uint8_t | vl53l5cx_get_ranging_data (VL53L5CX_Configuration *p_dev, VL53L5CX_ResultsData *p_results) |
This function gets the ranging data, using the selected output and the resolution. More... | |
uint8_t | vl53l5cx_get_resolution (VL53L5CX_Configuration *p_dev, uint8_t *p_resolution) |
This function gets the current resolution (4x4 or 8x8). More... | |
uint8_t | vl53l5cx_set_resolution (VL53L5CX_Configuration *p_dev, uint8_t resolution) |
This function sets a new resolution (4x4 or 8x8). More... | |
uint8_t | vl53l5cx_get_ranging_frequency_hz (VL53L5CX_Configuration *p_dev, uint8_t *p_frequency_hz) |
This function gets the current ranging frequency in Hz. More... | |
uint8_t | vl53l5cx_set_ranging_frequency_hz (VL53L5CX_Configuration *p_dev, uint8_t frequency_hz) |
This function sets a new ranging frequency in Hz. More... | |
uint8_t | vl53l5cx_get_integration_time_ms (VL53L5CX_Configuration *p_dev, uint32_t *p_time_ms) |
This function gets the current integration time in ms. More... | |
uint8_t | vl53l5cx_set_integration_time_ms (VL53L5CX_Configuration *p_dev, uint32_t integration_time_ms) |
This function sets a new integration time in ms. More... | |
uint8_t | vl53l5cx_get_sharpener_percent (VL53L5CX_Configuration *p_dev, uint8_t *p_sharpener_percent) |
This function gets the current sharpener in percent. More... | |
uint8_t | vl53l5cx_set_sharpener_percent (VL53L5CX_Configuration *p_dev, uint8_t sharpener_percent) |
This function sets a new sharpener value in percent. More... | |
uint8_t | vl53l5cx_get_target_order (VL53L5CX_Configuration *p_dev, uint8_t *p_target_order) |
This function gets the current target order (closest or strongest). More... | |
uint8_t | vl53l5cx_set_target_order (VL53L5CX_Configuration *p_dev, uint8_t target_order) |
This function sets a new target order. More... | |
uint8_t | vl53l5cx_get_ranging_mode (VL53L5CX_Configuration *p_dev, uint8_t *p_ranging_mode) |
This function is used to get the ranging mode. More... | |
uint8_t | vl53l5cx_set_ranging_mode (VL53L5CX_Configuration *p_dev, uint8_t ranging_mode) |
This function is used to set the ranging mode. More... | |
uint8_t | vl53l5cx_enable_internal_cp (VL53L5CX_Configuration *p_dev) |
This function is used to disable the VCSEL charge pump This optimizes the power consumption of the device To be used only if AVDD = 3.3V. More... | |
uint8_t | vl53l5cx_disable_internal_cp (VL53L5CX_Configuration *p_dev) |
This function is used to disable the VCSEL charge pump This optimizes the power consumption of the device To be used only if AVDD = 3.3V. More... | |
uint8_t | vl53l5cx_dci_read_data (VL53L5CX_Configuration *p_dev, uint8_t *data, uint32_t index, uint16_t data_size) |
This function can be used to read 'extra data' from DCI. More... | |
uint8_t | vl53l5cx_dci_write_data (VL53L5CX_Configuration *p_dev, uint8_t *data, uint32_t index, uint16_t data_size) |
This function can be used to write 'extra data' to DCI. More... | |
uint8_t | vl53l5cx_dci_replace_data (VL53L5CX_Configuration *p_dev, uint8_t *data, uint32_t index, uint16_t data_size, uint8_t *new_data, uint16_t new_data_size, uint16_t new_data_pos) |
This function can be used to replace 'extra data' in DCI. More... | |
|
static |
Copyright (c) 2021 STMicroelectronics.
All rights reserved.
This software component is provided to you as part of a software package and applicable license terms are in the Package_license file. If you received this software component outside of a package or without applicable license terms, the terms of the BSD-3-Clause license shall apply. You may obtain a copy of the BSD-3-Clause at: https://opensource.org/licenses/BSD-3-Clause
Inner function, not available outside this file. This function is used to wait for an answer from VL53L5CX sensor.
Definition at line 27 of file vl53l5cx_api.c.
References VL53L5CX_Configuration::platform, RdMulti(), status, VL53L5CX_Configuration::temp_buffer, timeout, VL53L5CX_MCU_ERROR, VL53L5CX_STATUS_OK, VL53L5CX_STATUS_TIMEOUT_ERROR, and WaitMs().
Referenced by _vl53l5cx_send_offset_data(), _vl53l5cx_send_xtalk_data(), vl53l5cx_dci_read_data(), vl53l5cx_dci_write_data(), vl53l5cx_init(), vl53l5cx_set_power_mode(), and vl53l5cx_start_ranging().
|
static |
Definition at line 66 of file vl53l5cx_api.c.
References VL53L5CX_Configuration::platform, RdByte(), status, timeout, VL53L5CX_STATUS_OK, and WaitMs().
Referenced by vl53l5cx_init().
|
static |
Inner function, not available outside this file.
This function is used to set the offset data gathered from NVM.
Definition at line 96 of file vl53l5cx_api.c.
References _vl53l5cx_poll_for_answer(), VL53L5CX_Configuration::offset_data, VL53L5CX_Configuration::platform, status, SwapBuffer(), VL53L5CX_Configuration::temp_buffer, VL53L5CX_OFFSET_BUFFER_SIZE, VL53L5CX_RESOLUTION_4X4, VL53L5CX_STATUS_OK, VL53L5CX_UI_CMD_STATUS, and WrMulti().
Referenced by vl53l5cx_init(), and vl53l5cx_set_resolution().
|
static |
Inner function, not available outside this file.
This function is used to set the Xtalk data from generic configuration, or user's calibration.
Definition at line 166 of file vl53l5cx_api.c.
References _vl53l5cx_poll_for_answer(), VL53L5CX_Configuration::platform, status, SwapBuffer(), VL53L5CX_Configuration::temp_buffer, VL53L5CX_RESOLUTION_4X4, VL53L5CX_STATUS_OK, VL53L5CX_UI_CMD_STATUS, VL53L5CX_XTALK_BUFFER_SIZE, WrMulti(), and VL53L5CX_Configuration::xtalk_data.
Referenced by vl53l5cx_init(), and vl53l5cx_set_resolution().
uint8_t vl53l5cx_check_data_ready | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(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. |
Definition at line 681 of file vl53l5cx_api.c.
References VL53L5CX_Configuration::platform, RdMulti(), status, VL53L5CX_Configuration::streamcount, VL53L5CX_Configuration::temp_buffer, and VL53L5CX_STATUS_OK.
Referenced by thd_lidar_vl53l5cx().
uint8_t vl53l5cx_dci_read_data | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(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). |
Definition at line 1194 of file vl53l5cx_api.c.
References _vl53l5cx_poll_for_answer(), VL53L5CX_Configuration::platform, RdMulti(), status, SwapBuffer(), VL53L5CX_Configuration::temp_buffer, VL53L5CX_STATUS_ERROR, VL53L5CX_STATUS_OK, VL53L5CX_TEMPORARY_BUFFER_SIZE, VL53L5CX_UI_CMD_END, VL53L5CX_UI_CMD_START, VL53L5CX_UI_CMD_STATUS, and WrMulti().
Referenced by vl53l5cx_dci_replace_data(), vl53l5cx_get_integration_time_ms(), vl53l5cx_get_ranging_frequency_hz(), vl53l5cx_get_ranging_mode(), vl53l5cx_get_resolution(), vl53l5cx_get_sharpener_percent(), vl53l5cx_get_target_order(), vl53l5cx_set_ranging_mode(), vl53l5cx_set_resolution(), and vl53l5cx_start_ranging().
uint8_t vl53l5cx_dci_replace_data | ( | VL53L5CX_Configuration * | p_dev, |
uint8_t * | data, | ||
uint32_t | index, | ||
uint16_t | data_size, | ||
uint8_t * | new_data, | ||
uint16_t | new_data_size, | ||
uint16_t | new_data_pos | ||
) |
This function can be used to replace 'extra data' in DCI.
The data can be simple data, or casted structure.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(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). |
(uint8_t) | *new_data : Contains the new fields. |
(uint16_t) | new_data_size : New data size. |
(uint16_t) | new_data_pos : New data position into the buffer. |
Definition at line 1295 of file vl53l5cx_api.c.
References status, vl53l5cx_dci_read_data(), vl53l5cx_dci_write_data(), and VL53L5CX_STATUS_OK.
Referenced by vl53l5cx_disable_internal_cp(), vl53l5cx_enable_internal_cp(), vl53l5cx_init(), vl53l5cx_set_integration_time_ms(), vl53l5cx_set_ranging_frequency_hz(), vl53l5cx_set_sharpener_percent(), and vl53l5cx_set_target_order().
uint8_t vl53l5cx_dci_write_data | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(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). |
Definition at line 1240 of file vl53l5cx_api.c.
References _vl53l5cx_poll_for_answer(), VL53L5CX_Configuration::platform, status, SwapBuffer(), VL53L5CX_Configuration::temp_buffer, VL53L5CX_STATUS_ERROR, VL53L5CX_STATUS_OK, VL53L5CX_TEMPORARY_BUFFER_SIZE, VL53L5CX_UI_CMD_END, VL53L5CX_UI_CMD_STATUS, and WrMulti().
Referenced by vl53l5cx_dci_replace_data(), vl53l5cx_init(), vl53l5cx_set_ranging_mode(), vl53l5cx_set_resolution(), and vl53l5cx_start_ranging().
uint8_t vl53l5cx_disable_internal_cp | ( | VL53L5CX_Configuration * | p_dev | ) |
This function is used to disable the VCSEL charge pump This optimizes the power consumption of the device To be used only if AVDD = 3.3V.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
Definition at line 1176 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_INTERNAL_CP, vl53l5cx_dci_replace_data(), and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_enable_internal_cp | ( | VL53L5CX_Configuration * | p_dev | ) |
This function is used to disable the VCSEL charge pump This optimizes the power consumption of the device To be used only if AVDD = 3.3V.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
Definition at line 1158 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_INTERNAL_CP, vl53l5cx_dci_replace_data(), and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_get_integration_time_ms | ( | VL53L5CX_Configuration * | p_dev, |
uint32_t * | p_time_ms | ||
) |
This function gets the current integration time in ms.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint32_t) | *p_time_ms: Contains integration time in ms. |
Definition at line 989 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_INT_TIME, vl53l5cx_dci_read_data(), and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_get_power_mode | ( | VL53L5CX_Configuration * | p_dev, |
uint8_t * | p_power_mode | ||
) |
This function is used to get the current sensor power mode.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(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). |
Definition at line 426 of file vl53l5cx_api.c.
References VL53L5CX_Configuration::platform, RdByte(), status, VL53L5CX_POWER_MODE_SLEEP, VL53L5CX_POWER_MODE_WAKEUP, VL53L5CX_STATUS_ERROR, VL53L5CX_STATUS_OK, and WrByte().
Referenced by vl53l5cx_set_power_mode().
uint8_t vl53l5cx_get_ranging_data | ( | VL53L5CX_Configuration * | p_dev, |
VL53L5CX_ResultsData * | p_results | ||
) |
This function gets the ranging data, using the selected output and the resolution.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(VL53L5CX_ResultsData) | *p_results : VL53L5 results structure. |
Definition at line 712 of file vl53l5cx_api.c.
References VL53L5CX_ResultsData::ambient_per_spad, VL53L5CX_Configuration::data_read_size, VL53L5CX_ResultsData::distance_mm, VL53L5CX_ResultsData::motion_indicator, VL53L5CX_ResultsData::nb_spads_enabled, VL53L5CX_ResultsData::nb_target_detected, VL53L5CX_Configuration::platform, VL53L5CX_ResultsData::range_sigma_mm, RdMulti(), VL53L5CX_ResultsData::reflectance, VL53L5CX_ResultsData::signal_per_spad, VL53L5CX_ResultsData::silicon_temp_degc, status, VL53L5CX_Configuration::streamcount, SwapBuffer(), VL53L5CX_ResultsData::target_status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_AMBIENT_RATE_IDX, VL53L5CX_DISTANCE_IDX, VL53L5CX_METADATA_IDX, VL53L5CX_MOTION_DETEC_IDX, VL53L5CX_NB_TARGET_DETECTED_IDX, VL53L5CX_NB_TARGET_PER_ZONE, VL53L5CX_RANGE_SIGMA_MM_IDX, VL53L5CX_REFLECTANCE_EST_PC_IDX, VL53L5CX_RESOLUTION_8X8, VL53L5CX_SIGNAL_RATE_IDX, VL53L5CX_SPAD_COUNT_IDX, VL53L5CX_STATUS_CORRUPTED_FRAME, VL53L5CX_STATUS_OK, and VL53L5CX_TARGET_STATUS_IDX.
Referenced by thd_lidar_vl53l5cx().
uint8_t vl53l5cx_get_ranging_frequency_hz | ( | VL53L5CX_Configuration * | p_dev, |
uint8_t * | p_frequency_hz | ||
) |
This function gets the current ranging frequency in Hz.
Ranging frequency corresponds to the time between each measurement.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | *p_frequency_hz: Contains the ranging frequency in Hz. |
Definition at line 963 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_FREQ_HZ, vl53l5cx_dci_read_data(), and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_get_ranging_mode | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | *p_ranging_mode : current ranging mode |
Definition at line 1098 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_RANGING_MODE, vl53l5cx_dci_read_data(), VL53L5CX_RANGING_MODE_AUTONOMOUS, VL53L5CX_RANGING_MODE_CONTINUOUS, and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_get_resolution | ( | VL53L5CX_Configuration * | p_dev, |
uint8_t * | p_resolution | ||
) |
This function gets the current resolution (4x4 or 8x8).
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | *p_resolution : Value of this pointer will be equal to 16 for 4x4 mode, and 64 for 8x8 mode. |
Definition at line 883 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, vl53l5cx_dci_read_data(), VL53L5CX_DCI_ZONE_CONFIG, and VL53L5CX_STATUS_OK.
Referenced by vl53l5cx_start_ranging().
uint8_t vl53l5cx_get_sharpener_percent | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint32_t) | *p_sharpener_percent: Contains the sharpener in percent. |
Definition at line 1028 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, vl53l5cx_dci_read_data(), VL53L5CX_DCI_SHARPENER, and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_get_target_order | ( | VL53L5CX_Configuration * | p_dev, |
uint8_t * | p_target_order | ||
) |
This function gets the current target order (closest or strongest).
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | *p_target_order: Contains the target order. |
Definition at line 1065 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, vl53l5cx_dci_read_data(), VL53L5CX_DCI_TARGET_ORDER, and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_init | ( | VL53L5CX_Configuration * | p_dev | ) |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
Definition at line 245 of file vl53l5cx_api.c.
References _vl53l5cx_poll_for_answer(), _vl53l5cx_poll_for_mcu_boot(), _vl53l5cx_send_offset_data(), _vl53l5cx_send_xtalk_data(), VL53L5CX_Configuration::default_configuration, VL53L5CX_Configuration::default_xtalk, VL53L5CX_Configuration::is_auto_stop_enabled, VL53L5CX_Configuration::offset_data, VL53L5CX_Configuration::platform, RdByte(), RdMulti(), status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_FW_NB_TARGET, VL53L5CX_DCI_PIPE_CONTROL, vl53l5cx_dci_replace_data(), VL53L5CX_DCI_SINGLE_RANGE, vl53l5cx_dci_write_data(), VL53L5CX_DEFAULT_CONFIGURATION, VL53L5CX_DEFAULT_XTALK, VL53L5CX_FIRMWARE, VL53L5CX_GET_NVM_CMD, VL53L5CX_GLARE_FILTER, VL53L5CX_NB_TARGET_PER_ZONE, VL53L5CX_NVM_DATA_SIZE, VL53L5CX_OFFSET_BUFFER_SIZE, VL53L5CX_RESOLUTION_4X4, VL53L5CX_STATUS_OK, VL53L5CX_UI_CMD_START, VL53L5CX_UI_CMD_STATUS, VL53L5CX_XTALK_BUFFER_SIZE, WaitMs(), WrByte(), WrMulti(), and VL53L5CX_Configuration::xtalk_data.
Referenced by thd_lidar_vl53l5cx().
uint8_t vl53l5cx_is_alive | ( | VL53L5CX_Configuration * | p_dev, |
uint8_t * | p_is_alive | ||
) |
Definition at line 221 of file vl53l5cx_api.c.
References VL53L5CX_Configuration::platform, RdByte(), status, VL53L5CX_STATUS_OK, and WrByte().
Referenced by thd_lidar_vl53l5cx().
uint8_t vl53l5cx_set_i2c_address | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint16_t) | i2c_address : New I2C address. |
Definition at line 412 of file vl53l5cx_api.c.
References VL53L5CX_Platform::address, VL53L5CX_Configuration::platform, status, VL53L5CX_STATUS_OK, and WrByte().
uint8_t vl53l5cx_set_integration_time_ms | ( | VL53L5CX_Configuration * | p_dev, |
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 continous.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(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. |
Definition at line 1004 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_INT_TIME, vl53l5cx_dci_replace_data(), VL53L5CX_STATUS_INVALID_PARAM, and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_set_power_mode | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | power_mode : Selected power mode (VL53L5CX_POWER_MODE_SLEEP or VL53L5CX_POWER_MODE_WAKEUP) |
Definition at line 455 of file vl53l5cx_api.c.
References _vl53l5cx_poll_for_answer(), VL53L5CX_Configuration::platform, status, vl53l5cx_get_power_mode(), VL53L5CX_POWER_MODE_SLEEP, VL53L5CX_POWER_MODE_WAKEUP, VL53L5CX_STATUS_ERROR, VL53L5CX_STATUS_OK, and WrByte().
uint8_t vl53l5cx_set_ranging_frequency_hz | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | frequency_hz : Contains the ranging frequency in Hz.
|
Definition at line 976 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_FREQ_HZ, vl53l5cx_dci_replace_data(), and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_set_ranging_mode | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | ranging_mode : Use macros VL53L5CX_RANGING_MODE_CONTINUOUS, VL53L5CX_RANGING_MODE_CONTINUOUS. |
Definition at line 1119 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_RANGING_MODE, vl53l5cx_dci_read_data(), VL53L5CX_DCI_SINGLE_RANGE, vl53l5cx_dci_write_data(), VL53L5CX_RANGING_MODE_AUTONOMOUS, VL53L5CX_RANGING_MODE_CONTINUOUS, VL53L5CX_STATUS_INVALID_PARAM, and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_set_resolution | ( | VL53L5CX_Configuration * | p_dev, |
uint8_t | resolution | ||
) |
This function sets a new resolution (4x4 or 8x8).
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | resolution : Use macro VL53L5CX_RESOLUTION_4X4 or VL53L5CX_RESOLUTION_8X8 to set the resolution. |
Definition at line 898 of file vl53l5cx_api.c.
References _vl53l5cx_send_offset_data(), _vl53l5cx_send_xtalk_data(), status, VL53L5CX_Configuration::temp_buffer, VL53L5CX_DCI_DSS_CONFIG, vl53l5cx_dci_read_data(), vl53l5cx_dci_write_data(), VL53L5CX_DCI_ZONE_CONFIG, VL53L5CX_RESOLUTION_4X4, VL53L5CX_RESOLUTION_8X8, VL53L5CX_STATUS_INVALID_PARAM, and VL53L5CX_STATUS_OK.
Referenced by thd_lidar_vl53l5cx().
uint8_t vl53l5cx_set_sharpener_percent | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint32_t) | sharpener_percent : Value between 0 (disabled) and 99%. |
Definition at line 1043 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, vl53l5cx_dci_replace_data(), VL53L5CX_DCI_SHARPENER, VL53L5CX_STATUS_INVALID_PARAM, and VL53L5CX_STATUS_OK.
uint8_t vl53l5cx_set_target_order | ( | VL53L5CX_Configuration * | p_dev, |
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.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
(uint8_t) | target_order : Required target order. |
Definition at line 1078 of file vl53l5cx_api.c.
References status, VL53L5CX_Configuration::temp_buffer, vl53l5cx_dci_replace_data(), VL53L5CX_DCI_TARGET_ORDER, VL53L5CX_STATUS_INVALID_PARAM, VL53L5CX_STATUS_OK, VL53L5CX_TARGET_ORDER_CLOSEST, and VL53L5CX_TARGET_ORDER_STRONGEST.
uint8_t vl53l5cx_start_ranging | ( | VL53L5CX_Configuration * | p_dev | ) |
This function starts a ranging session.
When the sensor streams, host cannot change settings 'on-the-fly'.
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
Definition at line 490 of file vl53l5cx_api.c.
References _vl53l5cx_poll_for_answer(), VL53L5CX_Configuration::data_read_size, VL53L5CX_Configuration::platform, status, VL53L5CX_Configuration::streamcount, VL53L5CX_Configuration::temp_buffer, VL53L5CX_AMBIENT_RATE_BH, VL53L5CX_COMMONDATA_BH, VL53L5CX_DCI_OUTPUT_CONFIG, VL53L5CX_DCI_OUTPUT_ENABLES, VL53L5CX_DCI_OUTPUT_LIST, vl53l5cx_dci_read_data(), vl53l5cx_dci_write_data(), VL53L5CX_DISTANCE_BH, vl53l5cx_get_resolution(), VL53L5CX_METADATA_BH, VL53L5CX_MOTION_DETECT_BH, VL53L5CX_NB_TARGET_DETECTED_BH, VL53L5CX_NB_TARGET_PER_ZONE, VL53L5CX_RANGE_SIGMA_MM_BH, VL53L5CX_REFLECTANCE_BH, VL53L5CX_SIGNAL_RATE_BH, VL53L5CX_SPAD_COUNT_BH, VL53L5CX_START_BH, VL53L5CX_STATUS_ERROR, VL53L5CX_STATUS_OK, VL53L5CX_TARGET_STATUS_BH, VL53L5CX_UI_CMD_END, VL53L5CX_UI_CMD_STATUS, WrByte(), and WrMulti().
Referenced by thd_lidar_vl53l5cx().
uint8_t vl53l5cx_stop_ranging | ( | VL53L5CX_Configuration * | p_dev | ) |
This function stops the ranging session.
It must be used when the sensor streams, after calling vl53l5cx_start_ranging().
(VL53L5CX_Configuration) | *p_dev : VL53L5CX configuration structure. |
Definition at line 627 of file vl53l5cx_api.c.
References VL53L5CX_Configuration::is_auto_stop_enabled, VL53L5CX_Configuration::platform, RdByte(), RdMulti(), status, timeout, VL53L5CX_STATUS_OK, WaitMs(), and WrByte().