Creating a project about VL6180XA1 for TT_Mxx

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers vl6180x_cfg.h Source File

vl6180x_cfg.h

00001 /*******************************************************************************
00002 Copyright © 2014, STMicroelectronics International N.V.
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007     * Redistributions of source code must retain the above copyright
00008       notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright
00010       notice, this list of conditions and the following disclaimer in the
00011       documentation and/or other materials provided with the distribution.
00012     * Neither the name of STMicroelectronics nor the
00013       names of its contributors may be used to endorse or promote products
00014       derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
00019 NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED. 
00020 IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
00021 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00022 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00023 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00024 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00026 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027 ********************************************************************************/
00028 /*
00029  * $Date: 2015-01-08 14:35:34 +0100 (Thu, 08 Jan 2015) $
00030  * $Revision: 2042 $
00031  */
00032  
00033 /**
00034  * @file VL6180x_cfg.h
00035  *
00036  * Proximity and ALS configuration
00037  */
00038 
00039 #ifndef VL6180x_CFG_H_
00040 #define VL6180x_CFG_H_
00041 
00042 /** @defgroup api_config Configuration
00043  *  @brief API static configuration
00044  */
00045 
00046 
00047 
00048 /** @ingroup api_config
00049  * @{*/
00050 
00051 
00052 /**
00053  * @def VL6180x_UPSCALE_SUPPORT
00054  * @brief Configure up-scale capabilities and default up-scale factor for ranging operations
00055  * 
00056  * @li 1 : Fixed scaling by 1 (no up-scaling support)
00057  * @li 2 : Fixed scaling by 2
00058  * @li 3 : Fixed scaling by 3
00059  * @li  -1 -2 -3 : Run time programmable through @a VL6180x_UpscaleSetScaling(). Default scaling factore is -VL6180x_UPSCALE_SUPPORT \n
00060  */
00061 //#define VL6180x_UPSCALE_SUPPORT -1
00062 
00063 /**
00064  * @def VL6180x_ALS_SUPPORT
00065  * @brief Enable ALS support
00066  *
00067  * Set to 0 if ALS is not used in application. This can help reducing code size if it is a concern.
00068  */
00069 #define VL6180x_ALS_SUPPORT      1
00070 
00071 /**
00072  * @def VL6180x_HAVE_DMAX_RANGING
00073  * @brief Enable DMax calculation for ranging applications.
00074  *  
00075  * When set to 1, __Dmax__ is returned by API typically when  @a VL6180x_RangePollMeasurement() high level
00076  * function is called (this is returned in @a VL6180x_RangeData_t structure).
00077  * __Dmax__ is an estimation of the maximum distance (in mm) the product can report a valid distance of a 17% target for 
00078  * the current ambient light conditions (__Dmax__ decreases when ambient light increases). __Dmax__ should be used only
00079  * when the product is not able to return a valid distance (no object or object is too far from the ranging sensor).
00080  * Typically, this is done by checking the __errorStatus__ field of the @a VL6180x_RangeData_t structure returned by 
00081  * the @a VL6180x_RangePollMeasurement() function.
00082  * You may refer to ::RangeError_u to get full list of supported error codes.
00083  * @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 
00084  */
00085 #define VL6180x_HAVE_DMAX_RANGING   1
00086 
00087 /**
00088  * @def VL6180x_WRAP_AROUND_FILTER_SUPPORT
00089  * @brief Enable wrap around filter (WAF) feature
00090  *  
00091  * In specific conditions, when targeting a mirror or a very reflective metal, a __wrap around__ effect can occur internally to the
00092  * ranging product which results in returning a wrong distance (under-estimated). Goal of the WAF is to detect this wrap arround effect
00093  * and to filter it by returning a non-valid distance : __errorStatus__ set to 16 (see ::RangeError_u)
00094  * @warning Wrap-around filter can not be used when device is running in continuous mode 
00095  * 
00096  * @li 0 : Filter is not supported, no filtering code is included in API
00097  * @li 1 : Filter is supported and active by default
00098  * @li -1 : Filter is supported but is not active by default @a VL6180x_FilterSetState() can turn it on and off at any time
00099  */
00100 #define VL6180x_WRAP_AROUND_FILTER_SUPPORT   1
00101 
00102 /**
00103  * @def VL6180x_EXTENDED_RANGE
00104  * @brief Enable extended ranging support
00105  *
00106  * Device that do not formally support extended ranging should only be used with a scaling factor of 1.
00107  * Correct operation with scaling factor other than 1 (>200mm ) is not granted by ST.
00108  */
00109 //#define VL6180x_EXTENDED_RANGE 0
00110 
00111 #define EXTENDED_RANGE_50CM     0
00112 //#define EXTENDED_RANGE_50CM     1
00113 
00114 #if EXTENDED_RANGE_50CM
00115 #define VL6180x_UPSCALE_SUPPORT -3
00116 #define VL6180x_EXTENDED_RANGE  1
00117 #else
00118 #define VL6180x_UPSCALE_SUPPORT -1
00119 #define VL6180x_EXTENDED_RANGE  0
00120 #endif
00121 
00122 #if (VL6180x_EXTENDED_RANGE) && (VL6180x_ALS_SUPPORT)
00123 #warning "Als support should be OFF for extended range"
00124 #endif
00125 
00126 #endif
00127 /** @} */ // end of api_config
00128 
00129 /* VL6180x_CFG_H_ */
00130