amiro-lld / drivers / VL53L1X / v1 / api / core / vl53l1_api.h @ 3ed0cc4d
History | View | Annotate | Download (42.035 KB)
1 |
|
---|---|
2 |
/*
|
3 |
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
|
4 |
*
|
5 |
* This file is part of VL53L1 Core and is dual licensed,
|
6 |
* either 'STMicroelectronics
|
7 |
* Proprietary license'
|
8 |
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
|
9 |
*
|
10 |
********************************************************************************
|
11 |
*
|
12 |
* 'STMicroelectronics Proprietary license'
|
13 |
*
|
14 |
********************************************************************************
|
15 |
*
|
16 |
* License terms: STMicroelectronics Proprietary in accordance with licensing
|
17 |
* terms at www.st.com/sla0081
|
18 |
*
|
19 |
* STMicroelectronics confidential
|
20 |
* Reproduction and Communication of this document is strictly prohibited unless
|
21 |
* specifically authorized in writing by STMicroelectronics.
|
22 |
*
|
23 |
*
|
24 |
********************************************************************************
|
25 |
*
|
26 |
* Alternatively, VL53L1 Core may be distributed under the terms of
|
27 |
* 'BSD 3-clause "New" or "Revised" License', in which case the following
|
28 |
* provisions apply instead of the ones mentioned above :
|
29 |
*
|
30 |
********************************************************************************
|
31 |
*
|
32 |
* License terms: BSD 3-clause "New" or "Revised" License.
|
33 |
*
|
34 |
* Redistribution and use in source and binary forms, with or without
|
35 |
* modification, are permitted provided that the following conditions are met:
|
36 |
*
|
37 |
* 1. Redistributions of source code must retain the above copyright notice, this
|
38 |
* list of conditions and the following disclaimer.
|
39 |
*
|
40 |
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
41 |
* this list of conditions and the following disclaimer in the documentation
|
42 |
* and/or other materials provided with the distribution.
|
43 |
*
|
44 |
* 3. Neither the name of the copyright holder nor the names of its contributors
|
45 |
* may be used to endorse or promote products derived from this software
|
46 |
* without specific prior written permission.
|
47 |
*
|
48 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
49 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
50 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
51 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
52 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
53 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
54 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
55 |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
56 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
57 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
58 |
*
|
59 |
*
|
60 |
********************************************************************************
|
61 |
*
|
62 |
*/
|
63 |
|
64 |
#ifndef _VL53L1_API_H_
|
65 |
#define _VL53L1_API_H_
|
66 |
|
67 |
#include "vl53l1_api_strings.h" |
68 |
#include "vl53l1_api_core.h" |
69 |
|
70 |
#ifdef __cplusplus
|
71 |
extern "C" |
72 |
{ |
73 |
#endif
|
74 |
|
75 |
#if !defined(VL53L1DevDataGet)
|
76 |
#warning "Usage of PALDevDataGet is deprecated define VL53L1DevDataGet instead\ |
77 |
in your vl53l1_platform_user_data.h file"
|
78 |
#define VL53L1DevDataGet(Dev, field) (Dev->Data.field)
|
79 |
#endif
|
80 |
|
81 |
#if !defined(VL53L1DevDataSet)
|
82 |
#warning "Usage of PALDevDataSet is deprecated define VL53L1DevDataSet instead\ |
83 |
in your vl53l1_platform_user_data.h file"
|
84 |
#define VL53L1DevDataSet(Dev, field, data) ((Dev->Data.field) = (data))
|
85 |
#endif
|
86 |
|
87 |
/** @defgroup VL53L1_cut11_group VL53L1 cut1.1 Function Definition
|
88 |
* @brief VL53L1 cut1.1 Function Definition
|
89 |
* @{
|
90 |
*/
|
91 |
|
92 |
/** @defgroup VL53L1_general_group VL53L1 General Functions
|
93 |
* @brief General functions and definitions
|
94 |
* @{
|
95 |
*/
|
96 |
|
97 |
/**
|
98 |
* @brief Return the VL53L1 driver Version
|
99 |
*
|
100 |
* @note This function doesn't access to the device
|
101 |
*
|
102 |
* @param pVersion Rer to current driver Version
|
103 |
* @return VL53L1_ERROR_NONE Success
|
104 |
* @return "Other error code" See ::VL53L1_Error
|
105 |
*/
|
106 |
VL53L1_Error VL53L1_GetVersion(VL53L1_Version_t *pVersion); |
107 |
|
108 |
/**
|
109 |
* @brief Reads the Product Revision for a for given Device
|
110 |
* This function can be used to distinguish cut1.0 from cut1.1.
|
111 |
*
|
112 |
* @param Dev Device Handle
|
113 |
* @param pProductRevisionMajor Pointer to Product Revision Major
|
114 |
* for a given Device
|
115 |
* @param pProductRevisionMinor Pointer to Product Revision Minor
|
116 |
* for a given Device
|
117 |
* @return VL53L1_ERROR_NONE Success
|
118 |
* @return "Other error code" See ::VL53L1_Error
|
119 |
*/
|
120 |
VL53L1_Error VL53L1_GetProductRevision(VL53L1_DEV Dev, |
121 |
uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor); |
122 |
|
123 |
/**
|
124 |
* @brief Reads the Device information for given Device
|
125 |
*
|
126 |
* @note This function Access to the device
|
127 |
*
|
128 |
* @param Dev Device Handle
|
129 |
* @param pVL53L1_DeviceInfo Pointer to current device info for a given
|
130 |
* Device
|
131 |
* @return VL53L1_ERROR_NONE Success
|
132 |
* @return "Other error code" See ::VL53L1_Error
|
133 |
*/
|
134 |
VL53L1_Error VL53L1_GetDeviceInfo(VL53L1_DEV Dev, |
135 |
VL53L1_DeviceInfo_t *pVL53L1_DeviceInfo); |
136 |
|
137 |
/**
|
138 |
* @brief Human readable Range Status string for a given RangeStatus
|
139 |
*
|
140 |
* @note This function doesn't access to the device
|
141 |
*
|
142 |
* @param RangeStatus The RangeStatus code as stored on
|
143 |
* @a VL53L1_RangingMeasurementData_t
|
144 |
* @param pRangeStatusString The returned RangeStatus string. Shall be
|
145 |
* defined as char buf[VL53L1_MAX_STRING_LENGTH]
|
146 |
* @return VL53L1_ERROR_NONE Success
|
147 |
* @return "Other error code" See ::VL53L1_Error
|
148 |
*/
|
149 |
VL53L1_Error VL53L1_GetRangeStatusString(uint8_t RangeStatus, |
150 |
char *pRangeStatusString);
|
151 |
|
152 |
/**
|
153 |
* @brief Human readable error string for driver error status
|
154 |
*
|
155 |
* @note This function doesn't access to the device
|
156 |
*
|
157 |
* @param PalErrorCode The error code as stored on @a VL53L1_Error
|
158 |
* @param pPalErrorString The error string corresponding to the
|
159 |
* PalErrorCode. Shall be defined as char buf[VL53L1_MAX_STRING_LENGTH]
|
160 |
* @return VL53L1_ERROR_NONE Success
|
161 |
* @return "Other error code" See ::VL53L1_Error
|
162 |
*/
|
163 |
VL53L1_Error VL53L1_GetPalErrorString(VL53L1_Error PalErrorCode, |
164 |
char *pPalErrorString);
|
165 |
|
166 |
/**
|
167 |
* @brief Human readable driver State string
|
168 |
*
|
169 |
* @note This function doesn't access to the device
|
170 |
*
|
171 |
* @param PalStateCode The State code as stored on @a VL53L1_State
|
172 |
* @param pPalStateString The State string corresponding to the
|
173 |
* PalStateCode. Shall be defined as char buf[VL53L1_MAX_STRING_LENGTH]
|
174 |
* @return VL53L1_ERROR_NONE Success
|
175 |
* @return "Other error code" See ::VL53L1_Error
|
176 |
*/
|
177 |
VL53L1_Error VL53L1_GetPalStateString(VL53L1_State PalStateCode, |
178 |
char *pPalStateString);
|
179 |
|
180 |
/**
|
181 |
* @brief Reads the internal state of the driver for a given Device
|
182 |
*
|
183 |
* @note This function doesn't access to the device
|
184 |
*
|
185 |
* @param Dev Device Handle
|
186 |
* @param pPalState Pointer to current state of the PAL for a
|
187 |
* given Device
|
188 |
* @return VL53L1_ERROR_NONE Success
|
189 |
* @return "Other error code" See ::VL53L1_Error
|
190 |
*/
|
191 |
VL53L1_Error VL53L1_GetPalState(VL53L1_DEV Dev, |
192 |
VL53L1_State *pPalState); |
193 |
|
194 |
|
195 |
|
196 |
/** @} VL53L1_general_group */
|
197 |
|
198 |
/** @defgroup VL53L1_init_group VL53L1 Init Functions
|
199 |
* @brief VL53L1 Init Functions
|
200 |
* @{
|
201 |
*/
|
202 |
|
203 |
/**
|
204 |
* @brief Set new device address
|
205 |
*
|
206 |
* After completion the device will answer to the new address programmed.
|
207 |
* This function should be called when several devices are used in parallel
|
208 |
* before start programming the sensor.
|
209 |
* When a single device us used, there is no need to call this function.
|
210 |
*
|
211 |
* When it is requested for multi devices system this function MUST be called
|
212 |
* prior to VL53L1_DataInit()
|
213 |
*
|
214 |
* @note This function Access to the device
|
215 |
*
|
216 |
* @param Dev Device Handle
|
217 |
* @param DeviceAddress The new Device address
|
218 |
* @return VL53L1_ERROR_NONE Success
|
219 |
* @return "Other error code" See ::VL53L1_Error
|
220 |
*/
|
221 |
VL53L1_Error VL53L1_SetDeviceAddress(VL53L1_DEV Dev, |
222 |
uint8_t DeviceAddress); |
223 |
|
224 |
/**
|
225 |
*
|
226 |
* @brief One time device initialization
|
227 |
*
|
228 |
* To be called once and only once after device is brought out of reset
|
229 |
* (Chip enable) and booted see @a VL53L1_WaitDeviceBooted()
|
230 |
*
|
231 |
* @par Function Description
|
232 |
* When not used after a fresh device "power up" or reset, it may return
|
233 |
* @a #VL53L1_ERROR_CALIBRATION_WARNING meaning wrong calibration data
|
234 |
* may have been fetched from device that can result in ranging offset error\n
|
235 |
* If application cannot execute device reset or need to run VL53L1_DataInit
|
236 |
* multiple time then it must ensure proper offset calibration saving and
|
237 |
* restore on its own by using @a VL53L1_GetOffsetCalibrationData() on first
|
238 |
* power up and then @a VL53L1_SetOffsetCalibrationData() in all subsequent init
|
239 |
* This function will change the VL53L1_State from VL53L1_STATE_POWERDOWN to
|
240 |
* VL53L1_STATE_WAIT_STATICINIT.
|
241 |
*
|
242 |
* @note This function Access to the device
|
243 |
*
|
244 |
* @param Dev Device Handle
|
245 |
* @return VL53L1_ERROR_NONE Success
|
246 |
* @return "Other error code" See ::VL53L1_Error
|
247 |
*/
|
248 |
VL53L1_Error VL53L1_DataInit(VL53L1_DEV Dev); |
249 |
|
250 |
|
251 |
/**
|
252 |
* @brief Do basic device init (and eventually patch loading)
|
253 |
* This function will change the VL53L1_State from
|
254 |
* VL53L1_STATE_WAIT_STATICINIT to VL53L1_STATE_IDLE.
|
255 |
* In this stage all default setting will be applied.
|
256 |
*
|
257 |
* @note This function Access to the device
|
258 |
*
|
259 |
* @param Dev Device Handle
|
260 |
* @return VL53L1_ERROR_NONE Success
|
261 |
* @return "Other error code" See ::VL53L1_Error
|
262 |
*/
|
263 |
VL53L1_Error VL53L1_StaticInit(VL53L1_DEV Dev); |
264 |
|
265 |
/**
|
266 |
* @brief Wait for device booted after chip enable (hardware standby)
|
267 |
* This function can be run only when VL53L1_State is VL53L1_STATE_POWERDOWN.
|
268 |
*
|
269 |
* @param Dev Device Handle
|
270 |
* @return VL53L1_ERROR_NONE Success
|
271 |
* @return "Other error code" See ::VL53L1_Error
|
272 |
*
|
273 |
*/
|
274 |
VL53L1_Error VL53L1_WaitDeviceBooted(VL53L1_DEV Dev); |
275 |
|
276 |
|
277 |
/** @} VL53L1_init_group */
|
278 |
|
279 |
/** @defgroup VL53L1_parameters_group VL53L1 Parameters Functions
|
280 |
* @brief Functions used to prepare and setup the device
|
281 |
* @{
|
282 |
*/
|
283 |
|
284 |
/**
|
285 |
* @brief Set a new Preset Mode
|
286 |
* @par Function Description
|
287 |
* Set device to a new Operating Mode (High speed ranging, Multi objects ...)
|
288 |
*
|
289 |
* @note This function doesn't Access to the device
|
290 |
*
|
291 |
* @warning This function change the timing budget to 16 ms and the inter-
|
292 |
* measurement period to 1000 ms. Also the VL53L1_DISTANCEMODE_LONG is used.
|
293 |
*
|
294 |
* @param Dev Device Handle
|
295 |
* @param PresetMode New Preset mode to apply
|
296 |
* <br>Valid values are:
|
297 |
*/
|
298 |
/**
|
299 |
* @li VL53L1_PRESETMODE_LITE_RANGING
|
300 |
* @li VL53L1_PRESETMODE_AUTONOMOUS
|
301 |
* @li VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS
|
302 |
*/
|
303 |
/**
|
304 |
*
|
305 |
* @return VL53L1_ERROR_NONE Success
|
306 |
* @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when PresetMode is
|
307 |
* not in the supported list
|
308 |
*/
|
309 |
VL53L1_Error VL53L1_SetPresetMode(VL53L1_DEV Dev, |
310 |
VL53L1_PresetModes PresetMode); |
311 |
|
312 |
/**
|
313 |
* @brief Get current Preset Mode
|
314 |
* @par Function Description
|
315 |
* Get actual mode of the device(ranging, histogram ...)
|
316 |
*
|
317 |
* @note This function doesn't Access to the device
|
318 |
*
|
319 |
* @param Dev Device Handle
|
320 |
* @param pPresetMode Pointer to current apply mode value
|
321 |
*
|
322 |
* @return VL53L1_ERROR_NONE Success
|
323 |
* @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when
|
324 |
* DeviceMode is not in the supported list
|
325 |
*/
|
326 |
VL53L1_Error VL53L1_GetPresetMode(VL53L1_DEV Dev, |
327 |
VL53L1_PresetModes *pPresetMode); |
328 |
|
329 |
|
330 |
/**
|
331 |
* @brief Set the distance mode
|
332 |
* @par Function Description
|
333 |
* Set the distance mode to be used for the next ranging.<br>
|
334 |
* The modes Short, Medium and Long are used to optimize the ranging accuracy
|
335 |
* in a specific range of distance.<br> The user select one of these modes to
|
336 |
* select the distance range.
|
337 |
* @note This function doesn't Access to the device
|
338 |
*
|
339 |
* @warning This function should be called after @a VL53L1_SetPresetMode().
|
340 |
|
341 |
* @param Dev Device Handle
|
342 |
* @param DistanceMode Distance mode to apply, valid values are:
|
343 |
* @li VL53L1_DISTANCEMODE_SHORT
|
344 |
* @li VL53L1_DISTANCEMODE_MEDIUM
|
345 |
* @li VL53L1_DISTANCEMODE_LONG
|
346 |
* @return VL53L1_ERROR_NONE Success
|
347 |
* @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when DistanceMode
|
348 |
* is not in the supported list
|
349 |
* @return "Other error code" See ::VL53L1_Error
|
350 |
*/
|
351 |
VL53L1_Error VL53L1_SetDistanceMode(VL53L1_DEV Dev, |
352 |
VL53L1_DistanceModes DistanceMode); |
353 |
|
354 |
/**
|
355 |
* @brief Get the distance mode
|
356 |
* @par Function Description
|
357 |
* Get the distance mode used for the next ranging.
|
358 |
*
|
359 |
* @param Dev Device Handle
|
360 |
* @param *pDistanceMode Pointer to Distance mode
|
361 |
* @return VL53L1_ERROR_NONE Success
|
362 |
* @return "Other error code" See ::VL53L1_Error
|
363 |
*/
|
364 |
VL53L1_Error VL53L1_GetDistanceMode(VL53L1_DEV Dev, |
365 |
VL53L1_DistanceModes *pDistanceMode); |
366 |
|
367 |
|
368 |
|
369 |
|
370 |
/**
|
371 |
* @brief Set Ranging Timing Budget in microseconds
|
372 |
*
|
373 |
* @par Function Description
|
374 |
* Defines the maximum time allowed by the user to the device to run a
|
375 |
* full ranging sequence for the current mode (ranging, histogram, ASL ...)
|
376 |
*
|
377 |
* @param Dev Device Handle
|
378 |
* @param MeasurementTimingBudgetMicroSeconds Max measurement time in
|
379 |
* microseconds.
|
380 |
* @return VL53L1_ERROR_NONE Success
|
381 |
* @return VL53L1_ERROR_INVALID_PARAMS Error timing parameter not
|
382 |
* supported.
|
383 |
* The maximum accepted value for the
|
384 |
* computed timing budget is 10 seconds
|
385 |
* the minimum value depends on the preset
|
386 |
* mode selected.
|
387 |
* @return "Other error code" See ::VL53L1_Error
|
388 |
*/
|
389 |
VL53L1_Error VL53L1_SetMeasurementTimingBudgetMicroSeconds( |
390 |
VL53L1_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds); |
391 |
|
392 |
/**
|
393 |
* @brief Get Ranging Timing Budget in microseconds
|
394 |
*
|
395 |
* @par Function Description
|
396 |
* Returns the programmed the maximum time allowed by the user to the
|
397 |
* device to run a full ranging sequence for the current mode
|
398 |
* (ranging, histogram, ASL ...)
|
399 |
*
|
400 |
* @param Dev Device Handle
|
401 |
* @param pMeasurementTimingBudgetMicroSeconds Max measurement time in
|
402 |
* microseconds.
|
403 |
* @return VL53L1_ERROR_NONE Success
|
404 |
* @return "Other error code" See ::VL53L1_Error
|
405 |
*/
|
406 |
VL53L1_Error VL53L1_GetMeasurementTimingBudgetMicroSeconds( |
407 |
VL53L1_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds); |
408 |
|
409 |
|
410 |
/**
|
411 |
* Program continuous mode Inter-Measurement period in milliseconds
|
412 |
*
|
413 |
* @par Function Description
|
414 |
* When trying to set too short time return INVALID_PARAMS minimal value
|
415 |
*
|
416 |
* @param Dev Device Handle
|
417 |
* @param InterMeasurementPeriodMilliSeconds Inter-Measurement Period in ms.
|
418 |
* this value should be greater than the duration set in
|
419 |
* @a VL53L1_SetMeasurementTimingBudgetMicroSeconds() to ensure smooth ranging
|
420 |
* operation.
|
421 |
* @return VL53L1_ERROR_NONE Success
|
422 |
* @return "Other error code" See ::VL53L1_Error
|
423 |
*/
|
424 |
VL53L1_Error VL53L1_SetInterMeasurementPeriodMilliSeconds( |
425 |
VL53L1_DEV Dev, uint32_t InterMeasurementPeriodMilliSeconds); |
426 |
|
427 |
/**
|
428 |
* Get continuous mode Inter-Measurement period in milliseconds
|
429 |
*
|
430 |
* @par Function Description
|
431 |
*
|
432 |
* @param Dev Device Handle
|
433 |
* @param pInterMeasurementPeriodMilliSeconds Pointer to programmed
|
434 |
* Inter-Measurement Period in milliseconds.
|
435 |
* @return VL53L1_ERROR_NONE
|
436 |
*/
|
437 |
VL53L1_Error VL53L1_GetInterMeasurementPeriodMilliSeconds( |
438 |
VL53L1_DEV Dev, uint32_t *pInterMeasurementPeriodMilliSeconds); |
439 |
|
440 |
|
441 |
/** @} VL53L1_parameters_group */
|
442 |
|
443 |
|
444 |
/** @defgroup VL53L1_limitcheck_group VL53L1 Limit Check Functions
|
445 |
* @brief Functions used for the Limit checks
|
446 |
* @{
|
447 |
*/
|
448 |
|
449 |
|
450 |
|
451 |
/**
|
452 |
* @brief Get the number of the check limit managed by a given Device
|
453 |
*
|
454 |
* @par Function Description
|
455 |
* This function give the number of the check limit managed by the Device
|
456 |
*
|
457 |
* @param pNumberOfLimitCheck Pointer to the number of check limit.
|
458 |
* @return VL53L1_ERROR_NONE Success
|
459 |
* @return "Other error code" See ::VL53L1_Error
|
460 |
*/
|
461 |
VL53L1_Error VL53L1_GetNumberOfLimitCheck( |
462 |
uint16_t *pNumberOfLimitCheck); |
463 |
|
464 |
/**
|
465 |
* @brief Return a description string for a given limit check number
|
466 |
*
|
467 |
* @par Function Description
|
468 |
* This function returns a description string for a given limit check number.
|
469 |
* The limit check is identified with the LimitCheckId.
|
470 |
*
|
471 |
* @param LimitCheckId Limit Check ID
|
472 |
(0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
|
473 |
* @param pLimitCheckString Pointer to the description string of
|
474 |
* the given check limit. Shall be defined as char buf[VL53L1_MAX_STRING_LENGTH]
|
475 |
* @return VL53L1_ERROR_NONE Success
|
476 |
* @return "Other error code" See ::VL53L1_Error
|
477 |
*/
|
478 |
VL53L1_Error VL53L1_GetLimitCheckInfo(uint16_t LimitCheckId, |
479 |
char *pLimitCheckString);
|
480 |
|
481 |
/**
|
482 |
* @brief Return a the Status of the specified check limit
|
483 |
*
|
484 |
* @par Function Description
|
485 |
* This function returns the Status of the specified check limit.
|
486 |
* The value indicate if the check is fail or not.
|
487 |
* The limit check is identified with the LimitCheckId.
|
488 |
*
|
489 |
* @param Dev Device Handle
|
490 |
* @param LimitCheckId Limit Check ID
|
491 |
(0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
|
492 |
* @param pLimitCheckStatus Pointer to the
|
493 |
Limit Check Status of the given check limit.
|
494 |
* LimitCheckStatus :
|
495 |
* 0 the check is not fail or not enabled
|
496 |
* 1 the check if fail
|
497 |
*
|
498 |
* <p><ul>
|
499 |
* <li>VL53L1_CHECKENABLE_SIGMA_FINAL_RANGE: the sigma indicate the quality
|
500 |
* of the measure. The more it is little the better it is.
|
501 |
* The status is 1 when current sigma is greater then the limit.</li>
|
502 |
* <li>VL53L1_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE: the signal rate indicate
|
503 |
* the strength of the returned signal. The more it is big the better it is.
|
504 |
* The status is 1 when current signal is lower then the limit.</li>
|
505 |
* </ul></p>
|
506 |
*
|
507 |
*
|
508 |
* @return VL53L1_ERROR_NONE Success
|
509 |
* @return "Other error code" See ::VL53L1_Error
|
510 |
*/
|
511 |
VL53L1_Error VL53L1_GetLimitCheckStatus(VL53L1_DEV Dev, |
512 |
uint16_t LimitCheckId, uint8_t *pLimitCheckStatus); |
513 |
|
514 |
/**
|
515 |
* @brief Enable/Disable a specific limit check
|
516 |
*
|
517 |
* @par Function Description
|
518 |
* This function Enable/Disable a specific limit check.
|
519 |
* The limit check is identified with the LimitCheckId.
|
520 |
*
|
521 |
* @note This function doesn't Access to the device
|
522 |
*
|
523 |
* @param Dev Device Handle
|
524 |
* @param LimitCheckId Limit Check ID
|
525 |
* (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
|
526 |
* @param LimitCheckEnable
|
527 |
* @li set LimitCheckEnable=1 enables the LimitCheckId limit
|
528 |
* @li set LimitCheckEnable=0 disables the LimitCheckId limit
|
529 |
* @return VL53L1_ERROR_NONE Success
|
530 |
* @return VL53L1_ERROR_INVALID_PARAMS This error is returned
|
531 |
* when LimitCheckId value is out of range.
|
532 |
* @return "Other error code" See ::VL53L1_Error
|
533 |
*/
|
534 |
VL53L1_Error VL53L1_SetLimitCheckEnable(VL53L1_DEV Dev, |
535 |
uint16_t LimitCheckId, uint8_t LimitCheckEnable); |
536 |
|
537 |
/**
|
538 |
* @brief Get specific limit check enable state
|
539 |
*
|
540 |
* @par Function Description
|
541 |
* This function get the enable state of a specific limit check.
|
542 |
* The limit check is identified with the LimitCheckId.
|
543 |
*
|
544 |
* @note This function Access to the device
|
545 |
*
|
546 |
* @param Dev Device Handle
|
547 |
* @param LimitCheckId Limit Check ID
|
548 |
* (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
|
549 |
* @param pLimitCheckEnable Pointer to the check limit enable
|
550 |
* value.
|
551 |
* @li if 1 the check limit corresponding to LimitCheckId is Enabled
|
552 |
* @li if 0 the check limit corresponding to LimitCheckId is disabled
|
553 |
* @return VL53L1_ERROR_NONE Success
|
554 |
* @return VL53L1_ERROR_INVALID_PARAMS This error is returned
|
555 |
* when LimitCheckId value is out of range.
|
556 |
* @return "Other error code" See ::VL53L1_Error
|
557 |
*/
|
558 |
VL53L1_Error VL53L1_GetLimitCheckEnable(VL53L1_DEV Dev, |
559 |
uint16_t LimitCheckId, uint8_t *pLimitCheckEnable); |
560 |
|
561 |
/**
|
562 |
* @brief Set a specific limit check value
|
563 |
*
|
564 |
* @par Function Description
|
565 |
* This function set a specific limit check value.
|
566 |
* The limit check is identified with the LimitCheckId.
|
567 |
*
|
568 |
* @note Note that the value written with that function will not be applied if
|
569 |
* the limit is not enabled. In other words this function will not enable the
|
570 |
* limit but change only the value. In case the limit is not enabled the value
|
571 |
* is saved internally and applied with VL53L1_SetLimitCheckEnable.
|
572 |
*
|
573 |
* @param Dev Device Handle
|
574 |
* @param LimitCheckId Limit Check ID
|
575 |
* (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
|
576 |
* @param LimitCheckValue Limit check Value for a given
|
577 |
* LimitCheckId
|
578 |
* @return VL53L1_ERROR_NONE Success
|
579 |
* @return "Other error code" See ::VL53L1_Error
|
580 |
*/
|
581 |
VL53L1_Error VL53L1_SetLimitCheckValue(VL53L1_DEV Dev, |
582 |
uint16_t LimitCheckId, FixPoint1616_t LimitCheckValue); |
583 |
|
584 |
/**
|
585 |
* @brief Get a specific limit check value
|
586 |
*
|
587 |
* @par Function Description
|
588 |
* This function get a specific limit check value from device then it updates
|
589 |
* internal values and check enables.
|
590 |
* The limit check is identified with the LimitCheckId.
|
591 |
*
|
592 |
* @note This function get the current value from device if zero then the value
|
593 |
* returned is the one stored by the user, but in that case the check is store
|
594 |
* as disabled. If the value from device is not zero, this is returned and set
|
595 |
* into the memory at the same way that user call VL53L1_SetLimitCheckValue()
|
596 |
*
|
597 |
* @param Dev Device Handle
|
598 |
* @param LimitCheckId Limit Check ID
|
599 |
* (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
|
600 |
* @param pLimitCheckValue Pointer to Limit
|
601 |
* check Value for a given LimitCheckId.
|
602 |
* @return VL53L1_ERROR_NONE Success
|
603 |
* @return "Other error code" See ::VL53L1_Error
|
604 |
*/
|
605 |
VL53L1_Error VL53L1_GetLimitCheckValue(VL53L1_DEV Dev, |
606 |
uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckValue); |
607 |
|
608 |
/**
|
609 |
* @brief Get the current value of the signal used for the limit check
|
610 |
*
|
611 |
* @par Function Description
|
612 |
* This function get a the current value of the signal used for the limit check.
|
613 |
* To obtain the latest value you should run a valid ranging before.
|
614 |
* The value reported is linked to the limit check identified with the
|
615 |
* LimitCheckId.
|
616 |
*
|
617 |
* @param Dev Device Handle
|
618 |
* @param LimitCheckId Limit Check ID
|
619 |
* (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
|
620 |
* @param pLimitCheckCurrent Pointer to current Value for a
|
621 |
* given LimitCheckId.
|
622 |
* @return VL53L1_ERROR_NONE Success
|
623 |
* @return "Other error code" See ::VL53L1_Error
|
624 |
*/
|
625 |
VL53L1_Error VL53L1_GetLimitCheckCurrent(VL53L1_DEV Dev, |
626 |
uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckCurrent); |
627 |
|
628 |
/** @} VL53L1_limitcheck_group */
|
629 |
|
630 |
|
631 |
|
632 |
/** @defgroup VL53L1_ROI_group VL53L1 ROI Functions
|
633 |
* @brief Functions used to select ROIs
|
634 |
* @{
|
635 |
*/
|
636 |
|
637 |
/**
|
638 |
* @brief Set the ROI to be used for ranging
|
639 |
*
|
640 |
* @par Function Description
|
641 |
* The user defined ROI is a rectangle described as per the following system
|
642 |
* from the Top Left corner to the Bottom Right corner.
|
643 |
* <br>Minimal ROI size is 4x4 spads
|
644 |
* @image html roi_coord.png
|
645 |
*
|
646 |
* @param Dev Device Handle
|
647 |
* @param pUserROi Pointer to the Structure definining the ROI
|
648 |
* @return VL53L1_ERROR_NONE Success
|
649 |
* @return "Other error code" See ::VL53L1_Error
|
650 |
*/
|
651 |
VL53L1_Error VL53L1_SetUserROI(VL53L1_DEV Dev, |
652 |
VL53L1_UserRoi_t *pUserROi); |
653 |
|
654 |
/**
|
655 |
* @brief Get the ROI managed by the Device
|
656 |
*
|
657 |
* @par Function Description
|
658 |
* Get the ROI managed by the Device
|
659 |
*
|
660 |
* @param Dev Device Handle
|
661 |
* @param pUserROi Pointer to the Structure definining the ROI
|
662 |
* @return VL53L1_ERROR_NONE Success
|
663 |
* @return "Other error code" See ::VL53L1_Error
|
664 |
*/
|
665 |
VL53L1_Error VL53L1_GetUserROI(VL53L1_DEV Dev, |
666 |
VL53L1_UserRoi_t *pUserROi); |
667 |
|
668 |
/** @} VL53L1_ROI_group */
|
669 |
|
670 |
/* \internal */
|
671 |
/** @defgroup VL53L1_sequencestep_group VL53L1 Sequence Step Functions
|
672 |
* @brief Functions used to select Steps done on each ranging
|
673 |
* @{
|
674 |
*/
|
675 |
|
676 |
/**
|
677 |
* @brief Gets number of sequence steps managed by the API.
|
678 |
*
|
679 |
* @par Function Description
|
680 |
* This function retrieves the number of sequence steps currently managed
|
681 |
* by the API
|
682 |
*
|
683 |
* @note This function Accesses the device
|
684 |
*
|
685 |
* @param Dev Device Handle
|
686 |
* @param pNumberOfSequenceSteps Out parameter reporting the number of
|
687 |
* sequence steps.
|
688 |
* @return VL53L1_ERROR_NONE Success
|
689 |
* @return "Other error code" See ::VL53L1_Error
|
690 |
*/
|
691 |
VL53L1_Error VL53L1_GetNumberOfSequenceSteps(VL53L1_DEV Dev, |
692 |
uint8_t *pNumberOfSequenceSteps); |
693 |
|
694 |
/**
|
695 |
* @brief Gets the name of a given sequence step.
|
696 |
*
|
697 |
* @par Function Description
|
698 |
* This function retrieves the name of sequence steps corresponding to
|
699 |
* SequenceStepId.
|
700 |
*
|
701 |
* @note This function doesn't Accesses the device
|
702 |
*
|
703 |
* @param SequenceStepId Sequence step identifier.
|
704 |
* @param pSequenceStepsString Pointer to Info string. Shall be
|
705 |
* defined as char buf[VL53L1_MAX_STRING_LENGTH]
|
706 |
* @return VL53L1_ERROR_NONE Success
|
707 |
* @return "Other error code" See ::VL53L1_Error
|
708 |
*/
|
709 |
VL53L1_Error VL53L1_GetSequenceStepsInfo( |
710 |
VL53L1_SequenceStepId SequenceStepId, char *pSequenceStepsString);
|
711 |
|
712 |
|
713 |
|
714 |
/**
|
715 |
* @brief Sets the (on/off) state of a requested sequence step.
|
716 |
*
|
717 |
* @par Function Description
|
718 |
* This function enables/disables a requested sequence step.
|
719 |
*
|
720 |
* @note This function Accesses the device
|
721 |
*
|
722 |
* @param Dev Device Handle
|
723 |
* @param SequenceStepId Sequence step identifier.
|
724 |
* @param SequenceStepEnabled Demanded state {0=Off,1=On}
|
725 |
* is enabled.
|
726 |
* @return VL53L1_ERROR_NONE Success
|
727 |
* @return VL53L1_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
|
728 |
* supported.
|
729 |
* @return "Other error code" See ::VL53L1_Error
|
730 |
*/
|
731 |
VL53L1_Error VL53L1_SetSequenceStepEnable(VL53L1_DEV Dev, |
732 |
VL53L1_SequenceStepId SequenceStepId, uint8_t SequenceStepEnabled); |
733 |
|
734 |
/**
|
735 |
* @brief Gets the (on/off) state of a requested sequence step.
|
736 |
*
|
737 |
* @par Function Description
|
738 |
* This function retrieves the state of a requested sequence step, i.e. on/off.
|
739 |
*
|
740 |
* @note This function Accesses the device
|
741 |
*
|
742 |
* @param Dev Device Handle
|
743 |
* @param SequenceStepId Sequence step identifier.
|
744 |
* @param pSequenceStepEnabled Out parameter reporting if the sequence step
|
745 |
* is enabled {0=Off,1=On}.
|
746 |
* @return VL53L1_ERROR_NONE Success
|
747 |
* @return VL53L1_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
|
748 |
* supported.
|
749 |
* @return "Other error code" See ::VL53L1_Error
|
750 |
*/
|
751 |
VL53L1_Error VL53L1_GetSequenceStepEnable(VL53L1_DEV Dev, |
752 |
VL53L1_SequenceStepId SequenceStepId, uint8_t *pSequenceStepEnabled); |
753 |
|
754 |
|
755 |
/** @} VL53L1_sequencestep_group */
|
756 |
/* \endinternal */
|
757 |
|
758 |
|
759 |
|
760 |
/** @defgroup VL53L1_measurement_group VL53L1 Measurement Functions
|
761 |
* @brief Functions used for the measurements
|
762 |
* @{
|
763 |
*/
|
764 |
|
765 |
/**
|
766 |
* @brief Start device measurement
|
767 |
*
|
768 |
* @details Started measurement will depend on preset parameters set through
|
769 |
* @a VL53L1_SetPreseMode()
|
770 |
* This function will change the VL53L1_State from VL53L1_STATE_IDLE to
|
771 |
* VL53L1_STATE_RUNNING.
|
772 |
*
|
773 |
* @note This function Access to the device
|
774 |
*
|
775 |
* @param Dev Device Handle
|
776 |
* @return VL53L1_ERROR_NONE Success
|
777 |
* @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when
|
778 |
* PresetMode programmed with @a VL53L1_SetPresetMode
|
779 |
* @return VL53L1_ERROR_TIME_OUT Time out on start measurement
|
780 |
* @return VL53L1_ERROR_INVALID_PARAMS This error might occur in timed mode
|
781 |
* when inter measurement period is smaller or too close to the timing budget.
|
782 |
* In such case measurements are not started and user must correct the timings
|
783 |
* passed to @a VL53L1_SetMeasurementTimingBudgetMicroSeconds() and
|
784 |
* @a VL53L1_SetInterMeasurementPeriodMilliSeconds() functions.
|
785 |
* @return "Other error code" See ::VL53L1_Error
|
786 |
*/
|
787 |
VL53L1_Error VL53L1_StartMeasurement(VL53L1_DEV Dev); |
788 |
|
789 |
/**
|
790 |
* @brief Stop device measurement
|
791 |
*
|
792 |
* @details Will set the device in standby mode at end of current measurement\n
|
793 |
* Not necessary in single mode as device shall return automatically
|
794 |
* in standby mode at end of measurement.
|
795 |
* This function will change the VL53L1_State from VL53L1_STATE_RUNNING
|
796 |
* to VL53L1_STATE_IDLE.
|
797 |
*
|
798 |
* @note This function Access to the device
|
799 |
*
|
800 |
* @param Dev Device Handle
|
801 |
* @return VL53L1_ERROR_NONE Success
|
802 |
* @return "Other error code" See ::VL53L1_Error
|
803 |
*/
|
804 |
VL53L1_Error VL53L1_StopMeasurement(VL53L1_DEV Dev); |
805 |
|
806 |
/**
|
807 |
* @brief Clear the Interrupt flag and start new measurement
|
808 |
* *
|
809 |
* @note This function Access to the device
|
810 |
*
|
811 |
* @param Dev Device Handle
|
812 |
* @return VL53L1_ERROR_NONE Success
|
813 |
* @return "Other error code" See ::VL53L1_Error
|
814 |
*/
|
815 |
VL53L1_Error VL53L1_ClearInterruptAndStartMeasurement(VL53L1_DEV Dev); |
816 |
|
817 |
/**
|
818 |
* @brief Return Measurement Data Ready
|
819 |
*
|
820 |
* @par Function Description
|
821 |
* This function indicate that a measurement data is ready.
|
822 |
* This function is used for non-blocking capture.
|
823 |
*
|
824 |
* @note This function Access to the device
|
825 |
*
|
826 |
* @param Dev Device Handle
|
827 |
* @param pMeasurementDataReady Pointer to Measurement Data Ready.
|
828 |
* 0 = data not ready, 1 = data ready
|
829 |
* @return VL53L1_ERROR_NONE Success
|
830 |
* @return "Other error code" See ::VL53L1_Error
|
831 |
*/
|
832 |
VL53L1_Error VL53L1_GetMeasurementDataReady(VL53L1_DEV Dev, |
833 |
uint8_t *pMeasurementDataReady); |
834 |
|
835 |
/**
|
836 |
* @brief Wait for measurement data ready.
|
837 |
* Blocking function.
|
838 |
* Note that the timeout is given by:
|
839 |
* VL53L1_RANGE_COMPLETION_POLLING_TIMEOUT_MS defined in def.h
|
840 |
*
|
841 |
*
|
842 |
* @note This function Access to the device
|
843 |
*
|
844 |
* @param Dev Device Handle
|
845 |
* @return VL53L1_ERROR_NONE Success
|
846 |
* @return VL53L1_ERROR_TIME_OUT In case of timeout
|
847 |
*/
|
848 |
VL53L1_Error VL53L1_WaitMeasurementDataReady(VL53L1_DEV Dev); |
849 |
|
850 |
|
851 |
/**
|
852 |
* @brief Retrieve the measurements from device for a given setup
|
853 |
*
|
854 |
* @par Function Description
|
855 |
* Get data from last successful Ranging measurement
|
856 |
*/
|
857 |
/**
|
858 |
*
|
859 |
* @warning USER must call @a VL53L1_ClearInterruptAndStartMeasurement() prior
|
860 |
* to call again this function
|
861 |
*
|
862 |
* @note This function Access to the device
|
863 |
*
|
864 |
* @note The first valid value returned by this function will have a range
|
865 |
* status equal to VL53L1_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK which means that
|
866 |
* the data is valid but no wrap around check have been done. User should take
|
867 |
* care about that.
|
868 |
*
|
869 |
* @param Dev Device Handle
|
870 |
* @param pRangingMeasurementData Pointer to the data structure to fill up.
|
871 |
* @return VL53L1_ERROR_NONE Success
|
872 |
* @return VL53L1_ERROR_MODE_NOT_SUPPORTED in case of MULTIZONES_SCANNING
|
873 |
* @return "Other error code" See ::VL53L1_Error
|
874 |
*/
|
875 |
VL53L1_Error VL53L1_GetRangingMeasurementData(VL53L1_DEV Dev, |
876 |
VL53L1_RangingMeasurementData_t *pRangingMeasurementData); |
877 |
|
878 |
|
879 |
|
880 |
/** @} VL53L1_measurement_group */
|
881 |
|
882 |
/** @defgroup VL53L1_Calibration_group VL53L1 Calibration Functions
|
883 |
* @brief Functions used for Calibration
|
884 |
* @{
|
885 |
*/
|
886 |
|
887 |
|
888 |
/**
|
889 |
* @brief Set Tuning Parameter value for a given parameter ID
|
890 |
*
|
891 |
* @par Function Description
|
892 |
* This function is used to improve the performance of the device. It permit to
|
893 |
* change a particular value used for a timeout or a threshold or a constant
|
894 |
* in an algorithm. The function will change the value of the parameter
|
895 |
* identified by an unique ID.
|
896 |
*
|
897 |
* @note This function doesn't Access to the device
|
898 |
*
|
899 |
* @param Dev Device Handle
|
900 |
* @param TuningParameterId Tuning Parameter ID
|
901 |
* @param TuningParameterValue Tuning Parameter Value
|
902 |
* @return VL53L1_ERROR_NONE Success
|
903 |
* @return "Other error code" See ::VL53L1_Error
|
904 |
*/
|
905 |
VL53L1_Error VL53L1_SetTuningParameter(VL53L1_DEV Dev, |
906 |
uint16_t TuningParameterId, int32_t TuningParameterValue); |
907 |
|
908 |
/**
|
909 |
* @brief Get Tuning Parameter value for a given parameter ID
|
910 |
*
|
911 |
* @par Function Description
|
912 |
* This function is used to get the value of the parameter
|
913 |
* identified by an unique ID.
|
914 |
*
|
915 |
* @note This function doesn't Access to the device
|
916 |
*
|
917 |
* @param Dev Device Handle
|
918 |
* @param TuningParameterId Tuning Parameter ID
|
919 |
* @param pTuningParameterValue Pointer to Tuning Parameter Value
|
920 |
* for a given TuningParameterId.
|
921 |
* @return VL53L1_ERROR_NONE Success
|
922 |
* @return "Other error code" See ::VL53L1_Error
|
923 |
*/
|
924 |
VL53L1_Error VL53L1_GetTuningParameter(VL53L1_DEV Dev, |
925 |
uint16_t TuningParameterId, int32_t *pTuningParameterValue); |
926 |
|
927 |
/**
|
928 |
* @brief Performs Reference Spad Management
|
929 |
*
|
930 |
* @par Function Description
|
931 |
* The reference SPAD initialization procedure determines the minimum amount
|
932 |
* of reference spads to be enables to achieve a target reference signal rate
|
933 |
* and should be performed once during initialization.
|
934 |
*
|
935 |
* @note This function Access to the device
|
936 |
*
|
937 |
* @param Dev Device Handle
|
938 |
* @return VL53L1_ERROR_NONE Success
|
939 |
* @return "Other error code" See ::VL53L1_Error
|
940 |
*/
|
941 |
VL53L1_Error VL53L1_PerformRefSpadManagement(VL53L1_DEV Dev); |
942 |
|
943 |
|
944 |
/**
|
945 |
* @brief Enable/Disable Cross talk compensation feature
|
946 |
*
|
947 |
* Enable/Disable Cross Talk correction.
|
948 |
*
|
949 |
* @param Dev Device Handle
|
950 |
* @param XTalkCompensationEnable Cross talk compensation
|
951 |
* to be set 0 = disabled or 1 = enabled.
|
952 |
* @return VL53L1_ERROR_NONE Success
|
953 |
* @return "Other error code" See ::VL53L1_Error
|
954 |
*/
|
955 |
VL53L1_Error VL53L1_SetXTalkCompensationEnable(VL53L1_DEV Dev, |
956 |
uint8_t XTalkCompensationEnable); |
957 |
|
958 |
/**
|
959 |
* @brief Get Cross talk compensation rate enable
|
960 |
*
|
961 |
* Get if the Cross Talk is Enabled or Disabled.
|
962 |
*
|
963 |
* @note This function doesn't access to the device
|
964 |
*
|
965 |
* @param Dev Device Handle
|
966 |
* @param pXTalkCompensationEnable Pointer to the Cross talk compensation
|
967 |
* state 0=disabled or 1 = enabled
|
968 |
* @return VL53L1_ERROR_NONE Success
|
969 |
* @return "Other error code" See ::VL53L1_Error
|
970 |
*/
|
971 |
VL53L1_Error VL53L1_GetXTalkCompensationEnable(VL53L1_DEV Dev, |
972 |
uint8_t *pXTalkCompensationEnable); |
973 |
|
974 |
/**
|
975 |
* @brief Perform XTalk Calibration
|
976 |
*
|
977 |
* @details Perform a XTalk calibration of the Device.
|
978 |
* This function will launch a ranging measurement, if interrupts
|
979 |
* are enabled an interrupt will be done.
|
980 |
* This function will clear the interrupt generated automatically.
|
981 |
* This function will program a new value for the XTalk compensation
|
982 |
* and it will enable the cross talk before exit.
|
983 |
*
|
984 |
* @warning This function is a blocking function
|
985 |
*
|
986 |
* @note This function Access to the device
|
987 |
*
|
988 |
* @param Dev Device Handle
|
989 |
* @param CalDistanceMilliMeter Target distance in mm
|
990 |
* The calibration uses current preset and distance mode without altering them.
|
991 |
* <br>User must call @a VL53L1_SetPresetMode() with
|
992 |
* VL53L1_PRESETMODE_AUTONOMOUS, VL53L1_PRESETMODE_LITE_RANGING or
|
993 |
* VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS parameter prior to launch calibration
|
994 |
*
|
995 |
* @return VL53L1_ERROR_NONE Success
|
996 |
* @return "Other error code" See ::VL53L1_Error
|
997 |
*/
|
998 |
VL53L1_Error VL53L1_PerformSingleTargetXTalkCalibration(VL53L1_DEV Dev, |
999 |
int32_t CalDistanceMilliMeter); |
1000 |
|
1001 |
|
1002 |
/**
|
1003 |
* @brief Define the mode to be used for the offset calibration
|
1004 |
*
|
1005 |
* Define the mode to be used for the offset calibration. This function should
|
1006 |
* be called before run the @a VL53L1_PerformOffsetCalibration()
|
1007 |
*
|
1008 |
* @param Dev Device Handle
|
1009 |
* @param OffsetCalibrationMode Offset Calibration Mode valid values are:
|
1010 |
* @li VL53L1_OFFSETCALIBRATIONMODE_STANDARD
|
1011 |
* @li VL53L1_OFFSETCALIBRATIONMODE_PRERANGE_ONLY
|
1012 |
*/
|
1013 |
/**
|
1014 |
*
|
1015 |
* @return VL53L1_ERROR_NONE Success
|
1016 |
* @return "Other error code" See ::VL53L1_Error
|
1017 |
*/
|
1018 |
VL53L1_Error VL53L1_SetOffsetCalibrationMode(VL53L1_DEV Dev, |
1019 |
VL53L1_OffsetCalibrationModes OffsetCalibrationMode); |
1020 |
|
1021 |
|
1022 |
|
1023 |
/**
|
1024 |
* @brief Perform Offset Calibration
|
1025 |
*
|
1026 |
* @details Perform a Offset calibration of the Device.
|
1027 |
* This function will launch a ranging measurement, if interrupts are
|
1028 |
* enabled interrupts will be done.
|
1029 |
* This function will program a new value for the Offset calibration value
|
1030 |
*
|
1031 |
* @warning This function is a blocking function
|
1032 |
*
|
1033 |
* @note This function Access to the device
|
1034 |
*
|
1035 |
* @param Dev Device Handle
|
1036 |
* @param CalDistanceMilliMeter Calibration distance value used for the
|
1037 |
* offset compensation.
|
1038 |
*
|
1039 |
* @return VL53L1_ERROR_NONE
|
1040 |
* @return "Other error code" See ::VL53L1_Error
|
1041 |
*/
|
1042 |
VL53L1_Error VL53L1_PerformOffsetCalibration(VL53L1_DEV Dev, |
1043 |
int32_t CalDistanceMilliMeter); |
1044 |
|
1045 |
/**
|
1046 |
* @brief Perform Offset simple Calibration
|
1047 |
*
|
1048 |
* @details Perform a very simple offset calibration of the Device.
|
1049 |
* This function will launch few ranging measurements and computes offset
|
1050 |
* calibration. The preset mode and the distance mode MUST be set by the
|
1051 |
* application before to call this function.
|
1052 |
*
|
1053 |
* @warning This function is a blocking function
|
1054 |
*
|
1055 |
* @note This function Access to the device
|
1056 |
*
|
1057 |
* @param Dev Device Handle
|
1058 |
* @param CalDistanceMilliMeter Calibration distance value used for the
|
1059 |
* offset compensation.
|
1060 |
*
|
1061 |
* @return VL53L1_ERROR_NONE
|
1062 |
* @return VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by
|
1063 |
* lack of valid measurements
|
1064 |
* @return VL53L1_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target
|
1065 |
* distance combined to the number of loops performed in the calibration lead to
|
1066 |
* an internal overflow. Try to reduce the distance of the target (140 mm)
|
1067 |
* @return "Other error code" See ::VL53L1_Error
|
1068 |
*/
|
1069 |
VL53L1_Error VL53L1_PerformOffsetSimpleCalibration(VL53L1_DEV Dev, |
1070 |
int32_t CalDistanceMilliMeter); |
1071 |
|
1072 |
/**
|
1073 |
* @brief Sets the Calibration Data.
|
1074 |
*
|
1075 |
* @par Function Description
|
1076 |
* This function set all the Calibration Data issued from the functions
|
1077 |
* @a VL53L1_PerformRefSpadManagement(), @a VL53L1_PerformXTalkCalibration,
|
1078 |
* @a VL53L1_PerformOffsetCalibration()
|
1079 |
*
|
1080 |
* @note This function doesn't Accesses the device
|
1081 |
*
|
1082 |
* @param Dev Device Handle
|
1083 |
* @param *pCalibrationData Pointer to Calibration data to be set.
|
1084 |
* @return VL53L1_ERROR_NONE Success
|
1085 |
* @return VL53L1_ERROR_INVALID_PARAMS pCalibrationData points to an older
|
1086 |
* version of the inner structure. Need for support to convert its content.
|
1087 |
* @return "Other error code" See ::VL53L1_Error
|
1088 |
*/
|
1089 |
VL53L1_Error VL53L1_SetCalibrationData(VL53L1_DEV Dev, |
1090 |
VL53L1_CalibrationData_t *pCalibrationData); |
1091 |
|
1092 |
/**
|
1093 |
* @brief Gets the Calibration Data.
|
1094 |
*
|
1095 |
* @par Function Description
|
1096 |
* This function get all the Calibration Data issued from the functions
|
1097 |
* @a VL53L1_PerformRefSpadManagement(), @a VL53L1_PerformXTalkCalibration,
|
1098 |
* @a VL53L1_PerformOffsetCalibration()
|
1099 |
*
|
1100 |
* @note This function doesn't Accesses the device
|
1101 |
*
|
1102 |
* @param Dev Device Handle
|
1103 |
* @param *pCalibrationData pointer where to store Calibration
|
1104 |
* data.
|
1105 |
* @return VL53L1_ERROR_NONE Success
|
1106 |
* @return "Other error code" See ::VL53L1_Error
|
1107 |
*/
|
1108 |
VL53L1_Error VL53L1_GetCalibrationData(VL53L1_DEV Dev, |
1109 |
VL53L1_CalibrationData_t *pCalibrationData); |
1110 |
|
1111 |
/**
|
1112 |
* @brief Gets the optical center.
|
1113 |
*
|
1114 |
* @par Function Description
|
1115 |
* This function get the optical center issued from the nvm set at FTM stage
|
1116 |
* expressed in the same coordinate system as the ROI are
|
1117 |
*
|
1118 |
* @note This function doesn't Accesses the device
|
1119 |
*
|
1120 |
* @param Dev Device Handle
|
1121 |
* @param *pOpticalCentreX pointer to the X position of center
|
1122 |
* in 16.16 fix point
|
1123 |
* @param *pOpticalCentreY pointer to the Y position of center
|
1124 |
* in 16.16 fix point
|
1125 |
* @return VL53L1_ERROR_NONE Success
|
1126 |
* @return "Other error code" See ::VL53L1_Error
|
1127 |
*/
|
1128 |
VL53L1_Error VL53L1_GetOpticalCenter(VL53L1_DEV Dev, |
1129 |
FixPoint1616_t *pOpticalCenterX, |
1130 |
FixPoint1616_t *pOpticalCenterY); |
1131 |
|
1132 |
/** @} VL53L1_Calibration_group */
|
1133 |
|
1134 |
/** @defgroup VL53L1_Thresholds_group VL53L1 IRQ Triggered events Functions
|
1135 |
* @brief Functions used to configure interrupt to be triggered only when
|
1136 |
* a measurement satisfies some thresholds parameters
|
1137 |
* @{
|
1138 |
*/
|
1139 |
|
1140 |
/**
|
1141 |
* @brief Configure the interrupt config, from the given structure
|
1142 |
*
|
1143 |
* @param[in] Dev : Device Handle
|
1144 |
* @param[in] pConfig : pointer to configuration structure
|
1145 |
*/
|
1146 |
|
1147 |
VL53L1_Error VL53L1_SetThresholdConfig(VL53L1_DEV Dev, |
1148 |
VL53L1_DetectionConfig_t *pConfig); |
1149 |
|
1150 |
/**
|
1151 |
* @brief Retrieves the interrupt config structure currently programmed
|
1152 |
* into the API
|
1153 |
*
|
1154 |
* @param[in] Dev : Device Handle
|
1155 |
* @param[out] pConfig : pointer to configuration structure
|
1156 |
*/
|
1157 |
|
1158 |
VL53L1_Error VL53L1_GetThresholdConfig(VL53L1_DEV Dev, |
1159 |
VL53L1_DetectionConfig_t *pConfig); |
1160 |
|
1161 |
|
1162 |
/** @} VL53L1_Thresholds_group */
|
1163 |
|
1164 |
|
1165 |
/** @} VL53L1_cut11_group */
|
1166 |
|
1167 |
#ifdef __cplusplus
|
1168 |
} |
1169 |
#endif
|
1170 |
|
1171 |
#endif /* _VL53L1_API_H_ */ |