vl6180x_cfg.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*******************************************************************************
  2. Copyright © 2015, STMicroelectronics International N.V.
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. * Neither the name of STMicroelectronics nor the
  12. names of its contributors may be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
  17. NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
  18. IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
  19. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. ********************************************************************************/
  26. /*
  27. * $Date: 2015-07-07 10:05:35 +0200 (Tue, 07 Jul 2015) $
  28. * $Revision: 2438 $
  29. */
  30. /**
  31. * @file VL6180x_cfg.h
  32. *
  33. * Proximity and ALS configuration
  34. */
  35. #ifndef VL6180x_CFG_H_
  36. #define VL6180x_CFG_H_
  37. /** @defgroup api_config Configuration
  38. * @brief API static configuration
  39. */
  40. /** @ingroup api_config
  41. * @{*/
  42. /**
  43. * @def VL6180x_UPSCALE_SUPPORT
  44. * @brief Configure up-scale capabilities and default up-scale factor for ranging operations
  45. *
  46. * @li 1 : Fixed scaling by 1 (no up-scaling support)
  47. * @li 2 : Fixed scaling by 2
  48. * @li 3 : Fixed scaling by 3
  49. * @li -1 -2 -3 : Run time programmable through @a VL6180x_UpscaleSetScaling(). Default scaling factore is -VL6180x_UPSCALE_SUPPORT \n
  50. */
  51. #define VL6180x_UPSCALE_SUPPORT -1
  52. /**
  53. * @def VL6180x_ALS_SUPPORT
  54. * @brief Enable ALS support
  55. *
  56. * Set to 0 if ALS is not used in application. This can help reducing code size if it is a concern.
  57. */
  58. #define VL6180x_ALS_SUPPORT 1
  59. /**
  60. * @def VL6180x_HAVE_DMAX_RANGING
  61. * @brief Enable DMax calculation for ranging applications.
  62. *
  63. * When set to 1, __Dmax__ is returned by API typically when @a VL6180x_RangePollMeasurement() high level
  64. * function is called (this is returned in @a VL6180x_RangeData_t structure).
  65. * __Dmax__ is an estimation of the maximum distance (in mm) the product can report a valid distance of a 17% target for
  66. * the current ambient light conditions (__Dmax__ decreases when ambient light increases). __Dmax__ should be used only
  67. * when the product is not able to return a valid distance (no object or object is too far from the ranging sensor).
  68. * Typically, this is done by checking the __errorStatus__ field of the @a VL6180x_RangeData_t structure returned by
  69. * the @a VL6180x_RangePollMeasurement() function.
  70. * You may refer to ::RangeError_u to get full list of supported error codes.
  71. * @warning Dmax is estimated for a 17% grey target. If the real target has a reflectance lower than 17%, report Dmax could be over-estimated
  72. */
  73. #define VL6180x_HAVE_DMAX_RANGING 1
  74. /**
  75. * @def VL6180x_WRAP_AROUND_FILTER_SUPPORT
  76. * @brief Enable wrap around filter (WAF) feature
  77. *
  78. * In specific conditions, when targeting a mirror or a very reflective metal, a __wrap around__ effect can occur internally to the
  79. * ranging product which results in returning a wrong distance (under-estimated). Goal of the WAF is to detect this wrap arround effect
  80. * and to filter it by returning a non-valid distance : __errorStatus__ set to 16 (see ::RangeError_u)
  81. * @warning Wrap-around filter can not be used when device is running in continuous mode
  82. *
  83. * @li 0 : Filter is not supported, no filtering code is included in API
  84. * @li 1 : Filter is supported and active by default
  85. * @li -1 : Filter is supported but is not active by default @a VL6180x_FilterSetState() can turn it on and off at any time
  86. */
  87. #define VL6180x_WRAP_AROUND_FILTER_SUPPORT 1
  88. /**
  89. * @def VL6180x_EXTENDED_RANGE
  90. * @brief Enable extended ranging support
  91. *
  92. * Device that do not formally support extended ranging should only be used with a scaling factor of 1.
  93. * Correct operation with scaling factor other than 1 (>200mm ) is not granted by ST.
  94. */
  95. #define VL6180x_EXTENDED_RANGE 0
  96. #if (VL6180x_EXTENDED_RANGE) && (VL6180x_ALS_SUPPORT)
  97. #warning "Als support should be OFF for extended range"
  98. #endif
  99. #endif
  100. /** @} */ // end of api_config
  101. /* VL6180x_CFG_H_ */