-
Notifications
You must be signed in to change notification settings - Fork 0
/
vl53l1x_error_codes.h
251 lines (226 loc) · 12.1 KB
/
vl53l1x_error_codes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
/*
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1X Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0081
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1X Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
/**
* @file vl53l1_error_codes.h
*
* @brief Error Code definitions for VL53L1X API.
*
*/
#ifndef _VL53L1X_ERROR_CODES_H_
#define _VL53L1X_ERROR_CODES_H_
#ifdef __cplusplus
extern "C" {
#endif
/****************************************
* PRIVATE define do not edit
****************************************/
/** @defgroup VL53L1X_define_Error_group Error and Warning code returned by API
* The following DEFINE are used to identify the PAL ERROR
* @{
*/
typedef int8_t VL53L1X_Error;
#define VL53L1X_ERROR_NONE ((VL53L1X_Error) 0)
#define VL53L1X_ERROR_CALIBRATION_WARNING ((VL53L1X_Error) - 1)
/*!< Warning invalid calibration data may be in used
\a VL53L1X_InitData()
\a VL53L1X_GetOffsetCalibrationData
\a VL53L1X_SetOffsetCalibrationData */
#define VL53L1X_ERROR_MIN_CLIPPED ((VL53L1X_Error) - 2)
/*!< Warning parameter passed was clipped to min before to be applied */
#define VL53L1X_ERROR_UNDEFINED ((VL53L1X_Error) - 3)
/*!< Unqualified error */
#define VL53L1X_ERROR_INVALID_PARAMS ((VL53L1X_Error) - 4)
/*!< Parameter passed is invalid or out of range */
#define VL53L1X_ERROR_NOT_SUPPORTED ((VL53L1X_Error) - 5)
/*!< Function is not supported in current mode or configuration */
#define VL53L1X_ERROR_RANGE_ERROR ((VL53L1X_Error) - 6)
/*!< Device report a ranging error interrupt status */
#define VL53L1X_ERROR_TIME_OUT ((VL53L1X_Error) - 7)
/*!< Aborted due to time out */
#define VL53L1X_ERROR_MODE_NOT_SUPPORTED ((VL53L1X_Error) - 8)
/*!< Asked mode is not supported by the device */
#define VL53L1X_ERROR_BUFFER_TOO_SMALL ((VL53L1X_Error) - 9)
/*!< ... */
#define VL53L1X_ERROR_COMMS_BUFFER_TOO_SMALL ((VL53L1X_Error) - 10)
/*!< Supplied buffer is larger than I2C supports */
#define VL53L1X_ERROR_GPIO_NOT_EXISTING ((VL53L1X_Error) - 11)
/*!< User tried to setup a non-existing GPIO pin */
#define VL53L1X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED ((VL53L1X_Error) - 12)
/*!< unsupported GPIO functionality */
#define VL53L1X_ERROR_CONTROL_INTERFACE ((VL53L1X_Error) - 13)
/*!< error reported from IO functions */
#define VL53L1X_ERROR_INVALID_COMMAND ((VL53L1X_Error) - 14)
/*!< The command is not allowed in the current device state
* (power down) */
#define VL53L1X_ERROR_DIVISION_BY_ZERO ((VL53L1X_Error) - 15)
/*!< In the function a division by zero occurs */
#define VL53L1X_ERROR_REF_SPAD_INIT ((VL53L1X_Error) - 16)
/*!< Error during reference SPAD initialization */
#define VL53L1X_ERROR_GPH_SYNC_CHECK_FAIL ((VL53L1X_Error) - 17)
/*!< GPH sync interrupt check fail - API out of sync with device*/
#define VL53L1X_ERROR_STREAM_COUNT_CHECK_FAIL ((VL53L1X_Error) - 18)
/*!< Stream count check fail - API out of sync with device */
#define VL53L1X_ERROR_GPH_ID_CHECK_FAIL ((VL53L1X_Error) - 19)
/*!< GPH ID check fail - API out of sync with device */
#define VL53L1X_ERROR_ZONE_STREAM_COUNT_CHECK_FAIL ((VL53L1X_Error) - 20)
/*!< Zone dynamic config stream count check failed - API out of sync */
#define VL53L1X_ERROR_ZONE_GPH_ID_CHECK_FAIL ((VL53L1X_Error) - 21)
/*!< Zone dynamic config GPH ID check failed - API out of sync */
#define VL53L1X_ERROR_XTALK_EXTRACTION_NO_SAMPLE_FAIL ((VL53L1X_Error) - 22)
/*!< Thrown when run_xtalk_extraction fn has 0 succesful samples
* when using the full array to sample the xtalk. In this case there is
* not enough information to generate new Xtalk parm info. The function
* will exit and leave the current xtalk parameters unaltered */
#define VL53L1X_ERROR_XTALK_EXTRACTION_SIGMA_LIMIT_FAIL ((VL53L1X_Error) - 23)
/*!< Thrown when run_xtalk_extraction fn has found that the
* avg sigma estimate of the full array xtalk sample is > than the
* maximal limit allowed. In this case the xtalk sample is too noisy for
* measurement. The function will exit and leave the current xtalk parameters
* unaltered. */
#define VL53L1X_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL ((VL53L1X_Error) - 24)
/*!< Thrown if there one of stages has no valid offset calibration
* samples. A fatal error calibration not valid */
#define VL53L1X_ERROR_OFFSET_CAL_NO_SPADS_ENABLED_FAIL ((VL53L1X_Error) - 25)
/*!< Thrown if there one of stages has zero effective SPADS
* Traps the case when MM1 SPADs is zero.
* A fatal error calibration not valid */
#define VL53L1X_ERROR_ZONE_CAL_NO_SAMPLE_FAIL ((VL53L1X_Error) - 26)
/*!< Thrown if then some of the zones have no valid samples
* A fatal error calibration not valid */
#define VL53L1X_ERROR_TUNING_PARM_KEY_MISMATCH ((VL53L1X_Error) - 27)
/*!< Thrown if the tuning file key table version does not match with
* expected value. The driver expects the key table version to match
* the compiled default version number in the define
* #VL53L1X_TUNINGPARM_KEY_TABLE_VERSION_DEFAULT
* */
#define VL53L1X_WARNING_REF_SPAD_CHAR_NOT_ENOUGH_SPADS ((VL53L1X_Error) - 28)
/*!< Thrown if there are less than 5 good SPADs are available. */
#define VL53L1X_WARNING_REF_SPAD_CHAR_RATE_TOO_HIGH ((VL53L1X_Error) - 29)
/*!< Thrown if the final reference rate is greater than
the upper reference rate limit - default is 40 Mcps.
Implies a minimum Q3 (x10) SPAD (5) selected */
#define VL53L1X_WARNING_REF_SPAD_CHAR_RATE_TOO_LOW ((VL53L1X_Error) - 30)
/*!< Thrown if the final reference rate is less than
the lower reference rate limit - default is 10 Mcps.
Implies maximum Q1 (x1) SPADs selected */
#define VL53L1X_WARNING_OFFSET_CAL_MISSING_SAMPLES ((VL53L1X_Error) - 31)
/*!< Thrown if there is less than the requested number of
* valid samples. */
#define VL53L1X_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH ((VL53L1X_Error) - 32)
/*!< Thrown if the offset calibration range sigma estimate is greater
* than 8.0 mm. This is the recommended min value to yield a stable
* offset measurement */
#define VL53L1X_WARNING_OFFSET_CAL_RATE_TOO_HIGH ((VL53L1X_Error) - 33)
/*!< Thrown when VL53L1X_run_offset_calibration() peak rate is greater
than that 50.0Mcps. This is the recommended max rate to avoid
pile-up influencing the offset measurement */
#define VL53L1X_WARNING_OFFSET_CAL_SPAD_COUNT_TOO_LOW ((VL53L1X_Error) - 34)
/*!< Thrown when VL53L1X_run_offset_calibration() when one of stages
range has less that 5.0 effective SPADS. This is the recommended
min value to yield a stable offset */
#define VL53L1X_WARNING_ZONE_CAL_MISSING_SAMPLES ((VL53L1X_Error) - 35)
/*!< Thrown if one of more of the zones have less than
the requested number of valid samples */
#define VL53L1X_WARNING_ZONE_CAL_SIGMA_TOO_HIGH ((VL53L1X_Error) - 36)
/*!< Thrown if one or more zones have sigma estimate value greater
* than 8.0 mm. This is the recommended min value to yield a stable
* offset measurement */
#define VL53L1X_WARNING_ZONE_CAL_RATE_TOO_HIGH ((VL53L1X_Error) - 37)
/*!< Thrown if one of more zones have peak rate higher than
that 50.0Mcps. This is the recommended max rate to avoid
pile-up influencing the offset measurement */
#define VL53L1X_WARNING_XTALK_MISSING_SAMPLES ((VL53L1X_Error) - 38)
/*!< Thrown to notify that some of the xtalk samples did not yield
* valid ranging pulse data while attempting to measure
* the xtalk signal in vl53l1_run_xtalk_extract(). This can signify any of
* the zones are missing samples, for further debug information the
* xtalk_results struct should be referred to. This warning is for
* notification only, the xtalk pulse and shape have still been generated
*/
#define VL53L1X_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT ((VL53L1X_Error) - 39)
/*!< Thrown to notify that some of teh xtalk samples used for gradient
* generation did not yield valid ranging pulse data while attempting to
* measure the xtalk signal in vl53l1_run_xtalk_extract(). This can signify
* that any one of the zones 0-3 yielded no successful samples. The
* xtalk_results struct should be referred to for further debug info.
* This warning is for notification only, the xtalk pulse and shape
* have still been generated.
*/
#define VL53L1X_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT ((VL53L1X_Error) - 40)
/*!< Thrown to notify that some of the xtalk samples used for gradient
* generation did not pass the sigma limit check while attempting to
* measure the xtalk signal in vl53l1_run_xtalk_extract(). This can signify
* that any one of the zones 0-3 yielded an avg sigma_mm value > the limit.
* The xtalk_results struct should be referred to for further debug info.
* This warning is for notification only, the xtalk pulse and shape
* have still been generated.
*/
#define VL53L1X_ERROR_NOT_IMPLEMENTED ((VL53L1X_Error) - 41)
/*!< Tells requested functionality has not been implemented yet or
* not compatible with the device */
#define VL53L1X_ERROR_PLATFORM_SPECIFIC_START ((VL53L1X_Error) - 60)
/*!< Tells the starting code for platform */
/** @} VL53L1X_define_Error_group */
#ifdef __cplusplus
}
#endif
#endif /* _VL53L1X_ERROR_CODES_H_ */