vl53l1_preset_setup.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. #ifndef _VL53L1_PRESET_SETUP_H_
  63. #define _VL53L1_PRESET_SETUP_H_
  64. #ifdef __cplusplus
  65. extern "C"
  66. {
  67. #endif
  68. /* indexes for the bare driver tuning setting API function */
  69. enum VL53L1_Tuning_t {
  70. VL53L1_TUNING_VERSION = 0,
  71. VL53L1_TUNING_PROXY_MIN,
  72. VL53L1_TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM,
  73. VL53L1_TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER,
  74. VL53L1_TUNING_MIN_AMBIENT_DMAX_VALID,
  75. VL53L1_TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER,
  76. VL53L1_TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM,
  77. VL53L1_TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT,
  78. VL53L1_TUNING_MAX_TUNABLE_KEY
  79. };
  80. /* default values for the tuning settings parameters */
  81. #define TUNING_VERSION 0x0004
  82. #define TUNING_PROXY_MIN -30 /* min distance in mm */
  83. #define TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM 600
  84. /* Target distance in mm for single target Xtalk */
  85. #define TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER 50
  86. /* Number of sample used for single target Xtalk */
  87. #define TUNING_MIN_AMBIENT_DMAX_VALID 8
  88. /* Minimum ambient level to state the Dmax returned by the device is valid */
  89. #define TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER 50
  90. /* Maximum loops to perform simple offset calibration */
  91. #define TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM 600
  92. /* Target distance in mm for target Xtalk from Bins method*/
  93. #define TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT 1
  94. /* Number of loops done during the simple offset calibration*/
  95. /* the following table should actually be defined as static and shall be part
  96. * of the VL53L1_StaticInit() function code
  97. */
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101. #endif /* _VL53L1_PRESET_SETUP_H_ */