1 /*******************************************************************************
2  Copyright � 2016, STMicroelectronics International N.V.
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of STMicroelectronics nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
19  NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
20  IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
21  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *****************************************************************************/
28 
29 #ifndef _VL53L0X_API_H_
30 #define _VL53L0X_API_H_
31 
32 #include "vl53l0x_api_strings.h"
33 #include "vl53l0x_def.h"
34 #include "vl53l0x_platform.h"
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 #ifdef _MSC_VER
42 #   ifdef VL53L0X_API_EXPORTS
43 #       define VL53L0X_API  __declspec(dllexport)
44 #   else
45 #       define VL53L0X_API
46 #   endif
47 #else
48 #   define VL53L0X_API
49 #endif
50 
51 /** @defgroup VL53L0X_cut11_group VL53L0X cut1.1 Function Definition
52  *  @brief    VL53L0X cut1.1 Function Definition
53  *  @{
54  */
55 
56 /** @defgroup VL53L0X_general_group VL53L0X General Functions
57  *  @brief    General functions and definitions
58  *  @{
59  */
60 
61 /**
62  * @brief Return the VL53L0X PAL Implementation Version
63  *
64  * @note This function doesn't access to the device
65  *
66  * @param   pVersion              Pointer to current PAL Implementation Version
67  * @return  VL53L0X_ERROR_NONE     Success
68  * @return  "Other error code"    See ::VL53L0X_Error
69  */
70 VL53L0X_API VL53L0X_Error VL53L0X_GetVersion(VL53L0X_Version_t *pVersion);
71 
72 /**
73  * @brief Return the PAL Specification Version used for the current
74  * implementation.
75  *
76  * @note This function doesn't access to the device
77  *
78  * @param   pPalSpecVersion       Pointer to current PAL Specification Version
79  * @return  VL53L0X_ERROR_NONE        Success
80  * @return  "Other error code"    See ::VL53L0X_Error
81  */
82 VL53L0X_API VL53L0X_Error VL53L0X_GetPalSpecVersion(
83 	VL53L0X_Version_t *pPalSpecVersion);
84 
85 /**
86  * @brief Reads the Product Revision for a for given Device
87  * This function can be used to distinguish cut1.0 from cut1.1.
88  *
89  * @note This function Access to the device
90  *
91  * @param   Dev                 Device Handle
92  * @param   pProductRevisionMajor  Pointer to Product Revision Major
93  * for a given Device
94  * @param   pProductRevisionMinor  Pointer to Product Revision Minor
95  * for a given Device
96  * @return  VL53L0X_ERROR_NONE      Success
97  * @return  "Other error code"  See ::VL53L0X_Error
98  */
99 VL53L0X_API VL53L0X_Error VL53L0X_GetProductRevision(VL53L0X_DEV Dev,
100 	uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor);
101 
102 /**
103  * @brief Reads the Device information for given Device
104  *
105  * @note This function Access to the device
106  *
107  * @param   Dev                 Device Handle
108  * @param   pVL53L0X_DeviceInfo  Pointer to current device info for a given
109  *  Device
110  * @return  VL53L0X_ERROR_NONE   Success
111  * @return  "Other error code"  See ::VL53L0X_Error
112  */
113 VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceInfo(VL53L0X_DEV Dev,
114 	VL53L0X_DeviceInfo_t *pVL53L0X_DeviceInfo);
115 
116 /**
117  * @brief Read current status of the error register for the selected device
118  *
119  * @note This function Access to the device
120  *
121  * @param   Dev                   Device Handle
122  * @param   pDeviceErrorStatus    Pointer to current error code of the device
123  * @return  VL53L0X_ERROR_NONE     Success
124  * @return  "Other error code"    See ::VL53L0X_Error
125  */
126 VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceErrorStatus(VL53L0X_DEV Dev,
127 	VL53L0X_DeviceError *pDeviceErrorStatus);
128 
129 /**
130  * @brief Human readable Range Status string for a given RangeStatus
131  *
132  * @note This function doesn't access to the device
133  *
134  * @param   RangeStatus         The RangeStatus code as stored on
135  * @a VL53L0X_RangingMeasurementData_t
136  * @param   pRangeStatusString  The returned RangeStatus string.
137  * @return  VL53L0X_ERROR_NONE   Success
138  * @return  "Other error code"  See ::VL53L0X_Error
139  */
140 VL53L0X_API VL53L0X_Error VL53L0X_GetRangeStatusString(uint8_t RangeStatus,
141 	char *pRangeStatusString);
142 
143 /**
144  * @brief Human readable error string for a given Error Code
145  *
146  * @note This function doesn't access to the device
147  *
148  * @param   ErrorCode           The error code as stored on ::VL53L0X_DeviceError
149  * @param   pDeviceErrorString  The error string corresponding to the ErrorCode
150  * @return  VL53L0X_ERROR_NONE   Success
151  * @return  "Other error code"  See ::VL53L0X_Error
152  */
153 VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceErrorString(
154 	VL53L0X_DeviceError ErrorCode, char *pDeviceErrorString);
155 
156 /**
157  * @brief Human readable error string for current PAL error status
158  *
159  * @note This function doesn't access to the device
160  *
161  * @param   PalErrorCode       The error code as stored on @a VL53L0X_Error
162  * @param   pPalErrorString    The error string corresponding to the
163  * PalErrorCode
164  * @return  VL53L0X_ERROR_NONE  Success
165  * @return  "Other error code" See ::VL53L0X_Error
166  */
167 VL53L0X_API VL53L0X_Error VL53L0X_GetPalErrorString(VL53L0X_Error PalErrorCode,
168 	char *pPalErrorString);
169 
170 /**
171  * @brief Human readable PAL State string
172  *
173  * @note This function doesn't access to the device
174  *
175  * @param   PalStateCode          The State code as stored on @a VL53L0X_State
176  * @param   pPalStateString       The State string corresponding to the
177  * PalStateCode
178  * @return  VL53L0X_ERROR_NONE     Success
179  * @return  "Other error code"    See ::VL53L0X_Error
180  */
181 VL53L0X_API VL53L0X_Error VL53L0X_GetPalStateString(VL53L0X_State PalStateCode,
182 	char *pPalStateString);
183 
184 /**
185  * @brief Reads the internal state of the PAL for a given Device
186  *
187  * @note This function doesn't access to the device
188  *
189  * @param   Dev                   Device Handle
190  * @param   pPalState             Pointer to current state of the PAL for a
191  * given Device
192  * @return  VL53L0X_ERROR_NONE     Success
193  * @return  "Other error code"    See ::VL53L0X_Error
194  */
195 VL53L0X_API VL53L0X_Error VL53L0X_GetPalState(VL53L0X_DEV Dev,
196 	VL53L0X_State *pPalState);
197 
198 /**
199  * @brief Set the power mode for a given Device
200  * The power mode can be Standby or Idle. Different level of both Standby and
201  * Idle can exists.
202  * This function should not be used when device is in Ranging state.
203  *
204  * @note This function Access to the device
205  *
206  * @param   Dev                   Device Handle
207  * @param   PowerMode             The value of the power mode to set.
208  * see ::VL53L0X_PowerModes
209  *                                Valid values are:
210  *                                VL53L0X_POWERMODE_STANDBY_LEVEL1,
211  *                                VL53L0X_POWERMODE_IDLE_LEVEL1
212  * @return  VL53L0X_ERROR_NONE                  Success
213  * @return  VL53L0X_ERROR_MODE_NOT_SUPPORTED    This error occurs when PowerMode
214  * is not in the supported list
215  * @return  "Other error code"    See ::VL53L0X_Error
216  */
217 VL53L0X_API VL53L0X_Error VL53L0X_SetPowerMode(VL53L0X_DEV Dev,
218 	VL53L0X_PowerModes PowerMode);
219 
220 /**
221  * @brief Get the power mode for a given Device
222  *
223  * @note This function Access to the device
224  *
225  * @param   Dev                   Device Handle
226  * @param   pPowerMode            Pointer to the current value of the power
227  * mode. see ::VL53L0X_PowerModes
228  *                                Valid values are:
229  *                                VL53L0X_POWERMODE_STANDBY_LEVEL1,
230  *                                VL53L0X_POWERMODE_IDLE_LEVEL1
231  * @return  VL53L0X_ERROR_NONE     Success
232  * @return  "Other error code"    See ::VL53L0X_Error
233  */
234 VL53L0X_API VL53L0X_Error VL53L0X_GetPowerMode(VL53L0X_DEV Dev,
235 	VL53L0X_PowerModes *pPowerMode);
236 
237 /**
238  * Set or over-hide part to part calibration offset
239  * \sa VL53L0X_DataInit()   VL53L0X_GetOffsetCalibrationDataMicroMeter()
240  *
241  * @note This function Access to the device
242  *
243  * @param   Dev                                Device Handle
244  * @param   OffsetCalibrationDataMicroMeter    Offset (microns)
245  * @return  VL53L0X_ERROR_NONE                  Success
246  * @return  "Other error code"                 See ::VL53L0X_Error
247  */
248 VL53L0X_API VL53L0X_Error VL53L0X_SetOffsetCalibrationDataMicroMeter(
249 	VL53L0X_DEV Dev, int32_t OffsetCalibrationDataMicroMeter);
250 
251 /**
252  * @brief Get part to part calibration offset
253  *
254  * @par Function Description
255  * Should only be used after a successful call to @a VL53L0X_DataInit to backup
256  * device NVM value
257  *
258  * @note This function Access to the device
259  *
260  * @param   Dev                                Device Handle
261  * @param   pOffsetCalibrationDataMicroMeter   Return part to part
262  * calibration offset from device (microns)
263  * @return  VL53L0X_ERROR_NONE                  Success
264  * @return  "Other error code"                 See ::VL53L0X_Error
265  */
266 VL53L0X_API VL53L0X_Error VL53L0X_GetOffsetCalibrationDataMicroMeter(
267 	VL53L0X_DEV Dev, int32_t *pOffsetCalibrationDataMicroMeter);
268 
269 /**
270  * Set the linearity corrective gain
271  *
272  * @note This function Access to the device
273  *
274  * @param   Dev                                Device Handle
275  * @param   LinearityCorrectiveGain            Linearity corrective
276  * gain in x1000
277  * if value is 1000 then no modification is applied.
278  * @return  VL53L0X_ERROR_NONE                  Success
279  * @return  "Other error code"                 See ::VL53L0X_Error
280  */
281 VL53L0X_API VL53L0X_Error VL53L0X_SetLinearityCorrectiveGain(VL53L0X_DEV Dev,
282 	int16_t LinearityCorrectiveGain);
283 
284 /**
285  * @brief Get the linearity corrective gain
286  *
287  * @par Function Description
288  * Should only be used after a successful call to @a VL53L0X_DataInit to backup
289  * device NVM value
290  *
291  * @note This function Access to the device
292  *
293  * @param   Dev                                Device Handle
294  * @param   pLinearityCorrectiveGain           Pointer to the linearity
295  * corrective gain in x1000
296  * if value is 1000 then no modification is applied.
297  * @return  VL53L0X_ERROR_NONE                  Success
298  * @return  "Other error code"                 See ::VL53L0X_Error
299  */
300 VL53L0X_API VL53L0X_Error VL53L0X_GetLinearityCorrectiveGain(VL53L0X_DEV Dev,
301 	uint16_t *pLinearityCorrectiveGain);
302 
303 /**
304  * Set Group parameter Hold state
305  *
306  * @par Function Description
307  * Set or remove device internal group parameter hold
308  *
309  * @note This function is not Implemented
310  *
311  * @param   Dev      Device Handle
312  * @param   GroupParamHold   Group parameter Hold state to be set (on/off)
313  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED        Not implemented
314  */
315 VL53L0X_API VL53L0X_Error VL53L0X_SetGroupParamHold(VL53L0X_DEV Dev,
316 	uint8_t GroupParamHold);
317 
318 /**
319  * @brief Get the maximal distance for actual setup
320  * @par Function Description
321  * Device must be initialized through @a VL53L0X_SetParameters() prior calling
322  * this function.
323  *
324  * Any range value more than the value returned is to be considered as
325  * "no target detected" or
326  * "no target in detectable range"\n
327  * @warning The maximal distance depends on the setup
328  *
329  * @note This function is not Implemented
330  *
331  * @param   Dev      Device Handle
332  * @param   pUpperLimitMilliMeter   The maximal range limit for actual setup
333  * (in millimeter)
334  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED        Not implemented
335  */
336 VL53L0X_API VL53L0X_Error VL53L0X_GetUpperLimitMilliMeter(VL53L0X_DEV Dev,
337 	uint16_t *pUpperLimitMilliMeter);
338 
339 
340 /**
341  * @brief Get the Total Signal Rate
342  * @par Function Description
343  * This function will return the Total Signal Rate after a good ranging is done.
344  *
345  * @note This function access to Device
346  *
347  * @param   Dev      Device Handle
348  * @param   pTotalSignalRate   Total Signal Rate value in Mega count per second
349  * @return  VL53L0X_ERROR_NONE     Success
350  * @return  "Other error code"    See ::VL53L0X_Error
351  */
352 VL53L0X_Error VL53L0X_GetTotalSignalRate(VL53L0X_DEV Dev,
353 	FixPoint1616_t *pTotalSignalRate);
354 
355 /** @} VL53L0X_general_group */
356 
357 /** @defgroup VL53L0X_init_group VL53L0X Init Functions
358  *  @brief    VL53L0X Init Functions
359  *  @{
360  */
361 
362 /**
363  * @brief Set new device address
364  *
365  * After completion the device will answer to the new address programmed.
366  * This function should be called when several devices are used in parallel
367  * before start programming the sensor.
368  * When a single device us used, there is no need to call this function.
369  *
370  * @note This function Access to the device
371  *
372  * @param   Dev                   Device Handle
373  * @param   DeviceAddress         The new Device address
374  * @return  VL53L0X_ERROR_NONE     Success
375  * @return  "Other error code"    See ::VL53L0X_Error
376  */
377 VL53L0X_API VL53L0X_Error VL53L0X_SetDeviceAddress(VL53L0X_DEV Dev,
378 	uint8_t DeviceAddress);
379 
380 /**
381  *
382  * @brief One time device initialization
383  *
384  * To be called once and only once after device is brought out of reset
385  * (Chip enable) and booted see @a VL53L0X_WaitDeviceBooted()
386  *
387  * @par Function Description
388  * When not used after a fresh device "power up" or reset, it may return
389  * @a #VL53L0X_ERROR_CALIBRATION_WARNING meaning wrong calibration data
390  * may have been fetched from device that can result in ranging offset error\n
391  * If application cannot execute device reset or need to run VL53L0X_DataInit
392  * multiple time then it  must ensure proper offset calibration saving and
393  * restore on its own by using @a VL53L0X_GetOffsetCalibrationData() on first
394  * power up and then @a VL53L0X_SetOffsetCalibrationData() in all subsequent init
395  * This function will change the VL53L0X_State from VL53L0X_STATE_POWERDOWN to
396  * VL53L0X_STATE_WAIT_STATICINIT.
397  *
398  * @note This function Access to the device
399  *
400  * @param   Dev                   Device Handle
401  * @return  VL53L0X_ERROR_NONE     Success
402  * @return  "Other error code"    See ::VL53L0X_Error
403  */
404 VL53L0X_API VL53L0X_Error VL53L0X_DataInit(VL53L0X_DEV Dev);
405 
406 /**
407  * @brief Set the tuning settings pointer
408  *
409  * This function is used to specify the Tuning settings buffer to be used
410  * for a given device. The buffer contains all the necessary data to permit
411  * the API to write tuning settings.
412  * This function permit to force the usage of either external or internal
413  * tuning settings.
414  *
415  * @note This function Access to the device
416  *
417  * @param   Dev                             Device Handle
418  * @param   pTuningSettingBuffer            Pointer to tuning settings buffer.
419  * @param   UseInternalTuningSettings       Use internal tuning settings value.
420  * @return  VL53L0X_ERROR_NONE     Success
421  * @return  "Other error code"    See ::VL53L0X_Error
422  */
423 VL53L0X_API VL53L0X_Error VL53L0X_SetTuningSettingBuffer(VL53L0X_DEV Dev,
424 	uint8_t *pTuningSettingBuffer, uint8_t UseInternalTuningSettings);
425 
426 /**
427  * @brief Get the tuning settings pointer and the internal external switch
428  * value.
429  *
430  * This function is used to get the Tuning settings buffer pointer and the
431  * value.
432  * of the switch to select either external or internal tuning settings.
433  *
434  * @note This function Access to the device
435  *
436  * @param   Dev                        Device Handle
437  * @param   ppTuningSettingBuffer      Pointer to tuning settings buffer.
438  * @param   pUseInternalTuningSettings Pointer to store Use internal tuning
439  *                                     settings value.
440  * @return  VL53L0X_ERROR_NONE          Success
441  * @return  "Other error code"         See ::VL53L0X_Error
442  */
443 VL53L0X_API VL53L0X_Error VL53L0X_GetTuningSettingBuffer(VL53L0X_DEV Dev,
444 	uint8_t **ppTuningSettingBuffer, uint8_t *pUseInternalTuningSettings);
445 
446 /**
447  * @brief Do basic device init (and eventually patch loading)
448  * This function will change the VL53L0X_State from
449  * VL53L0X_STATE_WAIT_STATICINIT to VL53L0X_STATE_IDLE.
450  * In this stage all default setting will be applied.
451  *
452  * @note This function Access to the device
453  *
454  * @param   Dev                   Device Handle
455  * @return  VL53L0X_ERROR_NONE     Success
456  * @return  "Other error code"    See ::VL53L0X_Error
457  */
458 VL53L0X_API VL53L0X_Error VL53L0X_StaticInit(VL53L0X_DEV Dev);
459 
460 /**
461  * @brief Wait for device booted after chip enable (hardware standby)
462  * This function can be run only when VL53L0X_State is VL53L0X_STATE_POWERDOWN.
463  *
464  * @note This function is not Implemented
465  *
466  * @param   Dev      Device Handle
467  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented
468  *
469  */
470 VL53L0X_API VL53L0X_Error VL53L0X_WaitDeviceBooted(VL53L0X_DEV Dev);
471 
472 /**
473  * @brief Do an hard reset or soft reset (depending on implementation) of the
474  * device \nAfter call of this function, device must be in same state as right
475  * after a power-up sequence.This function will change the VL53L0X_State to
476  * VL53L0X_STATE_POWERDOWN.
477  *
478  * @note This function Access to the device
479  *
480  * @param   Dev                   Device Handle
481  * @return  VL53L0X_ERROR_NONE     Success
482  * @return  "Other error code"    See ::VL53L0X_Error
483  */
484 VL53L0X_API VL53L0X_Error VL53L0X_ResetDevice(VL53L0X_DEV Dev);
485 
486 /** @} VL53L0X_init_group */
487 
488 /** @defgroup VL53L0X_parameters_group VL53L0X Parameters Functions
489  *  @brief    Functions used to prepare and setup the device
490  *  @{
491  */
492 
493 /**
494  * @brief  Prepare device for operation
495  * @par Function Description
496  * Update device with provided parameters
497  * @li Then start ranging operation.
498  *
499  * @note This function Access to the device
500  *
501  * @param   Dev                   Device Handle
502  * @param   pDeviceParameters     Pointer to store current device parameters.
503  * @return  VL53L0X_ERROR_NONE     Success
504  * @return  "Other error code"    See ::VL53L0X_Error
505  */
506 VL53L0X_API VL53L0X_Error VL53L0X_SetDeviceParameters(VL53L0X_DEV Dev,
507 	const VL53L0X_DeviceParameters_t *pDeviceParameters);
508 
509 /**
510  * @brief  Retrieve current device parameters
511  * @par Function Description
512  * Get actual parameters of the device
513  * @li Then start ranging operation.
514  *
515  * @note This function Access to the device
516  *
517  * @param   Dev                   Device Handle
518  * @param   pDeviceParameters     Pointer to store current device parameters.
519  * @return  VL53L0X_ERROR_NONE     Success
520  * @return  "Other error code"    See ::VL53L0X_Error
521  */
522 VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceParameters(VL53L0X_DEV Dev,
523 	VL53L0X_DeviceParameters_t *pDeviceParameters);
524 
525 /**
526  * @brief  Set a new device mode
527  * @par Function Description
528  * Set device to a new mode (ranging, histogram ...)
529  *
530  * @note This function doesn't Access to the device
531  *
532  * @param   Dev                   Device Handle
533  * @param   DeviceMode            New device mode to apply
534  *                                Valid values are:
535  *                                VL53L0X_DEVICEMODE_SINGLE_RANGING
536  *                                VL53L0X_DEVICEMODE_CONTINUOUS_RANGING
537  *                                VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
538  *                                VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
539  *                                VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
540  *                                VL53L0X_HISTOGRAMMODE_RETURN_ONLY
541  *                                VL53L0X_HISTOGRAMMODE_BOTH
542  *
543  *
544  * @return  VL53L0X_ERROR_NONE               Success
545  * @return  VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when DeviceMode is
546  *                                          not in the supported list
547  */
548 VL53L0X_API VL53L0X_Error VL53L0X_SetDeviceMode(VL53L0X_DEV Dev,
549 	VL53L0X_DeviceModes DeviceMode);
550 
551 /**
552  * @brief  Get current new device mode
553  * @par Function Description
554  * Get actual mode of the device(ranging, histogram ...)
555  *
556  * @note This function doesn't Access to the device
557  *
558  * @param   Dev                   Device Handle
559  * @param   pDeviceMode           Pointer to current apply mode value
560  *                                Valid values are:
561  *                                VL53L0X_DEVICEMODE_SINGLE_RANGING
562  *                                VL53L0X_DEVICEMODE_CONTINUOUS_RANGING
563  *                                VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
564  *                                VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
565  *                                VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
566  *                                VL53L0X_HISTOGRAMMODE_RETURN_ONLY
567  *                                VL53L0X_HISTOGRAMMODE_BOTH
568  *
569  * @return  VL53L0X_ERROR_NONE                   Success
570  * @return  VL53L0X_ERROR_MODE_NOT_SUPPORTED     This error occurs when
571  * DeviceMode is not in the supported list
572  */
573 VL53L0X_API VL53L0X_Error VL53L0X_GetDeviceMode(VL53L0X_DEV Dev,
574 	VL53L0X_DeviceModes *pDeviceMode);
575 
576 /**
577  * @brief  Sets the resolution of range measurements.
578  * @par Function Description
579  * Set resolution of range measurements to either 0.25mm if
580  * fraction enabled or 1mm if not enabled.
581  *
582  * @note This function Accesses the device
583  *
584  * @param   Dev               Device Handle
585  * @param   Enable            Enable high resolution
586  *
587  * @return  VL53L0X_ERROR_NONE               Success
588  * @return  "Other error code"              See ::VL53L0X_Error
589  */
590 VL53L0X_API VL53L0X_Error VL53L0X_SetRangeFractionEnable(VL53L0X_DEV Dev,
591 	uint8_t Enable);
592 
593 /**
594  * @brief  Gets the fraction enable parameter indicating the resolution of
595  * range measurements.
596  *
597  * @par Function Description
598  * Gets the fraction enable state, which translates to the resolution of
599  * range measurements as follows :Enabled:=0.25mm resolution,
600  * Not Enabled:=1mm resolution.
601  *
602  * @note This function Accesses the device
603  *
604  * @param   Dev               Device Handle
605  * @param   pEnable           Output Parameter reporting the fraction enable state.
606  *
607  * @return  VL53L0X_ERROR_NONE                   Success
608  * @return  "Other error code"                  See ::VL53L0X_Error
609  */
610 VL53L0X_API VL53L0X_Error VL53L0X_GetFractionEnable(VL53L0X_DEV Dev,
611 	uint8_t *pEnable);
612 
613 /**
614  * @brief  Set a new Histogram mode
615  * @par Function Description
616  * Set device to a new Histogram mode
617  *
618  * @note This function doesn't Access to the device
619  *
620  * @param   Dev                   Device Handle
621  * @param   HistogramMode         New device mode to apply
622  *                                Valid values are:
623  *                                VL53L0X_HISTOGRAMMODE_DISABLED
624  *                                VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
625  *                                VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
626  *                                VL53L0X_HISTOGRAMMODE_RETURN_ONLY
627  *                                VL53L0X_HISTOGRAMMODE_BOTH
628  *
629  * @return  VL53L0X_ERROR_NONE                   Success
630  * @return  VL53L0X_ERROR_MODE_NOT_SUPPORTED     This error occurs when
631  * HistogramMode is not in the supported list
632  * @return  "Other error code"    See ::VL53L0X_Error
633  */
634 VL53L0X_API VL53L0X_Error VL53L0X_SetHistogramMode(VL53L0X_DEV Dev,
635 	VL53L0X_HistogramModes HistogramMode);
636 
637 /**
638  * @brief  Get current new device mode
639  * @par Function Description
640  * Get current Histogram mode of a Device
641  *
642  * @note This function doesn't Access to the device
643  *
644  * @param   Dev                   Device Handle
645  * @param   pHistogramMode        Pointer to current Histogram Mode value
646  *                                Valid values are:
647  *                                VL53L0X_HISTOGRAMMODE_DISABLED
648  *                                VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
649  *                                VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
650  *                                VL53L0X_HISTOGRAMMODE_RETURN_ONLY
651  *                                VL53L0X_HISTOGRAMMODE_BOTH
652  * @return  VL53L0X_ERROR_NONE     Success
653  * @return  "Other error code"    See ::VL53L0X_Error
654  */
655 VL53L0X_API VL53L0X_Error VL53L0X_GetHistogramMode(VL53L0X_DEV Dev,
656 	VL53L0X_HistogramModes *pHistogramMode);
657 
658 /**
659  * @brief Set Ranging Timing Budget in microseconds
660  *
661  * @par Function Description
662  * Defines the maximum time allowed by the user to the device to run a
663  * full ranging sequence for the current mode (ranging, histogram, ASL ...)
664  *
665  * @note This function Access to the device
666  *
667  * @param   Dev                                Device Handle
668  * @param MeasurementTimingBudgetMicroSeconds  Max measurement time in
669  * microseconds.
670  *                                   Valid values are:
671  *                                   >= 17000 microsecs when wraparound enabled
672  *                                   >= 12000 microsecs when wraparound disabled
673  * @return  VL53L0X_ERROR_NONE             Success
674  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is returned if
675  MeasurementTimingBudgetMicroSeconds out of range
676  * @return  "Other error code"            See ::VL53L0X_Error
677  */
678 VL53L0X_API VL53L0X_Error VL53L0X_SetMeasurementTimingBudgetMicroSeconds(
679 	VL53L0X_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds);
680 
681 /**
682  * @brief Get Ranging Timing Budget in microseconds
683  *
684  * @par Function Description
685  * Returns the programmed the maximum time allowed by the user to the
686  * device to run a full ranging sequence for the current mode
687  * (ranging, histogram, ASL ...)
688  *
689  * @note This function Access to the device
690  *
691  * @param   Dev                                    Device Handle
692  * @param   pMeasurementTimingBudgetMicroSeconds   Max measurement time in
693  * microseconds.
694  *                                   Valid values are:
695  *                                   >= 17000 microsecs when wraparound enabled
696  *                                   >= 12000 microsecs when wraparound disabled
697  * @return  VL53L0X_ERROR_NONE                      Success
698  * @return  "Other error code"                     See ::VL53L0X_Error
699  */
700 VL53L0X_API VL53L0X_Error VL53L0X_GetMeasurementTimingBudgetMicroSeconds(
701 	VL53L0X_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds);
702 
703 /**
704  * @brief Gets the VCSEL pulse period.
705  *
706  * @par Function Description
707  * This function retrieves the VCSEL pulse period for the given period type.
708  *
709  * @note This function Accesses the device
710  *
711  * @param   Dev                      Device Handle
712  * @param   VcselPeriodType          VCSEL period identifier (pre-range|final).
713  * @param   pVCSELPulsePeriod        Pointer to VCSEL period value.
714  * @return  VL53L0X_ERROR_NONE        Success
715  * @return  VL53L0X_ERROR_INVALID_PARAMS  Error VcselPeriodType parameter not
716  *                                       supported.
717  * @return  "Other error code"           See ::VL53L0X_Error
718  */
719 VL53L0X_API VL53L0X_Error VL53L0X_GetVcselPulsePeriod(VL53L0X_DEV Dev,
720 	VL53L0X_VcselPeriod VcselPeriodType, uint8_t *pVCSELPulsePeriod);
721 
722 /**
723  * @brief Sets the VCSEL pulse period.
724  *
725  * @par Function Description
726  * This function retrieves the VCSEL pulse period for the given period type.
727  *
728  * @note This function Accesses the device
729  *
730  * @param   Dev                       Device Handle
731  * @param   VcselPeriodType	      VCSEL period identifier (pre-range|final).
732  * @param   VCSELPulsePeriod          VCSEL period value
733  * @return  VL53L0X_ERROR_NONE            Success
734  * @return  VL53L0X_ERROR_INVALID_PARAMS  Error VcselPeriodType parameter not
735  *                                       supported.
736  * @return  "Other error code"           See ::VL53L0X_Error
737  */
738 VL53L0X_API VL53L0X_Error VL53L0X_SetVcselPulsePeriod(VL53L0X_DEV Dev,
739 	VL53L0X_VcselPeriod VcselPeriodType, uint8_t VCSELPulsePeriod);
740 
741 /**
742  * @brief Sets the (on/off) state of a requested sequence step.
743  *
744  * @par Function Description
745  * This function enables/disables a requested sequence step.
746  *
747  * @note This function Accesses the device
748  *
749  * @param   Dev                          Device Handle
750  * @param   SequenceStepId	         Sequence step identifier.
751  * @param   SequenceStepEnabled          Demanded state {0=Off,1=On}
752  *                                       is enabled.
753  * @return  VL53L0X_ERROR_NONE            Success
754  * @return  VL53L0X_ERROR_INVALID_PARAMS  Error SequenceStepId parameter not
755  *                                       supported.
756  * @return  "Other error code"           See ::VL53L0X_Error
757  */
758 VL53L0X_API VL53L0X_Error VL53L0X_SetSequenceStepEnable(VL53L0X_DEV Dev,
759 	VL53L0X_SequenceStepId SequenceStepId, uint8_t SequenceStepEnabled);
760 
761 /**
762  * @brief Gets the (on/off) state of a requested sequence step.
763  *
764  * @par Function Description
765  * This function retrieves the state of a requested sequence step, i.e. on/off.
766  *
767  * @note This function Accesses the device
768  *
769  * @param   Dev                    Device Handle
770  * @param   SequenceStepId         Sequence step identifier.
771  * @param   pSequenceStepEnabled   Out parameter reporting if the sequence step
772  *                                 is enabled {0=Off,1=On}.
773  * @return  VL53L0X_ERROR_NONE            Success
774  * @return  VL53L0X_ERROR_INVALID_PARAMS  Error SequenceStepId parameter not
775  *                                       supported.
776  * @return  "Other error code"           See ::VL53L0X_Error
777  */
778 VL53L0X_API VL53L0X_Error VL53L0X_GetSequenceStepEnable(VL53L0X_DEV Dev,
779 	VL53L0X_SequenceStepId SequenceStepId, uint8_t *pSequenceStepEnabled);
780 
781 /**
782  * @brief Gets the (on/off) state of all sequence steps.
783  *
784  * @par Function Description
785  * This function retrieves the state of all sequence step in the scheduler.
786  *
787  * @note This function Accesses the device
788  *
789  * @param   Dev                          Device Handle
790  * @param   pSchedulerSequenceSteps      Pointer to struct containing result.
791  * @return  VL53L0X_ERROR_NONE            Success
792  * @return  "Other error code"           See ::VL53L0X_Error
793  */
794 VL53L0X_API VL53L0X_Error VL53L0X_GetSequenceStepEnables(VL53L0X_DEV Dev,
795 	VL53L0X_SchedulerSequenceSteps_t *pSchedulerSequenceSteps);
796 
797 /**
798  * @brief Sets the timeout of a requested sequence step.
799  *
800  * @par Function Description
801  * This function sets the timeout of a requested sequence step.
802  *
803  * @note This function Accesses the device
804  *
805  * @param   Dev                          Device Handle
806  * @param   SequenceStepId               Sequence step identifier.
807  * @param   TimeOutMilliSecs             Demanded timeout
808  * @return  VL53L0X_ERROR_NONE            Success
809  * @return  VL53L0X_ERROR_INVALID_PARAMS  Error SequenceStepId parameter not
810  *                                       supported.
811  * @return  "Other error code"           See ::VL53L0X_Error
812  */
813 VL53L0X_API VL53L0X_Error VL53L0X_SetSequenceStepTimeout(VL53L0X_DEV Dev,
814 	VL53L0X_SequenceStepId SequenceStepId, FixPoint1616_t TimeOutMilliSecs);
815 
816 /**
817  * @brief Gets the timeout of a requested sequence step.
818  *
819  * @par Function Description
820  * This function retrieves the timeout of a requested sequence step.
821  *
822  * @note This function Accesses the device
823  *
824  * @param   Dev                          Device Handle
825  * @param   SequenceStepId               Sequence step identifier.
826  * @param   pTimeOutMilliSecs            Timeout value.
827  * @return  VL53L0X_ERROR_NONE            Success
828  * @return  VL53L0X_ERROR_INVALID_PARAMS  Error SequenceStepId parameter not
829  *                                       supported.
830  * @return  "Other error code"           See ::VL53L0X_Error
831  */
832 VL53L0X_API VL53L0X_Error VL53L0X_GetSequenceStepTimeout(VL53L0X_DEV Dev,
833 	VL53L0X_SequenceStepId SequenceStepId,
834 	FixPoint1616_t *pTimeOutMilliSecs);
835 
836 /**
837  * @brief Gets number of sequence steps managed by the API.
838  *
839  * @par Function Description
840  * This function retrieves the number of sequence steps currently managed
841  * by the API
842  *
843  * @note This function Accesses the device
844  *
845  * @param   Dev                          Device Handle
846  * @param   pNumberOfSequenceSteps       Out parameter reporting the number of
847  *                                       sequence steps.
848  * @return  VL53L0X_ERROR_NONE            Success
849  * @return  "Other error code"           See ::VL53L0X_Error
850  */
851 VL53L0X_API VL53L0X_Error VL53L0X_GetNumberOfSequenceSteps(VL53L0X_DEV Dev,
852 	uint8_t *pNumberOfSequenceSteps);
853 
854 /**
855  * @brief Gets the name of a given sequence step.
856  *
857  * @par Function Description
858  * This function retrieves the name of sequence steps corresponding to
859  * SequenceStepId.
860  *
861  * @note This function doesn't Accesses the device
862  *
863  * @param   SequenceStepId               Sequence step identifier.
864  * @param   pSequenceStepsString         Pointer to Info string
865  *
866  * @return  VL53L0X_ERROR_NONE            Success
867  * @return  "Other error code"           See ::VL53L0X_Error
868  */
869 VL53L0X_API VL53L0X_Error VL53L0X_GetSequenceStepsInfo(
870 	VL53L0X_SequenceStepId SequenceStepId, char *pSequenceStepsString);
871 
872 /**
873  * Program continuous mode Inter-Measurement period in milliseconds
874  *
875  * @par Function Description
876  * When trying to set too short time return  INVALID_PARAMS minimal value
877  *
878  * @note This function Access to the device
879  *
880  * @param   Dev                                  Device Handle
881  * @param   InterMeasurementPeriodMilliSeconds   Inter-Measurement Period in ms.
882  * @return  VL53L0X_ERROR_NONE                    Success
883  * @return  "Other error code"                   See ::VL53L0X_Error
884  */
885 VL53L0X_API VL53L0X_Error VL53L0X_SetInterMeasurementPeriodMilliSeconds(
886 	VL53L0X_DEV Dev, uint32_t InterMeasurementPeriodMilliSeconds);
887 
888 /**
889  * Get continuous mode Inter-Measurement period in milliseconds
890  *
891  * @par Function Description
892  * When trying to set too short time return  INVALID_PARAMS minimal value
893  *
894  * @note This function Access to the device
895  *
896  * @param   Dev                                  Device Handle
897  * @param   pInterMeasurementPeriodMilliSeconds  Pointer to programmed
898  *  Inter-Measurement Period in milliseconds.
899  * @return  VL53L0X_ERROR_NONE                    Success
900  * @return  "Other error code"                   See ::VL53L0X_Error
901  */
902 VL53L0X_API VL53L0X_Error VL53L0X_GetInterMeasurementPeriodMilliSeconds(
903 	VL53L0X_DEV Dev, uint32_t *pInterMeasurementPeriodMilliSeconds);
904 
905 /**
906  * @brief Enable/Disable Cross talk compensation feature
907  *
908  * @note This function is not Implemented.
909  * Enable/Disable Cross Talk by set to zero the Cross Talk value
910  * by using @a VL53L0X_SetXTalkCompensationRateMegaCps().
911  *
912  * @param   Dev                       Device Handle
913  * @param   XTalkCompensationEnable   Cross talk compensation
914  *  to be set 0=disabled else = enabled
915  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED   Not implemented
916  */
917 VL53L0X_API VL53L0X_Error VL53L0X_SetXTalkCompensationEnable(VL53L0X_DEV Dev,
918 	uint8_t XTalkCompensationEnable);
919 
920 /**
921  * @brief Get Cross talk compensation rate
922  *
923  * @note This function is not Implemented.
924  * Enable/Disable Cross Talk by set to zero the Cross Talk value by
925  * using @a VL53L0X_SetXTalkCompensationRateMegaCps().
926  *
927  * @param   Dev                        Device Handle
928  * @param   pXTalkCompensationEnable   Pointer to the Cross talk compensation
929  *  state 0=disabled or 1 = enabled
930  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED   Not implemented
931  */
932 VL53L0X_API VL53L0X_Error VL53L0X_GetXTalkCompensationEnable(VL53L0X_DEV Dev,
933 	uint8_t *pXTalkCompensationEnable);
934 
935 /**
936  * @brief Set Cross talk compensation rate
937  *
938  * @par Function Description
939  * Set Cross talk compensation rate.
940  *
941  * @note This function Access to the device
942  *
943  * @param   Dev                            Device Handle
944  * @param   XTalkCompensationRateMegaCps   Compensation rate in
945  *  Mega counts per second (16.16 fix point) see datasheet for details
946  * @return  VL53L0X_ERROR_NONE              Success
947  * @return  "Other error code"             See ::VL53L0X_Error
948  */
949 VL53L0X_API VL53L0X_Error VL53L0X_SetXTalkCompensationRateMegaCps(VL53L0X_DEV Dev,
950 	FixPoint1616_t XTalkCompensationRateMegaCps);
951 
952 /**
953  * @brief Get Cross talk compensation rate
954  *
955  * @par Function Description
956  * Get Cross talk compensation rate.
957  *
958  * @note This function Access to the device
959  *
960  * @param   Dev                            Device Handle
961  * @param   pXTalkCompensationRateMegaCps  Pointer to Compensation rate
962  in Mega counts per second (16.16 fix point) see datasheet for details
963  * @return  VL53L0X_ERROR_NONE              Success
964  * @return  "Other error code"             See ::VL53L0X_Error
965  */
966 VL53L0X_API VL53L0X_Error VL53L0X_GetXTalkCompensationRateMegaCps(VL53L0X_DEV Dev,
967 	FixPoint1616_t *pXTalkCompensationRateMegaCps);
968 
969 /**
970  * @brief Set Reference Calibration Parameters
971  *
972  * @par Function Description
973  * Set Reference Calibration Parameters.
974  *
975  * @note This function Access to the device
976  *
977  * @param   Dev                            Device Handle
978  * @param   VhvSettings                    Parameter for VHV
979  * @param   PhaseCal                       Parameter for PhaseCal
980  * @return  VL53L0X_ERROR_NONE              Success
981  * @return  "Other error code"             See ::VL53L0X_Error
982  */
983 VL53L0X_API VL53L0X_Error VL53L0X_SetRefCalibration(VL53L0X_DEV Dev,
984 	uint8_t VhvSettings, uint8_t PhaseCal);
985 
986 /**
987  * @brief Get Reference Calibration Parameters
988  *
989  * @par Function Description
990  * Get Reference Calibration Parameters.
991  *
992  * @note This function Access to the device
993  *
994  * @param   Dev                            Device Handle
995  * @param   pVhvSettings                   Pointer to VHV parameter
996  * @param   pPhaseCal                      Pointer to PhaseCal Parameter
997  * @return  VL53L0X_ERROR_NONE              Success
998  * @return  "Other error code"             See ::VL53L0X_Error
999  */
1000 VL53L0X_API VL53L0X_Error VL53L0X_GetRefCalibration(VL53L0X_DEV Dev,
1001 	uint8_t *pVhvSettings, uint8_t *pPhaseCal);
1002 
1003 /**
1004  * @brief  Get the number of the check limit managed by a given Device
1005  *
1006  * @par Function Description
1007  * This function give the number of the check limit managed by the Device
1008  *
1009  * @note This function doesn't Access to the device
1010  *
1011  * @param   pNumberOfLimitCheck           Pointer to the number of check limit.
1012  * @return  VL53L0X_ERROR_NONE             Success
1013  * @return  "Other error code"            See ::VL53L0X_Error
1014  */
1015 VL53L0X_API VL53L0X_Error VL53L0X_GetNumberOfLimitCheck(
1016 	uint16_t *pNumberOfLimitCheck);
1017 
1018 /**
1019  * @brief  Return a description string for a given limit check number
1020  *
1021  * @par Function Description
1022  * This function returns a description string for a given limit check number.
1023  * The limit check is identified with the LimitCheckId.
1024  *
1025  * @note This function doesn't Access to the device
1026  *
1027  * @param   Dev                           Device Handle
1028  * @param   LimitCheckId                  Limit Check ID
1029  (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
1030  * @param   pLimitCheckString             Pointer to the
1031  description string of the given check limit.
1032  * @return  VL53L0X_ERROR_NONE             Success
1033  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is
1034  returned when LimitCheckId value is out of range.
1035  * @return  "Other error code"            See ::VL53L0X_Error
1036  */
1037 VL53L0X_API VL53L0X_Error VL53L0X_GetLimitCheckInfo(VL53L0X_DEV Dev,
1038 	uint16_t LimitCheckId, char *pLimitCheckString);
1039 
1040 /**
1041  * @brief  Return a the Status of the specified check limit
1042  *
1043  * @par Function Description
1044  * This function returns the Status of the specified check limit.
1045  * The value indicate if the check is fail or not.
1046  * The limit check is identified with the LimitCheckId.
1047  *
1048  * @note This function doesn't Access to the device
1049  *
1050  * @param   Dev                           Device Handle
1051  * @param   LimitCheckId                  Limit Check ID
1052  (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
1053  * @param   pLimitCheckStatus             Pointer to the
1054  Limit Check Status of the given check limit.
1055  * LimitCheckStatus :
1056  * 0 the check is not fail
1057  * 1 the check if fail or not enabled
1058  *
1059  * @return  VL53L0X_ERROR_NONE             Success
1060  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is
1061  returned when LimitCheckId value is out of range.
1062  * @return  "Other error code"            See ::VL53L0X_Error
1063  */
1064 VL53L0X_API VL53L0X_Error VL53L0X_GetLimitCheckStatus(VL53L0X_DEV Dev,
1065 	uint16_t LimitCheckId, uint8_t *pLimitCheckStatus);
1066 
1067 /**
1068  * @brief  Enable/Disable a specific limit check
1069  *
1070  * @par Function Description
1071  * This function Enable/Disable a specific limit check.
1072  * The limit check is identified with the LimitCheckId.
1073  *
1074  * @note This function doesn't Access to the device
1075  *
1076  * @param   Dev                           Device Handle
1077  * @param   LimitCheckId                  Limit Check ID
1078  *  (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
1079  * @param   LimitCheckEnable              if 1 the check limit
1080  *  corresponding to LimitCheckId is Enabled
1081  *                                        if 0 the check limit
1082  *  corresponding to LimitCheckId is disabled
1083  * @return  VL53L0X_ERROR_NONE             Success
1084  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is returned
1085  *  when LimitCheckId value is out of range.
1086  * @return  "Other error code"            See ::VL53L0X_Error
1087  */
1088 VL53L0X_API VL53L0X_Error VL53L0X_SetLimitCheckEnable(VL53L0X_DEV Dev,
1089 	uint16_t LimitCheckId, uint8_t LimitCheckEnable);
1090 
1091 /**
1092  * @brief  Get specific limit check enable state
1093  *
1094  * @par Function Description
1095  * This function get the enable state of a specific limit check.
1096  * The limit check is identified with the LimitCheckId.
1097  *
1098  * @note This function Access to the device
1099  *
1100  * @param   Dev                           Device Handle
1101  * @param   LimitCheckId                  Limit Check ID
1102  *  (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
1103  * @param   pLimitCheckEnable             Pointer to the check limit enable
1104  * value.
1105  *  if 1 the check limit
1106  *        corresponding to LimitCheckId is Enabled
1107  *  if 0 the check limit
1108  *        corresponding to LimitCheckId is disabled
1109  * @return  VL53L0X_ERROR_NONE             Success
1110  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is returned
1111  *  when LimitCheckId value is out of range.
1112  * @return  "Other error code"            See ::VL53L0X_Error
1113  */
1114 VL53L0X_API VL53L0X_Error VL53L0X_GetLimitCheckEnable(VL53L0X_DEV Dev,
1115 	uint16_t LimitCheckId, uint8_t *pLimitCheckEnable);
1116 
1117 /**
1118  * @brief  Set a specific limit check value
1119  *
1120  * @par Function Description
1121  * This function set a specific limit check value.
1122  * The limit check is identified with the LimitCheckId.
1123  *
1124  * @note This function Access to the device
1125  *
1126  * @param   Dev                           Device Handle
1127  * @param   LimitCheckId                  Limit Check ID
1128  *  (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
1129  * @param   LimitCheckValue               Limit check Value for a given
1130  * LimitCheckId
1131  * @return  VL53L0X_ERROR_NONE             Success
1132  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is returned when either
1133  *  LimitCheckId or LimitCheckValue value is out of range.
1134  * @return  "Other error code"            See ::VL53L0X_Error
1135  */
1136 VL53L0X_API VL53L0X_Error VL53L0X_SetLimitCheckValue(VL53L0X_DEV Dev,
1137 	uint16_t LimitCheckId, FixPoint1616_t LimitCheckValue);
1138 
1139 /**
1140  * @brief  Get a specific limit check value
1141  *
1142  * @par Function Description
1143  * This function get a specific limit check value from device then it updates
1144  * internal values and check enables.
1145  * The limit check is identified with the LimitCheckId.
1146  *
1147  * @note This function Access to the device
1148  *
1149  * @param   Dev                           Device Handle
1150  * @param   LimitCheckId                  Limit Check ID
1151  *  (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
1152  * @param   pLimitCheckValue              Pointer to Limit
1153  *  check Value for a given LimitCheckId.
1154  * @return  VL53L0X_ERROR_NONE             Success
1155  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is returned
1156  *  when LimitCheckId value is out of range.
1157  * @return  "Other error code"            See ::VL53L0X_Error
1158  */
1159 VL53L0X_API VL53L0X_Error VL53L0X_GetLimitCheckValue(VL53L0X_DEV Dev,
1160 	uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckValue);
1161 
1162 /**
1163  * @brief  Get the current value of the signal used for the limit check
1164  *
1165  * @par Function Description
1166  * This function get a the current value of the signal used for the limit check.
1167  * To obtain the latest value you should run a ranging before.
1168  * The value reported is linked to the limit check identified with the
1169  * LimitCheckId.
1170  *
1171  * @note This function Access to the device
1172  *
1173  * @param   Dev                           Device Handle
1174  * @param   LimitCheckId                  Limit Check ID
1175  *  (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
1176  * @param   pLimitCheckCurrent            Pointer to current Value for a
1177  * given LimitCheckId.
1178  * @return  VL53L0X_ERROR_NONE             Success
1179  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is returned when
1180  * LimitCheckId value is out of range.
1181  * @return  "Other error code"            See ::VL53L0X_Error
1182  */
1183 VL53L0X_API VL53L0X_Error VL53L0X_GetLimitCheckCurrent(VL53L0X_DEV Dev,
1184 	uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckCurrent);
1185 
1186 /**
1187  * @brief  Enable (or disable) Wrap around Check
1188  *
1189  * @note This function Access to the device
1190  *
1191  * @param   Dev                    Device Handle
1192  * @param   WrapAroundCheckEnable  Wrap around Check to be set
1193  *                                 0=disabled, other = enabled
1194  * @return  VL53L0X_ERROR_NONE      Success
1195  * @return  "Other error code"     See ::VL53L0X_Error
1196  */
1197 VL53L0X_API VL53L0X_Error VL53L0X_SetWrapAroundCheckEnable(VL53L0X_DEV Dev,
1198 		uint8_t WrapAroundCheckEnable);
1199 
1200 /**
1201  * @brief  Get setup of Wrap around Check
1202  *
1203  * @par Function Description
1204  * This function get the wrapAround check enable parameters
1205  *
1206  * @note This function Access to the device
1207  *
1208  * @param   Dev                     Device Handle
1209  * @param   pWrapAroundCheckEnable  Pointer to the Wrap around Check state
1210  *                                  0=disabled or 1 = enabled
1211  * @return  VL53L0X_ERROR_NONE       Success
1212  * @return  "Other error code"      See ::VL53L0X_Error
1213  */
1214 VL53L0X_API VL53L0X_Error VL53L0X_GetWrapAroundCheckEnable(VL53L0X_DEV Dev,
1215 		uint8_t *pWrapAroundCheckEnable);
1216 
1217 /**
1218  * @brief   Set Dmax Calibration Parameters for a given device
1219  * When one of the parameter is zero, this function will get parameter
1220  * from NVM.
1221  * @note This function doesn't Access to the device
1222  *
1223  * @param   Dev                    Device Handle
1224  * @param   RangeMilliMeter        Calibration Distance
1225  * @param   SignalRateRtnMegaCps   Signal rate return read at CalDistance
1226  * @return  VL53L0X_ERROR_NONE      Success
1227  * @return  "Other error code"     See ::VL53L0X_Error
1228  */
1229 VL53L0X_API VL53L0X_Error VL53L0X_SetDmaxCalParameters(VL53L0X_DEV Dev,
1230 		uint16_t RangeMilliMeter, FixPoint1616_t SignalRateRtnMegaCps);
1231 
1232 /**
1233  * @brief  Get Dmax Calibration Parameters for a given device
1234  *
1235  *
1236  * @note This function Access to the device
1237  *
1238  * @param   Dev                     Device Handle
1239  * @param   pRangeMilliMeter        Pointer to Calibration Distance
1240  * @param   pSignalRateRtnMegaCps   Pointer to Signal rate return
1241  * @return  VL53L0X_ERROR_NONE       Success
1242  * @return  "Other error code"      See ::VL53L0X_Error
1243  */
1244 VL53L0X_API VL53L0X_Error VL53L0X_GetDmaxCalParameters(VL53L0X_DEV Dev,
1245 	uint16_t *pRangeMilliMeter, FixPoint1616_t *pSignalRateRtnMegaCps);
1246 
1247 /** @} VL53L0X_parameters_group */
1248 
1249 /** @defgroup VL53L0X_measurement_group VL53L0X Measurement Functions
1250  *  @brief    Functions used for the measurements
1251  *  @{
1252  */
1253 
1254 /**
1255  * @brief Single shot measurement.
1256  *
1257  * @par Function Description
1258  * Perform simple measurement sequence (Start measure, Wait measure to end,
1259  * and returns when measurement is done).
1260  * Once function returns, user can get valid data by calling
1261  * VL53L0X_GetRangingMeasurement or VL53L0X_GetHistogramMeasurement
1262  * depending on defined measurement mode
1263  * User should Clear the interrupt in case this are enabled by using the
1264  * function VL53L0X_ClearInterruptMask().
1265  *
1266  * @warning This function is a blocking function
1267  *
1268  * @note This function Access to the device
1269  *
1270  * @param   Dev                  Device Handle
1271  * @return  VL53L0X_ERROR_NONE    Success
1272  * @return  "Other error code"   See ::VL53L0X_Error
1273  */
1274 VL53L0X_API VL53L0X_Error VL53L0X_PerformSingleMeasurement(VL53L0X_DEV Dev);
1275 
1276 /**
1277  * @brief Perform Reference Calibration
1278  *
1279  * @details Perform a reference calibration of the Device.
1280  * This function should be run from time to time before doing
1281  * a ranging measurement.
1282  * This function will launch a special ranging measurement, so
1283  * if interrupt are enable an interrupt will be done.
1284  * This function will clear the interrupt generated automatically.
1285  *
1286  * @warning This function is a blocking function
1287  *
1288  * @note This function Access to the device
1289  *
1290  * @param   Dev                  Device Handle
1291  * @param   pVhvSettings         Pointer to vhv settings parameter.
1292  * @param   pPhaseCal            Pointer to PhaseCal parameter.
1293  * @return  VL53L0X_ERROR_NONE    Success
1294  * @return  "Other error code"   See ::VL53L0X_Error
1295  */
1296 VL53L0X_API VL53L0X_Error VL53L0X_PerformRefCalibration(VL53L0X_DEV Dev,
1297 	uint8_t *pVhvSettings, uint8_t *pPhaseCal);
1298 
1299 /**
1300  * @brief Perform XTalk Measurement
1301  *
1302  * @details Measures the current cross talk from glass in front
1303  * of the sensor.
1304  * This functions performs a histogram measurement and uses the results
1305  * to measure the crosstalk. For the function to be successful, there
1306  * must be no target in front of the sensor.
1307  *
1308  * @warning This function is a blocking function
1309  *
1310  * @warning This function is not supported when the final range
1311  * vcsel clock period is set below 10 PCLKS.
1312  *
1313  * @note This function Access to the device
1314  *
1315  * @param   Dev                  Device Handle
1316  * @param   TimeoutMs            Histogram measurement duration.
1317  * @param   pXtalkPerSpad        Output parameter containing the crosstalk
1318  * measurement result, in MCPS/Spad. Format fixpoint 16:16.
1319  * @param   pAmbientTooHigh      Output parameter which indicate that
1320  * pXtalkPerSpad is not good if the Ambient is too high.
1321  * @return  VL53L0X_ERROR_NONE    Success
1322  * @return  VL53L0X_ERROR_INVALID_PARAMS vcsel clock period not supported
1323  * for this operation. Must not be less than 10PCLKS.
1324  * @return  "Other error code"   See ::VL53L0X_Error
1325  */
1326 VL53L0X_API VL53L0X_Error VL53L0X_PerformXTalkMeasurement(VL53L0X_DEV Dev,
1327 	uint32_t TimeoutMs, FixPoint1616_t *pXtalkPerSpad,
1328 	uint8_t *pAmbientTooHigh);
1329 
1330 /**
1331  * @brief Perform XTalk Calibration
1332  *
1333  * @details Perform a XTalk calibration of the Device.
1334  * This function will launch a ranging measurement, if interrupts
1335  * are enabled an interrupt will be done.
1336  * This function will clear the interrupt generated automatically.
1337  * This function will program a new value for the XTalk compensation
1338  * and it will enable the cross talk before exit.
1339  * This function will disable the VL53L0X_CHECKENABLE_RANGE_IGNORE_THRESHOLD.
1340  *
1341  * @warning This function is a blocking function
1342  *
1343  * @note This function Access to the device
1344  *
1345  * @note This function change the device mode to
1346  * VL53L0X_DEVICEMODE_SINGLE_RANGING
1347  *
1348  * @param   Dev                  Device Handle
1349  * @param   XTalkCalDistance     XTalkCalDistance value used for the XTalk
1350  * computation.
1351  * @param   pXTalkCompensationRateMegaCps  Pointer to new
1352  * XTalkCompensation value.
1353  * @return  VL53L0X_ERROR_NONE    Success
1354  * @return  "Other error code"   See ::VL53L0X_Error
1355  */
1356 VL53L0X_API VL53L0X_Error VL53L0X_PerformXTalkCalibration(VL53L0X_DEV Dev,
1357 	FixPoint1616_t XTalkCalDistance,
1358 	FixPoint1616_t *pXTalkCompensationRateMegaCps);
1359 
1360 /**
1361  * @brief Perform Offset Calibration
1362  *
1363  * @details Perform a Offset calibration of the Device.
1364  * This function will launch a ranging measurement, if interrupts are
1365  * enabled an interrupt will be done.
1366  * This function will clear the interrupt generated automatically.
1367  * This function will program a new value for the Offset calibration value
1368  * This function will disable the VL53L0X_CHECKENABLE_RANGE_IGNORE_THRESHOLD.
1369  *
1370  * @warning This function is a blocking function
1371  *
1372  * @note This function Access to the device
1373  *
1374  * @note This function does not change the device mode.
1375  *
1376  * @param   Dev                  Device Handle
1377  * @param   CalDistanceMilliMeter     Calibration distance value used for the
1378  * offset compensation.
1379  * @param   pOffsetMicroMeter  Pointer to new Offset value computed by the
1380  * function.
1381  *
1382  * @return  VL53L0X_ERROR_NONE    Success
1383  * @return  "Other error code"   See ::VL53L0X_Error
1384  */
1385 VL53L0X_API VL53L0X_Error VL53L0X_PerformOffsetCalibration(VL53L0X_DEV Dev,
1386 	FixPoint1616_t CalDistanceMilliMeter, int32_t *pOffsetMicroMeter);
1387 
1388 /**
1389  * @brief Start device measurement
1390  *
1391  * @details Started measurement will depend on device parameters set through
1392  * @a VL53L0X_SetParameters()
1393  * This is a non-blocking function.
1394  * This function will change the VL53L0X_State from VL53L0X_STATE_IDLE to
1395  * VL53L0X_STATE_RUNNING.
1396  *
1397  * @note This function Access to the device
1398  *
1399 
1400  * @param   Dev                  Device Handle
1401  * @return  VL53L0X_ERROR_NONE                  Success
1402  * @return  VL53L0X_ERROR_MODE_NOT_SUPPORTED    This error occurs when
1403  * DeviceMode programmed with @a VL53L0X_SetDeviceMode is not in the supported
1404  * list:
1405  *                                   Supported mode are:
1406  *                                   VL53L0X_DEVICEMODE_SINGLE_RANGING,
1407  *                                   VL53L0X_DEVICEMODE_CONTINUOUS_RANGING,
1408  *                                   VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
1409  * @return  VL53L0X_ERROR_TIME_OUT    Time out on start measurement
1410  * @return  "Other error code"   See ::VL53L0X_Error
1411  */
1412 VL53L0X_API VL53L0X_Error VL53L0X_StartMeasurement(VL53L0X_DEV Dev);
1413 
1414 /**
1415  * @brief Stop device measurement
1416  *
1417  * @details Will set the device in standby mode at end of current measurement\n
1418  *          Not necessary in single mode as device shall return automatically
1419  *          in standby mode at end of measurement.
1420  *          This function will change the VL53L0X_State from VL53L0X_STATE_RUNNING
1421  *          to VL53L0X_STATE_IDLE.
1422  *
1423  * @note This function Access to the device
1424  *
1425  * @param   Dev                  Device Handle
1426  * @return  VL53L0X_ERROR_NONE    Success
1427  * @return  "Other error code"   See ::VL53L0X_Error
1428  */
1429 VL53L0X_API VL53L0X_Error VL53L0X_StopMeasurement(VL53L0X_DEV Dev);
1430 
1431 /**
1432  * @brief Return Measurement Data Ready
1433  *
1434  * @par Function Description
1435  * This function indicate that a measurement data is ready.
1436  * This function check if interrupt mode is used then check is done accordingly.
1437  * If perform function clear the interrupt, this function will not work,
1438  * like in case of @a VL53L0X_PerformSingleRangingMeasurement().
1439  * The previous function is blocking function, VL53L0X_GetMeasurementDataReady
1440  * is used for non-blocking capture.
1441  *
1442  * @note This function Access to the device
1443  *
1444  * @param   Dev                    Device Handle
1445  * @param   pMeasurementDataReady  Pointer to Measurement Data Ready.
1446  *  0=data not ready, 1 = data ready
1447  * @return  VL53L0X_ERROR_NONE      Success
1448  * @return  "Other error code"     See ::VL53L0X_Error
1449  */
1450 VL53L0X_API VL53L0X_Error VL53L0X_GetMeasurementDataReady(VL53L0X_DEV Dev,
1451 	uint8_t *pMeasurementDataReady);
1452 
1453 /**
1454  * @brief Wait for device ready for a new measurement command.
1455  * Blocking function.
1456  *
1457  * @note This function is not Implemented
1458  *
1459  * @param   Dev      Device Handle
1460  * @param   MaxLoop    Max Number of polling loop (timeout).
1461  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED   Not implemented
1462  */
1463 VL53L0X_API VL53L0X_Error VL53L0X_WaitDeviceReadyForNewMeasurement(VL53L0X_DEV Dev,
1464 	uint32_t MaxLoop);
1465 
1466 /**
1467  * @brief Retrieve the Reference Signal after a measurements
1468  *
1469  * @par Function Description
1470  * Get Reference Signal from last successful Ranging measurement
1471  * This function return a valid value after that you call the
1472  * @a VL53L0X_GetRangingMeasurementData().
1473  *
1474  * @note This function Access to the device
1475  *
1476  * @param   Dev                      Device Handle
1477  * @param   pMeasurementRefSignal    Pointer to the Ref Signal to fill up.
1478  * @return  VL53L0X_ERROR_NONE        Success
1479  * @return  "Other error code"       See ::VL53L0X_Error
1480  */
1481 VL53L0X_API VL53L0X_Error VL53L0X_GetMeasurementRefSignal(VL53L0X_DEV Dev,
1482 	FixPoint1616_t *pMeasurementRefSignal);
1483 
1484 /**
1485  * @brief Retrieve the measurements from device for a given setup
1486  *
1487  * @par Function Description
1488  * Get data from last successful Ranging measurement
1489  * @warning USER should take care about  @a VL53L0X_GetNumberOfROIZones()
1490  * before get data.
1491  * PAL will fill a NumberOfROIZones times the corresponding data
1492  * structure used in the measurement function.
1493  *
1494  * @note This function Access to the device
1495  *
1496  * @param   Dev                      Device Handle
1497  * @param   pRangingMeasurementData  Pointer to the data structure to fill up.
1498  * @return  VL53L0X_ERROR_NONE        Success
1499  * @return  "Other error code"       See ::VL53L0X_Error
1500  */
1501 VL53L0X_API VL53L0X_Error VL53L0X_GetRangingMeasurementData(VL53L0X_DEV Dev,
1502 	VL53L0X_RangingMeasurementData_t *pRangingMeasurementData);
1503 
1504 /**
1505  * @brief Retrieve the measurements from device for a given setup
1506  *
1507  * @par Function Description
1508  * Get data from last successful Histogram measurement
1509  * @warning USER should take care about  @a VL53L0X_GetNumberOfROIZones()
1510  * before get data.
1511  * PAL will fill a NumberOfROIZones times the corresponding data structure
1512  * used in the measurement function.
1513  *
1514  * @note This function is not Implemented
1515  *
1516  * @param   Dev                         Device Handle
1517  * @param   pHistogramMeasurementData   Pointer to the histogram data structure.
1518  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED   Not implemented
1519  */
1520 VL53L0X_API VL53L0X_Error VL53L0X_GetHistogramMeasurementData(VL53L0X_DEV Dev,
1521 	VL53L0X_HistogramMeasurementData_t *pHistogramMeasurementData);
1522 
1523 /**
1524  * @brief Performs a single ranging measurement and retrieve the ranging
1525  * measurement data
1526  *
1527  * @par Function Description
1528  * This function will change the device mode to VL53L0X_DEVICEMODE_SINGLE_RANGING
1529  * with @a VL53L0X_SetDeviceMode(),
1530  * It performs measurement with @a VL53L0X_PerformSingleMeasurement()
1531  * It get data from last successful Ranging measurement with
1532  * @a VL53L0X_GetRangingMeasurementData.
1533  * Finally it clear the interrupt with @a VL53L0X_ClearInterruptMask().
1534  *
1535  * @note This function Access to the device
1536  *
1537  * @note This function change the device mode to
1538  * VL53L0X_DEVICEMODE_SINGLE_RANGING
1539  *
1540  * @param   Dev                       Device Handle
1541  * @param   pRangingMeasurementData   Pointer to the data structure to fill up.
1542  * @return  VL53L0X_ERROR_NONE         Success
1543  * @return  "Other error code"        See ::VL53L0X_Error
1544  */
1545 VL53L0X_API VL53L0X_Error VL53L0X_PerformSingleRangingMeasurement(VL53L0X_DEV Dev,
1546 	VL53L0X_RangingMeasurementData_t *pRangingMeasurementData);
1547 
1548 /**
1549  * @brief Performs a single histogram measurement and retrieve the histogram
1550  * measurement data
1551  *   Is equivalent to VL53L0X_PerformSingleMeasurement +
1552  *   VL53L0X_GetHistogramMeasurementData
1553  *
1554  * @par Function Description
1555  * Get data from last successful Ranging measurement.
1556  * This function will clear the interrupt in case of these are enabled.
1557  *
1558  * @note This function is not Implemented
1559  *
1560  * @param   Dev                        Device Handle
1561  * @param   pHistogramMeasurementData  Pointer to the data structure to fill up.
1562  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED   Not implemented
1563  */
1564 VL53L0X_API VL53L0X_Error VL53L0X_PerformSingleHistogramMeasurement(VL53L0X_DEV Dev,
1565 	VL53L0X_HistogramMeasurementData_t *pHistogramMeasurementData);
1566 
1567 /**
1568  * @brief Set the number of ROI Zones to be used for a specific Device
1569  *
1570  * @par Function Description
1571  * Set the number of ROI Zones to be used for a specific Device.
1572  * The programmed value should be less than the max number of ROI Zones given
1573  * with @a VL53L0X_GetMaxNumberOfROIZones().
1574  * This version of API manage only one zone.
1575  *
1576  * @param   Dev                           Device Handle
1577  * @param   NumberOfROIZones              Number of ROI Zones to be used for a
1578  *  specific Device.
1579  * @return  VL53L0X_ERROR_NONE             Success
1580  * @return  VL53L0X_ERROR_INVALID_PARAMS   This error is returned if
1581  * NumberOfROIZones != 1
1582  */
1583 VL53L0X_API VL53L0X_Error VL53L0X_SetNumberOfROIZones(VL53L0X_DEV Dev,
1584 	uint8_t NumberOfROIZones);
1585 
1586 /**
1587  * @brief Get the number of ROI Zones managed by the Device
1588  *
1589  * @par Function Description
1590  * Get number of ROI Zones managed by the Device
1591  * USER should take care about  @a VL53L0X_GetNumberOfROIZones()
1592  * before get data after a perform measurement.
1593  * PAL will fill a NumberOfROIZones times the corresponding data
1594  * structure used in the measurement function.
1595  *
1596  * @note This function doesn't Access to the device
1597  *
1598  * @param   Dev                   Device Handle
1599  * @param   pNumberOfROIZones     Pointer to the Number of ROI Zones value.
1600  * @return  VL53L0X_ERROR_NONE     Success
1601  */
1602 VL53L0X_API VL53L0X_Error VL53L0X_GetNumberOfROIZones(VL53L0X_DEV Dev,
1603 	uint8_t *pNumberOfROIZones);
1604 
1605 /**
1606  * @brief Get the Maximum number of ROI Zones managed by the Device
1607  *
1608  * @par Function Description
1609  * Get Maximum number of ROI Zones managed by the Device.
1610  *
1611  * @note This function doesn't Access to the device
1612  *
1613  * @param   Dev                    Device Handle
1614  * @param   pMaxNumberOfROIZones   Pointer to the Maximum Number
1615  *  of ROI Zones value.
1616  * @return  VL53L0X_ERROR_NONE      Success
1617  */
1618 VL53L0X_API VL53L0X_Error VL53L0X_GetMaxNumberOfROIZones(VL53L0X_DEV Dev,
1619 	uint8_t *pMaxNumberOfROIZones);
1620 
1621 /** @} VL53L0X_measurement_group */
1622 
1623 /** @defgroup VL53L0X_interrupt_group VL53L0X Interrupt Functions
1624  *  @brief    Functions used for interrupt managements
1625  *  @{
1626  */
1627 
1628 /**
1629  * @brief Set the configuration of GPIO pin for a given device
1630  *
1631  * @note This function Access to the device
1632  *
1633  * @param   Dev                   Device Handle
1634  * @param   Pin                   ID of the GPIO Pin
1635  * @param   Functionality         Select Pin functionality.
1636  *  Refer to ::VL53L0X_GpioFunctionality
1637  * @param   DeviceMode            Device Mode associated to the Gpio.
1638  * @param   Polarity              Set interrupt polarity. Active high
1639  *   or active low see ::VL53L0X_InterruptPolarity
1640  * @return  VL53L0X_ERROR_NONE                            Success
1641  * @return  VL53L0X_ERROR_GPIO_NOT_EXISTING               Only Pin=0 is accepted.
1642  * @return  VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED    This error occurs
1643  * when Functionality programmed is not in the supported list:
1644  *                             Supported value are:
1645  *                             VL53L0X_GPIOFUNCTIONALITY_OFF,
1646  *                             VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW,
1647  *                             VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH,
1648  VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT,
1649  *                               VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY
1650  * @return  "Other error code"    See ::VL53L0X_Error
1651  */
1652 VL53L0X_API VL53L0X_Error VL53L0X_SetGpioConfig(VL53L0X_DEV Dev, uint8_t Pin,
1653 	VL53L0X_DeviceModes DeviceMode, VL53L0X_GpioFunctionality Functionality,
1654 	VL53L0X_InterruptPolarity Polarity);
1655 
1656 /**
1657  * @brief Get current configuration for GPIO pin for a given device
1658  *
1659  * @note This function Access to the device
1660  *
1661  * @param   Dev                   Device Handle
1662  * @param   Pin                   ID of the GPIO Pin
1663  * @param   pDeviceMode           Pointer to Device Mode associated to the Gpio.
1664  * @param   pFunctionality        Pointer to Pin functionality.
1665  *  Refer to ::VL53L0X_GpioFunctionality
1666  * @param   pPolarity             Pointer to interrupt polarity.
1667  *  Active high or active low see ::VL53L0X_InterruptPolarity
1668  * @return  VL53L0X_ERROR_NONE                            Success
1669  * @return  VL53L0X_ERROR_GPIO_NOT_EXISTING               Only Pin=0 is accepted.
1670  * @return  VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED   This error occurs
1671  * when Functionality programmed is not in the supported list:
1672  *                      Supported value are:
1673  *                      VL53L0X_GPIOFUNCTIONALITY_OFF,
1674  *                      VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW,
1675  *                      VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH,
1676  *                      VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT,
1677  *                      VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY
1678  * @return  "Other error code"    See ::VL53L0X_Error
1679  */
1680 VL53L0X_API VL53L0X_Error VL53L0X_GetGpioConfig(VL53L0X_DEV Dev, uint8_t Pin,
1681 	VL53L0X_DeviceModes *pDeviceMode,
1682 	VL53L0X_GpioFunctionality *pFunctionality,
1683 	VL53L0X_InterruptPolarity *pPolarity);
1684 
1685 /**
1686  * @brief Set low and high Interrupt thresholds for a given mode
1687  * (ranging, ALS, ...) for a given device
1688  *
1689  * @par Function Description
1690  * Set low and high Interrupt thresholds for a given mode (ranging, ALS, ...)
1691  * for a given device
1692  *
1693  * @note This function Access to the device
1694  *
1695  * @note DeviceMode is ignored for the current device
1696  *
1697  * @param   Dev              Device Handle
1698  * @param   DeviceMode       Device Mode for which change thresholds
1699  * @param   ThresholdLow     Low threshold (mm, lux ..., depending on the mode)
1700  * @param   ThresholdHigh    High threshold (mm, lux ..., depending on the mode)
1701  * @return  VL53L0X_ERROR_NONE    Success
1702  * @return  "Other error code"   See ::VL53L0X_Error
1703  */
1704 VL53L0X_API VL53L0X_Error VL53L0X_SetInterruptThresholds(VL53L0X_DEV Dev,
1705 	VL53L0X_DeviceModes DeviceMode, FixPoint1616_t ThresholdLow,
1706 	FixPoint1616_t ThresholdHigh);
1707 
1708 /**
1709  * @brief  Get high and low Interrupt thresholds for a given mode
1710  *  (ranging, ALS, ...) for a given device
1711  *
1712  * @par Function Description
1713  * Get high and low Interrupt thresholds for a given mode (ranging, ALS, ...)
1714  * for a given device
1715  *
1716  * @note This function Access to the device
1717  *
1718  * @note DeviceMode is ignored for the current device
1719  *
1720  * @param   Dev              Device Handle
1721  * @param   DeviceMode       Device Mode from which read thresholds
1722  * @param   pThresholdLow    Low threshold (mm, lux ..., depending on the mode)
1723  * @param   pThresholdHigh   High threshold (mm, lux ..., depending on the mode)
1724  * @return  VL53L0X_ERROR_NONE   Success
1725  * @return  "Other error code"  See ::VL53L0X_Error
1726  */
1727 VL53L0X_API VL53L0X_Error VL53L0X_GetInterruptThresholds(VL53L0X_DEV Dev,
1728 	VL53L0X_DeviceModes DeviceMode, FixPoint1616_t *pThresholdLow,
1729 	FixPoint1616_t *pThresholdHigh);
1730 
1731 /**
1732  * @brief Return device stop completion status
1733  *
1734  * @par Function Description
1735  * Returns stop completiob status.
1736  * User shall call this function after a stop command
1737  *
1738  * @note This function Access to the device
1739  *
1740  * @param   Dev                    Device Handle
1741  * @param   pStopStatus            Pointer to status variable to update
1742  * @return  VL53L0X_ERROR_NONE      Success
1743  * @return  "Other error code"     See ::VL53L0X_Error
1744  */
1745 VL53L0X_API VL53L0X_Error VL53L0X_GetStopCompletedStatus(VL53L0X_DEV Dev,
1746 	uint32_t *pStopStatus);
1747 
1748 
1749 /**
1750  * @brief Clear given system interrupt condition
1751  *
1752  * @par Function Description
1753  * Clear given interrupt(s).
1754  *
1755  * @note This function Access to the device
1756  *
1757  * @param   Dev                  Device Handle
1758  * @param   InterruptMask        Mask of interrupts to clear
1759  * @return  VL53L0X_ERROR_NONE    Success
1760  * @return  VL53L0X_ERROR_INTERRUPT_NOT_CLEARED    Cannot clear interrupts
1761  *
1762  * @return  "Other error code"   See ::VL53L0X_Error
1763  */
1764 VL53L0X_API VL53L0X_Error VL53L0X_ClearInterruptMask(VL53L0X_DEV Dev,
1765 	uint32_t InterruptMask);
1766 
1767 /**
1768  * @brief Return device interrupt status
1769  *
1770  * @par Function Description
1771  * Returns currently raised interrupts by the device.
1772  * User shall be able to activate/deactivate interrupts through
1773  * @a VL53L0X_SetGpioConfig()
1774  *
1775  * @note This function Access to the device
1776  *
1777  * @param   Dev                    Device Handle
1778  * @param   pInterruptMaskStatus   Pointer to status variable to update
1779  * @return  VL53L0X_ERROR_NONE      Success
1780  * @return  "Other error code"     See ::VL53L0X_Error
1781  */
1782 VL53L0X_API VL53L0X_Error VL53L0X_GetInterruptMaskStatus(VL53L0X_DEV Dev,
1783 	uint32_t *pInterruptMaskStatus);
1784 
1785 /**
1786  * @brief Configure ranging interrupt reported to system
1787  *
1788  * @note This function is not Implemented
1789  *
1790  * @param   Dev                  Device Handle
1791  * @param   InterruptMask         Mask of interrupt to Enable/disable
1792  *  (0:interrupt disabled or 1: interrupt enabled)
1793  * @return  VL53L0X_ERROR_NOT_IMPLEMENTED   Not implemented
1794  */
1795 VL53L0X_API VL53L0X_Error VL53L0X_EnableInterruptMask(VL53L0X_DEV Dev,
1796 	uint32_t InterruptMask);
1797 
1798 /** @} VL53L0X_interrupt_group */
1799 
1800 /** @defgroup VL53L0X_SPADfunctions_group VL53L0X SPAD Functions
1801  *  @brief    Functions used for SPAD managements
1802  *  @{
1803  */
1804 
1805 /**
1806  * @brief  Set the SPAD Ambient Damper Threshold value
1807  *
1808  * @par Function Description
1809  * This function set the SPAD Ambient Damper Threshold value
1810  *
1811  * @note This function Access to the device
1812  *
1813  * @param   Dev                           Device Handle
1814  * @param   SpadAmbientDamperThreshold    SPAD Ambient Damper Threshold value
1815  * @return  VL53L0X_ERROR_NONE             Success
1816  * @return  "Other error code"            See ::VL53L0X_Error
1817  */
1818 VL53L0X_API VL53L0X_Error VL53L0X_SetSpadAmbientDamperThreshold(VL53L0X_DEV Dev,
1819 	uint16_t SpadAmbientDamperThreshold);
1820 
1821 /**
1822  * @brief  Get the current SPAD Ambient Damper Threshold value
1823  *
1824  * @par Function Description
1825  * This function get the SPAD Ambient Damper Threshold value
1826  *
1827  * @note This function Access to the device
1828  *
1829  * @param   Dev                           Device Handle
1830  * @param   pSpadAmbientDamperThreshold   Pointer to programmed
1831  *                                        SPAD Ambient Damper Threshold value
1832  * @return  VL53L0X_ERROR_NONE             Success
1833  * @return  "Other error code"            See ::VL53L0X_Error
1834  */
1835 VL53L0X_API VL53L0X_Error VL53L0X_GetSpadAmbientDamperThreshold(VL53L0X_DEV Dev,
1836 	uint16_t *pSpadAmbientDamperThreshold);
1837 
1838 /**
1839  * @brief  Set the SPAD Ambient Damper Factor value
1840  *
1841  * @par Function Description
1842  * This function set the SPAD Ambient Damper Factor value
1843  *
1844  * @note This function Access to the device
1845  *
1846  * @param   Dev                           Device Handle
1847  * @param   SpadAmbientDamperFactor       SPAD Ambient Damper Factor value
1848  * @return  VL53L0X_ERROR_NONE             Success
1849  * @return  "Other error code"            See ::VL53L0X_Error
1850  */
1851 VL53L0X_API VL53L0X_Error VL53L0X_SetSpadAmbientDamperFactor(VL53L0X_DEV Dev,
1852 	uint16_t SpadAmbientDamperFactor);
1853 
1854 /**
1855  * @brief  Get the current SPAD Ambient Damper Factor value
1856  *
1857  * @par Function Description
1858  * This function get the SPAD Ambient Damper Factor value
1859  *
1860  * @note This function Access to the device
1861  *
1862  * @param   Dev                           Device Handle
1863  * @param   pSpadAmbientDamperFactor      Pointer to programmed SPAD Ambient
1864  * Damper Factor value
1865  * @return  VL53L0X_ERROR_NONE             Success
1866  * @return  "Other error code"            See ::VL53L0X_Error
1867  */
1868 VL53L0X_API VL53L0X_Error VL53L0X_GetSpadAmbientDamperFactor(VL53L0X_DEV Dev,
1869 	uint16_t *pSpadAmbientDamperFactor);
1870 
1871 /**
1872  * @brief Performs Reference Spad Management
1873  *
1874  * @par Function Description
1875  * The reference SPAD initialization procedure determines the minimum amount
1876  * of reference spads to be enables to achieve a target reference signal rate
1877  * and should be performed once during initialization.
1878  *
1879  * @note This function Access to the device
1880  *
1881  * @note This function change the device mode to
1882  * VL53L0X_DEVICEMODE_SINGLE_RANGING
1883  *
1884  * @param   Dev                          Device Handle
1885  * @param   refSpadCount                 Reports ref Spad Count
1886  * @param   isApertureSpads              Reports if spads are of type
1887  *                                       aperture or non-aperture.
1888  *                                       1:=aperture, 0:=Non-Aperture
1889  * @return  VL53L0X_ERROR_NONE            Success
1890  * @return  VL53L0X_ERROR_REF_SPAD_INIT   Error in the Ref Spad procedure.
1891  * @return  "Other error code"           See ::VL53L0X_Error
1892  */
1893 VL53L0X_API VL53L0X_Error VL53L0X_PerformRefSpadManagement(VL53L0X_DEV Dev,
1894 	uint32_t *refSpadCount, uint8_t *isApertureSpads);
1895 
1896 /**
1897  * @brief Applies Reference SPAD configuration
1898  *
1899  * @par Function Description
1900  * This function applies a given number of reference spads, identified as
1901  * either Aperture or Non-Aperture.
1902  * The requested spad count and type are stored within the device specific
1903  * parameters data for access by the host.
1904  *
1905  * @note This function Access to the device
1906  *
1907  * @param   Dev                          Device Handle
1908  * @param   refSpadCount                 Number of ref spads.
1909  * @param   isApertureSpads              Defines if spads are of type
1910  *                                       aperture or non-aperture.
1911  *                                       1:=aperture, 0:=Non-Aperture
1912  * @return  VL53L0X_ERROR_NONE            Success
1913  * @return  VL53L0X_ERROR_REF_SPAD_INIT   Error in the in the reference
1914  *                                       spad configuration.
1915  * @return  "Other error code"           See ::VL53L0X_Error
1916  */
1917 VL53L0X_API VL53L0X_Error VL53L0X_SetReferenceSpads(VL53L0X_DEV Dev,
1918 	uint32_t refSpadCount, uint8_t isApertureSpads);
1919 
1920 /**
1921  * @brief Retrieves SPAD configuration
1922  *
1923  * @par Function Description
1924  * This function retrieves the current number of applied reference spads
1925  * and also their type : Aperture or Non-Aperture.
1926  *
1927  * @note This function Access to the device
1928  *
1929  * @param   Dev                          Device Handle
1930  * @param   refSpadCount                 Number ref Spad Count
1931  * @param   isApertureSpads              Reports if spads are of type
1932  *                                       aperture or non-aperture.
1933  *                                       1:=aperture, 0:=Non-Aperture
1934  * @return  VL53L0X_ERROR_NONE            Success
1935  * @return  VL53L0X_ERROR_REF_SPAD_INIT   Error in the in the reference
1936  *                                       spad configuration.
1937  * @return  "Other error code"           See ::VL53L0X_Error
1938  */
1939 VL53L0X_API VL53L0X_Error VL53L0X_GetReferenceSpads(VL53L0X_DEV Dev,
1940 	uint32_t *refSpadCount, uint8_t *isApertureSpads);
1941 
1942 /** @} VL53L0X_SPADfunctions_group */
1943 
1944 /** @} VL53L0X_cut11_group */
1945 
1946 #ifdef __cplusplus
1947 }
1948 #endif
1949 
1950 #endif /* _VL53L0X_API_H_ */
1951