Initial release. Mbed library for VL53L1CB

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers vl53l1_preset_setup.h Source File

vl53l1_preset_setup.h

00001 
00002 /******************************************************************************
00003  * Copyright (c) 2017, STMicroelectronics - All Rights Reserved
00004 
00005  This file is part of VL53L1 Core and is dual licensed,
00006  either 'STMicroelectronics
00007  Proprietary license'
00008  or 'BSD 3-clause "New" or "Revised" License' , at your option.
00009 
00010  ******************************************************************************
00011 
00012  'STMicroelectronics Proprietary license'
00013 
00014  *******************************************************************************
00015 
00016  License terms: STMicroelectronics Proprietary in accordance with licensing
00017  terms at www.st.com/sla0081
00018 
00019  STMicroelectronics confidential
00020  Reproduction and Communication of this document is strictly prohibited unless
00021  specifically authorized in writing by STMicroelectronics.
00022 
00023 
00024  *******************************************************************************
00025 
00026  Alternatively, VL53L1 Core may be distributed under the terms of
00027  'BSD 3-clause "New" or "Revised" License', in which case the following
00028  provisions apply instead of the ones mentioned above :
00029 
00030  *******************************************************************************
00031 
00032  License terms: BSD 3-clause "New" or "Revised" License.
00033 
00034  Redistribution and use in source and binary forms, with or without
00035  modification, are permitted provided that the following conditions are met:
00036 
00037  1. Redistributions of source code must retain the above copyright notice, this
00038  list of conditions and the following disclaimer.
00039 
00040  2. Redistributions in binary form must reproduce the above copyright notice,
00041  this list of conditions and the following disclaimer in the documentation
00042  and/or other materials provided with the distribution.
00043 
00044  3. Neither the name of the copyright holder nor the names of its contributors
00045  may be used to endorse or promote products derived from this software
00046  without specific prior written permission.
00047 
00048  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00049  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00050  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00051  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00052  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00053  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00054  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00055  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00056  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00057  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00058 
00059 
00060  *******************************************************************************
00061  */
00062 
00063 #ifndef _VL53L1_PRESET_SETUP_H_
00064 #define _VL53L1_PRESET_SETUP_H_
00065 
00066 #ifdef __cplusplus
00067 extern "C"
00068 {
00069 #endif
00070 
00071 /* indexes for the bare driver tuning setting API function */
00072 enum VL53L1_Tuning_t {
00073     VL53L1_TUNING_VERSION = 0,
00074     VL53L1_TUNING_PROXY_MIN,
00075     VL53L1_TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM,
00076     VL53L1_TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER,
00077     VL53L1_TUNING_MIN_AMBIENT_DMAX_VALID,
00078     VL53L1_TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER,
00079     VL53L1_TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM,
00080     VL53L1_TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT,
00081     VL53L1_TUNING_XTALK_FULL_ROI_BIN_SUM_MARGIN,
00082     VL53L1_TUNING_XTALK_FULL_ROI_DEFAULT_OFFSET,
00083     VL53L1_TUNING_ZERO_DISTANCE_OFFSET_NON_LINEAR_FACTOR,
00084     VL53L1_TUNING_MAX_TUNABLE_KEY
00085 };
00086 
00087 /* default values for the tuning settings parameters */
00088 #define TUNING_VERSION  0x0007
00089 
00090 #define TUNING_PROXY_MIN -30 /* min distance in mm */
00091 #define TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM 600
00092 /* Target distance in mm for single target Xtalk */
00093 #define TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER 50
00094 /* Number of sample used for single target Xtalk */
00095 #define TUNING_MIN_AMBIENT_DMAX_VALID 8
00096 /* Minimum ambient level to state the Dmax returned by the device is valid */
00097 #define TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER 10
00098 /* Maximum loops to perform simple offset calibration */
00099 #define TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM 600
00100 /* Target distance in mm for target Xtalk from Bins method*/
00101 #define TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT 3
00102 /* Number of loops done during the simple offset calibration*/
00103 #define TUNING_ZERO_DISTANCE_OFFSET_NON_LINEAR_FACTOR_DEFAULT 9
00104 /* zero distance offset calibration non linear compensation default value */
00105 
00106 /* The following settings are related to the fix for ticket EwokP #558410 */
00107 #define TUNING_XTALK_FULL_ROI_BIN_SUM_MARGIN 24
00108 /* Acceptance margin for the xtalk_shape bin_data sum computation */
00109 #define TUNING_XTALK_FULL_ROI_DEFAULT_OFFSET 50
00110 /* Recovery value for Xtalk compensation plane offset in kcps */
00111 /* 50 stands for ~0.10 kcps cover glass in 7.9 format */
00112 /* End of settings related to the fix for ticket EwokP #558410 */
00113 
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117 
00118 #endif /* _VL53L1_PRESET_SETUP_H_ */
00119