vl53l1_api.h 41 KB

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