vl53l1_api_core.c
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 
70 #include "vl53l1_ll_def.h"
71 #include "vl53l1_ll_device.h"
72 #include "vl53l1_platform.h"
73 #include "vl53l1_register_map.h"
75 #include "vl53l1_register_funcs.h"
76 #include "vl53l1_nvm_map.h"
77 #include "vl53l1_core.h"
78 #include "vl53l1_wait.h"
80 #include "vl53l1_silicon_core.h"
81 #include "vl53l1_api_core.h"
83 
84 #ifdef VL53L1_LOG_ENABLE
85 #include "vl53l1_api_debug.h"
86 #endif
87 
88 #define LOG_FUNCTION_START(fmt, ...) \
89  _LOG_FUNCTION_START(VL53L1_TRACE_MODULE_CORE, fmt, ##__VA_ARGS__)
90 #define LOG_FUNCTION_END(status, ...) \
91  _LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__)
92 #define LOG_FUNCTION_END_FMT(status, fmt, ...) \
93  _LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE, status, \
94  fmt, ##__VA_ARGS__)
95 
96 #define trace_print(level, ...) \
97  _LOG_TRACE_PRINT(VL53L1_TRACE_MODULE_CORE, \
98  level, VL53L1_TRACE_FUNCTION_NONE, ##__VA_ARGS__)
99 
100 #define VL53L1_MAX_I2C_XFER_SIZE 256
101 
102 #ifdef VL53L1_DEBUG
103 VL53L1_Error VL53L1_get_version(
104  VL53L1_DEV Dev,
105  VL53L1_ll_version_t *pdata)
106 {
107  /*
108  * respond with the #define values from version.h
109  * using memcpy(dst, src, size in bytes)
110  */
111 
113 
114  VL53L1_init_version(Dev);
115 
116  memcpy(pdata, &(pdev->version), sizeof(VL53L1_ll_version_t));
117 
118  return VL53L1_ERROR_NONE;
119 }
120 
121 VL53L1_Error VL53L1_get_device_firmware_version(
122  VL53L1_DEV Dev,
123  uint16_t *pfw_version)
124 {
125  /*
126  * Read Firmware version from device
127  */
128 
130 
131  LOG_FUNCTION_START("");
132 
133  if (status == VL53L1_ERROR_NONE) /*lint !e774 always true*/
134  status = VL53L1_disable_firmware(Dev);
135 
136  if (status == VL53L1_ERROR_NONE)
137  status = VL53L1_RdWord(
138  Dev,
140  pfw_version);
141 
142  if (status == VL53L1_ERROR_NONE)
143  status = VL53L1_enable_firmware(Dev);
144 
145  LOG_FUNCTION_END(status);
146 
147  return status;
148 }
149 #endif
150 
151 
153  VL53L1_DEV Dev,
154  uint8_t read_p2p_data)
155 {
156  /*
157  * Initialise pdev data structure
158  */
159 
161  VL53L1_LLDriverData_t *pdev =
163 
165  Dev,
167 
171 
174  pdev->offset_correction_mode =
176 
177  pdev->phasecal_config_timeout_us = 1000;
178  pdev->mm_config_timeout_us = 2000;
179  pdev->range_config_timeout_us = 13000;
180  pdev->inter_measurement_period_ms = 100;
181  pdev->dss_config__target_total_rate_mcps = 0x0A00;
182  pdev->debug_mode = 0x00;
183 
184  /* initialise gain calibration values to tuning parameter values */
185 
188 
189  /*
190  * Initialise version structure
191  */
192  VL53L1_init_version(Dev);
193 
194  /*
195  * For C-API one time initialization only read device G02 registers
196  * containing data copied from NVM
197  *
198  * Contains the key NVM data e.g identification info fast oscillator
199  * freq, max trim and laser safety info
200  */
201 
202  if (read_p2p_data > 0 && status == VL53L1_ERROR_NONE) /*lint !e774 always true*/
203  status = VL53L1_read_p2p_data(Dev);
204 
205  /* Initialise Ref SPAD Char configuration structure */
206 #ifndef VL53L1_NOCALIB
207  status =
209  &(pdev->refspadchar));
210 #endif
211 
212  /* Initialise SPAD Self Check (SSC) configuration structure */
213 #ifndef VL53L1_NOCALIB
214  status =
216  &(pdev->ssc_cfg));
217 #endif
218 
219  /* Initialise Private Xtalk configuration structure
220  * - Fill with customer NVM data to begin
221  */
222  status =
224  &(pdev->customer),
225  &(pdev->xtalk_cfg));
226 
227  /* Initialise Offset Calibration configuration structure
228  */
229 #ifndef VL53L1_NOCALIB
230  status =
232  &(pdev->offsetcal_cfg));
233 #endif
234 
235  /* Initialise Tuning Parameter structure
236  * - Added as part of Patch_AddingTuningParmStorage_11821
237  */
238  status =
240  &(pdev->tuning_parms));
241 
242  status = VL53L1_set_vhv_loopbound(Dev,
244 
245  /*
246  * Initialise default settings - much happen *after*
247  * reading /setting of static_nvm_managed
248  */
249 
250  if (status == VL53L1_ERROR_NONE)
251  status = VL53L1_set_preset_mode(
252  Dev,
253  pdev->preset_mode,
254  pdev->dss_config__target_total_rate_mcps, /* 9.7 format 20Mcps */
256  pdev->mm_config_timeout_us,
259 
260  /* Initial Low Power Auto Mode data structures */
261  /* Added for Patch_LowPowerAutoMode */
263  Dev
264  );
265 
266 #ifdef VL53L1_LOG_ENABLE
267 
268  /* Prints out the initial calibration data for debug */
269 
270  VL53L1_print_static_nvm_managed(
271  &(pdev->stat_nvm),
272  "data_init():pdev->lldata.stat_nvm.",
273  VL53L1_TRACE_MODULE_DATA_INIT);
274 
275  VL53L1_print_customer_nvm_managed(
276  &(pdev->customer),
277  "data_init():pdev->lldata.customer.",
278  VL53L1_TRACE_MODULE_DATA_INIT);
279 
280  VL53L1_print_nvm_copy_data(
281  &(pdev->nvm_copy_data),
282  "data_init():pdev->lldata.nvm_copy_data.",
283  VL53L1_TRACE_MODULE_DATA_INIT);
284 
285  VL53L1_print_additional_offset_cal_data(
286  &(pdev->add_off_cal_data),
287  "data_init():pdev->lldata.add_off_cal_data.",
288  VL53L1_TRACE_MODULE_DATA_INIT);
289 
290  VL53L1_print_user_zone(
291  &(pdev->mm_roi),
292  "data_init():pdev->lldata.mm_roi.",
293  VL53L1_TRACE_MODULE_DATA_INIT);
294 
295  VL53L1_print_optical_centre(
296  &(pdev->optical_centre),
297  "data_init():pdev->lldata.optical_centre.",
298  VL53L1_TRACE_MODULE_DATA_INIT);
299 
300  VL53L1_print_cal_peak_rate_map(
301  &(pdev->cal_peak_rate_map),
302  "data_init():pdev->lldata.cal_peak_rate_map.",
303  VL53L1_TRACE_MODULE_DATA_INIT);
304 
305 #endif
306 
307  LOG_FUNCTION_END(status);
308 
309  return status;
310 }
311 
312 
314  VL53L1_DEV Dev)
315 {
316 
317  /*
318  * For C-API one time initialization only reads device
319  * G02 registers containing data copied from NVM
320  *
321  * Contains the key NVM data e.g identification info
322  * fast oscillator freq, max trim and laser safety info
323  */
324 
327 
328  LOG_FUNCTION_START("");
329 
330  if (status == VL53L1_ERROR_NONE)
332  Dev,
333  &(pdev->stat_nvm));
334 
335  if (status == VL53L1_ERROR_NONE)
337  Dev,
338  &(pdev->customer));
339 
340  if (status == VL53L1_ERROR_NONE) {
341 
342  status = VL53L1_get_nvm_copy_data(
343  Dev,
344  &(pdev->nvm_copy_data));
345 
346  /* copy Return Good SPADs to buffer */
347  if (status == VL53L1_ERROR_NONE)
349  &(pdev->nvm_copy_data),
350  &(pdev->rtn_good_spads[0]));
351  }
352 
353  /*
354  * read slow osc calibration value
355  * counts per ms
356  */
357  if (status == VL53L1_ERROR_NONE)
358  status =
360  Dev,
363 
364  /*
365  * Check if there a sensible value for osc_measured__fast_osc__frequency
366  */
367 
368  if (pdev->stat_nvm.osc_measured__fast_osc__frequency < 0x1000) {
369  trace_print(
370  VL53L1_TRACE_LEVEL_WARNING,
371  "\nInvalid %s value (0x%04X) - forcing to 0x%04X\n\n",
372  "pdev->stat_nvm.osc_measured__fast_osc__frequency",
374  0xBCCC);
376  }
377 
378  /*
379  * Get MM ROI - contains optical centre as SPAD number
380  */
381 
382  if (status == VL53L1_ERROR_NONE)
383  status =
385  Dev,
386  &(pdev->mm_roi));
387 
388  /* catch parts where the optical centre is
389  * no programmed in to the NVM
390  */
391 
392  if (pdev->optical_centre.x_centre == 0 &&
393  pdev->optical_centre.y_centre == 0) {
394  pdev->optical_centre.x_centre =
395  pdev->mm_roi.x_centre << 4;
396  pdev->optical_centre.y_centre =
397  pdev->mm_roi.y_centre << 4;
398  }
399 
400  LOG_FUNCTION_END(status);
401 
402  return status;
403 }
404 
405 
407  VL53L1_DEV Dev)
408 {
415 
416  LOG_FUNCTION_START("");
417 
418  /* apply reset - note despite the name soft reset is active low! */
419  if (status == VL53L1_ERROR_NONE) /*lint !e774 always true*/
420  status = VL53L1_WrByte(
421  Dev,
423  0x00);
424 
425  /* wait for a while before releasing the reset */
426  if (status == VL53L1_ERROR_NONE)
427  status =
429  Dev,
431 
432  /* release reset */
433  if (status == VL53L1_ERROR_NONE)
434  status = VL53L1_WrByte(
435  Dev,
437  0x01);
438 
439  /* wait for firmware boot to complete */
440  if (status == VL53L1_ERROR_NONE)
441  status = VL53L1_wait_for_boot_completion(Dev);
442 
443  LOG_FUNCTION_END(status);
444 
445  return status;
446 }
447 
448 
450  VL53L1_DEV Dev,
451  VL53L1_calibration_data_t *pcal_data)
452 {
459 
460  uint32_t tempu32;
461 
462  LOG_FUNCTION_START("");
463 
464  if (pcal_data->struct_version !=
467  }
468 
469  if (status == VL53L1_ERROR_NONE) {
470 
471  /* memcpy(DEST, SRC, N) */
472  memcpy(
473  &(pdev->customer),
474  &(pcal_data->customer),
476 
477  /* memcpy(DEST, SRC, N) */
478  memcpy(
479  &(pdev->add_off_cal_data),
480  &(pcal_data->add_off_cal_data),
482 
483  /* memcpy(DEST, SRC, N) */
484  memcpy(
485  &(pdev->gain_cal),
486  &(pcal_data->gain_cal),
488 
489  /* memcpy(DEST, SRC, N) */
490  memcpy(
491  &(pdev->cal_peak_rate_map),
492  &(pcal_data->cal_peak_rate_map),
494 
495  /*
496  * Update internal xtalk data structures
497  */
498 
505 
506  /* Assess and update customer packet xtalk parameters */
507 
510  0x00;
512  0x00;
514  0x00;
515  } else {
519  if (tempu32 > 0xFFFF) { /* clip to 16 bits */
520  tempu32 = 0xFFFF;
521  }
523  (uint16_t)tempu32;
524  }
525  }
526 
527  LOG_FUNCTION_END(status);
528 
529  return status;
530 }
531 
532 
534  VL53L1_DEV Dev,
535  VL53L1_calibration_data_t *pcal_data)
536 {
543 
544  LOG_FUNCTION_START("");
545 
546  pcal_data->struct_version =
548 
549  /* memcpy(DEST, SRC, N) */
550  memcpy(
551  &(pcal_data->customer),
552  &(pdev->customer),
554 
555  /* Overwrite Struct with xtalk config parameters */
556  /* - customer struct versions are not golden copy */
557 
560  0xFFFF;
561  } else {
564  }
569 
570  /* memcpy(DEST, SRC, N) */
571  memcpy(
572  &(pcal_data->add_off_cal_data),
573  &(pdev->add_off_cal_data),
575 
576  /* memcpy(DEST, SRC, N) */
577  memcpy(
578  &(pcal_data->optical_centre),
579  &(pdev->optical_centre),
580  sizeof(VL53L1_optical_centre_t));
581 
582  /* memcpy(DEST, SRC, N) */
583  memcpy(
584  &(pcal_data->gain_cal),
585  &(pdev->gain_cal),
587 
588  /* memcpy(DEST, SRC, N) */
589  memcpy(
590  &(pcal_data->cal_peak_rate_map),
591  &(pdev->cal_peak_rate_map),
593 
594  LOG_FUNCTION_END(status);
595 
596  return status;
597 }
598 
599 
601  VL53L1_DEV Dev,
602  uint32_t inter_measurement_period_ms)
603 {
610 
611  LOG_FUNCTION_START("");
612 
613  if (pdev->dbg_results.result__osc_calibrate_val == 0)
615 
616  if (status == VL53L1_ERROR_NONE) {
617  pdev->inter_measurement_period_ms = inter_measurement_period_ms;
619  inter_measurement_period_ms *
621  }
622 
623  LOG_FUNCTION_END(status);
624 
625  return status;
626 }
627 
628 
630  VL53L1_DEV Dev,
631  uint32_t *pinter_measurement_period_ms)
632 {
639 
640  LOG_FUNCTION_START("");
641 
642  if (pdev->dbg_results.result__osc_calibrate_val == 0)
644 
645  if (status == VL53L1_ERROR_NONE)
646  *pinter_measurement_period_ms = \
647  pdev->tim_cfg.system__intermeasurement_period /
649 
650 
651  LOG_FUNCTION_END(status);
652 
653  return status;
654 }
655 
656 
658  VL53L1_DEV Dev,
659  uint32_t phasecal_config_timeout_us,
660  uint32_t mm_config_timeout_us,
661  uint32_t range_config_timeout_us)
662 {
669  VL53L1_LLDriverData_t *pdev =
671 
672  LOG_FUNCTION_START("");
673 
676 
677  if (status == VL53L1_ERROR_NONE) {
678 
679  pdev->phasecal_config_timeout_us = phasecal_config_timeout_us;
680  pdev->mm_config_timeout_us = mm_config_timeout_us;
681  pdev->range_config_timeout_us = range_config_timeout_us;
682 
683  status =
685  phasecal_config_timeout_us,
686  mm_config_timeout_us,
687  range_config_timeout_us,
689  &(pdev->gen_cfg),
690  &(pdev->tim_cfg));
691  }
692 
693  LOG_FUNCTION_END(status);
694 
695  return status;
696 }
697 
698 
700  VL53L1_DEV Dev,
701  uint32_t *pphasecal_config_timeout_us,
702  uint32_t *pmm_config_timeout_us,
703  uint32_t *prange_config_timeout_us)
704 {
711  VL53L1_LLDriverData_t *pdev =
713 
714  uint32_t macro_period_us = 0;
715  uint16_t timeout_encoded = 0;
716 
717  LOG_FUNCTION_START("");
718 
721 
722  if (status == VL53L1_ERROR_NONE) {
723 
724  /* Update Macro Period for Range A VCSEL Period */
725  macro_period_us =
729 
730  /* Get Phase Cal Timing A timeout */
731 
732  *pphasecal_config_timeout_us =
735  macro_period_us);
736 
737  /* Get MM Timing A timeout */
738 
739  timeout_encoded =
741  timeout_encoded = (timeout_encoded << 8) +
743 
744  *pmm_config_timeout_us =
746  timeout_encoded,
747  macro_period_us);
748 
749  /* Get Range Timing A timeout */
750 
751  timeout_encoded =
753  timeout_encoded = (timeout_encoded << 8) +
755 
756  *prange_config_timeout_us =
758  timeout_encoded,
759  macro_period_us);
760 
761  pdev->phasecal_config_timeout_us = *pphasecal_config_timeout_us;
762  pdev->mm_config_timeout_us = *pmm_config_timeout_us;
763  pdev->range_config_timeout_us = *prange_config_timeout_us;
764 
765  }
766 
767  LOG_FUNCTION_END(status);
768 
769  return status;
770 }
771 
772 
774  VL53L1_DEV Dev,
775  uint16_t cal_config__repeat_period)
776 {
782  VL53L1_LLDriverData_t *pdev =
784 
785  pdev->gen_cfg.cal_config__repeat_rate = cal_config__repeat_period;
786 
787  return status;
788 
789 }
790 
791 
793  VL53L1_DEV Dev,
794  uint16_t *pcal_config__repeat_period)
795 {
801  VL53L1_LLDriverData_t *pdev =
803 
804  *pcal_config__repeat_period = pdev->gen_cfg.cal_config__repeat_rate;
805 
806  return status;
807 
808 }
809 
810 
812  VL53L1_DEV Dev,
814  uint8_t value)
815 {
822  VL53L1_LLDriverData_t *pdev =
824 
825  uint8_t bit_mask = 0x01;
826  uint8_t clr_mask = 0xFF - bit_mask;
827  uint8_t bit_value = value & bit_mask;
828 
829  if (bit_id <= VL53L1_DEVICESEQUENCECONFIG_RANGE) {
830 
831  if (bit_id > 0) {
832  bit_mask = 0x01 << bit_id;
833  bit_value = bit_value << bit_id;
834  clr_mask = 0xFF - bit_mask;
835  }
836 
838  (pdev->dyn_cfg.system__sequence_config & clr_mask) | \
839  bit_value;
840 
841  } else {
843  }
844 
845  return status;
846 
847 }
848 
849 
851  VL53L1_DEV Dev,
853  uint8_t *pvalue)
854 {
861  VL53L1_LLDriverData_t *pdev =
863 
864  uint8_t bit_mask = 0x01;
865 
866  if (bit_id <= VL53L1_DEVICESEQUENCECONFIG_RANGE) {
867 
868  if (bit_id > 0) {
869  bit_mask = 0x01 << bit_id;
870  }
871 
872  *pvalue =
873  pdev->dyn_cfg.system__sequence_config & bit_mask;
874 
875  if (bit_id > 0) {
876  *pvalue = *pvalue >> bit_id;
877  }
878 
879  } else {
881  }
882 
883  return status;
884 }
885 
886 
888  VL53L1_DEV Dev,
889  VL53L1_DeviceInterruptPolarity interrupt_polarity)
890 {
896  VL53L1_LLDriverData_t *pdev =
898 
899  pdev->stat_cfg.gpio_hv_mux__ctrl = \
900  (pdev->stat_cfg.gpio_hv_mux__ctrl & \
901  VL53L1_DEVICEINTERRUPTPOLARITY_CLEAR_MASK) | \
902  (interrupt_polarity & \
904 
905  return status;
906 
907 }
908 
909 
910 #ifndef VL53L1_NOCALIB
912  VL53L1_DEV Dev,
914 {
915  /*
916  * Allows user config of Ref SPAD Char data structure
917  */
918 
920  VL53L1_LLDriverData_t *pdev =
922 
923  LOG_FUNCTION_START("");
924 
926  pdev->refspadchar.vcsel_period = pdata->vcsel_period;
927  pdev->refspadchar.timeout_us = pdata->timeout_us;
929  pdata->target_count_rate_mcps;
934 
935  LOG_FUNCTION_END(status);
936 
937  return status;
938 }
939 #endif
940 
941 #ifndef VL53L1_NOCALIB
943  VL53L1_DEV Dev,
945 {
946  /*
947  * Allows user config of Ref SPAD Char data structure
948  */
949 
951  VL53L1_LLDriverData_t *pdev =
953 
954  LOG_FUNCTION_START("");
955 
957  pdata->vcsel_period = pdev->refspadchar.vcsel_period;
958  pdata->timeout_us = pdev->refspadchar.timeout_us;
964 
965  LOG_FUNCTION_END(status);
966 
967  return status;
968 }
969 #endif
970 
971 
973  VL53L1_DEV Dev,
974  uint8_t range_ignore_thresh_mult,
975  uint16_t range_ignore_threshold_mcps)
976 {
982  VL53L1_LLDriverData_t *pdev =
984 
986  range_ignore_threshold_mcps;
987 
989  range_ignore_thresh_mult;
990 
991  return status;
992 
993 }
994 
996  VL53L1_DEV Dev,
997  uint8_t *prange_ignore_thresh_mult,
998  uint16_t *prange_ignore_threshold_mcps_internal,
999  uint16_t *prange_ignore_threshold_mcps_current)
1000 {
1011  VL53L1_LLDriverData_t *pdev =
1013 
1014  *prange_ignore_thresh_mult =
1016 
1017  *prange_ignore_threshold_mcps_current =
1019 
1020  *prange_ignore_threshold_mcps_internal =
1022 
1023  return status;
1024 
1025 }
1026 
1027 
1028 
1030  VL53L1_DEV Dev,
1031  VL53L1_DeviceInterruptPolarity *pinterrupt_polarity)
1032 {
1038  VL53L1_LLDriverData_t *pdev =
1040 
1041  *pinterrupt_polarity = \
1042  pdev->stat_cfg.gpio_hv_mux__ctrl & \
1043  VL53L1_DEVICEINTERRUPTPOLARITY_BIT_MASK ;
1044 
1045  return status;
1046 
1047 }
1048 
1049 
1051  VL53L1_DEV Dev,
1052  VL53L1_user_zone_t *puser_zone)
1053 {
1060 
1061  LOG_FUNCTION_START("");
1062 
1063  /* convert (row,col) location into a SPAD number */
1065  puser_zone->y_centre,
1066  puser_zone->x_centre,
1068 
1069  /* merge x and y sizes */
1071  puser_zone->width,
1072  puser_zone->height,
1074 
1075  /* need to add checks to ensure ROI is within array */
1076 
1077  LOG_FUNCTION_END(status);
1078 
1079  return status;
1080 }
1081 
1082 
1084  VL53L1_DEV Dev,
1085  VL53L1_user_zone_t *puser_zone)
1086 {
1093 
1094  LOG_FUNCTION_START("");
1095 
1096  /* convert SPAD number into (row,col) location*/
1099  &(puser_zone->y_centre),
1100  &(puser_zone->x_centre));
1101 
1102  /* extract x and y sizes */
1105  &(puser_zone->width),
1106  &(puser_zone->height));
1107 
1108  LOG_FUNCTION_END(status);
1109 
1110  return status;
1111 }
1112 
1113 
1114 
1116  VL53L1_DEV Dev,
1117  VL53L1_user_zone_t *pmm_roi)
1118 {
1125 
1126  uint8_t x = 0;
1127  uint8_t y = 0;
1128  uint8_t xy_size = 0;
1129 
1130  LOG_FUNCTION_START("");
1131 
1132  /* convert SPAD number into (row,col) location */
1135  &y,
1136  &x);
1137 
1138  pmm_roi->x_centre = x;
1139  pmm_roi->y_centre = y;
1140 
1141  /* extract x and y sizes
1142  *
1143  * Important: the sense of the device width and height is swapped
1144  * versus the API sense
1145  *
1146  * MS Nibble = height
1147  * LS Nibble = width
1148  */
1150 
1151  pmm_roi->height = xy_size >> 4;
1152  pmm_roi->width = xy_size & 0x0F;
1153 
1154  LOG_FUNCTION_END(status);
1155 
1156  return status;
1157 }
1158 
1160  VL53L1_DEV Dev,
1161  VL53L1_DevicePresetModes device_preset_mode,
1162  uint16_t *pdss_config__target_total_rate_mcps,
1163  uint32_t *pphasecal_config_timeout_us,
1164  uint32_t *pmm_config_timeout_us,
1165  uint32_t *prange_config_timeout_us)
1166 {
1169 
1170  LOG_FUNCTION_START("");
1171 
1172 
1173  switch (device_preset_mode) {
1174 
1181  *pdss_config__target_total_rate_mcps =
1183  *pphasecal_config_timeout_us =
1185  *pmm_config_timeout_us =
1187  *prange_config_timeout_us =
1189  break;
1190 
1195  *pdss_config__target_total_rate_mcps =
1197  *pphasecal_config_timeout_us =
1199  *pmm_config_timeout_us =
1201  *prange_config_timeout_us =
1203  break;
1204 
1208  *pdss_config__target_total_rate_mcps =
1210  *pphasecal_config_timeout_us =
1212  *pmm_config_timeout_us =
1214  *prange_config_timeout_us =
1216  break;
1217 
1218  default:
1219  status = VL53L1_ERROR_INVALID_PARAMS;
1220  break;
1221 
1222  }
1223 
1224  LOG_FUNCTION_END(status);
1225 
1226  return status;
1227 }
1228 
1229 
1231  VL53L1_DEV Dev,
1232  VL53L1_DevicePresetModes device_preset_mode,
1233  uint16_t dss_config__target_total_rate_mcps,
1234  uint32_t phasecal_config_timeout_us,
1235  uint32_t mm_config_timeout_us,
1236  uint32_t range_config_timeout_us,
1237  uint32_t inter_measurement_period_ms)
1238 {
1245  VL53L1_LLDriverData_t *pdev =
1247 
1248  VL53L1_static_config_t *pstatic = &(pdev->stat_cfg);
1249  VL53L1_general_config_t *pgeneral = &(pdev->gen_cfg);
1250  VL53L1_timing_config_t *ptiming = &(pdev->tim_cfg);
1251  VL53L1_dynamic_config_t *pdynamic = &(pdev->dyn_cfg);
1252  VL53L1_system_control_t *psystem = &(pdev->sys_ctrl);
1253  VL53L1_tuning_parm_storage_t *ptuning_parms = &(pdev->tuning_parms);
1254  VL53L1_low_power_auto_data_t *plpadata =
1255  &(pdev->low_power_auto_data);
1256 
1257  LOG_FUNCTION_START("");
1258 
1259  /* save input settings */
1260  pdev->preset_mode = device_preset_mode;
1261  pdev->mm_config_timeout_us = mm_config_timeout_us;
1262  pdev->range_config_timeout_us = range_config_timeout_us;
1263  pdev->inter_measurement_period_ms = inter_measurement_period_ms;
1264 
1265  /* Reset LL Driver state variables */
1266 
1268  Dev,
1270 
1271  /* apply selected preset */
1272 
1273  switch (device_preset_mode) {
1274 
1277  pstatic,
1278  pgeneral,
1279  ptiming,
1280  pdynamic,
1281  psystem,
1282  ptuning_parms);
1283  break;
1284 
1287  pstatic,
1288  pgeneral,
1289  ptiming,
1290  pdynamic,
1291  psystem,
1292  ptuning_parms);
1293  break;
1294 
1297  pstatic,
1298  pgeneral,
1299  ptiming,
1300  pdynamic,
1301  psystem,
1302  ptuning_parms);
1303  break;
1304 
1305 #ifndef VL53L1_NOCALIB
1308  pstatic,
1309  pgeneral,
1310  ptiming,
1311  pdynamic,
1312  psystem,
1313  ptuning_parms);
1314  break;
1315 
1318  pstatic,
1319  pgeneral,
1320  ptiming,
1321  pdynamic,
1322  psystem,
1323  ptuning_parms);
1324  break;
1325 #endif
1326 
1329  pstatic,
1330  pgeneral,
1331  ptiming,
1332  pdynamic,
1333  psystem,
1334  ptuning_parms);
1335  break;
1336 
1339  pstatic,
1340  pgeneral,
1341  ptiming,
1342  pdynamic,
1343  psystem,
1344  ptuning_parms);
1345  break;
1346 
1349  pstatic,
1350  pgeneral,
1351  ptiming,
1352  pdynamic,
1353  psystem,
1354  ptuning_parms);
1355  break;
1356 
1358  status = VL53L1_preset_mode_olt(
1359  pstatic,
1360  pgeneral,
1361  ptiming,
1362  pdynamic,
1363  psystem,
1364  ptuning_parms);
1365  break;
1366 
1369  pstatic,
1370  pgeneral,
1371  ptiming,
1372  pdynamic,
1373  psystem,
1374  ptuning_parms);
1375  break;
1376 
1379  pstatic,
1380  pgeneral,
1381  ptiming,
1382  pdynamic,
1383  psystem,
1384  ptuning_parms,
1385  plpadata);
1386  break;
1387 
1390  pstatic,
1391  pgeneral,
1392  ptiming,
1393  pdynamic,
1394  psystem,
1395  ptuning_parms,
1396  plpadata);
1397  break;
1398 
1401  pstatic,
1402  pgeneral,
1403  ptiming,
1404  pdynamic,
1405  psystem,
1406  ptuning_parms,
1407  plpadata);
1408  break;
1409 
1410  default:
1411  status = VL53L1_ERROR_INVALID_PARAMS;
1412  break;
1413 
1414  }
1415 
1416  /* update DSS target */
1417 
1418  if (status == VL53L1_ERROR_NONE) {
1419 
1421  dss_config__target_total_rate_mcps;
1423  dss_config__target_total_rate_mcps;
1424 
1425  }
1426 
1427  /*
1428  * Update the register timeout values based on input
1429  * real time values and preset mode VCSEL periods
1430  */
1431 
1432  if (status == VL53L1_ERROR_NONE)
1433  status =
1435  Dev,
1436  phasecal_config_timeout_us,
1437  mm_config_timeout_us,
1438  range_config_timeout_us);
1439 
1440  if (status == VL53L1_ERROR_NONE)
1441  status =
1443  Dev,
1444  inter_measurement_period_ms);
1445 
1446  LOG_FUNCTION_END(status);
1447 
1448  return status;
1449 }
1450 
1451 
1453  VL53L1_DEV Dev)
1454 {
1462  uint32_t tempu32;
1463 
1465 
1466  LOG_FUNCTION_START("");
1467 
1468  /* Fill Public customer NVM data with Xtalk parms */
1472  if (tempu32 > 0xFFFF) {
1473  tempu32 = 0xFFFF;
1474  }
1476  (uint16_t)tempu32;
1477 
1480 
1483 
1484  /* Enable Xtalk compensation */
1486 
1487  /* Update Range Ignore Threshold Xtalk Parameter */
1488 
1489  if (status == VL53L1_ERROR_NONE) {
1496  }
1497 
1498  /* Apply to device */
1499 
1500  if (status == VL53L1_ERROR_NONE) /*lint !e774 always true*/
1501  status =
1503  Dev,
1504  &(pdev->customer));
1505 
1506  LOG_FUNCTION_END(status);
1507 
1508  return status;
1509 
1510 }
1511 
1513  VL53L1_DEV Dev,
1514  uint8_t *pcrosstalk_compensation_enable)
1515 {
1528 
1529  LOG_FUNCTION_START("");
1530 
1531  /* Extract Xtalk Compensation Enable Status*/
1532 
1533  *pcrosstalk_compensation_enable =
1535 
1536 }
1537 
1538 
1540  VL53L1_DEV Dev,
1541  int16_t *pxtalk_margin)
1542 {
1543 
1544  /*
1545  * Gets the Xtalk Margin Factor in Kcps (fixed point 9.7)
1546  */
1547 
1549 
1551 
1552  LOG_FUNCTION_START("");
1553 
1554  *pxtalk_margin = pdev->xtalk_cfg.lite_mode_crosstalk_margin_kcps;
1555 
1556  LOG_FUNCTION_END(status);
1557 
1558  return status;
1559 
1560 }
1561 
1563  VL53L1_DEV Dev,
1564  int16_t xtalk_margin)
1565 {
1566 
1567  /*
1568  * Sets the offset calibration mode
1569  */
1570 
1572 
1574 
1575  LOG_FUNCTION_START("");
1576 
1577  pdev->xtalk_cfg.lite_mode_crosstalk_margin_kcps = xtalk_margin;
1578 
1579  LOG_FUNCTION_END(status);
1580 
1581  return status;
1582 }
1583 
1584 
1586  VL53L1_DEV Dev)
1587 {
1588 
1589  /*
1590  * Returns xtalk rate values to defaults as extracted from device NVM
1591  */
1592 
1594 
1596 
1597  LOG_FUNCTION_START("");
1598 
1605 
1606  LOG_FUNCTION_END(status);
1607 
1608  return status;
1609 }
1610 
1612  VL53L1_DEV Dev)
1613 {
1621 
1623 
1624  LOG_FUNCTION_START("");
1625 
1626  /* Fill Public customer NVM data with Xtalk parms */
1628  0x00;
1629 
1631  0x00;
1632 
1634  0x00;
1635 
1636 
1637  /* Disable Global Xtalk comnpensation */
1639 
1640  /* Update Range Ignore Threshold Xtalk Parameter */
1641 
1642  if (status == VL53L1_ERROR_NONE) {
1644  0x0000;
1645  }
1646 
1647  /* Apply to device */
1648 
1649  if (status == VL53L1_ERROR_NONE) { /*lint !e774 always true*/
1650  status =
1652  Dev,
1653  &(pdev->customer));
1654  }
1655  LOG_FUNCTION_END(status);
1656 
1657  return status;
1658 
1659 }
1660 
1662  VL53L1_DEV Dev,
1663  uint16_t *plite_sigma)
1664 {
1665 
1666  /*
1667  * Gets the Sigma Threshold value for Lite Mode
1668  *
1669  * (fixed point 14.2)
1670  */
1671 
1673 
1675 
1676  LOG_FUNCTION_START("");
1677 
1678  *plite_sigma =
1680 
1681  LOG_FUNCTION_END(status);
1682 
1683  return status;
1684 
1685 }
1686 
1688  VL53L1_DEV Dev,
1689  uint16_t lite_sigma)
1690 {
1691 
1692  /*
1693  * Sets the Sigma threshold value for Lite mode
1694  *
1695  * (fixed point 14.2)
1696  */
1697 
1699 
1701 
1702  LOG_FUNCTION_START("");
1703 
1704  pdev->tim_cfg.range_config__sigma_thresh = lite_sigma;
1705 
1706  LOG_FUNCTION_END(status);
1707 
1708  return status;
1709 
1710 }
1711 
1713  VL53L1_DEV Dev,
1714  uint16_t *plite_mincountrate)
1715 {
1716 
1717  /*
1718  * Gets the Min Count Rate value for Lite Mode
1719  *
1720  * (fixed point 9.7 Mcps)
1721  */
1722 
1724 
1726 
1727  LOG_FUNCTION_START("");
1728 
1729  *plite_mincountrate =
1731 
1732  LOG_FUNCTION_END(status);
1733 
1734  return status;
1735 
1736 }
1737 
1739  VL53L1_DEV Dev,
1740  uint16_t lite_mincountrate)
1741 {
1742 
1743  /*
1744  * Sets the Min COunt Rate value for Lite mode
1745  *
1746  * (fixed point 19.7Mcps)
1747  */
1748 
1750 
1752 
1753  LOG_FUNCTION_START("");
1754 
1756  lite_mincountrate;
1757 
1758  LOG_FUNCTION_END(status);
1759 
1760  return status;
1761 
1762 }
1763 
1765  VL53L1_DEV Dev,
1766  uint8_t *pvhv_loopbound)
1767 {
1768 
1769  /*
1770  * Gets the VHV Loop bound parm
1771  * - extracts only bits 7:2 from internal stat nvm parm
1772  */
1773 
1775 
1777 
1778  LOG_FUNCTION_START("");
1779 
1780  *pvhv_loopbound = pdev->stat_nvm.vhv_config__timeout_macrop_loop_bound / 4 ;
1781 
1782  LOG_FUNCTION_END(status);
1783 
1784  return status;
1785 
1786 }
1787 
1788 
1789 
1791  VL53L1_DEV Dev,
1792  uint8_t vhv_loopbound)
1793 {
1794 
1795  /*
1796  * Sets the VHV Loop bound parm
1797  * - sets only bits 7:2
1798  * - bits 1:0 remain unchanged
1799  * - ensure that any change here is followed by a
1800  * init_and_start_range with full i2c packet
1801  * configuration.
1802  */
1803 
1805 
1807 
1808  LOG_FUNCTION_START("");
1809 
1812  (vhv_loopbound * 4);
1813 
1814  LOG_FUNCTION_END(status);
1815 
1816  return status;
1817 
1818 }
1819 
1820 
1821 
1823  VL53L1_DEV Dev,
1824  uint8_t *pvhv_init_en,
1825  uint8_t *pvhv_init_value)
1826 {
1827 
1828  /*
1829  * Gets the VHV config init data
1830  */
1831 
1844 
1846 
1847  LOG_FUNCTION_START("");
1848 
1849  *pvhv_init_en = (pdev->stat_nvm.vhv_config__init & 0x80) >> 7;
1850  *pvhv_init_value =
1851  (pdev->stat_nvm.vhv_config__init & 0x7F);
1852 
1853  LOG_FUNCTION_END(status);
1854 
1855  return status;
1856 
1857 }
1858 
1859 
1860 
1862  VL53L1_DEV Dev,
1863  uint8_t vhv_init_en,
1864  uint8_t vhv_init_value)
1865 {
1866 
1867  /*
1868  * Sets the VHV Config init
1869  */
1870 
1872 
1874 
1875  LOG_FUNCTION_START("");
1876 
1877  pdev->stat_nvm.vhv_config__init =
1878  ((vhv_init_en & 0x01) << 7) +
1879  (vhv_init_value & 0x7F);
1880 
1881  LOG_FUNCTION_END(status);
1882 
1883  return status;
1884 
1885 }
1886 
1887 
1888 
1890  VL53L1_DEV Dev,
1891  uint8_t measurement_mode,
1892  VL53L1_DeviceConfigLevel device_config_level)
1893 {
1894  /*
1895  * Builds and sends a single I2C multiple byte transaction to
1896  * initialize the device and start a range measurement.
1897  *
1898  * The level of initialization is controlled by the
1899  * device_config_level input parameter
1900  *
1901  * system_control is always sent as the last byte of this
1902  * register group (mode_start) either triggers the range
1903  * or enables the next range
1904  */
1905 
1908 
1910 
1911  VL53L1_static_nvm_managed_t *pstatic_nvm = &(pdev->stat_nvm);
1912  VL53L1_customer_nvm_managed_t *pcustomer_nvm = &(pdev->customer);
1913  VL53L1_static_config_t *pstatic = &(pdev->stat_cfg);
1914  VL53L1_general_config_t *pgeneral = &(pdev->gen_cfg);
1915  VL53L1_timing_config_t *ptiming = &(pdev->tim_cfg);
1916  VL53L1_dynamic_config_t *pdynamic = &(pdev->dyn_cfg);
1917  VL53L1_system_control_t *psystem = &(pdev->sys_ctrl);
1918 
1919  VL53L1_ll_driver_state_t *pstate = &(pdev->ll_state);
1920 
1921  uint8_t *pbuffer = &buffer[0];
1922  uint16_t i = 0;
1923  uint16_t i2c_index = 0;
1924  uint16_t i2c_buffer_offset_bytes = 0;
1925  uint16_t i2c_buffer_size_bytes = 0;
1926 
1927  LOG_FUNCTION_START("");
1928 
1929  /* save measurement mode */
1930  pdev->measurement_mode = measurement_mode;
1931 
1932  /* Merge measurement mode with mode_start */
1933 
1934  psystem->system__mode_start =
1935  (psystem->system__mode_start &
1937  measurement_mode;
1938 
1939  /* copy in rit from xtalk config */
1940 
1943 
1944  /* Start Patch_LowPowerAutoMode */
1945 
1946  /* doing this ensures stop_range followed by a get_device_results does
1947  * not mess up the counters */
1948 
1949  if (pdev->low_power_auto_data.low_power_auto_range_count == 0xFF) {
1951  }
1952 
1953  /* For Presence. Override threshold config */
1954  if ((pdev->low_power_auto_data.is_low_power_auto_mode == 1) &&
1956  /* save interrupt config */
1959  /* set intr_new_measure_ready */
1960  pdev->gen_cfg.system__interrupt_config_gpio = 1 << 5;
1961  /* check MM1/MM2 disabled? */
1962  if ((pdev->dyn_cfg.system__sequence_config & (
1964  0x0) {
1967  } else {
1969  }
1970 
1971  /* make sure config gets written out */
1972  if (device_config_level <
1974  device_config_level =
1976  }
1977  }
1978 
1979  if ((pdev->low_power_auto_data.is_low_power_auto_mode == 1) &&
1981  /* restore interrupt config */
1984 
1985  /* make sure config gets written out including VHV config */
1986  device_config_level = VL53L1_DEVICECONFIGLEVEL_FULL;
1987  }
1988 
1989  /* End Patch_LowPowerAutoMode */
1990 
1991  /*
1992  * Determine Initial I2C index
1993  */
1994 
1995  switch (device_config_level) {
1998  break;
2001  break;
2003  i2c_index = VL53L1_STATIC_CONFIG_I2C_INDEX;
2004  break;
2006  i2c_index = VL53L1_GENERAL_CONFIG_I2C_INDEX;
2007  break;
2009  i2c_index = VL53L1_TIMING_CONFIG_I2C_INDEX;
2010  break;
2012  i2c_index = VL53L1_DYNAMIC_CONFIG_I2C_INDEX;
2013  break;
2014  default:
2015  i2c_index = VL53L1_SYSTEM_CONTROL_I2C_INDEX;
2016  break;
2017  }
2018 
2019  /* I2C Buffer size */
2020 
2021  i2c_buffer_size_bytes = \
2024  i2c_index;
2025 
2026  /* Initialize buffer */
2027 
2028  pbuffer = &buffer[0];
2029  for (i = 0 ; i < i2c_buffer_size_bytes ; i++) {
2030  *pbuffer++ = 0;
2031  }
2032 
2033  /* Build I2C buffer */
2034 
2035  if (device_config_level >= VL53L1_DEVICECONFIGLEVEL_FULL &&
2036  status == VL53L1_ERROR_NONE) {
2037 
2038  i2c_buffer_offset_bytes = \
2039  VL53L1_STATIC_NVM_MANAGED_I2C_INDEX - i2c_index;
2040 
2041  status =
2043  pstatic_nvm,
2045  &buffer[i2c_buffer_offset_bytes]);
2046  }
2047 
2048  if (device_config_level >= VL53L1_DEVICECONFIGLEVEL_CUSTOMER_ONWARDS &&
2049  status == VL53L1_ERROR_NONE) {
2050 
2051  i2c_buffer_offset_bytes = \
2052  VL53L1_CUSTOMER_NVM_MANAGED_I2C_INDEX - i2c_index;
2053 
2054  status =
2056  pcustomer_nvm,
2058  &buffer[i2c_buffer_offset_bytes]);
2059  }
2060 
2061  if (device_config_level >= VL53L1_DEVICECONFIGLEVEL_STATIC_ONWARDS &&
2062  status == VL53L1_ERROR_NONE) {
2063 
2064  i2c_buffer_offset_bytes = \
2065  VL53L1_STATIC_CONFIG_I2C_INDEX - i2c_index;
2066 
2067  status =
2069  pstatic,
2071  &buffer[i2c_buffer_offset_bytes]);
2072  }
2073 
2074  if (device_config_level >= VL53L1_DEVICECONFIGLEVEL_GENERAL_ONWARDS &&
2075  status == VL53L1_ERROR_NONE) {
2076 
2077  i2c_buffer_offset_bytes =
2078  VL53L1_GENERAL_CONFIG_I2C_INDEX - i2c_index;
2079 
2080  status =
2082  pgeneral,
2084  &buffer[i2c_buffer_offset_bytes]);
2085  }
2086 
2087  if (device_config_level >= VL53L1_DEVICECONFIGLEVEL_TIMING_ONWARDS &&
2088  status == VL53L1_ERROR_NONE) {
2089 
2090  i2c_buffer_offset_bytes = \
2091  VL53L1_TIMING_CONFIG_I2C_INDEX - i2c_index;
2092 
2093  status =
2095  ptiming,
2097  &buffer[i2c_buffer_offset_bytes]);
2098  }
2099 
2100  if (device_config_level >= VL53L1_DEVICECONFIGLEVEL_DYNAMIC_ONWARDS &&
2101  status == VL53L1_ERROR_NONE) {
2102 
2103  i2c_buffer_offset_bytes = \
2104  VL53L1_DYNAMIC_CONFIG_I2C_INDEX - i2c_index;
2105 
2106  /* If in back to back mode, use GPH ID from cfg_state */
2107  if ((psystem->system__mode_start &
2110  pdynamic->system__grouped_parameter_hold_0 = pstate->cfg_gph_id | 0x01;
2111  pdynamic->system__grouped_parameter_hold_1 = pstate->cfg_gph_id | 0x01;
2112  pdynamic->system__grouped_parameter_hold = pstate->cfg_gph_id;
2113  }
2114  status =
2116  pdynamic,
2118  &buffer[i2c_buffer_offset_bytes]);
2119  }
2120 
2121  if (status == VL53L1_ERROR_NONE) {
2122 
2123  i2c_buffer_offset_bytes = \
2124  VL53L1_SYSTEM_CONTROL_I2C_INDEX - i2c_index;
2125 
2126  status =
2128  psystem,
2130  &buffer[i2c_buffer_offset_bytes]);
2131  }
2132 
2133  /* Send I2C Buffer */
2134 
2135  if (status == VL53L1_ERROR_NONE) {
2136  status =
2138  Dev,
2139  i2c_index,
2140  buffer,
2141  (uint32_t)i2c_buffer_size_bytes);
2142  }
2143 
2144  /*
2145  * Update LL Driver State
2146  */
2147  if (status == VL53L1_ERROR_NONE)
2148  status = VL53L1_update_ll_driver_rd_state(Dev);
2149 
2150  if (status == VL53L1_ERROR_NONE)
2151  status = VL53L1_update_ll_driver_cfg_state(Dev);
2152 
2153  LOG_FUNCTION_END(status);
2154 
2155  return status;
2156 }
2157 
2158 
2160  VL53L1_DEV Dev)
2161 {
2162  /*
2163  * Stops any in process range using the ABORT command
2164  * Also clears all of the measurement mode bits
2165  */
2166 
2168 
2169  VL53L1_LLDriverData_t *pdev =
2171 
2172  /* Merge ABORT mode with mode_start */
2173 
2177 
2178  status = VL53L1_set_system_control(
2179  Dev,
2180  &pdev->sys_ctrl);
2181 
2182  /* Abort bit is auto clear so clear register group structure to match */
2185 
2186  /* reset zone dynamic info */
2188  Dev,
2190 
2191  /* reset low power auto */
2194 
2195  return status;
2196 }
2197 
2198 
2200  VL53L1_DEV Dev,
2201  VL53L1_DeviceResultsLevel device_results_level)
2202 {
2203  /*
2204  * Read via a single I2C multiple byte transaction all
2205  * of the requested device measurement data results
2206  */
2207 
2210 
2212 
2213  VL53L1_system_results_t *psystem_results = &(pdev->sys_results);
2214  VL53L1_core_results_t *pcore_results = &(pdev->core_results);
2215  VL53L1_debug_results_t *pdebug_results = &(pdev->dbg_results);
2216 
2218  uint16_t i2c_buffer_offset_bytes = 0;
2219  uint16_t i2c_buffer_size_bytes = 0;
2220 
2221  LOG_FUNCTION_START("");
2222 
2223  /* Determine multi byte read transaction size */
2224 
2225  switch (device_results_level) {
2227  i2c_buffer_size_bytes =
2230  i2c_index;
2231  break;
2233  i2c_buffer_size_bytes =
2236  i2c_index;
2237  break;
2238  default:
2239  i2c_buffer_size_bytes =
2241  break;
2242  }
2243 
2244  /* Read Result Data */
2245 
2246  if (status == VL53L1_ERROR_NONE) /*lint !e774 always true*/
2247  status =
2249  Dev,
2250  i2c_index,
2251  buffer,
2252  (uint32_t)i2c_buffer_size_bytes);
2253 
2254  /* Decode I2C buffer */
2255 
2256  if (device_results_level >= VL53L1_DEVICERESULTSLEVEL_FULL &&
2257  status == VL53L1_ERROR_NONE) {
2258 
2259  i2c_buffer_offset_bytes =
2260  VL53L1_DEBUG_RESULTS_I2C_INDEX - i2c_index;
2261 
2262  status =
2265  &buffer[i2c_buffer_offset_bytes],
2266  pdebug_results);
2267  }
2268 
2269  if (device_results_level >= VL53L1_DEVICERESULTSLEVEL_UPTO_CORE &&
2270  status == VL53L1_ERROR_NONE) {
2271 
2272  i2c_buffer_offset_bytes =
2273  VL53L1_CORE_RESULTS_I2C_INDEX - i2c_index;
2274 
2275  status =
2278  &buffer[i2c_buffer_offset_bytes],
2279  pcore_results);
2280  }
2281 
2282  if (status == VL53L1_ERROR_NONE) {
2283 
2284  i2c_buffer_offset_bytes = 0;
2285  status =
2288  &buffer[i2c_buffer_offset_bytes],
2289  psystem_results);
2290  }
2291 
2292  LOG_FUNCTION_END(status);
2293 
2294  return status;
2295 }
2296 
2297 
2299  VL53L1_DEV Dev,
2300  VL53L1_DeviceResultsLevel device_results_level,
2301  VL53L1_range_results_t *prange_results)
2302 {
2303  /*
2304  * Wrapper function using the functions below
2305  *
2306  * VL53L1_get_measurement_results()
2307  * VL53L1_init_and_start_range()
2308  * VL53L1_copy_sys_and_core_results_to_range_results()
2309  *
2310  * The input measurement mode controls what happens next ...
2311  */
2312 
2314 
2315  VL53L1_LLDriverData_t *pdev =
2317  VL53L1_LLDriverResults_t *pres =
2319 
2320  VL53L1_range_results_t *presults = &(pres->range_results);
2321 
2322  LOG_FUNCTION_START("");
2323 
2324  /* Get device results */
2325 
2326  if (status == VL53L1_ERROR_NONE) /*lint !e774 always true*/
2328  Dev,
2329  device_results_level);
2330 
2331  if (status == VL53L1_ERROR_NONE)
2334  &(pdev->sys_results),
2335  &(pdev->core_results),
2336  presults);
2337 
2338  /* Start Patch_LowPowerAutoMode */
2339  /* process results from first range of low power auto */
2341  /* change to manual calibrations. Only needed on the
2342  * first range out */
2343  if ((status == VL53L1_ERROR_NONE) &&
2346  Dev);
2348  } else if ((status == VL53L1_ERROR_NONE) &&
2351  }
2352 
2353  /* perform DSS calculation. This can be performed every range */
2354  if ((pdev->low_power_auto_data.low_power_auto_range_count != 0xFF) &&
2355  (status == VL53L1_ERROR_NONE)) {
2357  Dev);
2358  }
2359 
2360  }
2361  /* End Patch_LowPowerAutoMode */
2362 
2363  /* copy current state into results */
2364 
2365  presults->cfg_device_state = pdev->ll_state.cfg_device_state;
2366  presults->rd_device_state = pdev->ll_state.rd_device_state;
2367 
2368  /* copy internal structure to supplied output pointer */
2369 
2370  memcpy(
2371  prange_results,
2372  presults,
2373  sizeof(VL53L1_range_results_t));
2374 
2375  /*
2376  * Check LL driver and Device are in Sync
2377  * If not an error is raised
2378  */
2379 
2380  if (status == VL53L1_ERROR_NONE)
2381  status = VL53L1_check_ll_driver_rd_state(Dev);
2382 
2383 #ifdef VL53L1_LOG_ENABLE
2384  if (status == VL53L1_ERROR_NONE)
2385  VL53L1_print_range_results(
2386  presults,
2387  "get_device_results():pdev->llresults.range_results.",
2388  VL53L1_TRACE_MODULE_RANGE_RESULTS_DATA);
2389 #endif
2390 
2391  LOG_FUNCTION_END(status);
2392 
2393  return status;
2394 }
2395 
2396 
2398  VL53L1_DEV Dev,
2399  uint8_t measurement_mode)
2400 {
2401 
2402  /*
2403  * Enable next range by sending handshake which
2404  * clears the interrupt
2405  */
2406 
2408 
2409  LOG_FUNCTION_START("");
2410 
2411  /* Dynamic Management */
2412  /* Current results analysis and generate next settings */
2413 
2414 
2415  /* Dynamic GPH Management */
2416  /* Setup GPH absorption point and config values for next measurement */
2417 
2418  /* Update GPH registers, clear interrupt and set measurement mode */
2419 
2420  if (status == VL53L1_ERROR_NONE) /*lint !e774 always true*/
2421  status = VL53L1_init_and_start_range(
2422  Dev,
2423  measurement_mode,
2425 
2426  LOG_FUNCTION_END(status);
2427 
2428  return status;
2429 }
2430 
2431 
2433  int32_t gain_factor,
2435  VL53L1_core_results_t *pcore,
2436  VL53L1_range_results_t *presults)
2437 {
2438  uint8_t i = 0;
2439 
2440  VL53L1_range_data_t *pdata;
2441  int32_t range_mm = 0;
2442  uint32_t tmpu32 = 0;
2443 
2444  LOG_FUNCTION_START("");
2445 
2446  /* copy results */
2447 
2448  presults->stream_count = psys->result__stream_count;
2449 
2450  pdata = &(presults->data[0]);
2451 
2452  for (i = 0 ; i < 2 ; i++) {
2453 
2454  pdata->range_id = i;
2455  pdata->time_stamp = 0;
2456 
2457  if ((psys->result__stream_count == 0) &&
2461  } else {
2462  pdata->range_status =
2464  }
2465 
2466  switch (i) {
2467 
2468  case 0:
2469 
2471  pdata->actual_effective_spads =
2474  pdata->actual_effective_spads =
2476  else
2477  pdata->actual_effective_spads =
2479 
2484  pdata->ambient_count_rate_mcps =
2486 
2487  /* Start Patch_SigmaEstimateAccuracyImprovement */
2488 
2489  /* shift up sigma estimate to 7 bit fractional and clip to 9 bit int */
2490  tmpu32 = ((uint32_t)psys->result__sigma_sd0 << 5);
2491  if (tmpu32 > 0xFFFF) {
2492  tmpu32 = 0xFFFF;
2493  }
2494  pdata->sigma_mm = (uint16_t)tmpu32;
2495 
2496  /* End Patch_SigmaEstimateAccuracyImprovement */
2497 
2498  pdata->median_phase =
2499  psys->result__phase_sd0;
2500 
2501  range_mm =
2503 
2504  /* apply correction gain */
2505  range_mm *= gain_factor;
2506  range_mm += 0x0400;
2507  range_mm /= 0x0800;
2508 
2509  pdata->median_range_mm = (int16_t)range_mm;
2510 
2511  pdata->ranging_total_events =
2513  pdata->signal_total_events =
2515  pdata->total_periods_elapsed =
2517  pdata->ambient_window_events =
2519 
2520  break;
2521  case 1:
2522 
2523  pdata->actual_effective_spads =
2528  0xFFFF;
2529  pdata->ambient_count_rate_mcps =
2531 
2532  /* Start Patch_SigmaEstimateAccuracyImprovement */
2533 
2534  /* shift up sigma estimate to 7 bit fractional and clip to 9 bit int */
2535  tmpu32 = ((uint32_t)psys->result__sigma_sd1 << 5);
2536  if (tmpu32 > 0xFFFF) {
2537  tmpu32 = 0xFFFF;
2538  }
2539  pdata->sigma_mm = (uint16_t)tmpu32;
2540 
2541  /* End Patch_SigmaEstimateAccuracyImprovement */
2542 
2543  pdata->median_phase =
2544  psys->result__phase_sd1;
2545 
2546  range_mm =
2548 
2549  /* apply correction gain */
2550  range_mm *= gain_factor;
2551  range_mm += 0x0400;
2552  range_mm /= 0x0800;
2553 
2554  pdata->median_range_mm = (int16_t)range_mm;
2555 
2556  pdata->ranging_total_events =
2558  pdata->signal_total_events =
2560  pdata->total_periods_elapsed =
2562  pdata->ambient_window_events =
2564 
2565  break;
2566  }
2567 
2568  pdata++;
2569  }
2570 
2571  /* Update Global Device Status for results
2572  * - Default to no update
2573  */
2574 
2576 
2577  /* Check range status
2578  * - If device error condition, update device status
2579  * - Remove device status from range status output this should
2580  * only contain information relating to range data
2581  */
2582 
2583  switch (psys->result__range_status &
2585 
2591 
2592  presults->device_status = (psys->result__range_status &
2594 
2596  break;
2597 
2598  }
2599 
2600  LOG_FUNCTION_END(0);
2601 }
2602 
2603 /*
2604  * Configure the GPIO interrupt config, from the given input
2605  */
2606 
2608  VL53L1_DEV Dev,
2609  VL53L1_GPIO_Interrupt_Mode intr_mode_distance,
2610  VL53L1_GPIO_Interrupt_Mode intr_mode_rate,
2611  uint8_t intr_new_measure_ready,
2612  uint8_t intr_no_target,
2613  uint8_t intr_combined_mode,
2614  uint16_t thresh_distance_high,
2615  uint16_t thresh_distance_low,
2616  uint16_t thresh_rate_high,
2617  uint16_t thresh_rate_low
2618  )
2619 {
2621 
2624 
2625  LOG_FUNCTION_START("");
2626 
2627  /* update local data structure */
2628  pintconf->intr_mode_distance = intr_mode_distance;
2629  pintconf->intr_mode_rate = intr_mode_rate;
2630  pintconf->intr_new_measure_ready = intr_new_measure_ready;
2631  pintconf->intr_no_target = intr_no_target;
2632  pintconf->intr_combined_mode = intr_combined_mode;
2633  pintconf->threshold_distance_high = thresh_distance_high;
2634  pintconf->threshold_distance_low = thresh_distance_low;
2635  pintconf->threshold_rate_high = thresh_rate_high;
2636  pintconf->threshold_rate_low = thresh_rate_low;
2637 
2638  /* encoded interrupt config */
2641 
2642 
2643  /* set thresholds */
2645  Dev,
2646  pintconf);
2647 
2648  LOG_FUNCTION_END(status);
2649  return status;
2650 }
2651 
2652 /*
2653  * Configure the GPIO interrupt config, from the given structure
2654  */
2655 
2657  VL53L1_DEV Dev,
2659 {
2661 
2664 
2665  LOG_FUNCTION_START("");
2666 
2667  /* using memcpy(dst, src, size in bytes) */
2668  memcpy(pintconf, &(intconf), sizeof(VL53L1_GPIO_interrupt_config_t));
2669 
2670  /* encoded interrupt config */
2673 
2674  /* set thresholds */
2676  Dev,
2677  pintconf);
2678 
2679  LOG_FUNCTION_END(status);
2680  return status;
2681 }
2682 
2683 /*
2684  * Retrieve GPIO interrupt config structure
2685  */
2686 
2688  VL53L1_DEV Dev,
2690 {
2692 
2694 
2695  LOG_FUNCTION_START("");
2696 
2697  /*
2698  * Decode the system__interrupt_config_gpio register
2699  * This makes sure the structure is in line with the register
2700  */
2703 
2704  /*
2705  * Readout the system thresholds
2706  */
2711 
2716 
2717  if (pintconf == &(pdev->gpio_interrupt_config)) {
2718  /* Cowardly refusing to copy the same memory locations */
2719  } else {
2720 
2721  /* using memcpy(dst, src, size in bytes) */
2722  memcpy(pintconf, &(pdev->gpio_interrupt_config),
2724  }
2725 
2726  LOG_FUNCTION_END(status);
2727  return status;
2728 }
2729 
2731  VL53L1_DEV Dev,
2732  VL53L1_OffsetCalibrationMode offset_cal_mode)
2733 {
2734 
2735  /*
2736  * Sets the offset calibration mode
2737  */
2738 
2740 
2742 
2743  LOG_FUNCTION_START("");
2744 
2745  pdev->offset_calibration_mode = offset_cal_mode;
2746 
2747  LOG_FUNCTION_END(status);
2748 
2749  return status;
2750 }
2751 
2752 
2754  VL53L1_DEV Dev,
2755  VL53L1_OffsetCalibrationMode *poffset_cal_mode)
2756 {
2757 
2758  /*
2759  * Gets the offset calibration mode
2760  */
2761 
2763 
2765 
2766  LOG_FUNCTION_START("");
2767 
2768  *poffset_cal_mode = pdev->offset_calibration_mode;
2769 
2770  LOG_FUNCTION_END(status);
2771 
2772  return status;
2773 }
2774 
2775 
2777  VL53L1_DEV Dev,
2778  VL53L1_OffsetCorrectionMode offset_cor_mode)
2779 {
2780 
2781  /*
2782  * Sets the offset correction mode
2783  */
2784 
2786 
2788 
2789  LOG_FUNCTION_START("");
2790 
2791  pdev->offset_correction_mode = offset_cor_mode;
2792 
2793  LOG_FUNCTION_END(status);
2794 
2795  return status;
2796 }
2797 
2798 
2800  VL53L1_DEV Dev,
2801  VL53L1_OffsetCorrectionMode *poffset_cor_mode)
2802 {
2803 
2804  /*
2805  * Gets the offset correction mode
2806  */
2807 
2809 
2811 
2812  LOG_FUNCTION_START("");
2813 
2814  *poffset_cor_mode = pdev->offset_correction_mode;
2815 
2816  LOG_FUNCTION_END(status);
2817 
2818  return status;
2819 }
2820 
2821 
2822 /* Start Patch_AddedTuningParms_11761 */
2823 #ifdef VL53L1_DEBUG
2824 VL53L1_Error VL53L1_get_tuning_debug_data(
2825  VL53L1_DEV Dev,
2826  VL53L1_tuning_parameters_t *ptun_data)
2827 {
2828  /*
2829  * Helper function to extract all tuning parm values
2830  */
2831 
2833 
2835 
2836  LOG_FUNCTION_START("");
2837 
2838  ptun_data->vl53l1_tuningparm_version =
2840 
2843 
2844 
2845  ptun_data->vl53l1_tuningparm_lld_version =
2847 
2850 
2853 
2856 
2859 
2862 
2865 
2868 
2871 
2874 
2877 
2878  ptun_data->vl53l1_tuningparm_lite_rit_mult =
2880 
2883 
2886 
2889 
2892 
2895 
2898 
2901 
2904 
2907 
2910 
2913 
2914  ptun_data->vl53l1_tuningparm_vhv_loopbound =
2916 
2919 
2921  pdev->refspadchar.vcsel_period;
2922 
2924  pdev->refspadchar.timeout_us;
2925 
2928 
2931 
2934 
2937 
2940 
2943 
2946 
2949 
2952 
2955 
2957  pdev->ssc_cfg.vcsel_period;
2958 
2960  pdev->ssc_cfg.vcsel_start;
2961 
2963  pdev->ssc_cfg.rate_limit_mcps;
2964 
2967 
2970 
2973 
2976 
2979 
2982 
2985 
2988 
2991 
2994 
2997 
2998  LOG_FUNCTION_END(status);
2999 
3000  return status;
3001 }
3002 #endif
3003 
3005  VL53L1_DEV Dev,
3006  VL53L1_TuningParms tuning_parm_key,
3007  int32_t *ptuning_parm_value)
3008 {
3009 
3010  /*
3011  * Gets the requested tuning parm value
3012  * - Large case statement for returns
3013  * - if key does not match, INVALID parm error returned
3014  */
3015 
3017 
3019 
3020  LOG_FUNCTION_START("");
3021 
3022  switch (tuning_parm_key) {
3023 
3025  *ptuning_parm_value =
3027  break;
3029  *ptuning_parm_value =
3031  break;
3033  *ptuning_parm_value =
3035  break;
3037  *ptuning_parm_value =
3039  break;
3041  *ptuning_parm_value =
3043  break;
3045  *ptuning_parm_value =
3047  break;
3049  *ptuning_parm_value =
3051  break;
3053  *ptuning_parm_value =
3055  break;
3057  *ptuning_parm_value =
3059  break;
3061  *ptuning_parm_value =
3063  break;
3065  *ptuning_parm_value =
3067  break;
3069  *ptuning_parm_value =
3071  break;
3073  *ptuning_parm_value =
3075  break;
3077  *ptuning_parm_value =
3079  break;
3081  *ptuning_parm_value =
3083  break;
3085  *ptuning_parm_value =
3087  break;
3089  *ptuning_parm_value =
3091  break;
3093  *ptuning_parm_value =
3095  break;
3097  *ptuning_parm_value =
3099  break;
3101  *ptuning_parm_value =
3103  break;
3105  *ptuning_parm_value =
3107  break;
3109  *ptuning_parm_value =
3111  break;
3113  *ptuning_parm_value =
3115  break;
3117  *ptuning_parm_value =
3119  break;
3121  *ptuning_parm_value =
3123  break;
3125  *ptuning_parm_value =
3127  break;
3129  *ptuning_parm_value =
3131  break;
3133  *ptuning_parm_value =
3135  break;
3137  *ptuning_parm_value =
3139  break;
3141  *ptuning_parm_value =
3143  break;
3145  *ptuning_parm_value =
3147  break;
3149  *ptuning_parm_value =
3151  break;
3153  *ptuning_parm_value =
3155  break;
3157  *ptuning_parm_value =
3159  break;
3161  *ptuning_parm_value =
3163  break;
3165  *ptuning_parm_value =
3167  break;
3169  *ptuning_parm_value =
3171  break;
3173  *ptuning_parm_value =
3175  break;
3177  *ptuning_parm_value =
3179  break;
3181  *ptuning_parm_value =
3183  break;
3185  *ptuning_parm_value =
3187  break;
3189  *ptuning_parm_value =
3191  break;
3193  *ptuning_parm_value =
3195  break;
3197  *ptuning_parm_value =
3198  (int32_t)pdev->ssc_cfg.vcsel_period;
3199  break;
3201  *ptuning_parm_value =
3202  (int32_t)pdev->ssc_cfg.vcsel_start;
3203  break;
3205  *ptuning_parm_value =
3207  break;
3209  *ptuning_parm_value =
3211  break;
3213  *ptuning_parm_value =
3215  break;
3217  *ptuning_parm_value =
3219  break;
3221  *ptuning_parm_value =
3223  break;
3225  *ptuning_parm_value =
3227  break;
3229  *ptuning_parm_value =
3231  break;
3233  *ptuning_parm_value =
3235  break;
3237  *ptuning_parm_value =
3239  break;
3241  *ptuning_parm_value =
3243  break;
3245  *ptuning_parm_value =
3247  break;
3249  *ptuning_parm_value =
3251  break;
3252 
3253 
3254  default:
3255  *ptuning_parm_value = 0x7FFFFFFF;
3256  status = VL53L1_ERROR_INVALID_PARAMS;
3257  break;
3258 
3259  }
3260 
3261  LOG_FUNCTION_END(status);
3262 
3263  return status;
3264 }
3265 
3267  VL53L1_DEV Dev,
3268  VL53L1_TuningParms tuning_parm_key,
3269  int32_t tuning_parm_value)
3270 {
3271 
3272  /*
3273  * Sets the requested tuning parm value
3274  * - Large case statement for set value
3275  * - if key does not match, INVALID parm error returned
3276  */
3277 
3279 
3281 
3282  LOG_FUNCTION_START("");
3283 
3284  switch (tuning_parm_key) {
3285 
3288  (uint16_t)tuning_parm_value;
3289  break;
3292  (uint16_t)tuning_parm_value;
3293 
3294  /* Perform Key Table Check
3295  *
3296  * - If does not match default, key table
3297  * format does not match tuning file,
3298  * error should be thrown
3299  *
3300  */
3301 
3302  if ((uint16_t)tuning_parm_value
3305  }
3306  break;
3309  (uint16_t)tuning_parm_value;
3310  break;
3313  (uint8_t)tuning_parm_value;
3314  break;
3317  (uint8_t)tuning_parm_value;
3318  break;
3321  (uint16_t)tuning_parm_value;
3322  break;
3325  (uint16_t)tuning_parm_value;
3326  break;
3329  (uint8_t)tuning_parm_value;
3330  break;
3333  (uint16_t)tuning_parm_value;
3334  break;
3337  (uint16_t)tuning_parm_value;
3338  break;
3341  (uint16_t)tuning_parm_value;
3342  break;
3345  (uint16_t)tuning_parm_value;
3346  break;
3349  (uint16_t)tuning_parm_value;
3350  break;
3353  (uint16_t)tuning_parm_value;
3354  break;
3357  (uint8_t)tuning_parm_value;
3358  break;
3361  (uint8_t)tuning_parm_value;
3362  break;
3365  (uint8_t)tuning_parm_value;
3366  break;
3369  (uint8_t)tuning_parm_value;
3370  break;
3373  (uint8_t)tuning_parm_value;
3374  break;
3377  (uint8_t)tuning_parm_value;
3378  break;
3381  (uint8_t)tuning_parm_value;
3382  break;
3385  (int16_t)tuning_parm_value;
3386  break;
3389  (uint8_t)tuning_parm_value;
3390  break;
3393  (uint8_t)tuning_parm_value;
3394  break;
3397  (uint8_t)tuning_parm_value;
3398  break;
3401  (uint8_t)tuning_parm_value;
3402  break;
3405  (uint8_t)tuning_parm_value;
3406  break;
3409  (uint8_t)tuning_parm_value;
3410  break;
3413  (uint8_t)tuning_parm_value;
3414  break;
3417  (uint8_t)tuning_parm_value;
3418  break;
3421  (uint8_t)tuning_parm_value;
3422  break;
3424  pdev->refspadchar.vcsel_period =
3425  (uint8_t)tuning_parm_value;
3426  break;
3428  pdev->refspadchar.timeout_us =
3429  (uint32_t)tuning_parm_value;
3430  break;
3433  (uint16_t)tuning_parm_value;
3434  break;
3437  (uint16_t)tuning_parm_value;
3438  break;
3441  (uint16_t)tuning_parm_value;
3442  break;
3445  (uint16_t)tuning_parm_value;
3446  break;
3449  (uint32_t)tuning_parm_value;
3450  break;
3453  (uint32_t)tuning_parm_value;
3454  break;
3457  (uint32_t)tuning_parm_value;
3458  break;
3461  (uint8_t)tuning_parm_value;
3462  break;
3465  (uint8_t)tuning_parm_value;
3466  break;
3469  (uint8_t)tuning_parm_value;
3470  break;
3472  pdev->ssc_cfg.vcsel_period =
3473  (uint8_t)tuning_parm_value;
3474  break;
3476  pdev->ssc_cfg.vcsel_start =
3477  (uint8_t)tuning_parm_value;
3478  break;
3480  pdev->ssc_cfg.rate_limit_mcps =
3481  (uint16_t)tuning_parm_value;
3482  break;
3485  (uint16_t)tuning_parm_value;
3486  break;
3489  (uint16_t)tuning_parm_value;
3490  break;
3493  (uint32_t)tuning_parm_value;
3494  break;
3497  (uint32_t)tuning_parm_value;
3498  break;
3501  (uint32_t)tuning_parm_value;
3502  break;
3505  (uint32_t)tuning_parm_value;
3506  break;
3509  (uint32_t)tuning_parm_value;
3510  break;
3513  (uint32_t)tuning_parm_value;
3514  break;
3517  (uint8_t)tuning_parm_value;
3518  break;
3521  (uint32_t)tuning_parm_value;
3522  break;
3525  (uint32_t)tuning_parm_value;
3526  break;
3527 
3528 
3529  default:
3530  status = VL53L1_ERROR_INVALID_PARAMS;
3531  break;
3532 
3533  }
3534 
3535  LOG_FUNCTION_END(status);
3536 
3537  return status;
3538 }
3539 
3540 /* End Patch_AddedTuningParms_11761 */
VL53L1_system_results_t
Definition: vl53l1_register_structs.h:1359
VL53L1_general_config_t::system__thresh_rate_high
uint16_t system__thresh_rate_high
Definition: vl53l1_register_structs.h:850
VL53L1_CORE_RESULTS_I2C_INDEX
#define VL53L1_CORE_RESULTS_I2C_INDEX
Definition: vl53l1_register_structs.h:82
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lowpowerauto_range_config_timeout_us
uint32_t vl53l1_tuningparm_lowpowerauto_range_config_timeout_us
Definition: vl53l1_ll_def.h:1004
VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__STANDARD
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__STANDARD
Definition: vl53l1_ll_device.h:168
VL53L1_init_ll_driver_state
void VL53L1_init_ll_driver_state(VL53L1_DEV Dev, VL53L1_DeviceState device_state)
Initialise LL Driver State.
Definition: vl53l1_core.c:114
VL53L1_tuning_parm_storage_t::tp_lite_sigma_est_amb_width_ns
uint8_t tp_lite_sigma_est_amb_width_ns
Definition: vl53l1_ll_def.h:338
VL53L1_range_data_t::range_status
uint8_t range_status
Definition: vl53l1_ll_def.h:597
VL53L1_copy_sys_and_core_results_to_range_results
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.
Definition: vl53l1_api_core.c:2432
VL53L1_TUNINGPARM_OFFSET_CAL_PRE_SAMPLES
#define VL53L1_TUNINGPARM_OFFSET_CAL_PRE_SAMPLES
Definition: vl53l1_ll_device.h:655
VL53L1_system_results_t::result__dss_actual_effective_spads_sd1
uint16_t result__dss_actual_effective_spads_sd1
Definition: vl53l1_register_structs.h:1505
VL53L1_timing_config_t
Definition: vl53l1_register_structs.h:932
VL53L1_TUNINGPARM_LITE_SIGMA_EST_AMB_WIDTH_NS
#define VL53L1_TUNINGPARM_LITE_SIGMA_EST_AMB_WIDTH_NS
Definition: vl53l1_ll_device.h:605
VL53L1_SOFTWARE_RESET_DURATION_US
#define VL53L1_SOFTWARE_RESET_DURATION_US
Definition: vl53l1_ll_device.h:481
VL53L1_xtalk_config_t::crosstalk_range_ignore_threshold_mult
uint8_t crosstalk_range_ignore_threshold_mult
Definition: vl53l1_ll_def.h:235
VL53L1_low_power_auto_data_t
Structure to hold state, tuning and output variables for the low power auto mode (Presence)
Definition: vl53l1_ll_def.h:480
VL53L1_get_lite_xtalk_margin_kcps
VL53L1_Error VL53L1_get_lite_xtalk_margin_kcps(VL53L1_DEV Dev, int16_t *pxtalk_margin)
Get function for Xtalk Margin setting Histogram Mode version.
Definition: vl53l1_api_core.c:1539
VL53L1_tuning_parm_storage_t::tp_range_timeout_lite_us
uint32_t tp_range_timeout_lite_us
Definition: vl53l1_ll_def.h:383
VL53L1_user_zone_t
Defines User Zone(ROI) parameters.
Definition: vl53l1_ll_def.h:413
vl53l1_ll_def.h
Type definitions for VL53L1 LL Driver.
VL53L1_calc_macro_period_us
uint32_t VL53L1_calc_macro_period_us(uint16_t fast_osc_frequency, uint8_t vcsel_period)
Forces shadow stream count to zero.
Definition: vl53l1_core.c:920
VL53L1_dynamic_config_t::system__thresh_low
uint16_t system__thresh_low
Definition: vl53l1_register_structs.h:1127
VL53L1_TUNINGPARM_LITE_XTALK_MARGIN_KCPS
#define VL53L1_TUNINGPARM_LITE_XTALK_MARGIN_KCPS
Definition: vl53l1_ll_device.h:617
VL53L1_offsetcal_config_t::pre_num_of_samples
uint8_t pre_num_of_samples
Definition: vl53l1_ll_def.h:793
VL53L1_SYSTEM_RESULTS_I2C_SIZE_BYTES
#define VL53L1_SYSTEM_RESULTS_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:103
uint32_t
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
uint8_t
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
VL53L1_GPIO_interrupt_config_t::intr_no_target
uint8_t intr_no_target
Definition: vl53l1_ll_def.h:444
VL53L1_i2c_encode_system_control
VL53L1_Error VL53L1_i2c_encode_system_control(VL53L1_system_control_t *pdata, uint16_t buf_size, uint8_t *pbuffer)
Gets dynamic_config register group.
Definition: vl53l1_register_funcs.c:1239
VL53L1_range_data_t::sigma_mm
uint16_t sigma_mm
Definition: vl53l1_ll_def.h:580
VL53L1_core_results_t::result_core__ambient_window_events_sd0
uint32_t result_core__ambient_window_events_sd0
Definition: vl53l1_register_structs.h:1629
VL53L1_debug_results_t::result__osc_calibrate_val
uint16_t result__osc_calibrate_val
Definition: vl53l1_register_structs.h:1802
VL53L1_timing_config_t::mm_config__timeout_macrop_a_lo
uint8_t mm_config__timeout_macrop_a_lo
Definition: vl53l1_register_structs.h:943
VL53L1_TUNINGPARM_SPADMAP_RATE_LIMIT_MCPS
#define VL53L1_TUNINGPARM_SPADMAP_RATE_LIMIT_MCPS
Definition: vl53l1_ll_device.h:665
VL53L1_LLDriverData_t::debug_mode
uint8_t debug_mode
Definition: vl53l1_ll_def.h:841
VL53L1_TUNINGPARM_TIMED_RANGE_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_TIMED_RANGE_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:681
vl53l1_api_debug.h
EwokPlus25 low level API function definitions.
VL53L1_tuning_parm_storage_t::tp_lite_min_clip
uint8_t tp_lite_min_clip
Definition: vl53l1_ll_def.h:304
VL53L1_LLDriverData_t::version
VL53L1_ll_version_t version
Definition: vl53l1_ll_def.h:845
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_mm_config_timeout_us
uint32_t vl53l1_tuningparm_lite_mm_config_timeout_us
Definition: vl53l1_ll_def.h:998
trace_print
#define trace_print(level,...)
Definition: vl53l1_api_core.c:96
VL53L1_set_calibration_repeat_period
VL53L1_Error VL53L1_set_calibration_repeat_period(VL53L1_DEV Dev, uint16_t cal_config__repeat_period)
Sets the 12-bit calibration repeat period value.
Definition: vl53l1_api_core.c:773
VL53L1_tuning_parameters_t::vl53l1_tuningparm_initial_phase_ref_lite_long_range
uint8_t vl53l1_tuningparm_initial_phase_ref_lite_long_range
Definition: vl53l1_ll_def.h:973
VL53L1_i2c_decode_system_results
VL53L1_Error VL53L1_i2c_decode_system_results(uint16_t buf_size, uint8_t *pbuffer, VL53L1_system_results_t *pdata)
Gets system_control register group.
Definition: vl53l1_register_funcs.c:1491
VL53L1_TUNINGPARM_LITE_SEED_CONFIG
#define VL53L1_TUNINGPARM_LITE_SEED_CONFIG
Definition: vl53l1_ll_device.h:611
VL53L1_SYSTEM_RESULTS_I2C_INDEX
#define VL53L1_SYSTEM_RESULTS_I2C_INDEX
Definition: vl53l1_register_structs.h:81
VL53L1_tuning_parameters_t::vl53l1_tuningparm_offset_cal_dss_rate_mcps
uint16_t vl53l1_tuningparm_offset_cal_dss_rate_mcps
Definition: vl53l1_ll_def.h:984
VL53L1_tuning_parm_storage_t
TuningParameter Storage.
Definition: vl53l1_ll_def.h:254
VL53L1_core_results_t
Definition: vl53l1_register_structs.h:1628
VL53L1_tuning_parm_storage_t::tp_mm_timeout_lite_us
uint32_t tp_mm_timeout_lite_us
Definition: vl53l1_ll_def.h:373
VL53L1_LLDriverData_t::mm_config_timeout_us
uint32_t mm_config_timeout_us
Definition: vl53l1_ll_def.h:828
VL53L1_additional_offset_cal_data_t
Additional Offset Calibration Data.
Definition: vl53l1_ll_def.h:692
VL53L1_tuning_parameters_t::vl53l1_tuningparm_timed_phasecal_config_timeout_us
uint32_t vl53l1_tuningparm_timed_phasecal_config_timeout_us
Definition: vl53l1_ll_def.h:997
VL53L1_DEVICEMEASUREMENTMODE_STOP_MASK
#define VL53L1_DEVICEMEASUREMENTMODE_STOP_MASK
Definition: vl53l1_register_settings.h:118
VL53L1_system_results_t::result__phase_sd1
uint16_t result__phase_sd1
Definition: vl53l1_register_structs.h:1545
VL53L1_tuning_parm_storage_t::tp_lite_short_min_count_rate_rtn_mcps
uint16_t tp_lite_short_min_count_rate_rtn_mcps
Definition: vl53l1_ll_def.h:330
VL53L1_TUNINGPARM_TIMED_PHASECAL_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_TIMED_PHASECAL_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:673
VL53L1_system_results_t::result__final_crosstalk_corrected_range_mm_sd0
uint16_t result__final_crosstalk_corrected_range_mm_sd0
Definition: vl53l1_register_structs.h:1455
VL53L1_preset_mode_standard_ranging_short_range
VL53L1_Error VL53L1_preset_mode_standard_ranging_short_range(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_STANDAR...
Definition: vl53l1_api_preset_modes.c:655
VL53L1_core_results_t::result_core__signal_total_events_sd0
int32_t result_core__signal_total_events_sd0
Definition: vl53l1_register_structs.h:1649
VL53L1_LLDriverData_t::add_off_cal_data
VL53L1_additional_offset_cal_data_t add_off_cal_data
Definition: vl53l1_ll_def.h:856
VL53L1_encode_row_col
void VL53L1_encode_row_col(uint8_t row, uint8_t col, uint8_t *pspad_number)
Encodes a (col,row) coord value into ByteIndex.BitIndex format.
Definition: vl53l1_core.c:1451
VL53L1_TUNINGPARM_LITE_MED_SIGMA_THRESH_MM
#define VL53L1_TUNINGPARM_LITE_MED_SIGMA_THRESH_MM
Definition: vl53l1_ll_device.h:593
VL53L1_TUNINGPARM_LOWPOWERAUTO_RANGE_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_LOWPOWERAUTO_RANGE_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:687
VL53L1_i2c_encode_static_config
VL53L1_Error VL53L1_i2c_encode_static_config(VL53L1_static_config_t *pdata, uint16_t buf_size, uint8_t *pbuffer)
Encodes data structure VL53L1_static_config_t into a I2C write buffer.
Definition: vl53l1_register_funcs.c:432
VL53L1_tuning_parameters_t::vl53l1_tuningparm_offset_cal_mm1_samples
uint8_t vl53l1_tuningparm_offset_cal_mm1_samples
Definition: vl53l1_ll_def.h:989
VL53L1_TUNINGPARM_REFSPADCHAR_MIN_COUNTRATE_LIMIT_MCPS
#define VL53L1_TUNINGPARM_REFSPADCHAR_MIN_COUNTRATE_LIMIT_MCPS
Definition: vl53l1_ll_device.h:643
VL53L1_get_refspadchar_config_struct
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.
Definition: vl53l1_api_core.c:942
VL53L1_tuning_parm_storage_t::tp_dss_target_timed_mcps
uint16_t tp_dss_target_timed_mcps
Definition: vl53l1_ll_def.h:361
VL53L1_dynamic_config_t::roi_config__user_roi_centre_spad
uint8_t roi_config__user_roi_centre_spad
Definition: vl53l1_register_structs.h:1230
VL53L1_TUNINGPARM_LITE_LONG_MIN_COUNT_RATE_RTN_MCPS
#define VL53L1_TUNINGPARM_LITE_LONG_MIN_COUNT_RATE_RTN_MCPS
Definition: vl53l1_ll_device.h:597
VL53L1_LLDriverData_t::dss_config__target_total_rate_mcps
uint16_t dss_config__target_total_rate_mcps
Definition: vl53l1_ll_def.h:834
VL53L1_DEVICEERROR_VCSELWATCHDOGTESTFAILURE
#define VL53L1_DEVICEERROR_VCSELWATCHDOGTESTFAILURE
Definition: vl53l1_ll_device.h:259
VL53L1_DEVICECONFIGLEVEL_FULL
#define VL53L1_DEVICECONFIGLEVEL_FULL
Definition: vl53l1_ll_device.h:356
VL53L1_tuning_parameters_t::vl53l1_tuningparm_refspadchar_min_countrate_limit_mcps
uint16_t vl53l1_tuningparm_refspadchar_min_countrate_limit_mcps
Definition: vl53l1_ll_def.h:982
VL53L1_DeviceConfigLevel
uint8_t VL53L1_DeviceConfigLevel
Definition: vl53l1_ll_device.h:332
VL53L1_TUNINGPARM_OFFSET_CAL_PHASECAL_TIMEOUT_US
#define VL53L1_TUNINGPARM_OFFSET_CAL_PHASECAL_TIMEOUT_US
Definition: vl53l1_ll_device.h:649
VL53L1_DEVICEPRESETMODE_SINGLESHOT_RANGING
#define VL53L1_DEVICEPRESETMODE_SINGLESHOT_RANGING
Definition: vl53l1_ll_device.h:137
VL53L1_TUNINGPARM_LITE_PHASECAL_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_LITE_PHASECAL_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:671
VL53L1_DEVICEPRESETMODE_STANDARD_RANGING
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING
Definition: vl53l1_ll_device.h:128
VL53L1_calibration_data_t::cal_peak_rate_map
VL53L1_cal_peak_rate_map_t cal_peak_rate_map
Definition: vl53l1_ll_def.h:935
VL53L1_TUNINGPARM_INITIAL_PHASE_REF_LITE_MED_RANGE
#define VL53L1_TUNINGPARM_INITIAL_PHASE_REF_LITE_MED_RANGE
Definition: vl53l1_ll_device.h:627
VL53L1_LLDriverData_t::range_config_timeout_us
uint32_t range_config_timeout_us
Definition: vl53l1_ll_def.h:830
VL53L1_dynamic_config_t::system__thresh_high
uint16_t system__thresh_high
Definition: vl53l1_register_structs.h:1117
VL53L1_LLDriverData_t::ll_state
VL53L1_ll_driver_state_t ll_state
Definition: vl53l1_ll_def.h:848
VL53L1_DYNAMIC_CONFIG_I2C_INDEX
#define VL53L1_DYNAMIC_CONFIG_I2C_INDEX
Definition: vl53l1_register_structs.h:79
VL53L1_range_data_t
Internal data structure for storing post processed ranges.
Definition: vl53l1_ll_def.h:523
VL53L1_set_part_to_part_data
VL53L1_Error VL53L1_set_part_to_part_data(VL53L1_DEV Dev, VL53L1_calibration_data_t *pcal_data)
Sets the customer part to part data.
Definition: vl53l1_api_core.c:449
VL53L1_preset_mode_standard_ranging_mm2_cal
VL53L1_Error VL53L1_preset_mode_standard_ranging_mm2_cal(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_STANDAR...
Definition: vl53l1_api_preset_modes.c:862
VL53L1_read_p2p_data
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.
Definition: vl53l1_api_core.c:313
VL53L1_TUNINGPARM_TIMED_MM_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_TIMED_MM_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:677
VL53L1_timing_config_t::range_config__sigma_thresh
uint16_t range_config__sigma_thresh
Definition: vl53l1_register_structs.h:1033
VL53L1_system_control_t::system__mode_start
uint8_t system__mode_start
Definition: vl53l1_register_structs.h:1332
VL53L1_timing_config_t::range_config__vcsel_period_a
uint8_t range_config__vcsel_period_a
Definition: vl53l1_register_structs.h:993
VL53L1_preset_mode_olt
VL53L1_Error VL53L1_preset_mode_olt(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_OLT.
Definition: vl53l1_api_preset_modes.c:1367
vl53l1_api_core.h
EwokPlus25 low level API function definitions.
VL53L1_CUSTOMER_NVM_MANAGED_I2C_SIZE_BYTES
#define VL53L1_CUSTOMER_NVM_MANAGED_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:97
VL53L1_tuning_parm_storage_t::tp_init_phase_ref_lite_med
uint8_t tp_init_phase_ref_lite_med
Definition: vl53l1_ll_def.h:284
VL53L1_tuning_parm_storage_t::tp_tuning_parm_lld_version
uint16_t tp_tuning_parm_lld_version
Definition: vl53l1_ll_def.h:264
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_seed_config
uint8_t vl53l1_tuningparm_lite_seed_config
Definition: vl53l1_ll_def.h:966
VL53L1_SOFT_RESET
#define VL53L1_SOFT_RESET
Definition: vl53l1_register_map.h:75
VL53L1_MAX_I2C_XFER_SIZE
#define VL53L1_MAX_I2C_XFER_SIZE
Definition: vl53l1_api_core.c:100
VL53L1_TUNINGPARM_REFSPADCHAR_VCSEL_PERIOD
#define VL53L1_TUNINGPARM_REFSPADCHAR_VCSEL_PERIOD
Definition: vl53l1_ll_device.h:637
VL53L1_set_sequence_config_bit
VL53L1_Error VL53L1_set_sequence_config_bit(VL53L1_DEV Dev, VL53L1_DeviceSequenceConfig bit_id, uint8_t value)
Set system sequence config bit value.
Definition: vl53l1_api_core.c:811
VL53L1_TUNINGPARM_VHV_LOOPBOUND
#define VL53L1_TUNINGPARM_VHV_LOOPBOUND
Definition: vl53l1_ll_device.h:633
VL53L1_GPIO_interrupt_config_t::threshold_distance_high
uint16_t threshold_distance_high
Definition: vl53l1_ll_def.h:458
VL53L1_general_config_t::system__interrupt_config_gpio
uint8_t system__interrupt_config_gpio
Definition: vl53l1_register_structs.h:764
VL53L1_DEVICEERROR_RANGECOMPLETE
#define VL53L1_DEVICEERROR_RANGECOMPLETE
Definition: vl53l1_ll_device.h:266
VL53L1_system_results_t::result__ambient_count_rate_mcps_sd0
uint16_t result__ambient_count_rate_mcps_sd0
Definition: vl53l1_register_structs.h:1425
VL53L1_timing_config_t::range_config__timeout_macrop_a_lo
uint8_t range_config__timeout_macrop_a_lo
Definition: vl53l1_register_structs.h:983
VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_LONG_RANGE
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_LONG_RANGE
Definition: vl53l1_ll_device.h:130
VL53L1_tuning_parm_storage_t::tp_timed_seed_cfg
uint8_t tp_timed_seed_cfg
Definition: vl53l1_ll_def.h:347
VL53L1_TUNINGPARM_OFFSET_CAL_DSS_RATE_MCPS
#define VL53L1_TUNINGPARM_OFFSET_CAL_DSS_RATE_MCPS
Definition: vl53l1_ll_device.h:647
VL53L1_general_config_t
Definition: vl53l1_register_structs.h:743
VL53L1_update_ll_driver_rd_state
VL53L1_Error VL53L1_update_ll_driver_rd_state(VL53L1_DEV Dev)
Update LL Driver Read State.
Definition: vl53l1_core.c:138
VL53L1_static_config_t::dss_config__target_total_rate_mcps
uint16_t dss_config__target_total_rate_mcps
Definition: vl53l1_register_structs.h:417
VL53L1_optical_centre_t::x_centre
uint8_t x_centre
Definition: vl53l1_ll_def.h:403
VL53L1_timing_config_t::range_config__timeout_macrop_a_hi
uint8_t range_config__timeout_macrop_a_hi
Definition: vl53l1_register_structs.h:973
VL53L1_range_data_t::ranging_total_events
uint32_t ranging_total_events
Definition: vl53l1_ll_def.h:558
VL53L1_LLDriverData_t::mm_roi
VL53L1_user_zone_t mm_roi
Definition: vl53l1_ll_def.h:858
VL53L1_range_data_t::median_phase
uint16_t median_phase
Definition: vl53l1_ll_def.h:585
VL53L1_offsetcal_config_t::mm_config_timeout_us
uint32_t mm_config_timeout_us
Definition: vl53l1_ll_def.h:789
VL53L1_low_power_auto_data_t::low_power_auto_range_count
uint8_t low_power_auto_range_count
Definition: vl53l1_ll_def.h:493
VL53L1_stop_range
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.
Definition: vl53l1_api_core.c:2159
VL53L1_data_init
VL53L1_Error VL53L1_data_init(VL53L1_DEV Dev, uint8_t read_p2p_data)
Get LL Driver version information.
Definition: vl53l1_api_core.c:152
VL53L1_LLDriverData_t::xtalk_cfg
VL53L1_xtalk_config_t xtalk_cfg
Definition: vl53l1_ll_def.h:870
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_med_min_count_rate_rtn_mcps
uint16_t vl53l1_tuningparm_lite_med_min_count_rate_rtn_mcps
Definition: vl53l1_ll_def.h:960
VL53L1_set_vhv_loopbound
VL53L1_Error VL53L1_set_vhv_loopbound(VL53L1_DEV Dev, uint8_t vhv_loopbound)
Set function for VHV loopbound config.
Definition: vl53l1_api_core.c:1790
VL53L1_tuning_parameters_t::vl53l1_tuningparm_key_table_version
uint16_t vl53l1_tuningparm_key_table_version
Definition: vl53l1_ll_def.h:949
VL53L1_encode_GPIO_interrupt_config
uint8_t VL53L1_encode_GPIO_interrupt_config(VL53L1_GPIO_interrupt_config_t *pintconf)
Encodes VL53L1_GPIO_interrupt_config_t structure to FW register format.
Definition: vl53l1_core.c:1706
VL53L1_DEVICERESULTSLEVEL_FULL
#define VL53L1_DEVICERESULTSLEVEL_FULL
Definition: vl53l1_ll_device.h:377
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_short_min_count_rate_rtn_mcps
uint16_t vl53l1_tuningparm_lite_short_min_count_rate_rtn_mcps
Definition: vl53l1_ll_def.h:961
VL53L1_set_lite_min_count_rate
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 ...
Definition: vl53l1_api_core.c:1738
vl53l1_wait.h
EwokPlus25 low level Driver wait function definitions.
vl53l1_register_settings.h
Device register setting defines.
vl53l1_api_preset_modes.h
EwokPlus25 API core function definition.
VL53L1_xtalk_config_t::algo__crosstalk_compensation_plane_offset_kcps
uint32_t algo__crosstalk_compensation_plane_offset_kcps
Definition: vl53l1_ll_def.h:215
VL53L1_ll_version_t
Defines the parameters of the LL driver Get Version Functions.
Definition: vl53l1_ll_def.h:157
VL53L1_set_customer_nvm_managed
VL53L1_Error VL53L1_set_customer_nvm_managed(VL53L1_DEV Dev, VL53L1_customer_nvm_managed_t *pdata)
Sets customer_nvm_managed register group.
Definition: vl53l1_register_funcs.c:366
VL53L1_TUNINGPARM_INITIAL_PHASE_RTN_LITE_SHORT_RANGE
#define VL53L1_TUNINGPARM_INITIAL_PHASE_RTN_LITE_SHORT_RANGE
Definition: vl53l1_ll_device.h:623
VL53L1_timing_config_t::range_config__min_count_rate_rtn_limit_mcps
uint16_t range_config__min_count_rate_rtn_limit_mcps
Definition: vl53l1_register_structs.h:1043
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_long_min_count_rate_rtn_mcps
uint16_t vl53l1_tuningparm_lite_long_min_count_rate_rtn_mcps
Definition: vl53l1_ll_def.h:959
VL53L1_set_GPIO_interrupt_config_struct
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.
Definition: vl53l1_api_core.c:2656
VL53L1_calibration_data_t
Per Part calibration data.
Definition: vl53l1_ll_def.h:928
VL53L1_LLDriverData_t::inter_measurement_period_ms
uint32_t inter_measurement_period_ms
Definition: vl53l1_ll_def.h:832
VL53L1_TUNINGPARM_KEY_TABLE_VERSION_DEFAULT
#define VL53L1_TUNINGPARM_KEY_TABLE_VERSION_DEFAULT
Definition: vl53l1_tuning_parm_defaults.h:90
VL53L1_enable_firmware
VL53L1_Error VL53L1_enable_firmware(VL53L1_DEV Dev)
Enables MCU firmware.
Definition: vl53l1_core.c:768
VL53L1_range_results_t::cfg_device_state
VL53L1_DeviceState cfg_device_state
Definition: vl53l1_ll_def.h:610
VL53L1_range_results_t::data
VL53L1_range_data_t data[2]
Definition: vl53l1_ll_def.h:620
VL53L1_DEVICERESULTSLEVEL_UPTO_CORE
#define VL53L1_DEVICERESULTSLEVEL_UPTO_CORE
Definition: vl53l1_ll_device.h:374
VL53L1_range_data_t::range_id
uint8_t range_id
Definition: vl53l1_ll_def.h:527
VL53L1_STATIC_NVM_MANAGED_I2C_INDEX
#define VL53L1_STATIC_NVM_MANAGED_I2C_INDEX
Definition: vl53l1_register_structs.h:74
VL53L1_tuning_parm_storage_t::tp_lite_short_sigma_thresh_mm
uint16_t tp_lite_short_sigma_thresh_mm
Definition: vl53l1_ll_def.h:317
VL53L1_DEVICECONFIGLEVEL_GENERAL_ONWARDS
#define VL53L1_DEVICECONFIGLEVEL_GENERAL_ONWARDS
Definition: vl53l1_ll_device.h:344
VL53L1_cal_peak_rate_map_t
Structure for storing the calibration peak rate map Used by DMAX to understand the spatial roll off i...
Definition: vl53l1_ll_def.h:714
VL53L1_tuning_parameters_t::vl53l1_tuningparm_initial_phase_ref_lite_med_range
uint8_t vl53l1_tuningparm_initial_phase_ref_lite_med_range
Definition: vl53l1_ll_def.h:974
VL53L1_STATIC_CONFIG_I2C_INDEX
#define VL53L1_STATIC_CONFIG_I2C_INDEX
Definition: vl53l1_register_structs.h:76
VL53L1_range_data_t::ambient_count_rate_mcps
uint16_t ambient_count_rate_mcps
Definition: vl53l1_ll_def.h:571
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_rit_mult
uint8_t vl53l1_tuningparm_lite_rit_mult
Definition: vl53l1_ll_def.h:965
VL53L1_TUNINGPARM_LOWPOWERAUTO_MM_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_LOWPOWERAUTO_MM_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:685
VL53L1_offsetcal_config_t::phasecal_config_timeout_us
uint32_t phasecal_config_timeout_us
Definition: vl53l1_ll_def.h:783
VL53L1_ssc_config_t::rate_limit_mcps
uint16_t rate_limit_mcps
Definition: vl53l1_ll_def.h:201
VL53L1_tuning_parm_storage_t::tp_init_phase_rtn_lite_short
uint8_t tp_init_phase_rtn_lite_short
Definition: vl53l1_ll_def.h:276
VL53L1_TUNINGPARM_LITE_DSS_CONFIG_TARGET_TOTAL_RATE_MCPS
#define VL53L1_TUNINGPARM_LITE_DSS_CONFIG_TARGET_TOTAL_RATE_MCPS
Definition: vl53l1_ll_device.h:667
VL53L1_LLDriverData_t::offset_calibration_mode
VL53L1_OffsetCalibrationMode offset_calibration_mode
Definition: vl53l1_ll_def.h:822
VL53L1_xtalk_config_t::algo__crosstalk_compensation_x_plane_gradient_kcps
int16_t algo__crosstalk_compensation_x_plane_gradient_kcps
Definition: vl53l1_ll_def.h:217
VL53L1_DEVICEERROR_USERROICLIP
#define VL53L1_DEVICEERROR_USERROICLIP
Definition: vl53l1_ll_device.h:270
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_short_sigma_thresh_mm
uint16_t vl53l1_tuningparm_lite_short_sigma_thresh_mm
Definition: vl53l1_ll_def.h:958
VL53L1_get_vhv_loopbound
VL53L1_Error VL53L1_get_vhv_loopbound(VL53L1_DEV Dev, uint8_t *pvhv_loopbound)
Get function for VHV loopbound config.
Definition: vl53l1_api_core.c:1764
VL53L1_core_results_t::result_core__signal_total_events_sd1
int32_t result_core__signal_total_events_sd1
Definition: vl53l1_register_structs.h:1689
VL53L1_DEVICEPRESETMODE_TIMED_RANGING
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING
Definition: vl53l1_ll_device.h:133
VL53L1_TUNINGPARM_LITE_SIGMA_EST_PULSE_WIDTH
#define VL53L1_TUNINGPARM_LITE_SIGMA_EST_PULSE_WIDTH
Definition: vl53l1_ll_device.h:603
VL53L1_TUNINGPARM_LITE_RANGING_GAIN_FACTOR
#define VL53L1_TUNINGPARM_LITE_RANGING_GAIN_FACTOR
Definition: vl53l1_ll_device.h:587
VL53L1_CUSTOMER_NVM_MANAGED_I2C_INDEX
#define VL53L1_CUSTOMER_NVM_MANAGED_I2C_INDEX
Definition: vl53l1_register_structs.h:75
VL53L1_init_refspadchar_config_struct
VL53L1_Error VL53L1_init_refspadchar_config_struct(VL53L1_refspadchar_config_t *pdata)
Initializes Ref SPAD Char Configuration Parameters.
Definition: vl53l1_api_preset_modes.c:87
VL53L1_calibration_data_t::gain_cal
VL53L1_gain_calibration_data_t gain_cal
Definition: vl53l1_ll_def.h:934
VL53L1_ssc_config_t::vcsel_period
uint8_t vcsel_period
Definition: vl53l1_ll_def.h:193
VL53L1_nvm_copy_data_t::roi_config__mode_roi_centre_spad
uint8_t roi_config__mode_roi_centre_spad
Definition: vl53l1_register_structs.h:2670
VL53L1_tuning_parameters_t::vl53l1_tuningparm_offset_cal_pre_samples
uint8_t vl53l1_tuningparm_offset_cal_pre_samples
Definition: vl53l1_ll_def.h:988
VL53L1_low_power_auto_data_stop_range
VL53L1_Error VL53L1_low_power_auto_data_stop_range(VL53L1_DEV Dev)
Reset internal state but leave low_power_auto mode intact.
Definition: vl53l1_core.c:2133
VL53L1_CORE_RESULTS_I2C_SIZE_BYTES
#define VL53L1_CORE_RESULTS_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:104
VL53L1_range_data_t::ambient_window_events
uint32_t ambient_window_events
Definition: vl53l1_ll_def.h:556
VL53L1_dynamic_config_t::system__grouped_parameter_hold_1
uint8_t system__grouped_parameter_hold_1
Definition: vl53l1_register_structs.h:1198
VL53L1_LLDriverData_t::ssc_cfg
VL53L1_ssc_config_t ssc_cfg
Definition: vl53l1_ll_def.h:869
VL53L1_TUNINGPARM_SPADMAP_VCSEL_START
#define VL53L1_TUNINGPARM_SPADMAP_VCSEL_START
Definition: vl53l1_ll_device.h:663
VL53L1_TUNINGPARM_VHV_LOOPBOUND_DEFAULT
#define VL53L1_TUNINGPARM_VHV_LOOPBOUND_DEFAULT
Definition: vl53l1_tuning_parm_defaults.h:146
vl53l1_core.h
EwokPlus25 core function definitions.
VL53L1_system_results_t::result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0
uint16_t result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0
Definition: vl53l1_register_structs.h:1465
VL53L1_TUNINGPARM_KEY_TABLE_VERSION
#define VL53L1_TUNINGPARM_KEY_TABLE_VERSION
Definition: vl53l1_ll_device.h:577
VL53L1_range_results_t::rd_device_state
VL53L1_DeviceState rd_device_state
Definition: vl53l1_ll_def.h:612
VL53L1_calibration_data_t::add_off_cal_data
VL53L1_additional_offset_cal_data_t add_off_cal_data
Definition: vl53l1_ll_def.h:932
VL53L1_get_inter_measurement_period_ms
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.
Definition: vl53l1_api_core.c:629
VL53L1_LLDriverData_t::tim_cfg
VL53L1_timing_config_t tim_cfg
Definition: vl53l1_ll_def.h:877
VL53L1_GPIO_interrupt_config_t
Structure to configure conditions when GPIO interrupt is trigerred.
Definition: vl53l1_ll_def.h:430
VL53L1_tuning_parm_storage_t::tp_lite_med_sigma_thresh_mm
uint16_t tp_lite_med_sigma_thresh_mm
Definition: vl53l1_ll_def.h:313
LOG_FUNCTION_END
#define LOG_FUNCTION_END(status,...)
Definition: vl53l1_api_core.c:90
VL53L1_range_data_t::peak_signal_count_rate_mcps
uint16_t peak_signal_count_rate_mcps
Definition: vl53l1_ll_def.h:567
VL53L1_get_preset_mode_timing_cfg
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.
Definition: vl53l1_api_core.c:1159
VL53L1_customer_nvm_managed_t
Definition: vl53l1_register_structs.h:243
VL53L1_encode_zone_size
void VL53L1_encode_zone_size(uint8_t width, uint8_t height, uint8_t *pencoded_xy_size)
Encodes a zone width & height into encoded size format.
Definition: vl53l1_core.c:1489
VL53L1_update_ll_driver_cfg_state
VL53L1_Error VL53L1_update_ll_driver_cfg_state(VL53L1_DEV Dev)
Update LL Driver Configuration State.
Definition: vl53l1_core.c:349
VL53L1_system_results_t::result__phase_sd0
uint16_t result__phase_sd0
Definition: vl53l1_register_structs.h:1445
VL53L1_static_nvm_managed_t::vhv_config__timeout_macrop_loop_bound
uint8_t vhv_config__timeout_macrop_loop_bound
Definition: vl53l1_register_structs.h:189
VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_MEDIUM_RANGE
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_MEDIUM_RANGE
Definition: vl53l1_ll_device.h:139
VL53L1_init_version
void VL53L1_init_version(VL53L1_DEV Dev)
Initialise version info in pdev.
Definition: vl53l1_core.c:98
VL53L1_system_results_t::result__peak_signal_count_rate_mcps_sd1
uint16_t result__peak_signal_count_rate_mcps_sd1
Definition: vl53l1_register_structs.h:1515
VL53L1_offsetcal_config_t::mm1_num_of_samples
uint8_t mm1_num_of_samples
Definition: vl53l1_ll_def.h:796
VL53L1_refspadchar_config_t::target_count_rate_mcps
uint16_t target_count_rate_mcps
Definition: vl53l1_ll_def.h:173
VL53L1_tuning_parm_storage_t::tp_lite_seed_cfg
uint8_t tp_lite_seed_cfg
Definition: vl53l1_ll_def.h:344
VL53L1_LLDriverData_t::core_results
VL53L1_core_results_t core_results
Definition: vl53l1_ll_def.h:887
VL53L1_xtalk_config_t::nvm_default__crosstalk_compensation_plane_offset_kcps
uint32_t nvm_default__crosstalk_compensation_plane_offset_kcps
Definition: vl53l1_ll_def.h:221
VL53L1_static_nvm_managed_t::osc_measured__fast_osc__frequency
uint16_t osc_measured__fast_osc__frequency
Definition: vl53l1_register_structs.h:179
VL53L1_tuning_parm_storage_t::tp_dss_target_lite_mcps
uint16_t tp_dss_target_lite_mcps
Definition: vl53l1_ll_def.h:358
VL53L1_copy_rtn_good_spads_to_buffer
void VL53L1_copy_rtn_good_spads_to_buffer(VL53L1_nvm_copy_data_t *pdata, uint8_t *pbuffer)
Convenience function to copy return SPAD enables to buffer.
Definition: vl53l1_core.c:437
vl53l1_register_funcs.h
VL53L1 Register Function declarations.
VL53L1_tuning_parm_storage_t::tp_phasecal_target
uint8_t tp_phasecal_target
Definition: vl53l1_ll_def.h:297
VL53L1_MCU_GENERAL_PURPOSE__GP_0
#define VL53L1_MCU_GENERAL_PURPOSE__GP_0
Definition: vl53l1_register_map.h:4969
VL53L1_Dev_t
Definition: vl53l1_platform_user_data.h:78
VL53L1_DevicePresetModes
uint8_t VL53L1_DevicePresetModes
Definition: vl53l1_ll_device.h:125
VL53L1_xtalk_config_t::crosstalk_range_ignore_threshold_rate_mcps
uint16_t crosstalk_range_ignore_threshold_rate_mcps
Definition: vl53l1_ll_def.h:237
VL53L1_init_offset_cal_config_struct
VL53L1_Error VL53L1_init_offset_cal_config_struct(VL53L1_offsetcal_config_t *pdata)
Initializes Offset Calibration Configuration Parameters.
Definition: vl53l1_api_preset_modes.c:249
VL53L1_get_interrupt_polarity
VL53L1_Error VL53L1_get_interrupt_polarity(VL53L1_DEV Dev, VL53L1_DeviceInterruptPolarity *pinterrupt_polarity)
Get the interrupt polarity bit state.
Definition: vl53l1_api_core.c:1029
VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_SHORT_RANGE
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_SHORT_RANGE
Definition: vl53l1_ll_device.h:138
VL53L1_range_results_t
Structure for storing the set of range results.
Definition: vl53l1_ll_def.h:608
VL53L1_system_results_t::result__sigma_sd1
uint16_t result__sigma_sd1
Definition: vl53l1_register_structs.h:1535
VL53L1_WaitUs
VL53L1_Error VL53L1_WaitUs(VL53L1_Dev_t *pdev, int32_t wait_us)
Definition: vl53l1_platform.c:77
VL53L1_tuning_parameters_t::vl53l1_tuningparm_offset_cal_range_timeout_us
uint32_t vl53l1_tuningparm_offset_cal_range_timeout_us
Definition: vl53l1_ll_def.h:987
VL53L1_TUNINGPARM_PHASECAL_TARGET
#define VL53L1_TUNINGPARM_PHASECAL_TARGET
Definition: vl53l1_ll_device.h:583
VL53L1_LLDriverData_t::gain_cal
VL53L1_gain_calibration_data_t gain_cal
Definition: vl53l1_ll_def.h:857
VL53L1_set_tuning_parm
VL53L1_Error VL53L1_set_tuning_parm(VL53L1_DEV Dev, VL53L1_TuningParms tuning_parm_key, int32_t tuning_parm_value)
Generic Tuning Parameter set function.
Definition: vl53l1_api_core.c:3266
VL53L1_TUNINGPARM_REFSPADCHAR_DEVICE_TEST_MODE
#define VL53L1_TUNINGPARM_REFSPADCHAR_DEVICE_TEST_MODE
Definition: vl53l1_ll_device.h:635
VL53L1_decode_GPIO_interrupt_config
VL53L1_GPIO_interrupt_config_t VL53L1_decode_GPIO_interrupt_config(uint8_t system__interrupt_config)
Decodes FW register to VL53L1_GPIO_interrupt_config_t structure.
Definition: vl53l1_core.c:1724
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_sigma_ref_mm
uint8_t vl53l1_tuningparm_lite_sigma_ref_mm
Definition: vl53l1_ll_def.h:964
VL53L1_dynamic_config_t
Definition: vl53l1_register_structs.h:1105
VL53L1_low_power_auto_data_init
VL53L1_Error VL53L1_low_power_auto_data_init(VL53L1_DEV Dev)
Initialize the Low Power Auto data structure.
Definition: vl53l1_core.c:2101
VL53L1_GPIO_interrupt_config_t::intr_mode_rate
VL53L1_GPIO_Interrupt_Mode intr_mode_rate
Definition: vl53l1_ll_def.h:436
VL53L1_get_lite_min_count_rate
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 ...
Definition: vl53l1_api_core.c:1712
VL53L1_tuning_parm_storage_t::tp_mm_timeout_lpa_us
uint32_t tp_mm_timeout_lpa_us
Definition: vl53l1_ll_def.h:379
VL53L1_SYSTEM_CONTROL_I2C_INDEX
#define VL53L1_SYSTEM_CONTROL_I2C_INDEX
Definition: vl53l1_register_structs.h:80
int16_t
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_debug_results_t
Definition: vl53l1_register_structs.h:1731
VL53L1_TUNINGPARM_LITE_MIN_CLIP_MM
#define VL53L1_TUNINGPARM_LITE_MIN_CLIP_MM
Definition: vl53l1_ll_device.h:589
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_range_config_timeout_us
uint32_t vl53l1_tuningparm_lite_range_config_timeout_us
Definition: vl53l1_ll_def.h:1000
VL53L1_range_data_t::signal_total_events
int32_t signal_total_events
Definition: vl53l1_ll_def.h:561
VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_LONG_RANGE
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_LONG_RANGE
Definition: vl53l1_ll_device.h:140
VL53L1_GPIO_Interrupt_Mode
uint8_t VL53L1_GPIO_Interrupt_Mode
Definition: vl53l1_ll_device.h:540
VL53L1_LLDriverData_t::gen_cfg
VL53L1_general_config_t gen_cfg
Definition: vl53l1_ll_def.h:876
VL53L1_TUNINGPARM_LITE_LONG_SIGMA_THRESH_MM
#define VL53L1_TUNINGPARM_LITE_LONG_SIGMA_THRESH_MM
Definition: vl53l1_ll_device.h:591
VL53L1_set_GPIO_interrupt_config
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.
Definition: vl53l1_api_core.c:2607
VL53L1_set_range_ignore_threshold
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.
Definition: vl53l1_api_core.c:972
VL53L1_TUNINGPARM_LITE_QUANTIFIER
#define VL53L1_TUNINGPARM_LITE_QUANTIFIER
Definition: vl53l1_ll_device.h:613
VL53L1_core_results_t::result_core__ranging_total_events_sd0
uint32_t result_core__ranging_total_events_sd0
Definition: vl53l1_register_structs.h:1639
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_sigma_est_pulse_width
uint8_t vl53l1_tuningparm_lite_sigma_est_pulse_width
Definition: vl53l1_ll_def.h:962
VL53L1_LLDriverData_t::measurement_mode
VL53L1_DeviceMeasurementModes measurement_mode
Definition: vl53l1_ll_def.h:820
VL53L1_tuning_parm_storage_t::tp_lite_first_order_select
uint8_t tp_lite_first_order_select
Definition: vl53l1_ll_def.h:354
VL53L1_TIMING_CONFIG_I2C_SIZE_BYTES
#define VL53L1_TIMING_CONFIG_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:100
VL53L1_OffsetCalibrationMode
uint8_t VL53L1_OffsetCalibrationMode
Definition: vl53l1_ll_device.h:165
VL53L1_LLDriverData_t::dyn_cfg
VL53L1_dynamic_config_t dyn_cfg
Definition: vl53l1_ll_def.h:878
VL53L1_low_power_auto_setup_manual_calibration
VL53L1_Error VL53L1_low_power_auto_setup_manual_calibration(VL53L1_DEV Dev)
Setup ranges after the first one in low power auto mode by turning off FW calibration steps and progr...
Definition: vl53l1_core.c:2216
VL53L1_get_offset_calibration_mode
VL53L1_Error VL53L1_get_offset_calibration_mode(VL53L1_DEV Dev, VL53L1_OffsetCalibrationMode *poffset_cal_mode)
Get function for offset calibration mode.
Definition: vl53l1_api_core.c:2753
VL53L1_decode_zone_size
void VL53L1_decode_zone_size(uint8_t encoded_xy_size, uint8_t *pwidth, uint8_t *pheight)
Decodes encoded zone size format into width and height values.
Definition: vl53l1_core.c:1468
VL53L1_decode_row_col
void VL53L1_decode_row_col(uint8_t spad_number, uint8_t *prow, uint8_t *pcol)
Decodes the Byte.Bit coord encoding into an (x,y) coord value.
Definition: vl53l1_core_support.c:426
VL53L1_tuning_parm_storage_t::tp_init_phase_ref_lite_short
uint8_t tp_init_phase_ref_lite_short
Definition: vl53l1_ll_def.h:288
VL53L1_set_user_zone
VL53L1_Error VL53L1_set_user_zone(VL53L1_DEV Dev, VL53L1_user_zone_t *puser_zone)
Sets the current user Zone (ROI) configuration structure data.
Definition: vl53l1_api_core.c:1050
VL53L1_GPIO_interrupt_config_t::intr_combined_mode
uint8_t intr_combined_mode
Definition: vl53l1_ll_def.h:450
VL53L1_TUNINGPARM_INITIAL_PHASE_RTN_LITE_LONG_RANGE
#define VL53L1_TUNINGPARM_INITIAL_PHASE_RTN_LITE_LONG_RANGE
Definition: vl53l1_ll_device.h:619
VL53L1_init_and_start_range
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.
Definition: vl53l1_api_core.c:1889
VL53L1_ll_driver_state_t::cfg_device_state
VL53L1_DeviceState cfg_device_state
Definition: vl53l1_ll_def.h:754
VL53L1_wait_for_boot_completion
VL53L1_Error VL53L1_wait_for_boot_completion(VL53L1_DEV Dev)
Wait for initial firmware boot to finish.
Definition: vl53l1_wait.c:88
VL53L1_core_results_t::result_core__total_periods_elapsed_sd0
uint32_t result_core__total_periods_elapsed_sd0
Definition: vl53l1_register_structs.h:1659
VL53L1_tuning_parm_storage_t::tp_init_phase_ref_lite_long
uint8_t tp_init_phase_ref_lite_long
Definition: vl53l1_ll_def.h:280
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_sigma_est_amb_width_ns
uint8_t vl53l1_tuningparm_lite_sigma_est_amb_width_ns
Definition: vl53l1_ll_def.h:963
VL53L1_tuning_parameters_t::vl53l1_tuningparm_offset_cal_phasecal_timeout_us
uint32_t vl53l1_tuningparm_offset_cal_phasecal_timeout_us
Definition: vl53l1_ll_def.h:985
VL53L1_tuning_parm_storage_t::tp_tuning_parm_key_table_version
uint16_t tp_tuning_parm_key_table_version
Definition: vl53l1_ll_def.h:260
VL53L1_core_results_t::result_core__total_periods_elapsed_sd1
uint32_t result_core__total_periods_elapsed_sd1
Definition: vl53l1_register_structs.h:1699
VL53L1_low_power_auto_data_t::saved_interrupt_config
uint8_t saved_interrupt_config
Definition: vl53l1_ll_def.h:496
VL53L1_tuning_parm_storage_t::tp_tuning_parm_version
uint16_t tp_tuning_parm_version
Definition: vl53l1_ll_def.h:257
VL53L1_LL_CALIBRATION_DATA_STRUCT_VERSION
#define VL53L1_LL_CALIBRATION_DATA_STRUCT_VERSION
Definition: vl53l1_ll_def.h:110
VL53L1_TUNINGPARM_LITE_RANGING_GAIN_FACTOR_DEFAULT
#define VL53L1_TUNINGPARM_LITE_RANGING_GAIN_FACTOR_DEFAULT
Definition: vl53l1_tuning_parm_defaults.h:100
vl53l1_register_map.h
VL53L1 Register Map definitions.
VL53L1_TUNINGPARM_CONSISTENCY_LITE_PHASE_TOLERANCE
#define VL53L1_TUNINGPARM_CONSISTENCY_LITE_PHASE_TOLERANCE
Definition: vl53l1_ll_device.h:581
VL53L1_tuning_parm_storage_t::tp_cal_repeat_rate
uint16_t tp_cal_repeat_rate
Definition: vl53l1_ll_def.h:300
VL53L1_DYNAMIC_CONFIG_I2C_SIZE_BYTES
#define VL53L1_DYNAMIC_CONFIG_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:101
VL53L1_LLDriverData_t::offsetcal_cfg
VL53L1_offsetcal_config_t offsetcal_cfg
Definition: vl53l1_ll_def.h:871
VL53L1_DEVICESTATE_UNKNOWN
#define VL53L1_DEVICESTATE_UNKNOWN
Definition: vl53l1_ll_device.h:113
VL53L1_nvm_copy_data_t::roi_config__mode_roi_xy_size
uint8_t roi_config__mode_roi_xy_size
Definition: vl53l1_register_structs.h:2680
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lowpowerauto_vhv_loop_bound
uint8_t vl53l1_tuningparm_lowpowerauto_vhv_loop_bound
Definition: vl53l1_ll_def.h:1002
VL53L1_set_system_control
VL53L1_Error VL53L1_set_system_control(VL53L1_DEV Dev, VL53L1_system_control_t *pdata)
Decodes data structure VL53L1_system_control_t from the input I2C read buffer.
Definition: vl53l1_register_funcs.c:1309
vl53l1_silicon_core.h
EwokPlus25 low level silicon specific API function definitions.
VL53L1_static_nvm_managed_t::vhv_config__init
uint8_t vhv_config__init
Definition: vl53l1_register_structs.h:220
LOG_FUNCTION_START
#define LOG_FUNCTION_START(fmt,...)
Definition: vl53l1_api_core.c:88
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lld_version
uint16_t vl53l1_tuningparm_lld_version
Definition: vl53l1_ll_def.h:950
VL53L1_LLDriverData_t::dbg_results
VL53L1_debug_results_t dbg_results
Definition: vl53l1_ll_def.h:888
VL53L1_LLDriverData_t::wait_method
uint8_t wait_method
Definition: vl53l1_ll_def.h:816
vl53l1_nvm_map.h
NVM Map definitions for EwokPlus25 NVM Interface Functions.
VL53L1_preset_mode_standard_ranging_long_range
VL53L1_Error VL53L1_preset_mode_standard_ranging_long_range(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_STANDAR...
Definition: vl53l1_api_preset_modes.c:731
VL53L1_tuning_parameters_t::vl53l1_tuningparm_vhv_loopbound
uint8_t vl53l1_tuningparm_vhv_loopbound
Definition: vl53l1_ll_def.h:977
VL53L1_OFFSETCORRECTIONMODE__MM1_MM2_OFFSETS
#define VL53L1_OFFSETCORRECTIONMODE__MM1_MM2_OFFSETS
Definition: vl53l1_ll_device.h:185
VL53L1_system_results_t::result__avg_signal_count_rate_mcps_sd0
uint16_t result__avg_signal_count_rate_mcps_sd0
Definition: vl53l1_register_structs.h:1495
VL53L1_LLDriverData_t::nvm_copy_data
VL53L1_nvm_copy_data_t nvm_copy_data
Definition: vl53l1_ll_def.h:881
VL53L1_STATIC_NVM_MANAGED_I2C_SIZE_BYTES
#define VL53L1_STATIC_NVM_MANAGED_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:96
VL53L1_TuningParms
uint16_t VL53L1_TuningParms
Definition: vl53l1_ll_device.h:563
VL53L1_preset_mode_standard_ranging
VL53L1_Error VL53L1_preset_mode_standard_ranging(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_STANDAR...
Definition: vl53l1_api_preset_modes.c:395
VL53L1_i2c_decode_debug_results
VL53L1_Error VL53L1_i2c_decode_debug_results(uint16_t buf_size, uint8_t *pbuffer, VL53L1_debug_results_t *pdata)
Sets core_results register group.
Definition: vl53l1_register_funcs.c:1937
VL53L1_TUNINGPARM_TIMED_SEED_CONFIG
#define VL53L1_TUNINGPARM_TIMED_SEED_CONFIG
Definition: vl53l1_ll_device.h:631
VL53L1_get_lite_sigma_threshold
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...
Definition: vl53l1_api_core.c:1661
VL53L1_set_offset_calibration_mode
VL53L1_Error VL53L1_set_offset_calibration_mode(VL53L1_DEV Dev, VL53L1_OffsetCalibrationMode offset_cal_mode)
Set function for offset calibration mode.
Definition: vl53l1_api_core.c:2730
VL53L1_offsetcal_config_t::range_config_timeout_us
uint32_t range_config_timeout_us
Definition: vl53l1_ll_def.h:786
VL53L1_TUNINGPARM_LLD_VERSION
#define VL53L1_TUNINGPARM_LLD_VERSION
Definition: vl53l1_ll_device.h:579
VL53L1_set_inter_measurement_period_ms
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.
Definition: vl53l1_api_core.c:600
VL53L1_TUNINGPARM_INITIAL_PHASE_REF_LITE_LONG_RANGE
#define VL53L1_TUNINGPARM_INITIAL_PHASE_REF_LITE_LONG_RANGE
Definition: vl53l1_ll_device.h:625
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_phasecal_config_timeout_us
uint32_t vl53l1_tuningparm_lite_phasecal_config_timeout_us
Definition: vl53l1_ll_def.h:996
VL53L1_user_zone_t::height
uint8_t height
Definition: vl53l1_ll_def.h:418
VL53L1_tuning_parm_storage_t::tp_lite_sigma_est_pulse_width_ns
uint8_t tp_lite_sigma_est_pulse_width_ns
Definition: vl53l1_ll_def.h:335
VL53L1_check_ll_driver_rd_state
VL53L1_Error VL53L1_check_ll_driver_rd_state(VL53L1_DEV Dev)
Checks if the LL Driver Read state and expected stream count matches the state and stream count recei...
Definition: vl53l1_core.c:255
VL53L1_tuning_parameters_t::vl53l1_tuningparm_refspadchar_vcsel_period
uint8_t vl53l1_tuningparm_refspadchar_vcsel_period
Definition: vl53l1_ll_def.h:979
VL53L1_user_zone_t::width
uint8_t width
Definition: vl53l1_ll_def.h:417
VL53L1_xtalk_config_t::lite_mode_crosstalk_margin_kcps
int16_t lite_mode_crosstalk_margin_kcps
Definition: vl53l1_ll_def.h:229
VL53L1_dynamic_config_t::system__grouped_parameter_hold_0
uint8_t system__grouped_parameter_hold_0
Definition: vl53l1_register_structs.h:1106
VL53L1_GPIO_interrupt_config_t::threshold_rate_low
uint16_t threshold_rate_low
Definition: vl53l1_ll_def.h:467
VL53L1_ll_driver_state_t::rd_device_state
VL53L1_DeviceState rd_device_state
Definition: vl53l1_ll_def.h:764
VL53L1_GPIO_interrupt_config_t::threshold_distance_low
uint16_t threshold_distance_low
Definition: vl53l1_ll_def.h:461
VL53L1_set_interrupt_polarity
VL53L1_Error VL53L1_set_interrupt_polarity(VL53L1_DEV Dev, VL53L1_DeviceInterruptPolarity interrupt_polarity)
Set the interrupt polarity bit in.
Definition: vl53l1_api_core.c:887
VL53L1_get_vhv_config
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.
Definition: vl53l1_api_core.c:1822
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_dss_config_target_total_rate_mcps
uint16_t vl53l1_tuningparm_lite_dss_config_target_total_rate_mcps
Definition: vl53l1_ll_def.h:994
VL53L1_ReadMulti
VL53L1_Error VL53L1_ReadMulti(VL53L1_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count)
Definition: vl53l1_platform.c:16
VL53L1_WriteMulti
VL53L1_Error VL53L1_WriteMulti(VL53L1_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count)
Definition: vl53l1_platform.c:11
VL53L1_WAIT_METHOD_BLOCKING
#define VL53L1_WAIT_METHOD_BLOCKING
Definition: vl53l1_ll_device.h:91
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_first_order_select
uint8_t vl53l1_tuningparm_lite_first_order_select
Definition: vl53l1_ll_def.h:968
VL53L1_DEVICEERROR_NOVHVVALUEFOUND
#define VL53L1_DEVICEERROR_NOVHVVALUEFOUND
Definition: vl53l1_ll_device.h:260
VL53L1_LLDriverData_t::gpio_interrupt_config
VL53L1_GPIO_interrupt_config_t gpio_interrupt_config
Definition: vl53l1_ll_def.h:851
VL53L1_ssc_config_t::vcsel_start
uint8_t vcsel_start
Definition: vl53l1_ll_def.h:195
VL53L1_static_config_t
Definition: vl53l1_register_structs.h:416
VL53L1_DEVICEPRESETMODE_TIMED_RANGING_SHORT_RANGE
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING_SHORT_RANGE
Definition: vl53l1_ll_device.h:134
VL53L1_i2c_encode_customer_nvm_managed
VL53L1_Error VL53L1_i2c_encode_customer_nvm_managed(VL53L1_customer_nvm_managed_t *pdata, uint16_t buf_size, uint8_t *pbuffer)
Encodes data structure VL53L1_customer_nvm_managed_t into a I2C write buffer.
Definition: vl53l1_register_funcs.c:240
VL53L1_user_zone_t::y_centre
uint8_t y_centre
Definition: vl53l1_ll_def.h:416
VL53L1_TUNINGPARM_REFSPADCHAR_TARGET_COUNT_RATE_MCPS
#define VL53L1_TUNINGPARM_REFSPADCHAR_TARGET_COUNT_RATE_MCPS
Definition: vl53l1_ll_device.h:641
VL53L1_system_results_t::result__stream_count
uint8_t result__stream_count
Definition: vl53l1_register_structs.h:1395
VL53L1_TUNINGPARM_LITE_FIRST_ORDER_SELECT
#define VL53L1_TUNINGPARM_LITE_FIRST_ORDER_SELECT
Definition: vl53l1_ll_device.h:615
VL53L1_TUNINGPARM_OFFSET_CAL_MM2_SAMPLES
#define VL53L1_TUNINGPARM_OFFSET_CAL_MM2_SAMPLES
Definition: vl53l1_ll_device.h:659
VL53L1_DEVICEINTERRUPTPOLARITY_BIT_MASK
#define VL53L1_DEVICEINTERRUPTPOLARITY_BIT_MASK
Definition: vl53l1_ll_device.h:221
VL53L1_dynamic_config_t::system__sequence_config
uint8_t system__sequence_config
Definition: vl53l1_register_structs.h:1250
VL53L1_get_measurement_results
VL53L1_Error VL53L1_get_measurement_results(VL53L1_DEV Dev, VL53L1_DeviceResultsLevel device_results_level)
Get range measurement result data.
Definition: vl53l1_api_core.c:2199
VL53L1_timing_config_t::system__intermeasurement_period
uint32_t system__intermeasurement_period
Definition: vl53l1_register_structs.h:1073
VL53L1_ERROR_INVALID_PARAMS
#define VL53L1_ERROR_INVALID_PARAMS
Definition: vl53l1_error_codes.h:102
VL53L1_xtalk_config_t::algo__crosstalk_compensation_y_plane_gradient_kcps
int16_t algo__crosstalk_compensation_y_plane_gradient_kcps
Definition: vl53l1_ll_def.h:219
VL53L1_ERROR_NONE
#define VL53L1_ERROR_NONE
Definition: vl53l1_error_codes.h:91
VL53L1_DEVICEMEASUREMENTMODE_STOP
#define VL53L1_DEVICEMEASUREMENTMODE_STOP
Definition: vl53l1_ll_device.h:152
VL53L1_TUNINGPARM_LITE_RIT_MULT
#define VL53L1_TUNINGPARM_LITE_RIT_MULT
Definition: vl53l1_ll_device.h:609
VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM1_CAL
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM1_CAL
Definition: vl53l1_ll_device.h:131
VL53L1_calibration_data_t::customer
VL53L1_customer_nvm_managed_t customer
Definition: vl53l1_ll_def.h:931
VL53L1_LLDriverResults_t::range_results
VL53L1_range_results_t range_results
Definition: vl53l1_ll_def.h:917
VL53L1_dynamic_config_t::roi_config__user_roi_requested_global_xy_size
uint8_t roi_config__user_roi_requested_global_xy_size
Definition: vl53l1_register_structs.h:1240
VL53L1_tuning_parm_storage_t::tp_lite_long_min_count_rate_rtn_mcps
uint16_t tp_lite_long_min_count_rate_rtn_mcps
Definition: vl53l1_ll_def.h:322
VL53L1_LLDriverData_t::tuning_parms
VL53L1_tuning_parm_storage_t tuning_parms
Definition: vl53l1_ll_def.h:862
VL53L1_static_config_t::algo__range_ignore_threshold_mcps
uint16_t algo__range_ignore_threshold_mcps
Definition: vl53l1_register_structs.h:659
VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM2_CAL
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM2_CAL
Definition: vl53l1_ll_device.h:132
VL53L1_tuning_parameters_t::vl53l1_tuningparm_refspadchar_target_count_rate_mcps
uint16_t vl53l1_tuningparm_refspadchar_target_count_rate_mcps
Definition: vl53l1_ll_def.h:981
VL53L1_system_results_t::result__mm_inner_actual_effective_spads_sd0
uint16_t result__mm_inner_actual_effective_spads_sd0
Definition: vl53l1_register_structs.h:1475
VL53L1_TUNINGPARM_OFFSET_CAL_MM_TIMEOUT_US
#define VL53L1_TUNINGPARM_OFFSET_CAL_MM_TIMEOUT_US
Definition: vl53l1_ll_device.h:651
VL53L1_GPIO_interrupt_config_t::intr_new_measure_ready
uint8_t intr_new_measure_ready
Definition: vl53l1_ll_def.h:441
VL53L1_GENERAL_CONFIG_I2C_INDEX
#define VL53L1_GENERAL_CONFIG_I2C_INDEX
Definition: vl53l1_register_structs.h:77
VL53L1_preset_mode_low_power_auto_long_ranging
VL53L1_Error VL53L1_preset_mode_low_power_auto_long_ranging(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms, VL53L1_low_power_auto_data_t *plpadata)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_LOWPOWE...
Definition: vl53l1_api_preset_modes.c:1242
VL53L1_get_device_results
VL53L1_Error VL53L1_get_device_results(VL53L1_DEV Dev, VL53L1_DeviceResultsLevel device_results_level, VL53L1_range_results_t *prange_results)
Get device system results, updates GPH registers and clears interrupt and configures SYSTEM__MODE_STA...
Definition: vl53l1_api_core.c:2298
VL53L1_get_static_nvm_managed
VL53L1_Error VL53L1_get_static_nvm_managed(VL53L1_DEV Dev, VL53L1_static_nvm_managed_t *pdata)
Gets static_nvm_managed register group.
Definition: vl53l1_register_funcs.c:207
VL53L1_range_data_t::avg_signal_count_rate_mcps
uint16_t avg_signal_count_rate_mcps
Definition: vl53l1_ll_def.h:569
VL53L1_LLDriverData_t::sys_results
VL53L1_system_results_t sys_results
Definition: vl53l1_ll_def.h:880
VL53L1_general_config_t::system__thresh_rate_low
uint16_t system__thresh_rate_low
Definition: vl53l1_register_structs.h:860
VL53L1_i2c_encode_timing_config
VL53L1_Error VL53L1_i2c_encode_timing_config(VL53L1_timing_config_t *pdata, uint16_t buf_size, uint8_t *pbuffer)
Gets general_config register group.
Definition: vl53l1_register_funcs.c:864
VL53L1_set_lite_sigma_threshold
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...
Definition: vl53l1_api_core.c:1687
VL53L1_customer_nvm_managed_t::mm_config__outer_offset_mm
int16_t mm_config__outer_offset_mm
Definition: vl53l1_register_structs.h:394
VL53L1_tuning_parm_storage_t::tp_lite_sigma_ref_mm
uint8_t tp_lite_sigma_ref_mm
Definition: vl53l1_ll_def.h:341
VL53L1_SYSTEM_CONTROL_I2C_SIZE_BYTES
#define VL53L1_SYSTEM_CONTROL_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:102
VL53L1_customer_nvm_managed_t::algo__crosstalk_compensation_x_plane_gradient_kcps
int16_t algo__crosstalk_compensation_x_plane_gradient_kcps
Definition: vl53l1_register_structs.h:344
VL53L1_low_power_auto_update_DSS
VL53L1_Error VL53L1_low_power_auto_update_DSS(VL53L1_DEV Dev)
Do a DSS calculation and update manual config.
Definition: vl53l1_core.c:2256
VL53L1_DEBUG_RESULTS_I2C_SIZE_BYTES
#define VL53L1_DEBUG_RESULTS_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:105
VL53L1_set_preset_mode
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.
Definition: vl53l1_api_core.c:1230
VL53L1_low_power_auto_data_t::vhv_loop_bound
uint8_t vhv_loop_bound
Definition: vl53l1_ll_def.h:486
VL53L1_RESULT__OSC_CALIBRATE_VAL
#define VL53L1_RESULT__OSC_CALIBRATE_VAL
Definition: vl53l1_register_map.h:3177
VL53L1_TUNINGPARM_LITE_MED_MIN_COUNT_RATE_RTN_MCPS
#define VL53L1_TUNINGPARM_LITE_MED_MIN_COUNT_RATE_RTN_MCPS
Definition: vl53l1_ll_device.h:599
VL53L1_tuning_parameters_t::vl53l1_tuningparm_version
uint16_t vl53l1_tuningparm_version
Definition: vl53l1_ll_def.h:948
VL53L1_set_offset_correction_mode
VL53L1_Error VL53L1_set_offset_correction_mode(VL53L1_DEV Dev, VL53L1_OffsetCorrectionMode offset_cor_mode)
Set function for offset correction mode.
Definition: vl53l1_api_core.c:2776
VL53L1_gain_calibration_data_t::standard_ranging_gain_factor
uint16_t standard_ranging_gain_factor
Definition: vl53l1_ll_def.h:739
VL53L1_WrByte
VL53L1_Error VL53L1_WrByte(VL53L1_DEV Dev, uint16_t index, uint8_t data)
Definition: vl53l1_platform.c:20
VL53L1_range_data_t::actual_effective_spads
uint16_t actual_effective_spads
Definition: vl53l1_ll_def.h:541
VL53L1_tuning_parameters_t::vl53l1_tuningparm_initial_phase_rtn_lite_med_range
uint8_t vl53l1_tuningparm_initial_phase_rtn_lite_med_range
Definition: vl53l1_ll_def.h:971
VL53L1_tuning_parameters_t::vl53l1_tuningparm_initial_phase_rtn_lite_long_range
uint8_t vl53l1_tuningparm_initial_phase_rtn_lite_long_range
Definition: vl53l1_ll_def.h:970
VL53L1_get_range_ignore_threshold
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.
Definition: vl53l1_api_core.c:995
VL53L1_tuning_parameters_t::vl53l1_tuningparm_refspadchar_phasecal_timeout_us
uint32_t vl53l1_tuningparm_refspadchar_phasecal_timeout_us
Definition: vl53l1_ll_def.h:980
VL53L1_enable_xtalk_compensation
VL53L1_Error VL53L1_enable_xtalk_compensation(VL53L1_DEV Dev)
Simple function to enable xtalk compensation.
Definition: vl53l1_api_core.c:1452
VL53L1_TUNINGPARM_LITE_SIGMA_REF_MM
#define VL53L1_TUNINGPARM_LITE_SIGMA_REF_MM
Definition: vl53l1_ll_device.h:607
VL53L1_DEVICECONFIGLEVEL_TIMING_ONWARDS
#define VL53L1_DEVICECONFIGLEVEL_TIMING_ONWARDS
Definition: vl53l1_ll_device.h:340
VL53L1_system_results_t::result__range_status
uint8_t result__range_status
Definition: vl53l1_register_structs.h:1372
vl53l1_tuning_parm_defaults.h
Define defaults for tuning parm list.
VL53L1_DEVICECONFIGLEVEL_DYNAMIC_ONWARDS
#define VL53L1_DEVICECONFIGLEVEL_DYNAMIC_ONWARDS
Definition: vl53l1_ll_device.h:337
VL53L1_RdWord
VL53L1_Error VL53L1_RdWord(VL53L1_DEV Dev, uint16_t index, uint16_t *data)
Definition: vl53l1_platform.c:42
int32_t
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_customer_nvm_managed_t::algo__crosstalk_compensation_plane_offset_kcps
uint16_t algo__crosstalk_compensation_plane_offset_kcps
Definition: vl53l1_register_structs.h:334
VL53L1_system_results_t::result__ambient_count_rate_mcps_sd1
uint16_t result__ambient_count_rate_mcps_sd1
Definition: vl53l1_register_structs.h:1525
VL53L1_calibration_data_t::struct_version
uint32_t struct_version
Definition: vl53l1_ll_def.h:930
VL53L1_customer_nvm_managed_t::algo__part_to_part_range_offset_mm
int16_t algo__part_to_part_range_offset_mm
Definition: vl53l1_register_structs.h:374
VL53L1_SEQUENCE_MM2_EN
#define VL53L1_SEQUENCE_MM2_EN
Definition: vl53l1_register_settings.h:162
VL53L1_general_config_t::cal_config__repeat_rate
uint16_t cal_config__repeat_rate
Definition: vl53l1_register_structs.h:789
VL53L1_TUNINGPARM_LOWPOWERAUTO_VHV_LOOP_BOUND
#define VL53L1_TUNINGPARM_LOWPOWERAUTO_VHV_LOOP_BOUND
Definition: vl53l1_ll_device.h:683
VL53L1_tuning_parameters_t::vl53l1_tuningparm_timed_range_config_timeout_us
uint32_t vl53l1_tuningparm_timed_range_config_timeout_us
Definition: vl53l1_ll_def.h:1001
VL53L1_DeviceSequenceConfig
uint8_t VL53L1_DeviceSequenceConfig
Definition: vl53l1_ll_device.h:198
VL53L1_GPIO_interrupt_config_t::intr_mode_distance
VL53L1_GPIO_Interrupt_Mode intr_mode_distance
Definition: vl53l1_ll_def.h:433
VL53L1_LLDriverData_t::customer
VL53L1_customer_nvm_managed_t customer
Definition: vl53l1_ll_def.h:854
VL53L1_range_results_t::device_status
uint8_t device_status
Definition: vl53l1_ll_def.h:617
VL53L1_system_results_t::result__dss_actual_effective_spads_sd0
uint16_t result__dss_actual_effective_spads_sd0
Definition: vl53l1_register_structs.h:1405
VL53L1_get_sequence_config_bit
VL53L1_Error VL53L1_get_sequence_config_bit(VL53L1_DEV Dev, VL53L1_DeviceSequenceConfig bit_id, uint8_t *pvalue)
Get system sequence config bit value.
Definition: vl53l1_api_core.c:850
VL53L1_tuning_parameters_t::vl53l1_tuningparm_spadmap_rate_limit_mcps
uint16_t vl53l1_tuningparm_spadmap_rate_limit_mcps
Definition: vl53l1_ll_def.h:993
VL53L1_software_reset
VL53L1_Error VL53L1_software_reset(VL53L1_DEV Dev)
Performs device software reset and then waits for the firmware to finish booting.
Definition: vl53l1_api_core.c:406
VL53L1_DEVICEERROR_MULTCLIPFAIL
#define VL53L1_DEVICEERROR_MULTCLIPFAIL
Definition: vl53l1_ll_device.h:274
VL53L1_DEVICESEQUENCECONFIG_RANGE
#define VL53L1_DEVICESEQUENCECONFIG_RANGE
Definition: vl53l1_ll_device.h:207
VL53L1_system_control_t
Definition: vl53l1_register_structs.h:1290
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_xtalk_margin_kcps
int16_t vl53l1_tuningparm_lite_xtalk_margin_kcps
Definition: vl53l1_ll_def.h:969
VL53L1_TUNINGPARM_LITE_SHORT_SIGMA_THRESH_MM
#define VL53L1_TUNINGPARM_LITE_SHORT_SIGMA_THRESH_MM
Definition: vl53l1_ll_device.h:595
VL53L1_LLDriverData_t::preset_mode
VL53L1_DevicePresetModes preset_mode
Definition: vl53l1_ll_def.h:818
VL53L1_DEVICESTATE_SW_STANDBY
#define VL53L1_DEVICESTATE_SW_STANDBY
Definition: vl53l1_ll_device.h:106
VL53L1_i2c_encode_general_config
VL53L1_Error VL53L1_i2c_encode_general_config(VL53L1_general_config_t *pdata, uint16_t buf_size, uint8_t *pbuffer)
Gets static_config register group.
Definition: vl53l1_register_funcs.c:672
VL53L1_TUNINGPARM_OFFSET_CAL_RANGE_TIMEOUT_US
#define VL53L1_TUNINGPARM_OFFSET_CAL_RANGE_TIMEOUT_US
Definition: vl53l1_ll_device.h:653
VL53L1_DEVICEPRESETMODE_TIMED_RANGING_LONG_RANGE
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING_LONG_RANGE
Definition: vl53l1_ll_device.h:135
VL53L1_dynamic_config_t::system__grouped_parameter_hold
uint8_t system__grouped_parameter_hold
Definition: vl53l1_register_structs.h:1267
VL53L1_DEVICECONFIGLEVEL_CUSTOMER_ONWARDS
#define VL53L1_DEVICECONFIGLEVEL_CUSTOMER_ONWARDS
Definition: vl53l1_ll_device.h:352
VL53L1_tuning_parm_storage_t::tp_phasecal_timeout_lite_us
uint32_t tp_phasecal_timeout_lite_us
Definition: vl53l1_ll_def.h:365
VL53L1_ERROR_DIVISION_BY_ZERO
#define VL53L1_ERROR_DIVISION_BY_ZERO
Definition: vl53l1_error_codes.h:125
VL53L1_TUNINGPARM_LITE_CAL_REPEAT_RATE
#define VL53L1_TUNINGPARM_LITE_CAL_REPEAT_RATE
Definition: vl53l1_ll_device.h:585
VL53L1_core_results_t::result_core__ambient_window_events_sd1
uint32_t result_core__ambient_window_events_sd1
Definition: vl53l1_register_structs.h:1669
VL53L1_xtalk_config_t::nvm_default__crosstalk_compensation_x_plane_gradient_kcps
int16_t nvm_default__crosstalk_compensation_x_plane_gradient_kcps
Definition: vl53l1_ll_def.h:223
VL53L1_optical_centre_t::y_centre
uint8_t y_centre
Definition: vl53l1_ll_def.h:404
VL53L1_GPIO_interrupt_config_t::threshold_rate_high
uint16_t threshold_rate_high
Definition: vl53l1_ll_def.h:464
VL53L1_TUNINGPARM_LITE_MM_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_LITE_MM_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:675
VL53L1_calibration_data_t::optical_centre
VL53L1_optical_centre_t optical_centre
Definition: vl53l1_ll_def.h:933
VL53L1_tuning_parameters_t::vl53l1_tuningparm_initial_phase_ref_lite_short_range
uint8_t vl53l1_tuningparm_initial_phase_ref_lite_short_range
Definition: vl53l1_ll_def.h:975
VL53L1_get_timeouts_us
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.
Definition: vl53l1_api_core.c:699
VL53L1_get_tuning_parm
VL53L1_Error VL53L1_get_tuning_parm(VL53L1_DEV Dev, VL53L1_TuningParms tuning_parm_key, int32_t *ptuning_parm_value)
Generic Tuning Parameter extraction function.
Definition: vl53l1_api_core.c:3004
VL53L1_set_lite_xtalk_margin_kcps
VL53L1_Error VL53L1_set_lite_xtalk_margin_kcps(VL53L1_DEV Dev, int16_t xtalk_margin)
Set function for Xtalk Margin setting Histogram Mode version.
Definition: vl53l1_api_core.c:1562
VL53L1_restore_xtalk_nvm_default
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.
Definition: vl53l1_api_core.c:1585
VL53L1_DEVICEREPORTSTATUS_MM1
#define VL53L1_DEVICEREPORTSTATUS_MM1
Definition: vl53l1_ll_device.h:302
VL53L1DevStructGetLLDriverHandle
#define VL53L1DevStructGetLLDriverHandle(Dev)
Definition: vl53l1_platform_user_data.h:94
VL53L1_TIMING_CONFIG_I2C_INDEX
#define VL53L1_TIMING_CONFIG_I2C_INDEX
Definition: vl53l1_register_structs.h:78
VL53L1_DeviceInterruptPolarity
uint8_t VL53L1_DeviceInterruptPolarity
Definition: vl53l1_ll_device.h:217
VL53L1_refspadchar_config_t
Reference SPAD Characterization (RefSpadChar) Config.
Definition: vl53l1_ll_def.h:168
VL53L1_LLDriverData_t::rtn_good_spads
uint8_t rtn_good_spads[VL53L1_RTN_SPAD_BUFFER_SIZE]
Definition: vl53l1_ll_def.h:865
VL53L1_system_results_t::result__report_status
uint8_t result__report_status
Definition: vl53l1_register_structs.h:1385
VL53L1_LLDriverData_t::sys_ctrl
VL53L1_system_control_t sys_ctrl
Definition: vl53l1_ll_def.h:879
VL53L1_tuning_parm_storage_t::tp_mm_timeout_timed_us
uint32_t tp_mm_timeout_timed_us
Definition: vl53l1_ll_def.h:376
VL53L1_LLDriverData_t::phasecal_config_timeout_us
uint32_t phasecal_config_timeout_us
Definition: vl53l1_ll_def.h:826
VL53L1_tuning_parameters_t::vl53l1_tuningparm_offset_cal_mm2_samples
uint8_t vl53l1_tuningparm_offset_cal_mm2_samples
Definition: vl53l1_ll_def.h:990
VL53L1_tuning_parameters_t::vl53l1_tuningparm_timed_dss_config_target_total_rate_mcps
uint16_t vl53l1_tuningparm_timed_dss_config_target_total_rate_mcps
Definition: vl53l1_ll_def.h:995
VL53L1_preset_mode_singleshot_ranging
VL53L1_Error VL53L1_preset_mode_singleshot_ranging(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_SINGLES...
Definition: vl53l1_api_preset_modes.c:1297
VL53L1_DEVICEPRESETMODE_OLT
#define VL53L1_DEVICEPRESETMODE_OLT
Definition: vl53l1_ll_device.h:136
VL53L1_LLDriverData_t::low_power_auto_data
VL53L1_low_power_auto_data_t low_power_auto_data
Definition: vl53l1_ll_def.h:892
VL53L1_set_vhv_config
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.
Definition: vl53l1_api_core.c:1861
VL53L1_get_calibration_repeat_period
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.
Definition: vl53l1_api_core.c:792
VL53L1_tuning_parameters_t::vl53l1_tuningparm_timed_mm_config_timeout_us
uint32_t vl53l1_tuningparm_timed_mm_config_timeout_us
Definition: vl53l1_ll_def.h:999
VL53L1_range_data_t::median_range_mm
int16_t median_range_mm
Definition: vl53l1_ll_def.h:590
VL53L1_LLDriverResults_t
VL53L1 LL Driver ST private results structure.
Definition: vl53l1_ll_def.h:914
VL53L1_tuning_parm_storage_t::tp_lite_long_sigma_thresh_mm
uint16_t tp_lite_long_sigma_thresh_mm
Definition: vl53l1_ll_def.h:309
VL53L1_tuning_parameters_t::vl53l1_tuningparm_refspadchar_max_countrate_limit_mcps
uint16_t vl53l1_tuningparm_refspadchar_max_countrate_limit_mcps
Definition: vl53l1_ll_def.h:983
VL53L1_DEBUG_RESULTS_I2C_INDEX
#define VL53L1_DEBUG_RESULTS_I2C_INDEX
Definition: vl53l1_register_structs.h:83
VL53L1_GENERAL_CONFIG_I2C_SIZE_BYTES
#define VL53L1_GENERAL_CONFIG_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:99
vl53l1_ll_device.h
LL Driver Device specific defines. To be adapted by implementer for the targeted device.
VL53L1_DEVICECONFIGLEVEL_STATIC_ONWARDS
#define VL53L1_DEVICECONFIGLEVEL_STATIC_ONWARDS
Definition: vl53l1_ll_device.h:348
VL53L1_TUNINGPARM_VERSION
#define VL53L1_TUNINGPARM_VERSION
Definition: vl53l1_ll_device.h:575
VL53L1_LLDriverData_t::stat_cfg
VL53L1_static_config_t stat_cfg
Definition: vl53l1_ll_def.h:875
VL53L1_OffsetCorrectionMode
uint8_t VL53L1_OffsetCorrectionMode
Definition: vl53l1_ll_device.h:182
VL53L1_calc_range_ignore_threshold
uint16_t VL53L1_calc_range_ignore_threshold(uint32_t central_rate, int16_t x_gradient, int16_t y_gradient, uint8_t rate_mult)
Calculates the Xtalk Range Ignore Threshold rate per spad in 3.13Mcps.
Definition: vl53l1_core.c:987
VL53L1_get_offset_correction_mode
VL53L1_Error VL53L1_get_offset_correction_mode(VL53L1_DEV Dev, VL53L1_OffsetCorrectionMode *poffset_cor_mode)
Get function for offset correction mode.
Definition: vl53l1_api_core.c:2799
VL53L1_core_results_t::result_core__ranging_total_events_sd1
uint32_t result_core__ranging_total_events_sd1
Definition: vl53l1_register_structs.h:1679
VL53L1_TUNINGPARM_INITIAL_PHASE_RTN_LITE_MED_RANGE
#define VL53L1_TUNINGPARM_INITIAL_PHASE_RTN_LITE_MED_RANGE
Definition: vl53l1_ll_device.h:621
VL53L1_xtalk_config_t::nvm_default__crosstalk_compensation_y_plane_gradient_kcps
int16_t nvm_default__crosstalk_compensation_y_plane_gradient_kcps
Definition: vl53l1_ll_def.h:225
VL53L1_TUNINGPARM_REFSPADCHAR_PHASECAL_TIMEOUT_US
#define VL53L1_TUNINGPARM_REFSPADCHAR_PHASECAL_TIMEOUT_US
Definition: vl53l1_ll_device.h:639
VL53L1_LLDriverData_t::optical_centre
VL53L1_optical_centre_t optical_centre
Definition: vl53l1_ll_def.h:859
VL53L1_get_GPIO_interrupt_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.
Definition: vl53l1_api_core.c:2687
VL53L1_get_user_zone
VL53L1_Error VL53L1_get_user_zone(VL53L1_DEV Dev, VL53L1_user_zone_t *puser_zone)
Gets the current user zone (ROI) configuration structure data.
Definition: vl53l1_api_core.c:1083
VL53L1_preset_mode_low_power_auto_short_ranging
VL53L1_Error VL53L1_preset_mode_low_power_auto_short_ranging(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms, VL53L1_low_power_auto_data_t *plpadata)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_LOWPOWE...
Definition: vl53l1_api_preset_modes.c:1189
VL53L1_tuning_parameters_t::vl53l1_tuningparm_spadmap_vcsel_period
uint8_t vl53l1_tuningparm_spadmap_vcsel_period
Definition: vl53l1_ll_def.h:991
VL53L1_tuning_parm_storage_t::tp_init_phase_rtn_lite_long
uint8_t tp_init_phase_rtn_lite_long
Definition: vl53l1_ll_def.h:268
VL53L1_DEVICEERROR_VCSELCONTINUITYTESTFAILURE
#define VL53L1_DEVICEERROR_VCSELCONTINUITYTESTFAILURE
Definition: vl53l1_ll_device.h:258
vl53l1_platform.h
VL53L1_calc_decoded_timeout_us
uint32_t VL53L1_calc_decoded_timeout_us(uint16_t timeout_encoded, uint32_t macro_period_us)
Calculates the decoded timeout in us based on the input encoded timeout register value and the macro ...
Definition: vl53l1_core.c:1201
VL53L1_refspadchar_config_t::vcsel_period
uint8_t vcsel_period
Definition: vl53l1_ll_def.h:171
VL53L1_preset_mode_timed_ranging_short_range
VL53L1_Error VL53L1_preset_mode_timed_ranging_short_range(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_TIMED_R...
Definition: vl53l1_api_preset_modes.c:989
VL53L1_offsetcal_config_t::mm2_num_of_samples
uint8_t mm2_num_of_samples
Definition: vl53l1_ll_def.h:799
VL53L1_offsetcal_config_t::dss_config__target_total_rate_mcps
uint16_t dss_config__target_total_rate_mcps
Definition: vl53l1_ll_def.h:780
VL53L1DevStructGetLLResultsHandle
#define VL53L1DevStructGetLLResultsHandle(Dev)
Definition: vl53l1_platform_user_data.h:95
VL53L1_DEVICEMEASUREMENTMODE_BACKTOBACK
#define VL53L1_DEVICEMEASUREMENTMODE_BACKTOBACK
Definition: vl53l1_ll_device.h:154
VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_SHORT_RANGE
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_SHORT_RANGE
Definition: vl53l1_ll_device.h:129
VL53L1_optical_centre_t
Optical Centre data.
Definition: vl53l1_ll_def.h:401
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_med_sigma_thresh_mm
uint16_t vl53l1_tuningparm_lite_med_sigma_thresh_mm
Definition: vl53l1_ll_def.h:957
VL53L1_tuning_parameters_t::vl53l1_tuningparm_initial_phase_rtn_lite_short_range
uint8_t vl53l1_tuningparm_initial_phase_rtn_lite_short_range
Definition: vl53l1_ll_def.h:972
VL53L1_tuning_parameters_t::vl53l1_tuningparm_refspadchar_device_test_mode
uint8_t vl53l1_tuningparm_refspadchar_device_test_mode
Definition: vl53l1_ll_def.h:978
VL53L1_xtalk_config_t::global_crosstalk_compensation_enable
uint8_t global_crosstalk_compensation_enable
Definition: vl53l1_ll_def.h:227
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_min_clip_mm
uint8_t vl53l1_tuningparm_lite_min_clip_mm
Definition: vl53l1_ll_def.h:955
VL53L1_LLDriverData_t
VL53L1 LL Driver ST private data structure .
Definition: vl53l1_ll_def.h:814
VL53L1_DEVICEERROR_NOUPDATE
#define VL53L1_DEVICEERROR_NOUPDATE
Definition: vl53l1_ll_device.h:256
VL53L1_system_results_t::result__sigma_sd0
uint16_t result__sigma_sd0
Definition: vl53l1_register_structs.h:1435
VL53L1_DEVICEREPORTSTATUS_MM2
#define VL53L1_DEVICEREPORTSTATUS_MM2
Definition: vl53l1_ll_device.h:303
VL53L1_init_ssc_config_struct
VL53L1_Error VL53L1_init_ssc_config_struct(VL53L1_ssc_config_t *pdata)
Initializes SPAD Self Check (SSC) Configuration Parameters.
Definition: vl53l1_api_preset_modes.c:128
VL53L1_get_part_to_part_data
VL53L1_Error VL53L1_get_part_to_part_data(VL53L1_DEV Dev, VL53L1_calibration_data_t *pcal_data)
Gets the customer part to part data.
Definition: vl53l1_api_core.c:533
VL53L1_calc_timeout_register_values
VL53L1_Error VL53L1_calc_timeout_register_values(uint32_t phasecal_config_timeout_us, uint32_t mm_config_timeout_us, uint32_t range_config_timeout_us, uint16_t fast_osc_frequency, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming)
Converts the input MM and range timeouts in [us] into the appropriate register values.
Definition: vl53l1_core.c:1273
VL53L1_TUNINGPARM_REFSPADCHAR_MAX_COUNTRATE_LIMIT_MCPS
#define VL53L1_TUNINGPARM_REFSPADCHAR_MAX_COUNTRATE_LIMIT_MCPS
Definition: vl53l1_ll_device.h:645
VL53L1_get_customer_nvm_managed
VL53L1_Error VL53L1_get_customer_nvm_managed(VL53L1_DEV Dev, VL53L1_customer_nvm_managed_t *pdata)
Gets customer_nvm_managed register group.
Definition: vl53l1_register_funcs.c:399
VL53L1_tuning_parameters_t::vl53l1_tuningparm_spadmap_vcsel_start
uint8_t vl53l1_tuningparm_spadmap_vcsel_start
Definition: vl53l1_ll_def.h:992
VL53L1_init_tuning_parm_storage_struct
VL53L1_Error VL53L1_init_tuning_parm_storage_struct(VL53L1_tuning_parm_storage_t *pdata)
Initializes Tuning Parameter Storage Values.
Definition: vl53l1_api_preset_modes.c:291
VL53L1_TUNINGPARM_LITE_RANGE_CONFIG_TIMEOUT_US
#define VL53L1_TUNINGPARM_LITE_RANGE_CONFIG_TIMEOUT_US
Definition: vl53l1_ll_device.h:679
VL53L1_ll_driver_state_t
Contains the driver state information.
Definition: vl53l1_ll_def.h:752
VL53L1_Error
int8_t VL53L1_Error
Definition: vl53l1_error_codes.h:89
VL53L1_general_config_t::phasecal_config__timeout_macrop
uint8_t phasecal_config__timeout_macrop
Definition: vl53l1_register_structs.h:809
VL53L1_tuning_parameters_t
Tuning Parameters Debug data.
Definition: vl53l1_ll_def.h:947
VL53L1_RANGE_STATUS__RANGE_STATUS_MASK
#define VL53L1_RANGE_STATUS__RANGE_STATUS_MASK
Definition: vl53l1_register_settings.h:199
VL53L1_preset_mode_low_power_auto_ranging
VL53L1_Error VL53L1_preset_mode_low_power_auto_ranging(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms, VL53L1_low_power_auto_data_t *plpadata)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_LOWPOWE...
Definition: vl53l1_api_preset_modes.c:1136
VL53L1_set_GPIO_thresholds_from_struct
VL53L1_Error VL53L1_set_GPIO_thresholds_from_struct(VL53L1_DEV Dev, VL53L1_GPIO_interrupt_config_t *pintconf)
SET GPIO thresholds from structure. Sets both rate and distance thresholds.
Definition: vl53l1_core.c:1792
VL53L1_TUNINGPARM_TIMED_DSS_CONFIG_TARGET_TOTAL_RATE_MCPS
#define VL53L1_TUNINGPARM_TIMED_DSS_CONFIG_TARGET_TOTAL_RATE_MCPS
Definition: vl53l1_ll_device.h:669
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lowpowerauto_mm_config_timeout_us
uint32_t vl53l1_tuningparm_lowpowerauto_mm_config_timeout_us
Definition: vl53l1_ll_def.h:1003
VL53L1_system_results_t::result__mm_outer_actual_effective_spads_sd0
uint16_t result__mm_outer_actual_effective_spads_sd0
Definition: vl53l1_register_structs.h:1485
VL53L1_i2c_encode_dynamic_config
VL53L1_Error VL53L1_i2c_encode_dynamic_config(VL53L1_dynamic_config_t *pdata, uint16_t buf_size, uint8_t *pbuffer)
Decodes data structure VL53L1_timing_config_t from the input I2C read buffer.
Definition: vl53l1_register_funcs.c:1054
VL53L1_get_mode_mitigation_roi
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.
Definition: vl53l1_api_core.c:1115
VL53L1_gain_calibration_data_t
Gain calibration data.
Definition: vl53l1_ll_def.h:737
VL53L1_preset_mode_timed_ranging_long_range
VL53L1_Error VL53L1_preset_mode_timed_ranging_long_range(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_TIMED_R...
Definition: vl53l1_api_preset_modes.c:1062
VL53L1_i2c_encode_static_nvm_managed
VL53L1_Error VL53L1_i2c_encode_static_nvm_managed(VL53L1_static_nvm_managed_t *pdata, uint16_t buf_size, uint8_t *pbuffer)
Encodes data structure VL53L1_static_nvm_managed_t into a I2C write buffer.
Definition: vl53l1_register_funcs.c:84
VL53L1_refspadchar_config_t::device_test_mode
uint8_t device_test_mode
Definition: vl53l1_ll_def.h:170
VL53L1_DeviceResultsLevel
uint8_t VL53L1_DeviceResultsLevel
Definition: vl53l1_ll_device.h:369
VL53L1_DEVICEMEASUREMENTMODE_ABORT
#define VL53L1_DEVICEMEASUREMENTMODE_ABORT
Definition: vl53l1_ll_device.h:156
VL53L1_tuning_parm_storage_t::tp_consistency_lite_phase_tolerance
uint8_t tp_consistency_lite_phase_tolerance
Definition: vl53l1_ll_def.h:293
VL53L1_init_xtalk_config_struct
VL53L1_Error VL53L1_init_xtalk_config_struct(VL53L1_customer_nvm_managed_t *pnvm, VL53L1_xtalk_config_t *pdata)
Initializes Xtalk Configuration Parameters.
Definition: vl53l1_api_preset_modes.c:174
VL53L1_LLDriverData_t::offset_correction_mode
VL53L1_OffsetCorrectionMode offset_correction_mode
Definition: vl53l1_ll_def.h:824
uint16_t
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_static_config_t::gpio_hv_mux__ctrl
uint8_t gpio_hv_mux__ctrl
Definition: vl53l1_register_structs.h:537
VL53L1_disable_firmware
VL53L1_Error VL53L1_disable_firmware(VL53L1_DEV Dev)
Disables MCU firmware.
Definition: vl53l1_core.c:787
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_quantifier
uint8_t vl53l1_tuningparm_lite_quantifier
Definition: vl53l1_ll_def.h:967
VL53L1_range_data_t::time_stamp
uint32_t time_stamp
Definition: vl53l1_ll_def.h:529
VL53L1_tuning_parm_storage_t::tp_lite_med_min_count_rate_rtn_mcps
uint16_t tp_lite_med_min_count_rate_rtn_mcps
Definition: vl53l1_ll_def.h:326
VL53L1_tuning_parameters_t::vl53l1_tuningparm_offset_cal_mm_timeout_us
uint32_t vl53l1_tuningparm_offset_cal_mm_timeout_us
Definition: vl53l1_ll_def.h:986
VL53L1_SEQUENCE_MM1_EN
#define VL53L1_SEQUENCE_MM1_EN
Definition: vl53l1_register_settings.h:161
VL53L1_calc_crosstalk_plane_offset_with_margin
uint32_t VL53L1_calc_crosstalk_plane_offset_with_margin(uint32_t plane_offset_kcps, int16_t margin_offset_kcps)
Function to add signed margin to the xtalk plane offset value, dealing with signed and unsigned value...
Definition: vl53l1_core.c:1172
VL53L1_ERROR_TUNING_PARM_KEY_MISMATCH
#define VL53L1_ERROR_TUNING_PARM_KEY_MISMATCH
Definition: vl53l1_error_codes.h:164
VL53L1_set_timeouts_us
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.
Definition: vl53l1_api_core.c:657
VL53L1_refspadchar_config_t::max_count_rate_limit_mcps
uint16_t max_count_rate_limit_mcps
Definition: vl53l1_ll_def.h:177
VL53L1_preset_mode_timed_ranging
VL53L1_Error VL53L1_preset_mode_timed_ranging(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_TIMED_R...
Definition: vl53l1_api_preset_modes.c:917
VL53L1_tuning_parm_storage_t::tp_range_timeout_timed_us
uint32_t tp_range_timeout_timed_us
Definition: vl53l1_ll_def.h:386
VL53L1_TUNINGPARM_LITE_SHORT_MIN_COUNT_RATE_RTN_MCPS
#define VL53L1_TUNINGPARM_LITE_SHORT_MIN_COUNT_RATE_RTN_MCPS
Definition: vl53l1_ll_device.h:601
VL53L1_tuning_parm_storage_t::tp_phasecal_timeout_timed_us
uint32_t tp_phasecal_timeout_timed_us
Definition: vl53l1_ll_def.h:369
VL53L1_get_xtalk_compensation_enable
void VL53L1_get_xtalk_compensation_enable(VL53L1_DEV Dev, uint8_t *pcrosstalk_compensation_enable)
Simple function to retrieve xtalk compensation status.
Definition: vl53l1_api_core.c:1512
VL53L1_static_nvm_managed_t
Definition: vl53l1_register_structs.h:128
VL53L1_clear_interrupt_and_enable_next_range
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.
Definition: vl53l1_api_core.c:2397
VL53L1_system_results_t::result__final_crosstalk_corrected_range_mm_sd1
uint16_t result__final_crosstalk_corrected_range_mm_sd1
Definition: vl53l1_register_structs.h:1555
VL53L1_calc_timeout_us
uint32_t VL53L1_calc_timeout_us(uint32_t timeout_mclks, uint32_t macro_period_us)
Calculates the timeout in us based on the input timeout im macro periods value and the macro period i...
Definition: vl53l1_core.c:1133
VL53L1_tuning_parameters_t::vl53l1_tuningparm_timed_seed_config
uint8_t vl53l1_tuningparm_timed_seed_config
Definition: vl53l1_ll_def.h:976
VL53L1_ll_driver_state_t::cfg_gph_id
uint8_t cfg_gph_id
Definition: vl53l1_ll_def.h:759
VL53L1_tuning_parm_storage_t::tp_lite_quantifier
uint8_t tp_lite_quantifier
Definition: vl53l1_ll_def.h:351
VL53L1_user_zone_t::x_centre
uint8_t x_centre
Definition: vl53l1_ll_def.h:415
VL53L1_range_data_t::total_periods_elapsed
uint32_t total_periods_elapsed
Definition: vl53l1_ll_def.h:544
VL53L1_refspadchar_config_t::timeout_us
uint32_t timeout_us
Definition: vl53l1_ll_def.h:172
VL53L1_i2c_decode_core_results
VL53L1_Error VL53L1_i2c_decode_core_results(uint16_t buf_size, uint8_t *pbuffer, VL53L1_core_results_t *pdata)
Encodes data structure VL53L1_core_results_t into a I2C write buffer.
Definition: vl53l1_register_funcs.c:1693
VL53L1_low_power_auto_data_t::is_low_power_auto_mode
uint8_t is_low_power_auto_mode
Definition: vl53l1_ll_def.h:489
VL53L1_LLDriverData_t::stat_nvm
VL53L1_static_nvm_managed_t stat_nvm
Definition: vl53l1_ll_def.h:874
VL53L1_get_nvm_copy_data
VL53L1_Error VL53L1_get_nvm_copy_data(VL53L1_DEV Dev, VL53L1_nvm_copy_data_t *pdata)
Sets nvm_copy_data register group.
Definition: vl53l1_register_funcs.c:2405
VL53L1_LLDriverData_t::cal_peak_rate_map
VL53L1_cal_peak_rate_map_t cal_peak_rate_map
Definition: vl53l1_ll_def.h:855
VL53L1_range_results_t::stream_count
uint8_t stream_count
Definition: vl53l1_ll_def.h:614
VL53L1_STATIC_CONFIG_I2C_SIZE_BYTES
#define VL53L1_STATIC_CONFIG_I2C_SIZE_BYTES
Definition: vl53l1_register_structs.h:98
VL53L1_disable_xtalk_compensation
VL53L1_Error VL53L1_disable_xtalk_compensation(VL53L1_DEV Dev)
Simple function to disable xtalk compensation.
Definition: vl53l1_api_core.c:1611
VL53L1_preset_mode_standard_ranging_mm1_cal
VL53L1_Error VL53L1_preset_mode_standard_ranging_mm1_cal(VL53L1_static_config_t *pstatic, VL53L1_general_config_t *pgeneral, VL53L1_timing_config_t *ptiming, VL53L1_dynamic_config_t *pdynamic, VL53L1_system_control_t *psystem, VL53L1_tuning_parm_storage_t *ptuning_parms)
Initializes static and dynamic configuration settings for preset mode VL53L1_DEVICEPRESETMODE_STANDAR...
Definition: vl53l1_api_preset_modes.c:808
VL53L1_TUNINGPARM_SPADMAP_VCSEL_PERIOD
#define VL53L1_TUNINGPARM_SPADMAP_VCSEL_PERIOD
Definition: vl53l1_ll_device.h:661
VL53L1_refspadchar_config_t::min_count_rate_limit_mcps
uint16_t min_count_rate_limit_mcps
Definition: vl53l1_ll_def.h:175
VL53L1_tuning_parm_storage_t::tp_init_phase_rtn_lite_med
uint8_t tp_init_phase_rtn_lite_med
Definition: vl53l1_ll_def.h:272
VL53L1_customer_nvm_managed_t::algo__crosstalk_compensation_y_plane_gradient_kcps
int16_t algo__crosstalk_compensation_y_plane_gradient_kcps
Definition: vl53l1_register_structs.h:354
VL53L1_tuning_parm_storage_t::tp_range_timeout_lpa_us
uint32_t tp_range_timeout_lpa_us
Definition: vl53l1_ll_def.h:389
VL53L1_TUNINGPARM_INITIAL_PHASE_REF_LITE_SHORT_RANGE
#define VL53L1_TUNINGPARM_INITIAL_PHASE_REF_LITE_SHORT_RANGE
Definition: vl53l1_ll_device.h:629
VL53L1_TUNINGPARM_OFFSET_CAL_MM1_SAMPLES
#define VL53L1_TUNINGPARM_OFFSET_CAL_MM1_SAMPLES
Definition: vl53l1_ll_device.h:657
VL53L1_DEVICEERROR_RANGECOMPLETE_NO_WRAP_CHECK
#define VL53L1_DEVICEERROR_RANGECOMPLETE_NO_WRAP_CHECK
Definition: vl53l1_ll_device.h:276
VL53L1_timing_config_t::mm_config__timeout_macrop_a_hi
uint8_t mm_config__timeout_macrop_a_hi
Definition: vl53l1_register_structs.h:933
VL53L1_tuning_parameters_t::vl53l1_tuningparm_lite_long_sigma_thresh_mm
uint16_t vl53l1_tuningparm_lite_long_sigma_thresh_mm
Definition: vl53l1_ll_def.h:956
VL53L1_set_refspadchar_config_struct
VL53L1_Error VL53L1_set_refspadchar_config_struct(VL53L1_DEV Dev, VL53L1_refspadchar_config_t *pdata)
Extract the Ref spad char cfg struct from pdev.
Definition: vl53l1_api_core.c:911
VL53L1_LLDriverData_t::refspadchar
VL53L1_refspadchar_config_t refspadchar
Definition: vl53l1_ll_def.h:868


vl53l1x
Author(s):
autogenerated on Fri Aug 2 2024 08:35:54