vl53l1_api_core.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2017, STMicroelectronics - All Rights Reserved
3 *
4 * This file is part of VL53L1 Core and is dual licensed,
5 * either 'STMicroelectronics
6 * Proprietary license'
7 * or 'BSD 3-clause "New" or "Revised" License' , at your option.
8 *
9 ********************************************************************************
10 *
11 * 'STMicroelectronics Proprietary license'
12 *
13 ********************************************************************************
14 *
15 * License terms: STMicroelectronics Proprietary in accordance with licensing
16 * terms at www.st.com/sla0081
17 *
18 * STMicroelectronics confidential
19 * Reproduction and Communication of this document is strictly prohibited unless
20 * specifically authorized in writing by STMicroelectronics.
21 *
22 *
23 ********************************************************************************
24 *
25 * Alternatively, VL53L1 Core may be distributed under the terms of
26 * 'BSD 3-clause "New" or "Revised" License', in which case the following
27 * provisions apply instead of the ones mentioned above :
28 *
29 ********************************************************************************
30 *
31 * License terms: BSD 3-clause "New" or "Revised" License.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions are met:
35 *
36 * 1. Redistributions of source code must retain the above copyright notice, this
37 * list of conditions and the following disclaimer.
38 *
39 * 2. Redistributions in binary form must reproduce the above copyright notice,
40 * this list of conditions and the following disclaimer in the documentation
41 * and/or other materials provided with the distribution.
42 *
43 * 3. Neither the name of the copyright holder nor the names of its contributors
44 * may be used to endorse or promote products derived from this software
45 * without specific prior written permission.
46 *
47 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
48 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
50 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
51 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
53 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
54 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
55 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
56 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 *
58 *
59 ********************************************************************************
60 *
61 */
62 
69 #ifndef _VL53L1_API_CORE_H_
70 #define _VL53L1_API_CORE_H_
71 
72 #include "vl53l1_platform.h"
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
78 
88 #ifdef VL53L1_DEBUG
89 VL53L1_Error VL53L1_get_version(
90  VL53L1_DEV Dev,
91  VL53L1_ll_version_t *pversion);
92 
102 VL53L1_Error VL53L1_get_device_firmware_version(
103  VL53L1_DEV Dev,
104  uint16_t *pfw_version);
105 #endif
106 
107 
122  VL53L1_DEV Dev,
123  uint8_t read_p2p_data);
124 
125 
141  VL53L1_DEV Dev);
142 
143 
155  VL53L1_DEV Dev);
156 
157 
175  VL53L1_DEV Dev,
176  VL53L1_calibration_data_t *pcal_data);
177 
178 
193  VL53L1_DEV Dev,
194  VL53L1_calibration_data_t *pcal_data);
195 
196 
210 #ifdef VL53L1_DEBUG
211 VL53L1_Error VL53L1_get_tuning_debug_data(
212  VL53L1_DEV Dev,
213  VL53L1_tuning_parameters_t *ptun_data);
214 #endif
215 
216 
230  VL53L1_DEV Dev,
231  uint32_t inter_measurement_period_ms);
232 
233 
247  VL53L1_DEV Dev,
248  uint32_t *pinter_measurement_period_ms);
249 
250 
267  VL53L1_DEV Dev,
268  uint32_t phasecal_config_timeout_us,
269  uint32_t mm_config_timeout_us,
270  uint32_t range_config_timeout_us);
271 
272 
289  VL53L1_DEV Dev,
290  uint32_t *pphasecal_config_timeout_us,
291  uint32_t *pmm_config_timeout_us,
292  uint32_t *prange_config_timeout_us);
293 
294 
315  VL53L1_DEV Dev,
316  uint16_t cal_config__repeat_period);
317 
318 
330  VL53L1_DEV Dev,
331  uint16_t *pcal_config__repeat_period);
332 
333 
346  VL53L1_DEV Dev,
348  uint8_t value);
349 
350 
363  VL53L1_DEV Dev,
365  uint8_t *pvalue);
366 
367 
379  VL53L1_DEV Dev,
380  VL53L1_DeviceInterruptPolarity interrupt_polarity);
381 
382 
394  VL53L1_DEV Dev,
395  VL53L1_DeviceInterruptPolarity *pinterrupt_polarity);
396 
407 #ifndef VL53L1_NOCALIB
409  VL53L1_DEV Dev,
411 #endif
412 
423 #ifndef VL53L1_NOCALIB
425  VL53L1_DEV Dev,
427 #endif
428 
442  VL53L1_DEV Dev,
443  uint8_t range_ignore_thresh_mult,
444  uint16_t range_ignore_threshold_mcps);
445 
467  VL53L1_DEV Dev,
468  uint8_t *prange_ignore_thresh_mult,
469  uint16_t *prange_ignore_threshold_mcps_internal,
470  uint16_t *prange_ignore_threshold_mcps_current);
471 
472 
484  VL53L1_DEV Dev,
485  VL53L1_user_zone_t *puser_zone);
486 
487 
499  VL53L1_DEV Dev,
500  VL53L1_user_zone_t *puser_zone);
501 
502 
514  VL53L1_DEV Dev,
515  VL53L1_user_zone_t *pmm_roi);
516 
517 
549  VL53L1_DEV Dev,
550  VL53L1_DevicePresetModes device_preset_mode,
551  uint16_t dss_config__target_total_rate_mcps,
552  uint32_t phasecal_config_timeout_us,
553  uint32_t mm_config_timeout_us,
554  uint32_t range_config_timeout_us,
555  uint32_t inter_measurement_period_ms);
556 
557 
575  VL53L1_DEV Dev,
576  VL53L1_DevicePresetModes device_preset_mode,
577  uint16_t *pdss_config__target_total_rate_mcps,
578  uint32_t *pphasecal_config_timeout_us,
579  uint32_t *pmm_config_timeout_us,
580  uint32_t *prange_config_timeout_us);
581 
595  VL53L1_DEV Dev);
596 
610  VL53L1_DEV Dev);
611 
612 
625  VL53L1_DEV Dev,
626  uint8_t *pcrosstalk_compensation_enable);
627 
672  VL53L1_DEV Dev,
673  uint8_t measurement_mode,
674  VL53L1_DeviceConfigLevel device_config_level);
675 
676 
688  VL53L1_DEV Dev);
689 
690 
717  VL53L1_DEV Dev,
718  VL53L1_DeviceResultsLevel device_result_level);
719 
720 
747  VL53L1_DEV Dev,
748  VL53L1_DeviceResultsLevel device_result_level,
749  VL53L1_range_results_t *prange_results);
750 
751 
778  VL53L1_DEV Dev,
779  uint8_t measurement_mode);
780 
781 
792  int32_t gain_factor,
794  VL53L1_core_results_t *pcore,
795  VL53L1_range_results_t *presults);
796 
813  VL53L1_DEV Dev,
814  VL53L1_GPIO_Interrupt_Mode intr_mode_distance,
815  VL53L1_GPIO_Interrupt_Mode intr_mode_rate,
816  uint8_t intr_new_measure_ready,
817  uint8_t intr_no_target,
818  uint8_t intr_combined_mode,
819  uint16_t thresh_distance_high,
820  uint16_t thresh_distance_low,
821  uint16_t thresh_rate_high,
822  uint16_t thresh_rate_low
823  );
824 
833  VL53L1_DEV Dev,
835 
845  VL53L1_DEV Dev,
847 
859  VL53L1_DEV Dev,
860  VL53L1_OffsetCalibrationMode offset_cal_mode);
861 
862 
874  VL53L1_DEV Dev,
875  VL53L1_OffsetCalibrationMode *poffset_cal_mode);
876 
877 
889  VL53L1_DEV Dev,
890  VL53L1_OffsetCalibrationMode offset_cor_mode);
891 
892 
904  VL53L1_DEV Dev,
905  VL53L1_OffsetCorrectionMode *poffset_cor_mode);
906 
920  VL53L1_DEV Dev,
921  int16_t *pxtalk_margin);
922 
936  VL53L1_DEV Dev,
937  int16_t xtalk_margin);
938 
957  VL53L1_DEV Dev,
958  uint16_t *plite_mincountrate);
959 
960 
979  VL53L1_DEV Dev,
980  uint16_t lite_mincountrate);
981 
982 
1002  VL53L1_DEV Dev,
1003  uint16_t *plite_sigma);
1004 
1005 
1024  VL53L1_DEV Dev,
1025  uint16_t lite_sigma);
1026 
1027 
1044  VL53L1_DEV Dev);
1045 
1062  VL53L1_DEV Dev,
1063  uint8_t vhv_init_en,
1064  uint8_t vhv_init_value);
1065 
1082  VL53L1_DEV Dev,
1083  uint8_t *pvhv_init_en,
1084  uint8_t *pvhv_init_value);
1085 
1103  VL53L1_DEV Dev,
1104  uint8_t vhv_loopbound);
1105 
1123  VL53L1_DEV Dev,
1124  uint8_t *pvhv_loopbound);
1125 
1148  VL53L1_DEV Dev,
1149  VL53L1_TuningParms tuning_parm_key,
1150  int32_t *ptuning_parm_value);
1151 
1174  VL53L1_DEV Dev,
1175  VL53L1_TuningParms tuning_parm_key,
1176  int32_t tuning_parm_value);
1177 
1178 
1179 #ifdef __cplusplus
1180 }
1181 #endif
1182 
1183 #endif /* _VL53L1_API_CORE_H_ */
VL53L1_Error VL53L1_set_refspadchar_config_struct(VL53L1_DEV Dev, VL53L1_refspadchar_config_t *pdata)
Extract the Ref spad char cfg struct from pdev.
VL53L1_Error VL53L1_get_offset_correction_mode(VL53L1_DEV Dev, VL53L1_OffsetCorrectionMode *poffset_cor_mode)
Get function for offset correction mode.
Reference SPAD Characterization (RefSpadChar) Config.
VL53L1_Error VL53L1_software_reset(VL53L1_DEV Dev)
Performs device software reset and then waits for the firmware to finish booting. ...
VL53L1_Error VL53L1_set_tuning_parm(VL53L1_DEV Dev, VL53L1_TuningParms tuning_parm_key, int32_t tuning_parm_value)
Generic Tuning Parameter set function.
VL53L1_Error VL53L1_get_user_zone(VL53L1_DEV Dev, VL53L1_user_zone_t *puser_zone)
Gets the current user zone (ROI) configuration structure data.
void VL53L1_copy_sys_and_core_results_to_range_results(int32_t gain_factor, VL53L1_system_results_t *psys, VL53L1_core_results_t *pcore, VL53L1_range_results_t *presults)
Copies system and core results to range results data structure.
VL53L1_Error VL53L1_get_lite_sigma_threshold(VL53L1_DEV Dev, uint16_t *plite_sigma)
Get function for Lite Mode Max Sigma Threshold parameter, used to filter and validate ranges based on...
VL53L1_Error VL53L1_get_measurement_results(VL53L1_DEV Dev, VL53L1_DeviceResultsLevel device_result_level)
Get range measurement result data.
VL53L1_Error VL53L1_set_lite_min_count_rate(VL53L1_DEV Dev, uint16_t lite_mincountrate)
Set function for Lite Mode Minimum Count Rate parameter, used to filter and validate ranges based on ...
VL53L1_Error VL53L1_set_user_zone(VL53L1_DEV Dev, VL53L1_user_zone_t *puser_zone)
Sets the current user Zone (ROI) configuration structure data.
uint8_t VL53L1_DeviceConfigLevel
VL53L1_Error VL53L1_get_lite_xtalk_margin_kcps(VL53L1_DEV Dev, int16_t *pxtalk_margin)
Get function for Xtalk Margin setting Histogram Mode version.
VL53L1_Error VL53L1_read_p2p_data(VL53L1_DEV Dev)
For C-API one time initialization only reads device G02 registers containing data copied from NVM...
VL53L1_Error VL53L1_set_inter_measurement_period_ms(VL53L1_DEV Dev, uint32_t inter_measurement_period_ms)
Gets the tuning parm part to part data.
VL53L1_Error VL53L1_init_and_start_range(VL53L1_DEV Dev, uint8_t measurement_mode, VL53L1_DeviceConfigLevel device_config_level)
Builds and sends the I2C buffer to initialize the device and start a range measurement.
short int16_t
Typedef defining 16 bit short type. The developer should modify this to suit the platform being deplo...
Definition: vl53l1_types.h:128
VL53L1_Error VL53L1_get_timeouts_us(VL53L1_DEV Dev, uint32_t *pphasecal_config_timeout_us, uint32_t *pmm_config_timeout_us, uint32_t *prange_config_timeout_us)
Gets the phasecal, mode mitigation and ranging timeouts for the VL53L1_timing_config_t structure...
VL53L1_Error VL53L1_set_offset_correction_mode(VL53L1_DEV Dev, VL53L1_OffsetCalibrationMode offset_cor_mode)
Set function for offset correction mode.
int8_t VL53L1_Error
Defines User Zone(ROI) parameters.
VL53L1_Error VL53L1_enable_xtalk_compensation(VL53L1_DEV Dev)
Simple function to enable xtalk compensation.
VL53L1_Error VL53L1_get_inter_measurement_period_ms(VL53L1_DEV Dev, uint32_t *pinter_measurement_period_ms)
Gets inter measurement period from the VL53L1_timing_config_t structure.
VL53L1_Error VL53L1_get_sequence_config_bit(VL53L1_DEV Dev, VL53L1_DeviceSequenceConfig bit_id, uint8_t *pvalue)
Get system sequence config bit value.
VL53L1_Error VL53L1_data_init(VL53L1_DEV Dev, uint8_t read_p2p_data)
Get LL Driver version information.
VL53L1_Error VL53L1_get_interrupt_polarity(VL53L1_DEV Dev, VL53L1_DeviceInterruptPolarity *pinterrupt_polarity)
Get the interrupt polarity bit state.
VL53L1_Error VL53L1_get_vhv_loopbound(VL53L1_DEV Dev, uint8_t *pvhv_loopbound)
Get function for VHV loopbound config.
VL53L1_Error VL53L1_get_GPIO_interrupt_config(VL53L1_DEV Dev, VL53L1_GPIO_interrupt_config_t *pintconf)
Retrieves the GPIO interrupt config structure currently programmed into the API.
VL53L1_Error VL53L1_set_preset_mode(VL53L1_DEV Dev, VL53L1_DevicePresetModes device_preset_mode, uint16_t dss_config__target_total_rate_mcps, uint32_t phasecal_config_timeout_us, uint32_t mm_config_timeout_us, uint32_t range_config_timeout_us, uint32_t inter_measurement_period_ms)
Initialises the configuration data structures for the selected preset mode.
VL53L1_Error VL53L1_clear_interrupt_and_enable_next_range(VL53L1_DEV Dev, uint8_t measurement_mode)
Sends the ranging handshake to clear the interrupt allow the device to move onto the next range...
VL53L1_Error VL53L1_set_GPIO_interrupt_config(VL53L1_DEV Dev, VL53L1_GPIO_Interrupt_Mode intr_mode_distance, VL53L1_GPIO_Interrupt_Mode intr_mode_rate, uint8_t intr_new_measure_ready, uint8_t intr_no_target, uint8_t intr_combined_mode, uint16_t thresh_distance_high, uint16_t thresh_distance_low, uint16_t thresh_rate_high, uint16_t thresh_rate_low)
Configure the GPIO interrupt config, from the given input.
uint8_t VL53L1_OffsetCorrectionMode
VL53L1_Error VL53L1_set_part_to_part_data(VL53L1_DEV Dev, VL53L1_calibration_data_t *pcal_data)
Sets the customer part to part data.
VL53L1_Error VL53L1_disable_xtalk_compensation(VL53L1_DEV Dev)
Simple function to disable xtalk compensation.
VL53L1_Error VL53L1_get_tuning_parm(VL53L1_DEV Dev, VL53L1_TuningParms tuning_parm_key, int32_t *ptuning_parm_value)
Generic Tuning Parameter extraction function.
VL53L1_Error VL53L1_stop_range(VL53L1_DEV Dev)
Sends an abort command to stop the in progress range. Also clears all of the measurement mode bits...
Defines the parameters of the LL driver Get Version Functions.
int int32_t
Typedef defining 32 bit int type. The developer should modify this to suit the platform being deploye...
Definition: vl53l1_types.h:118
VL53L1_Error VL53L1_set_sequence_config_bit(VL53L1_DEV Dev, VL53L1_DeviceSequenceConfig bit_id, uint8_t value)
Set system sequence config bit value.
VL53L1_Error VL53L1_get_vhv_config(VL53L1_DEV Dev, uint8_t *pvhv_init_en, uint8_t *pvhv_init_value)
Get function for VHV Config values extracts two parms from individual internal byte.
VL53L1_Error VL53L1_set_timeouts_us(VL53L1_DEV Dev, uint32_t phasecal_config_timeout_us, uint32_t mm_config_timeout_us, uint32_t range_config_timeout_us)
Sets the phasecal, mode mitigation and ranging timeouts in the VL53L1_timing_config_t structure...
VL53L1_Error VL53L1_set_lite_xtalk_margin_kcps(VL53L1_DEV Dev, int16_t xtalk_margin)
Set function for Xtalk Margin setting Histogram Mode version.
VL53L1_Error VL53L1_set_vhv_loopbound(VL53L1_DEV Dev, uint8_t vhv_loopbound)
Set function for VHV loopbound config.
VL53L1_Error VL53L1_set_lite_sigma_threshold(VL53L1_DEV Dev, uint16_t lite_sigma)
Set function for Lite Mode Max Sigma Threshold parameter, used to filter and validate ranges based on...
uint16_t VL53L1_TuningParms
uint8_t VL53L1_DeviceInterruptPolarity
Structure to configure conditions when GPIO interrupt is trigerred.
VL53L1_Error VL53L1_set_interrupt_polarity(VL53L1_DEV Dev, VL53L1_DeviceInterruptPolarity interrupt_polarity)
Set the interrupt polarity bit in.
uint8_t VL53L1_GPIO_Interrupt_Mode
void VL53L1_get_xtalk_compensation_enable(VL53L1_DEV Dev, uint8_t *pcrosstalk_compensation_enable)
Simple function to retrieve xtalk compensation status.
uint8_t VL53L1_DeviceResultsLevel
VL53L1_Error VL53L1_set_GPIO_interrupt_config_struct(VL53L1_DEV Dev, VL53L1_GPIO_interrupt_config_t intconf)
Configure the GPIO interrupt config, from the given structure.
VL53L1_Error VL53L1_set_vhv_config(VL53L1_DEV Dev, uint8_t vhv_init_en, uint8_t vhv_init_value)
Set function for VHV Config values sets two parms into individual internal byte.
Tuning Parameters Debug data.
VL53L1_Error VL53L1_get_range_ignore_threshold(VL53L1_DEV Dev, uint8_t *prange_ignore_thresh_mult, uint16_t *prange_ignore_threshold_mcps_internal, uint16_t *prange_ignore_threshold_mcps_current)
Get the Range Ignore Threshold Rate value.
uint8_t VL53L1_DeviceSequenceConfig
VL53L1_Error VL53L1_set_offset_calibration_mode(VL53L1_DEV Dev, VL53L1_OffsetCalibrationMode offset_cal_mode)
Set function for offset calibration mode.
VL53L1_Error VL53L1_get_calibration_repeat_period(VL53L1_DEV Dev, uint16_t *pcal_config__repeat_period)
Gets the current 12-bit calibration repeat period value.
uint8_t VL53L1_OffsetCalibrationMode
uint8_t VL53L1_DevicePresetModes
VL53L1_Error VL53L1_get_lite_min_count_rate(VL53L1_DEV Dev, uint16_t *plite_mincountrate)
Get function for Lite Mode Minimum Count Rate parameter, used to filter and validate ranges based on ...
VL53L1_Error VL53L1_get_refspadchar_config_struct(VL53L1_DEV Dev, VL53L1_refspadchar_config_t *pdata)
Set the Ref spad char cfg struct internal to pdev.
VL53L1_Error VL53L1_get_mode_mitigation_roi(VL53L1_DEV Dev, VL53L1_user_zone_t *pmm_roi)
Gets the current mode mitigation zone (ROI) configuration structure data.
Structure for storing the set of range results.
VL53L1_Error VL53L1_get_part_to_part_data(VL53L1_DEV Dev, VL53L1_calibration_data_t *pcal_data)
Gets the customer part to part data.
Per Part calibration data.
VL53L1_Error VL53L1_set_calibration_repeat_period(VL53L1_DEV Dev, uint16_t cal_config__repeat_period)
Sets the 12-bit calibration repeat period value.
VL53L1_Error VL53L1_get_preset_mode_timing_cfg(VL53L1_DEV Dev, VL53L1_DevicePresetModes device_preset_mode, uint16_t *pdss_config__target_total_rate_mcps, uint32_t *pphasecal_config_timeout_us, uint32_t *pmm_config_timeout_us, uint32_t *prange_config_timeout_us)
Gets the requested preset mode configuration tuning parameters.
VL53L1_Error VL53L1_set_range_ignore_threshold(VL53L1_DEV Dev, uint8_t range_ignore_thresh_mult, uint16_t range_ignore_threshold_mcps)
Set the Range Ignore Threshold Rate value.
VL53L1_Error VL53L1_get_device_results(VL53L1_DEV Dev, VL53L1_DeviceResultsLevel device_result_level, VL53L1_range_results_t *prange_results)
Get device system results, updates GPH registers and clears interrupt and configures SYSTEM__MODE_STA...
VL53L1_Error VL53L1_restore_xtalk_nvm_default(VL53L1_DEV Dev)
Function to restore the plane_offset, x gradient and y gradient values to original NVM values...
unsigned short uint16_t
Typedef defining 16 bit unsigned short type. The developer should modify this to suit the platform be...
Definition: vl53l1_types.h:123
VL53L1_Error VL53L1_get_offset_calibration_mode(VL53L1_DEV Dev, VL53L1_OffsetCalibrationMode *poffset_cal_mode)
Get function for offset calibration mode.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type. The developer should modify this to suit the platform bein...
Definition: vl53l1_types.h:133
unsigned int uint32_t
Typedef defining 32 bit unsigned int type. The developer should modify this to suit the platform bein...
Definition: vl53l1_types.h:113


vl53l1x
Author(s):
autogenerated on Sat Dec 10 2022 03:15:50