charles macneill / VL53L1CB
Committer:
charlesmn
Date:
Fri Nov 06 12:15:24 2020 +0000
Revision:
0:3d72bef69191
Initial release. Mbed library for VL53L1CB

Who changed what in which revision?

UserRevisionLine numberNew contents of line
charlesmn 0:3d72bef69191 1
charlesmn 0:3d72bef69191 2 /******************************************************************************
charlesmn 0:3d72bef69191 3 * Copyright (c) 2017, STMicroelectronics - All Rights Reserved
charlesmn 0:3d72bef69191 4
charlesmn 0:3d72bef69191 5 This file is part of VL53L1 Core and is dual licensed,
charlesmn 0:3d72bef69191 6 either 'STMicroelectronics
charlesmn 0:3d72bef69191 7 Proprietary license'
charlesmn 0:3d72bef69191 8 or 'BSD 3-clause "New" or "Revised" License' , at your option.
charlesmn 0:3d72bef69191 9
charlesmn 0:3d72bef69191 10 ******************************************************************************
charlesmn 0:3d72bef69191 11
charlesmn 0:3d72bef69191 12 'STMicroelectronics Proprietary license'
charlesmn 0:3d72bef69191 13
charlesmn 0:3d72bef69191 14 *******************************************************************************
charlesmn 0:3d72bef69191 15
charlesmn 0:3d72bef69191 16 License terms: STMicroelectronics Proprietary in accordance with licensing
charlesmn 0:3d72bef69191 17 terms at www.st.com/sla0081
charlesmn 0:3d72bef69191 18
charlesmn 0:3d72bef69191 19 STMicroelectronics confidential
charlesmn 0:3d72bef69191 20 Reproduction and Communication of this document is strictly prohibited unless
charlesmn 0:3d72bef69191 21 specifically authorized in writing by STMicroelectronics.
charlesmn 0:3d72bef69191 22
charlesmn 0:3d72bef69191 23
charlesmn 0:3d72bef69191 24 *******************************************************************************
charlesmn 0:3d72bef69191 25
charlesmn 0:3d72bef69191 26 Alternatively, VL53L1 Core may be distributed under the terms of
charlesmn 0:3d72bef69191 27 'BSD 3-clause "New" or "Revised" License', in which case the following
charlesmn 0:3d72bef69191 28 provisions apply instead of the ones mentioned above :
charlesmn 0:3d72bef69191 29
charlesmn 0:3d72bef69191 30 *******************************************************************************
charlesmn 0:3d72bef69191 31
charlesmn 0:3d72bef69191 32 License terms: BSD 3-clause "New" or "Revised" License.
charlesmn 0:3d72bef69191 33
charlesmn 0:3d72bef69191 34 Redistribution and use in source and binary forms, with or without
charlesmn 0:3d72bef69191 35 modification, are permitted provided that the following conditions are met:
charlesmn 0:3d72bef69191 36
charlesmn 0:3d72bef69191 37 1. Redistributions of source code must retain the above copyright notice, this
charlesmn 0:3d72bef69191 38 list of conditions and the following disclaimer.
charlesmn 0:3d72bef69191 39
charlesmn 0:3d72bef69191 40 2. Redistributions in binary form must reproduce the above copyright notice,
charlesmn 0:3d72bef69191 41 this list of conditions and the following disclaimer in the documentation
charlesmn 0:3d72bef69191 42 and/or other materials provided with the distribution.
charlesmn 0:3d72bef69191 43
charlesmn 0:3d72bef69191 44 3. Neither the name of the copyright holder nor the names of its contributors
charlesmn 0:3d72bef69191 45 may be used to endorse or promote products derived from this software
charlesmn 0:3d72bef69191 46 without specific prior written permission.
charlesmn 0:3d72bef69191 47
charlesmn 0:3d72bef69191 48 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
charlesmn 0:3d72bef69191 49 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
charlesmn 0:3d72bef69191 50 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
charlesmn 0:3d72bef69191 51 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
charlesmn 0:3d72bef69191 52 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
charlesmn 0:3d72bef69191 53 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
charlesmn 0:3d72bef69191 54 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
charlesmn 0:3d72bef69191 55 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
charlesmn 0:3d72bef69191 56 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
charlesmn 0:3d72bef69191 57 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
charlesmn 0:3d72bef69191 58
charlesmn 0:3d72bef69191 59
charlesmn 0:3d72bef69191 60 *******************************************************************************
charlesmn 0:3d72bef69191 61 */
charlesmn 0:3d72bef69191 62
charlesmn 0:3d72bef69191 63 #ifndef _VL53L1_API_H_
charlesmn 0:3d72bef69191 64 #define _VL53L1_API_H_
charlesmn 0:3d72bef69191 65
charlesmn 0:3d72bef69191 66 #include "vl53l1_api_strings.h"
charlesmn 0:3d72bef69191 67 #include "vl53l1_api_core.h"
charlesmn 0:3d72bef69191 68 #include "vl53l1_preset_setup.h"
charlesmn 0:3d72bef69191 69
charlesmn 0:3d72bef69191 70 #ifdef __cplusplus
charlesmn 0:3d72bef69191 71 extern "C"
charlesmn 0:3d72bef69191 72 {
charlesmn 0:3d72bef69191 73 #endif
charlesmn 0:3d72bef69191 74
charlesmn 0:3d72bef69191 75 #if !defined(VL53L1DevDataGet)
charlesmn 0:3d72bef69191 76 #warning "PALDevDataGet is deprecated define VL53L1DevDataGet instead"
charlesmn 0:3d72bef69191 77 #define VL53L1DevDataGet(Dev, field) (Dev->Data.field)
charlesmn 0:3d72bef69191 78 #endif
charlesmn 0:3d72bef69191 79
charlesmn 0:3d72bef69191 80 #if !defined(VL53L1DevDataSet)
charlesmn 0:3d72bef69191 81 #warning "PALDevDataSet is deprecated define VL53L1DevDataSet instead"
charlesmn 0:3d72bef69191 82 #define VL53L1DevDataSet(Dev, field, data) ((Dev->Data.field) = (data))
charlesmn 0:3d72bef69191 83 #endif
charlesmn 0:3d72bef69191 84
charlesmn 0:3d72bef69191 85 /** @defgroup VL53L1_cut11_group VL53L1 cut1.1 Function Definition
charlesmn 0:3d72bef69191 86 * @brief VL53L1 cut1.1 Function Definition
charlesmn 0:3d72bef69191 87 * @{
charlesmn 0:3d72bef69191 88 */
charlesmn 0:3d72bef69191 89
charlesmn 0:3d72bef69191 90 /** @defgroup VL53L1_general_group VL53L1 General Functions
charlesmn 0:3d72bef69191 91 * @brief General functions and definitions
charlesmn 0:3d72bef69191 92 * @{
charlesmn 0:3d72bef69191 93 */
charlesmn 0:3d72bef69191 94
charlesmn 0:3d72bef69191 95 /**
charlesmn 0:3d72bef69191 96 * @brief Return the VL53L1 driver Version
charlesmn 0:3d72bef69191 97 *
charlesmn 0:3d72bef69191 98 * @note This function doesn't access to the device
charlesmn 0:3d72bef69191 99 *
charlesmn 0:3d72bef69191 100 * @param pVersion Rer to current driver Version
charlesmn 0:3d72bef69191 101 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 102 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 103 */
charlesmn 0:3d72bef69191 104 VL53L1_Error VL53L1_GetVersion(VL53L1_Version_t *pVersion);
charlesmn 0:3d72bef69191 105
charlesmn 0:3d72bef69191 106 /**
charlesmn 0:3d72bef69191 107 * @brief Reads the Product Revision for a for given Device
charlesmn 0:3d72bef69191 108 * This function can be used to distinguish cut1.0 from cut1.1.
charlesmn 0:3d72bef69191 109 *
charlesmn 0:3d72bef69191 110 * @param Dev Device Handle
charlesmn 0:3d72bef69191 111 * @param pProductRevisionMajor Pointer to Product Revision Major
charlesmn 0:3d72bef69191 112 * for a given Device
charlesmn 0:3d72bef69191 113 * @param pProductRevisionMinor Pointer to Product Revision Minor
charlesmn 0:3d72bef69191 114 * for a given Device
charlesmn 0:3d72bef69191 115 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 116 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 117 */
charlesmn 0:3d72bef69191 118 VL53L1_Error VL53L1_GetProductRevision(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 119 uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor);
charlesmn 0:3d72bef69191 120
charlesmn 0:3d72bef69191 121 /**
charlesmn 0:3d72bef69191 122 * @brief Reads the Device information for given Device
charlesmn 0:3d72bef69191 123 *
charlesmn 0:3d72bef69191 124 * @note This function Access to the device
charlesmn 0:3d72bef69191 125 *
charlesmn 0:3d72bef69191 126 * @param Dev Device Handle
charlesmn 0:3d72bef69191 127 * @param pVL53L1_DeviceInfo Pointer to current device info for a given
charlesmn 0:3d72bef69191 128 * Device
charlesmn 0:3d72bef69191 129 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 130 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 131 */
charlesmn 0:3d72bef69191 132 VL53L1_Error VL53L1_GetDeviceInfo(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 133 VL53L1_DeviceInfo_t *pVL53L1_DeviceInfo);
charlesmn 0:3d72bef69191 134
charlesmn 0:3d72bef69191 135 /**
charlesmn 0:3d72bef69191 136 * @brief Reads the Device unique identifier
charlesmn 0:3d72bef69191 137 *
charlesmn 0:3d72bef69191 138 * @note This function Access to the device
charlesmn 0:3d72bef69191 139 *
charlesmn 0:3d72bef69191 140 * @param Dev Device Handle
charlesmn 0:3d72bef69191 141 * @param pUid Pointer to current device unique ID
charlesmn 0:3d72bef69191 142 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 143 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 144 */
charlesmn 0:3d72bef69191 145 VL53L1_Error VL53L1_GetUID(VL53L1_DEV Dev, uint64_t *pUid);
charlesmn 0:3d72bef69191 146
charlesmn 0:3d72bef69191 147 /**
charlesmn 0:3d72bef69191 148 * @brief Human readable Range Status string for a given RangeStatus
charlesmn 0:3d72bef69191 149 *
charlesmn 0:3d72bef69191 150 * @note This function doesn't access to the device
charlesmn 0:3d72bef69191 151 *
charlesmn 0:3d72bef69191 152 * @param RangeStatus The RangeStatus code as stored on
charlesmn 0:3d72bef69191 153 * @a VL53L1_RangingMeasurementData_t
charlesmn 0:3d72bef69191 154 * @param pRangeStatusString The returned RangeStatus string. Shall be
charlesmn 0:3d72bef69191 155 * defined as char buf[VL53L1_MAX_STRING_LENGTH]
charlesmn 0:3d72bef69191 156 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 157 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 158 */
charlesmn 0:3d72bef69191 159 VL53L1_Error VL53L1_GetRangeStatusString(uint8_t RangeStatus,
charlesmn 0:3d72bef69191 160 char *pRangeStatusString);
charlesmn 0:3d72bef69191 161
charlesmn 0:3d72bef69191 162 /**
charlesmn 0:3d72bef69191 163 * @brief Human readable error string for driver error status
charlesmn 0:3d72bef69191 164 *
charlesmn 0:3d72bef69191 165 * @note This function doesn't access to the device
charlesmn 0:3d72bef69191 166 *
charlesmn 0:3d72bef69191 167 * @param PalErrorCode The error code as stored on @a VL53L1_Error
charlesmn 0:3d72bef69191 168 * @param pPalErrorString The error string corresponding to the
charlesmn 0:3d72bef69191 169 * PalErrorCode. Shall be defined as char buf[VL53L1_MAX_STRING_LENGTH]
charlesmn 0:3d72bef69191 170 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 171 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 172 */
charlesmn 0:3d72bef69191 173 VL53L1_Error VL53L1_GetPalErrorString(VL53L1_Error PalErrorCode,
charlesmn 0:3d72bef69191 174 char *pPalErrorString);
charlesmn 0:3d72bef69191 175
charlesmn 0:3d72bef69191 176 /**
charlesmn 0:3d72bef69191 177 * @brief Human readable driver State string
charlesmn 0:3d72bef69191 178 *
charlesmn 0:3d72bef69191 179 * @note This function doesn't access to the device
charlesmn 0:3d72bef69191 180 *
charlesmn 0:3d72bef69191 181 * @param PalStateCode The State code as stored on @a VL53L1_State
charlesmn 0:3d72bef69191 182 * @param pPalStateString The State string corresponding to the
charlesmn 0:3d72bef69191 183 * PalStateCode. Shall be defined as char buf[VL53L1_MAX_STRING_LENGTH]
charlesmn 0:3d72bef69191 184 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 185 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 186 */
charlesmn 0:3d72bef69191 187 VL53L1_Error VL53L1_GetPalStateString(VL53L1_State PalStateCode,
charlesmn 0:3d72bef69191 188 char *pPalStateString);
charlesmn 0:3d72bef69191 189
charlesmn 0:3d72bef69191 190 /**
charlesmn 0:3d72bef69191 191 * @brief Reads the internal state of the driver for a given Device
charlesmn 0:3d72bef69191 192 *
charlesmn 0:3d72bef69191 193 * @note This function doesn't access to the device
charlesmn 0:3d72bef69191 194 *
charlesmn 0:3d72bef69191 195 * @param Dev Device Handle
charlesmn 0:3d72bef69191 196 * @param pPalState Pointer to current state of the PAL for a
charlesmn 0:3d72bef69191 197 * given Device
charlesmn 0:3d72bef69191 198 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 199 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 200 */
charlesmn 0:3d72bef69191 201 VL53L1_Error VL53L1_GetPalState(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 202 VL53L1_State *pPalState);
charlesmn 0:3d72bef69191 203
charlesmn 0:3d72bef69191 204
charlesmn 0:3d72bef69191 205
charlesmn 0:3d72bef69191 206 /** @} VL53L1_general_group */
charlesmn 0:3d72bef69191 207
charlesmn 0:3d72bef69191 208 /** @defgroup VL53L1_init_group VL53L1 Init Functions
charlesmn 0:3d72bef69191 209 * @brief VL53L1 Init Functions
charlesmn 0:3d72bef69191 210 * @{
charlesmn 0:3d72bef69191 211 */
charlesmn 0:3d72bef69191 212
charlesmn 0:3d72bef69191 213 /**
charlesmn 0:3d72bef69191 214 * @brief Set new device address
charlesmn 0:3d72bef69191 215 *
charlesmn 0:3d72bef69191 216 * After completion the device will answer to the new address programmed.
charlesmn 0:3d72bef69191 217 * This function should be called when several devices are used in parallel
charlesmn 0:3d72bef69191 218 * before start programming the sensor.
charlesmn 0:3d72bef69191 219 * When a single device us used, there is no need to call this function.
charlesmn 0:3d72bef69191 220 *
charlesmn 0:3d72bef69191 221 * When it is requested for multi devices system this function MUST be called
charlesmn 0:3d72bef69191 222 * prior to VL53L1_DataInit()
charlesmn 0:3d72bef69191 223 *
charlesmn 0:3d72bef69191 224 * @note This function Access to the device
charlesmn 0:3d72bef69191 225 *
charlesmn 0:3d72bef69191 226 * @param Dev Device Handle
charlesmn 0:3d72bef69191 227 * @param DeviceAddress The new Device address
charlesmn 0:3d72bef69191 228 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 229 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 230 */
charlesmn 0:3d72bef69191 231 VL53L1_Error VL53L1_SetDeviceAddress(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 232 uint8_t DeviceAddress);
charlesmn 0:3d72bef69191 233
charlesmn 0:3d72bef69191 234 /**
charlesmn 0:3d72bef69191 235 *
charlesmn 0:3d72bef69191 236 * @brief One time device initialization
charlesmn 0:3d72bef69191 237 *
charlesmn 0:3d72bef69191 238 * To be called after device has been powered on and booted
charlesmn 0:3d72bef69191 239 * see @a VL53L1_WaitDeviceBooted()
charlesmn 0:3d72bef69191 240 *
charlesmn 0:3d72bef69191 241 * @par Function Description
charlesmn 0:3d72bef69191 242 * When not used after a fresh device "power up", it may return
charlesmn 0:3d72bef69191 243 * @a #VL53L1_ERROR_CALIBRATION_WARNING meaning wrong calibration data
charlesmn 0:3d72bef69191 244 * may have been fetched from device that can result in ranging offset error\n
charlesmn 0:3d72bef69191 245 * If VL53L1_DataInit is called several times then the application must restore
charlesmn 0:3d72bef69191 246 * calibration calling @a VL53L1_SetOffsetCalibrationData()
charlesmn 0:3d72bef69191 247 * It implies application has gathered calibration data thanks to
charlesmn 0:3d72bef69191 248 * @a VL53L1_GetOffsetCalibrationData() after an initial calibration stage.
charlesmn 0:3d72bef69191 249 * This function will change the VL53L1_State from VL53L1_STATE_POWERDOWN to
charlesmn 0:3d72bef69191 250 * VL53L1_STATE_WAIT_STATICINIT.
charlesmn 0:3d72bef69191 251 *
charlesmn 0:3d72bef69191 252 * @note This function Access to the device
charlesmn 0:3d72bef69191 253 *
charlesmn 0:3d72bef69191 254 * @param Dev Device Handle
charlesmn 0:3d72bef69191 255 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 256 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 257 */
charlesmn 0:3d72bef69191 258 VL53L1_Error VL53L1_DataInit(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 259
charlesmn 0:3d72bef69191 260
charlesmn 0:3d72bef69191 261 /**
charlesmn 0:3d72bef69191 262 * @brief Do basic device init (and eventually patch loading)
charlesmn 0:3d72bef69191 263 * This function will change the VL53L1_State from
charlesmn 0:3d72bef69191 264 * VL53L1_STATE_WAIT_STATICINIT to VL53L1_STATE_IDLE.
charlesmn 0:3d72bef69191 265 * In this stage all default setting will be applied.
charlesmn 0:3d72bef69191 266 *
charlesmn 0:3d72bef69191 267 * @note This function Access to the device
charlesmn 0:3d72bef69191 268 *
charlesmn 0:3d72bef69191 269 * @param Dev Device Handle
charlesmn 0:3d72bef69191 270 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 271 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 272 */
charlesmn 0:3d72bef69191 273 VL53L1_Error VL53L1_StaticInit(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 274
charlesmn 0:3d72bef69191 275 /**
charlesmn 0:3d72bef69191 276 * @brief Wait for device booted after chip enable (hardware standby)
charlesmn 0:3d72bef69191 277 * This function can be run only when VL53L1_State is VL53L1_STATE_POWERDOWN.
charlesmn 0:3d72bef69191 278 *
charlesmn 0:3d72bef69191 279 * @param Dev Device Handle
charlesmn 0:3d72bef69191 280 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 281 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 282 *
charlesmn 0:3d72bef69191 283 */
charlesmn 0:3d72bef69191 284 VL53L1_Error VL53L1_WaitDeviceBooted(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 285
charlesmn 0:3d72bef69191 286
charlesmn 0:3d72bef69191 287 /** @} VL53L1_init_group */
charlesmn 0:3d72bef69191 288
charlesmn 0:3d72bef69191 289 /** @defgroup VL53L1_parameters_group VL53L1 Parameters Functions
charlesmn 0:3d72bef69191 290 * @brief Functions used to prepare and setup the device
charlesmn 0:3d72bef69191 291 * @{
charlesmn 0:3d72bef69191 292 */
charlesmn 0:3d72bef69191 293
charlesmn 0:3d72bef69191 294 /**
charlesmn 0:3d72bef69191 295 * @brief Set a new Preset Mode
charlesmn 0:3d72bef69191 296 * @par Function Description
charlesmn 0:3d72bef69191 297 * Set device to a new Operating Mode (High speed ranging, Multi objects ...)
charlesmn 0:3d72bef69191 298 *
charlesmn 0:3d72bef69191 299 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 300 *
charlesmn 0:3d72bef69191 301 * @warning This function change the timing budget to 16 ms and the inter-
charlesmn 0:3d72bef69191 302 * measurement period to 1000 ms. Also the VL53L1_DISTANCEMODE_LONG is used.
charlesmn 0:3d72bef69191 303 *
charlesmn 0:3d72bef69191 304 * @param Dev Device Handle
charlesmn 0:3d72bef69191 305 * @param PresetMode New Preset mode to apply
charlesmn 0:3d72bef69191 306 * <br>Valid values are:
charlesmn 0:3d72bef69191 307 */
charlesmn 0:3d72bef69191 308 /**
charlesmn 0:3d72bef69191 309 * @li VL53L1_PRESETMODE_MULTIZONES_SCANNING
charlesmn 0:3d72bef69191 310 * @li VL53L1_PRESETMODE_RANGING
charlesmn 0:3d72bef69191 311 * @li VL53L1_PRESETMODE_AUTONOMOUS
charlesmn 0:3d72bef69191 312 * @li VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS
charlesmn 0:3d72bef69191 313 * @li VL53L1_PRESETMODE_LITE_RANGING
charlesmn 0:3d72bef69191 314 * @li VL53L1_PRESETMODE_OLT
charlesmn 0:3d72bef69191 315 */
charlesmn 0:3d72bef69191 316 /**
charlesmn 0:3d72bef69191 317 *
charlesmn 0:3d72bef69191 318 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 319 * @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when PresetMode is
charlesmn 0:3d72bef69191 320 * not in the supported list
charlesmn 0:3d72bef69191 321 */
charlesmn 0:3d72bef69191 322 VL53L1_Error VL53L1_SetPresetMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 323 VL53L1_PresetModes PresetMode);
charlesmn 0:3d72bef69191 324
charlesmn 0:3d72bef69191 325 /**
charlesmn 0:3d72bef69191 326 * @brief Get current Preset Mode
charlesmn 0:3d72bef69191 327 * @par Function Description
charlesmn 0:3d72bef69191 328 * Get actual mode of the device(ranging, histogram ...)
charlesmn 0:3d72bef69191 329 *
charlesmn 0:3d72bef69191 330 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 331 *
charlesmn 0:3d72bef69191 332 * @param Dev Device Handle
charlesmn 0:3d72bef69191 333 * @param pPresetMode Pointer to current apply mode value
charlesmn 0:3d72bef69191 334 *
charlesmn 0:3d72bef69191 335 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 336 * @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when
charlesmn 0:3d72bef69191 337 * DeviceMode is not in the supported list
charlesmn 0:3d72bef69191 338 */
charlesmn 0:3d72bef69191 339 VL53L1_Error VL53L1_GetPresetMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 340 VL53L1_PresetModes *pPresetMode);
charlesmn 0:3d72bef69191 341
charlesmn 0:3d72bef69191 342
charlesmn 0:3d72bef69191 343 /**
charlesmn 0:3d72bef69191 344 * @brief Set the distance mode
charlesmn 0:3d72bef69191 345 * @par Function Description
charlesmn 0:3d72bef69191 346 * Set the distance mode to be used for the next ranging.<br>
charlesmn 0:3d72bef69191 347 * The modes Short, Medium and Long are used to optimize the ranging accuracy
charlesmn 0:3d72bef69191 348 * in a specific range of distance.<br> The user select one of these modes to
charlesmn 0:3d72bef69191 349 * select the distance range. <br>
charlesmn 0:3d72bef69191 350 * Two additional modes are supported: AUTO and AUTO_LITE the difference between
charlesmn 0:3d72bef69191 351 * these modes is the following.<br>
charlesmn 0:3d72bef69191 352 * The mode AUTO take into account both the ranging distance (RangeMilliMeter)
charlesmn 0:3d72bef69191 353 * and the dmax distance (DmaxMilliMeter).<br> The algorithm uses the ranging
charlesmn 0:3d72bef69191 354 * distance when the range status is ok and uses the dmax distance when the
charlesmn 0:3d72bef69191 355 * range status is not ok.<br>
charlesmn 0:3d72bef69191 356 * The AUTO_LITE take into account only the ranging distance, so nothing is done
charlesmn 0:3d72bef69191 357 * in case of range error i.e. the distance mode will not be changed.
charlesmn 0:3d72bef69191 358 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 359 *
charlesmn 0:3d72bef69191 360 * @warning This function should be called after @a VL53L1_SetPresetMode().
charlesmn 0:3d72bef69191 361
charlesmn 0:3d72bef69191 362 * @param Dev Device Handle
charlesmn 0:3d72bef69191 363 * @param DistanceMode Distance mode to apply valid values are:
charlesmn 0:3d72bef69191 364 * @li VL53L1_DISTANCEMODE_SHORT
charlesmn 0:3d72bef69191 365 * @li VL53L1_DISTANCEMODE_MEDIUM
charlesmn 0:3d72bef69191 366 * @li VL53L1_DISTANCEMODE_LONG
charlesmn 0:3d72bef69191 367 * @li VL53L1_DISTANCEMODE_AUTO_LITE
charlesmn 0:3d72bef69191 368 * @li VL53L1_DISTANCEMODE_AUTO
charlesmn 0:3d72bef69191 369 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 370 * @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when DistanceMode
charlesmn 0:3d72bef69191 371 * is not in the supported list
charlesmn 0:3d72bef69191 372 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 373 */
charlesmn 0:3d72bef69191 374 VL53L1_Error VL53L1_SetDistanceMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 375 VL53L1_DistanceModes DistanceMode);
charlesmn 0:3d72bef69191 376
charlesmn 0:3d72bef69191 377 /**
charlesmn 0:3d72bef69191 378 * @brief Get the distance mode
charlesmn 0:3d72bef69191 379 * @par Function Description
charlesmn 0:3d72bef69191 380 * Get the distance mode used for the next ranging.
charlesmn 0:3d72bef69191 381 *
charlesmn 0:3d72bef69191 382 * @param Dev Device Handle
charlesmn 0:3d72bef69191 383 * @param *pDistanceMode Pointer to Distance mode
charlesmn 0:3d72bef69191 384 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 385 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 386 */
charlesmn 0:3d72bef69191 387 VL53L1_Error VL53L1_GetDistanceMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 388 VL53L1_DistanceModes *pDistanceMode);
charlesmn 0:3d72bef69191 389
charlesmn 0:3d72bef69191 390
charlesmn 0:3d72bef69191 391 /**
charlesmn 0:3d72bef69191 392 * @brief Set the output mode
charlesmn 0:3d72bef69191 393 * @par Function Description
charlesmn 0:3d72bef69191 394 * Set the output mode to be used for the next ranging. The output mode is used
charlesmn 0:3d72bef69191 395 * to select, in case of multiple objects, which one will be used in
charlesmn 0:3d72bef69191 396 * function @a VL53L1_GetRangingMeasurementData().
charlesmn 0:3d72bef69191 397 * VL53L1_SetOutputMode also sets the object used by automatic
charlesmn 0:3d72bef69191 398 * distance mode algorithm when @a VL53L1_SetDistanceMode() is
charlesmn 0:3d72bef69191 399 * set to automatic mode.
charlesmn 0:3d72bef69191 400 *
charlesmn 0:3d72bef69191 401 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 402 *
charlesmn 0:3d72bef69191 403 * @warning This function should be called after @a VL53L1_SetPresetMode().
charlesmn 0:3d72bef69191 404
charlesmn 0:3d72bef69191 405 * @param Dev Device Handle
charlesmn 0:3d72bef69191 406 * @param OutputMode Output mode to apply valid values are:
charlesmn 0:3d72bef69191 407 * @li VL53L1_OUTPUTMODE_NEAREST
charlesmn 0:3d72bef69191 408 * @li VL53L1_OUTPUTMODE_STRONGEST
charlesmn 0:3d72bef69191 409 *
charlesmn 0:3d72bef69191 410 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 411 * @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when OutputMode
charlesmn 0:3d72bef69191 412 * is not in the supported list
charlesmn 0:3d72bef69191 413 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 414 */
charlesmn 0:3d72bef69191 415 VL53L1_Error VL53L1_SetOutputMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 416 VL53L1_OutputModes OutputMode);
charlesmn 0:3d72bef69191 417
charlesmn 0:3d72bef69191 418 /**
charlesmn 0:3d72bef69191 419 * @brief Get the output mode
charlesmn 0:3d72bef69191 420 * @par Function Description
charlesmn 0:3d72bef69191 421 * Get the output mode used for the next ranging.
charlesmn 0:3d72bef69191 422 *
charlesmn 0:3d72bef69191 423 * @param Dev Device Handle
charlesmn 0:3d72bef69191 424 * @param *pOutputMode Pointer to Output mode
charlesmn 0:3d72bef69191 425 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 426 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 427 */
charlesmn 0:3d72bef69191 428 VL53L1_Error VL53L1_GetOutputMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 429 VL53L1_OutputModes *pOutputMode);
charlesmn 0:3d72bef69191 430
charlesmn 0:3d72bef69191 431
charlesmn 0:3d72bef69191 432 /**
charlesmn 0:3d72bef69191 433 * @brief Set Ranging Timing Budget in microseconds
charlesmn 0:3d72bef69191 434 *
charlesmn 0:3d72bef69191 435 * @par Function Description
charlesmn 0:3d72bef69191 436 * Defines the maximum time allowed by the user to the device to run a
charlesmn 0:3d72bef69191 437 * full ranging sequence for the current mode (ranging, histogram, ASL ...)
charlesmn 0:3d72bef69191 438 *
charlesmn 0:3d72bef69191 439 * @param Dev Device Handle
charlesmn 0:3d72bef69191 440 * @param MeasurementTimingBudgetMicroSeconds Max measurement time in
charlesmn 0:3d72bef69191 441 * microseconds.
charlesmn 0:3d72bef69191 442 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 443 * @return VL53L1_ERROR_INVALID_PARAMS Error timing parameter not
charlesmn 0:3d72bef69191 444 * supported.
charlesmn 0:3d72bef69191 445 * The maximum accepted value for the
charlesmn 0:3d72bef69191 446 * computed timing budget is 10 seconds
charlesmn 0:3d72bef69191 447 * the minimum value depends on the preset
charlesmn 0:3d72bef69191 448 * mode selected.
charlesmn 0:3d72bef69191 449 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 450 */
charlesmn 0:3d72bef69191 451 VL53L1_Error VL53L1_SetMeasurementTimingBudgetMicroSeconds(
charlesmn 0:3d72bef69191 452 VL53L1_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds);
charlesmn 0:3d72bef69191 453
charlesmn 0:3d72bef69191 454 /**
charlesmn 0:3d72bef69191 455 * @brief Get Ranging Timing Budget in microseconds
charlesmn 0:3d72bef69191 456 *
charlesmn 0:3d72bef69191 457 * @par Function Description
charlesmn 0:3d72bef69191 458 * Returns the programmed the maximum time allowed by the user to the
charlesmn 0:3d72bef69191 459 * device to run a full ranging sequence for the current mode
charlesmn 0:3d72bef69191 460 * (ranging, histogram, ASL ...)
charlesmn 0:3d72bef69191 461 *
charlesmn 0:3d72bef69191 462 * @param Dev Device Handle
charlesmn 0:3d72bef69191 463 * @param pMeasurementTimingBudgetMicroSeconds Max measurement time in
charlesmn 0:3d72bef69191 464 * microseconds.
charlesmn 0:3d72bef69191 465 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 466 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 467 */
charlesmn 0:3d72bef69191 468 VL53L1_Error VL53L1_GetMeasurementTimingBudgetMicroSeconds(
charlesmn 0:3d72bef69191 469 VL53L1_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds);
charlesmn 0:3d72bef69191 470
charlesmn 0:3d72bef69191 471
charlesmn 0:3d72bef69191 472 /**
charlesmn 0:3d72bef69191 473 * Program continuous mode Inter-Measurement period in milliseconds
charlesmn 0:3d72bef69191 474 *
charlesmn 0:3d72bef69191 475 * @par Function Description
charlesmn 0:3d72bef69191 476 * When trying to set too short time return INVALID_PARAMS minimal value
charlesmn 0:3d72bef69191 477 *
charlesmn 0:3d72bef69191 478 * @param Dev Device Handle
charlesmn 0:3d72bef69191 479 * @param InterMeasurementPeriodMilliSeconds Inter-Measurement Period in ms.
charlesmn 0:3d72bef69191 480 * this value should be greater than the duration set in
charlesmn 0:3d72bef69191 481 * @a VL53L1_SetMeasurementTimingBudgetMicroSeconds() to ensure smooth ranging
charlesmn 0:3d72bef69191 482 * operation.
charlesmn 0:3d72bef69191 483 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 484 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 485 */
charlesmn 0:3d72bef69191 486 VL53L1_Error VL53L1_SetInterMeasurementPeriodMilliSeconds(
charlesmn 0:3d72bef69191 487 VL53L1_DEV Dev, uint32_t InterMeasurementPeriodMilliSeconds);
charlesmn 0:3d72bef69191 488
charlesmn 0:3d72bef69191 489 /**
charlesmn 0:3d72bef69191 490 * Get continuous mode Inter-Measurement period in milliseconds
charlesmn 0:3d72bef69191 491 *
charlesmn 0:3d72bef69191 492 * @par Function Description
charlesmn 0:3d72bef69191 493 *
charlesmn 0:3d72bef69191 494 * @param Dev Device Handle
charlesmn 0:3d72bef69191 495 * @param pInterMeasurementPeriodMilliSeconds Pointer to programmed
charlesmn 0:3d72bef69191 496 * Inter-Measurement Period in milliseconds.
charlesmn 0:3d72bef69191 497 * @return VL53L1_ERROR_NONE
charlesmn 0:3d72bef69191 498 */
charlesmn 0:3d72bef69191 499 VL53L1_Error VL53L1_GetInterMeasurementPeriodMilliSeconds(
charlesmn 0:3d72bef69191 500 VL53L1_DEV Dev, uint32_t *pInterMeasurementPeriodMilliSeconds);
charlesmn 0:3d72bef69191 501
charlesmn 0:3d72bef69191 502 /**
charlesmn 0:3d72bef69191 503 * @brief target reflectance for Dmax setting
charlesmn 0:3d72bef69191 504 * @par Function Description
charlesmn 0:3d72bef69191 505 * Allow user to set the value for target reflectance @ 940nm to calculate the
charlesmn 0:3d72bef69191 506 * ambient DMAX values for. Set to 50% by default by @a VL53L1_DataInit()
charlesmn 0:3d72bef69191 507 *
charlesmn 0:3d72bef69191 508 * @param Dev Device Handle
charlesmn 0:3d72bef69191 509 * @param DmaxReflectance Reflectance % in 16.16 fixed point
charlesmn 0:3d72bef69191 510 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 511 * @return VL53L1_ERROR_INVALID_PARAMS in case input value is not in range
charlesmn 0:3d72bef69191 512 * from 0 to 100. Note that this is a fix point value so the max value is
charlesmn 0:3d72bef69191 513 * 100 * 65536.
charlesmn 0:3d72bef69191 514 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 515 */
charlesmn 0:3d72bef69191 516 VL53L1_Error VL53L1_SetDmaxReflectance(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 517 FixPoint1616_t DmaxReflectance);
charlesmn 0:3d72bef69191 518
charlesmn 0:3d72bef69191 519 /**
charlesmn 0:3d72bef69191 520 * @brief Get target reflectance for Dmax
charlesmn 0:3d72bef69191 521 * @par Function Description
charlesmn 0:3d72bef69191 522 * Retrieves the value for target reflectance @ 940nm to calculate the
charlesmn 0:3d72bef69191 523 * ambient DMAX values for. Set to 50% by default by @a VL53L1_DataInit()
charlesmn 0:3d72bef69191 524 *
charlesmn 0:3d72bef69191 525 * @param Dev Device Handle
charlesmn 0:3d72bef69191 526 * @param pDmaxReflectance pointer to Reflectance % in 16.16 fixed point
charlesmn 0:3d72bef69191 527 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 528 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 529 */
charlesmn 0:3d72bef69191 530 VL53L1_Error VL53L1_GetDmaxReflectance(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 531 FixPoint1616_t *pDmaxReflectance);
charlesmn 0:3d72bef69191 532 /**
charlesmn 0:3d72bef69191 533 * @brief Set function for ambient Dmax mode
charlesmn 0:3d72bef69191 534 *
charlesmn 0:3d72bef69191 535 *
charlesmn 0:3d72bef69191 536 * @param Dev Device Handle
charlesmn 0:3d72bef69191 537 * @param DmaxMode DMAX mode to be used in ranging
charlesmn 0:3d72bef69191 538 *
charlesmn 0:3d72bef69191 539 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 540 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 541 */
charlesmn 0:3d72bef69191 542
charlesmn 0:3d72bef69191 543
charlesmn 0:3d72bef69191 544 VL53L1_Error VL53L1_SetDmaxMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 545 VL53L1_DeviceDmaxModes DmaxMode);
charlesmn 0:3d72bef69191 546
charlesmn 0:3d72bef69191 547 /**
charlesmn 0:3d72bef69191 548 * @brief Get function for ambient Dmax mode
charlesmn 0:3d72bef69191 549 *
charlesmn 0:3d72bef69191 550 * @param Dev Device Handle
charlesmn 0:3d72bef69191 551 * @param pDmaxMode output pointer to DMAX mode currently in use
charlesmn 0:3d72bef69191 552 *
charlesmn 0:3d72bef69191 553 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 554 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 555 */
charlesmn 0:3d72bef69191 556
charlesmn 0:3d72bef69191 557 VL53L1_Error VL53L1_GetDmaxMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 558 VL53L1_DeviceDmaxModes *pDmaxMode);
charlesmn 0:3d72bef69191 559
charlesmn 0:3d72bef69191 560 /** @} VL53L1_parameters_group */
charlesmn 0:3d72bef69191 561
charlesmn 0:3d72bef69191 562
charlesmn 0:3d72bef69191 563 /** @defgroup VL53L1_limitcheck_group VL53L1 Limit Check Functions
charlesmn 0:3d72bef69191 564 * @brief Functions used for the Limit checks
charlesmn 0:3d72bef69191 565 * @{
charlesmn 0:3d72bef69191 566 */
charlesmn 0:3d72bef69191 567
charlesmn 0:3d72bef69191 568
charlesmn 0:3d72bef69191 569
charlesmn 0:3d72bef69191 570 /**
charlesmn 0:3d72bef69191 571 * @brief Get the number of the check limit managed by a given Device
charlesmn 0:3d72bef69191 572 *
charlesmn 0:3d72bef69191 573 * @par Function Description
charlesmn 0:3d72bef69191 574 * This function give the number of the check limit managed by the Device
charlesmn 0:3d72bef69191 575 *
charlesmn 0:3d72bef69191 576 * @param pNumberOfLimitCheck Pointer to the number of check limit.
charlesmn 0:3d72bef69191 577 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 578 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 579 */
charlesmn 0:3d72bef69191 580 VL53L1_Error VL53L1_GetNumberOfLimitCheck(
charlesmn 0:3d72bef69191 581 uint16_t *pNumberOfLimitCheck);
charlesmn 0:3d72bef69191 582
charlesmn 0:3d72bef69191 583 /**
charlesmn 0:3d72bef69191 584 * @brief Return a description string for a given limit check number
charlesmn 0:3d72bef69191 585 *
charlesmn 0:3d72bef69191 586 * @par Function Description
charlesmn 0:3d72bef69191 587 * This function returns a description string for a given limit check number.
charlesmn 0:3d72bef69191 588 * The limit check is identified with the LimitCheckId.
charlesmn 0:3d72bef69191 589 *
charlesmn 0:3d72bef69191 590 * @param LimitCheckId Limit Check ID
charlesmn 0:3d72bef69191 591 * (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
charlesmn 0:3d72bef69191 592 * @param pLimitCheckString Pointer to the description string of
charlesmn 0:3d72bef69191 593 * the given check limit. Shall be defined as char buf[VL53L1_MAX_STRING_LENGTH]
charlesmn 0:3d72bef69191 594 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 595 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 596 */
charlesmn 0:3d72bef69191 597 VL53L1_Error VL53L1_GetLimitCheckInfo(uint16_t LimitCheckId,
charlesmn 0:3d72bef69191 598 char *pLimitCheckString);
charlesmn 0:3d72bef69191 599
charlesmn 0:3d72bef69191 600 /**
charlesmn 0:3d72bef69191 601 * @brief Return a the Status of the specified check limit
charlesmn 0:3d72bef69191 602 *
charlesmn 0:3d72bef69191 603 * @par Function Description
charlesmn 0:3d72bef69191 604 * This function returns the Status of the specified check limit.
charlesmn 0:3d72bef69191 605 * The value indicate if the check is fail or not.
charlesmn 0:3d72bef69191 606 * The limit check is identified with the LimitCheckId.
charlesmn 0:3d72bef69191 607 *
charlesmn 0:3d72bef69191 608 * @param Dev Device Handle
charlesmn 0:3d72bef69191 609 * @param LimitCheckId Limit Check ID
charlesmn 0:3d72bef69191 610 (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
charlesmn 0:3d72bef69191 611 * @param pLimitCheckStatus Pointer to the
charlesmn 0:3d72bef69191 612 Limit Check Status of the given check limit.
charlesmn 0:3d72bef69191 613 * LimitCheckStatus :
charlesmn 0:3d72bef69191 614 * 0 the check is not fail or not enabled
charlesmn 0:3d72bef69191 615 * 1 the check if fail
charlesmn 0:3d72bef69191 616 *
charlesmn 0:3d72bef69191 617 * <p><ul>
charlesmn 0:3d72bef69191 618 * <li>VL53L1_CHECKENABLE_SIGMA_FINAL_RANGE: the sigma indicate the quality
charlesmn 0:3d72bef69191 619 * of the measure. The more it is little the better it is.
charlesmn 0:3d72bef69191 620 * The status is 1 when current sigma is greater then the limit.</li>
charlesmn 0:3d72bef69191 621 * <li>VL53L1_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE: the signal rate indicate
charlesmn 0:3d72bef69191 622 * the strength of the returned signal. The more it is big the better it is.
charlesmn 0:3d72bef69191 623 * The status is 1 when current signal is lower then the limit.</li>
charlesmn 0:3d72bef69191 624 * </ul></p>
charlesmn 0:3d72bef69191 625 *
charlesmn 0:3d72bef69191 626 *
charlesmn 0:3d72bef69191 627 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 628 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 629 */
charlesmn 0:3d72bef69191 630 VL53L1_Error VL53L1_GetLimitCheckStatus(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 631 uint16_t LimitCheckId, uint8_t *pLimitCheckStatus);
charlesmn 0:3d72bef69191 632
charlesmn 0:3d72bef69191 633 /**
charlesmn 0:3d72bef69191 634 * @brief Enable/Disable a specific limit check
charlesmn 0:3d72bef69191 635 *
charlesmn 0:3d72bef69191 636 * @par Function Description
charlesmn 0:3d72bef69191 637 * This function Enable/Disable a specific limit check.
charlesmn 0:3d72bef69191 638 * The limit check is identified with the LimitCheckId.
charlesmn 0:3d72bef69191 639 *
charlesmn 0:3d72bef69191 640 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 641 *
charlesmn 0:3d72bef69191 642 * @param Dev Device Handle
charlesmn 0:3d72bef69191 643 * @param LimitCheckId Limit Check ID
charlesmn 0:3d72bef69191 644 * (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
charlesmn 0:3d72bef69191 645 * @param LimitCheckEnable
charlesmn 0:3d72bef69191 646 * @li set LimitCheckEnable=1 enables the LimitCheckId limit
charlesmn 0:3d72bef69191 647 * @li set LimitCheckEnable=0 disables the LimitCheckId limit
charlesmn 0:3d72bef69191 648 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 649 * @return VL53L1_ERROR_INVALID_PARAMS This error is returned
charlesmn 0:3d72bef69191 650 * when LimitCheckId value is out of range.
charlesmn 0:3d72bef69191 651 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 652 */
charlesmn 0:3d72bef69191 653 VL53L1_Error VL53L1_SetLimitCheckEnable(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 654 uint16_t LimitCheckId, uint8_t LimitCheckEnable);
charlesmn 0:3d72bef69191 655
charlesmn 0:3d72bef69191 656 /**
charlesmn 0:3d72bef69191 657 * @brief Get specific limit check enable state
charlesmn 0:3d72bef69191 658 *
charlesmn 0:3d72bef69191 659 * @par Function Description
charlesmn 0:3d72bef69191 660 * This function get the enable state of a specific limit check.
charlesmn 0:3d72bef69191 661 * The limit check is identified with the LimitCheckId.
charlesmn 0:3d72bef69191 662 *
charlesmn 0:3d72bef69191 663 * @note This function Access to the device
charlesmn 0:3d72bef69191 664 *
charlesmn 0:3d72bef69191 665 * @param Dev Device Handle
charlesmn 0:3d72bef69191 666 * @param LimitCheckId Limit Check ID
charlesmn 0:3d72bef69191 667 * (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
charlesmn 0:3d72bef69191 668 * @param pLimitCheckEnable Pointer to the check limit enable
charlesmn 0:3d72bef69191 669 * value.
charlesmn 0:3d72bef69191 670 * @li if 1 the check limit corresponding to LimitCheckId is Enabled
charlesmn 0:3d72bef69191 671 * @li if 0 the check limit corresponding to LimitCheckId is disabled
charlesmn 0:3d72bef69191 672 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 673 * @return VL53L1_ERROR_INVALID_PARAMS This error is returned
charlesmn 0:3d72bef69191 674 * when LimitCheckId value is out of range.
charlesmn 0:3d72bef69191 675 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 676 */
charlesmn 0:3d72bef69191 677 VL53L1_Error VL53L1_GetLimitCheckEnable(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 678 uint16_t LimitCheckId, uint8_t *pLimitCheckEnable);
charlesmn 0:3d72bef69191 679
charlesmn 0:3d72bef69191 680 /**
charlesmn 0:3d72bef69191 681 * @brief Set a specific limit check value
charlesmn 0:3d72bef69191 682 *
charlesmn 0:3d72bef69191 683 * @par Function Description
charlesmn 0:3d72bef69191 684 * This function set a specific limit check value.
charlesmn 0:3d72bef69191 685 * The limit check is identified with the LimitCheckId.
charlesmn 0:3d72bef69191 686 *
charlesmn 0:3d72bef69191 687 * @note Note that the value written with that function will not be applied if
charlesmn 0:3d72bef69191 688 * the limit is not enabled. In other words this function will not enable the
charlesmn 0:3d72bef69191 689 * limit but change only the value. In case the limit is not enabled the value
charlesmn 0:3d72bef69191 690 * is saved internally and applied with VL53L1_SetLimitCheckEnable.
charlesmn 0:3d72bef69191 691 *
charlesmn 0:3d72bef69191 692 * @param Dev Device Handle
charlesmn 0:3d72bef69191 693 * @param LimitCheckId Limit Check ID
charlesmn 0:3d72bef69191 694 * (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
charlesmn 0:3d72bef69191 695 * @param LimitCheckValue Limit check Value for a given
charlesmn 0:3d72bef69191 696 * LimitCheckId
charlesmn 0:3d72bef69191 697 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 698 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 699 */
charlesmn 0:3d72bef69191 700 VL53L1_Error VL53L1_SetLimitCheckValue(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 701 uint16_t LimitCheckId, FixPoint1616_t LimitCheckValue);
charlesmn 0:3d72bef69191 702
charlesmn 0:3d72bef69191 703 /**
charlesmn 0:3d72bef69191 704 * @brief Get a specific limit check value
charlesmn 0:3d72bef69191 705 *
charlesmn 0:3d72bef69191 706 * @par Function Description
charlesmn 0:3d72bef69191 707 * This function get a specific limit check value from device then it updates
charlesmn 0:3d72bef69191 708 * internal values and check enables.
charlesmn 0:3d72bef69191 709 * The limit check is identified with the LimitCheckId.
charlesmn 0:3d72bef69191 710 *
charlesmn 0:3d72bef69191 711 * @note This function get the current value from device if zero then the value
charlesmn 0:3d72bef69191 712 * returned is the one stored by the user, but in that case the check is store
charlesmn 0:3d72bef69191 713 * as disabled. If the value from device is not zero, this is returned and set
charlesmn 0:3d72bef69191 714 * into the memory at the same way that user call VL53L1_SetLimitCheckValue()
charlesmn 0:3d72bef69191 715 *
charlesmn 0:3d72bef69191 716 * @param Dev Device Handle
charlesmn 0:3d72bef69191 717 * @param LimitCheckId Limit Check ID
charlesmn 0:3d72bef69191 718 * (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
charlesmn 0:3d72bef69191 719 * @param pLimitCheckValue Pointer to Limit
charlesmn 0:3d72bef69191 720 * check Value for a given LimitCheckId.
charlesmn 0:3d72bef69191 721 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 722 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 723 */
charlesmn 0:3d72bef69191 724 VL53L1_Error VL53L1_GetLimitCheckValue(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 725 uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckValue);
charlesmn 0:3d72bef69191 726
charlesmn 0:3d72bef69191 727 /**
charlesmn 0:3d72bef69191 728 * @brief Get the current value of the signal used for the limit check
charlesmn 0:3d72bef69191 729 *
charlesmn 0:3d72bef69191 730 * @par Function Description
charlesmn 0:3d72bef69191 731 * This function get a the current value of the signal used for the limit check.
charlesmn 0:3d72bef69191 732 * To obtain the latest value you should run a valid ranging before.
charlesmn 0:3d72bef69191 733 * The value reported is linked to the limit check identified with the
charlesmn 0:3d72bef69191 734 * LimitCheckId.
charlesmn 0:3d72bef69191 735 *
charlesmn 0:3d72bef69191 736 * @param Dev Device Handle
charlesmn 0:3d72bef69191 737 * @param LimitCheckId Limit Check ID
charlesmn 0:3d72bef69191 738 * (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
charlesmn 0:3d72bef69191 739 * @param pLimitCheckCurrent Pointer to current Value for a
charlesmn 0:3d72bef69191 740 * given LimitCheckId.
charlesmn 0:3d72bef69191 741 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 742 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 743 */
charlesmn 0:3d72bef69191 744 VL53L1_Error VL53L1_GetLimitCheckCurrent(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 745 uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckCurrent);
charlesmn 0:3d72bef69191 746
charlesmn 0:3d72bef69191 747 /** @} VL53L1_limitcheck_group */
charlesmn 0:3d72bef69191 748
charlesmn 0:3d72bef69191 749
charlesmn 0:3d72bef69191 750
charlesmn 0:3d72bef69191 751 /** @defgroup VL53L1_ROI_group VL53L1 ROI Functions
charlesmn 0:3d72bef69191 752 * @brief Functions used to select ROIs
charlesmn 0:3d72bef69191 753 * @{
charlesmn 0:3d72bef69191 754 */
charlesmn 0:3d72bef69191 755
charlesmn 0:3d72bef69191 756 /**
charlesmn 0:3d72bef69191 757 * @brief Get the Maximum number of ROI Zones managed by the Device
charlesmn 0:3d72bef69191 758 *
charlesmn 0:3d72bef69191 759 * @par Function Description
charlesmn 0:3d72bef69191 760 * Get Maximum number of ROI Zones managed by the Device.
charlesmn 0:3d72bef69191 761 *
charlesmn 0:3d72bef69191 762 * @note The number of Zone depends on the preset mode used so to have the
charlesmn 0:3d72bef69191 763 * right number this function should be call after @a VL53L1_SetPresetMode()
charlesmn 0:3d72bef69191 764 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 765 *
charlesmn 0:3d72bef69191 766 * @param Dev Device Handle
charlesmn 0:3d72bef69191 767 * @param pMaxNumberOfROI Pointer to the Maximum Number
charlesmn 0:3d72bef69191 768 * of ROI Zones value.
charlesmn 0:3d72bef69191 769 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 770 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 771 */
charlesmn 0:3d72bef69191 772 VL53L1_Error VL53L1_GetMaxNumberOfROI(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 773 uint8_t *pMaxNumberOfROI);
charlesmn 0:3d72bef69191 774 /**
charlesmn 0:3d72bef69191 775 * @brief Set the ROI to be used for ranging
charlesmn 0:3d72bef69191 776 *
charlesmn 0:3d72bef69191 777 * @par Function Description
charlesmn 0:3d72bef69191 778 * The user defined ROIs are rectangles described as per the following system
charlesmn 0:3d72bef69191 779 * from the Top Left corner to the Bottom Right corner.
charlesmn 0:3d72bef69191 780 * <br>Minimal ROI size is 4x4 spads
charlesmn 0:3d72bef69191 781 * @image html roi_coord.png
charlesmn 0:3d72bef69191 782 *
charlesmn 0:3d72bef69191 783 * @param Dev Device Handle
charlesmn 0:3d72bef69191 784 * @param pRoiConfig Pointer to the Structure containing all the
charlesmn 0:3d72bef69191 785 * ROI to be used.
charlesmn 0:3d72bef69191 786 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 787 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 788 */
charlesmn 0:3d72bef69191 789 VL53L1_Error VL53L1_SetROI(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 790 VL53L1_RoiConfig_t *pRoiConfig);
charlesmn 0:3d72bef69191 791
charlesmn 0:3d72bef69191 792 /**
charlesmn 0:3d72bef69191 793 * @brief Get the ROI managed by the Device
charlesmn 0:3d72bef69191 794 *
charlesmn 0:3d72bef69191 795 * @par Function Description
charlesmn 0:3d72bef69191 796 * Get the ROI managed by the Device
charlesmn 0:3d72bef69191 797 *
charlesmn 0:3d72bef69191 798 * @param Dev Device Handle
charlesmn 0:3d72bef69191 799 * @param pRoiConfig Pointer to the Structure containing all the
charlesmn 0:3d72bef69191 800 * ROI to be used.
charlesmn 0:3d72bef69191 801 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 802 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 803 */
charlesmn 0:3d72bef69191 804 VL53L1_Error VL53L1_GetROI(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 805 VL53L1_RoiConfig_t *pRoiConfig);
charlesmn 0:3d72bef69191 806
charlesmn 0:3d72bef69191 807 /** @} VL53L1_ROI_group */
charlesmn 0:3d72bef69191 808
charlesmn 0:3d72bef69191 809 /* \internal */
charlesmn 0:3d72bef69191 810 /** @defgroup VL53L1_sequencestep_group VL53L1 Sequence Step Functions
charlesmn 0:3d72bef69191 811 * @brief Functions used to select Steps done on each ranging
charlesmn 0:3d72bef69191 812 * @{
charlesmn 0:3d72bef69191 813 */
charlesmn 0:3d72bef69191 814
charlesmn 0:3d72bef69191 815 /**
charlesmn 0:3d72bef69191 816 * @brief Gets number of sequence steps managed by the API.
charlesmn 0:3d72bef69191 817 *
charlesmn 0:3d72bef69191 818 * @par Function Description
charlesmn 0:3d72bef69191 819 * This function retrieves the number of sequence steps currently managed
charlesmn 0:3d72bef69191 820 * by the API
charlesmn 0:3d72bef69191 821 *
charlesmn 0:3d72bef69191 822 * @note This function Accesses the device
charlesmn 0:3d72bef69191 823 *
charlesmn 0:3d72bef69191 824 * @param Dev Device Handle
charlesmn 0:3d72bef69191 825 * @param pNumberOfSequenceSteps Out parameter reporting the number of
charlesmn 0:3d72bef69191 826 * sequence steps.
charlesmn 0:3d72bef69191 827 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 828 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 829 */
charlesmn 0:3d72bef69191 830 VL53L1_Error VL53L1_GetNumberOfSequenceSteps(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 831 uint8_t *pNumberOfSequenceSteps);
charlesmn 0:3d72bef69191 832
charlesmn 0:3d72bef69191 833 /**
charlesmn 0:3d72bef69191 834 * @brief Gets the name of a given sequence step.
charlesmn 0:3d72bef69191 835 *
charlesmn 0:3d72bef69191 836 * @par Function Description
charlesmn 0:3d72bef69191 837 * This function retrieves the name of sequence steps corresponding to
charlesmn 0:3d72bef69191 838 * SequenceStepId.
charlesmn 0:3d72bef69191 839 *
charlesmn 0:3d72bef69191 840 * @note This function doesn't Accesses the device
charlesmn 0:3d72bef69191 841 *
charlesmn 0:3d72bef69191 842 * @param SequenceStepId Sequence step identifier.
charlesmn 0:3d72bef69191 843 * @param pSequenceStepsString Pointer to Info string. Shall be
charlesmn 0:3d72bef69191 844 * defined as char buf[VL53L1_MAX_STRING_LENGTH]
charlesmn 0:3d72bef69191 845 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 846 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 847 */
charlesmn 0:3d72bef69191 848 VL53L1_Error VL53L1_GetSequenceStepsInfo(
charlesmn 0:3d72bef69191 849 VL53L1_SequenceStepId SequenceStepId, char *pSequenceStepsString);
charlesmn 0:3d72bef69191 850
charlesmn 0:3d72bef69191 851
charlesmn 0:3d72bef69191 852
charlesmn 0:3d72bef69191 853 /**
charlesmn 0:3d72bef69191 854 * @brief Sets the (on/off) state of a requested sequence step.
charlesmn 0:3d72bef69191 855 *
charlesmn 0:3d72bef69191 856 * @par Function Description
charlesmn 0:3d72bef69191 857 * This function enables/disables a requested sequence step.
charlesmn 0:3d72bef69191 858 *
charlesmn 0:3d72bef69191 859 * @note This function Accesses the device
charlesmn 0:3d72bef69191 860 *
charlesmn 0:3d72bef69191 861 * @param Dev Device Handle
charlesmn 0:3d72bef69191 862 * @param SequenceStepId Sequence step identifier.
charlesmn 0:3d72bef69191 863 * @param SequenceStepEnabled Demanded state {0=Off,1=On}
charlesmn 0:3d72bef69191 864 * is enabled.
charlesmn 0:3d72bef69191 865 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 866 * @return VL53L1_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
charlesmn 0:3d72bef69191 867 * supported.
charlesmn 0:3d72bef69191 868 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 869 */
charlesmn 0:3d72bef69191 870 VL53L1_Error VL53L1_SetSequenceStepEnable(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 871 VL53L1_SequenceStepId SequenceStepId, uint8_t SequenceStepEnabled);
charlesmn 0:3d72bef69191 872
charlesmn 0:3d72bef69191 873 /**
charlesmn 0:3d72bef69191 874 * @brief Gets the (on/off) state of a requested sequence step.
charlesmn 0:3d72bef69191 875 *
charlesmn 0:3d72bef69191 876 * @par Function Description
charlesmn 0:3d72bef69191 877 * This function retrieves the state of a requested sequence step, i.e. on/off.
charlesmn 0:3d72bef69191 878 *
charlesmn 0:3d72bef69191 879 * @note This function Accesses the device
charlesmn 0:3d72bef69191 880 *
charlesmn 0:3d72bef69191 881 * @param Dev Device Handle
charlesmn 0:3d72bef69191 882 * @param SequenceStepId Sequence step identifier.
charlesmn 0:3d72bef69191 883 * @param pSequenceStepEnabled Out parameter reporting if the sequence step
charlesmn 0:3d72bef69191 884 * is enabled {0=Off,1=On}.
charlesmn 0:3d72bef69191 885 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 886 * @return VL53L1_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
charlesmn 0:3d72bef69191 887 * supported.
charlesmn 0:3d72bef69191 888 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 889 */
charlesmn 0:3d72bef69191 890 VL53L1_Error VL53L1_GetSequenceStepEnable(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 891 VL53L1_SequenceStepId SequenceStepId, uint8_t *pSequenceStepEnabled);
charlesmn 0:3d72bef69191 892
charlesmn 0:3d72bef69191 893
charlesmn 0:3d72bef69191 894 /** @} VL53L1_sequencestep_group */
charlesmn 0:3d72bef69191 895 /* \endinternal */
charlesmn 0:3d72bef69191 896
charlesmn 0:3d72bef69191 897
charlesmn 0:3d72bef69191 898
charlesmn 0:3d72bef69191 899 /** @defgroup VL53L1_measurement_group VL53L1 Measurement Functions
charlesmn 0:3d72bef69191 900 * @brief Functions used for the measurements
charlesmn 0:3d72bef69191 901 * @{
charlesmn 0:3d72bef69191 902 */
charlesmn 0:3d72bef69191 903
charlesmn 0:3d72bef69191 904 /**
charlesmn 0:3d72bef69191 905 * @brief Start device measurement
charlesmn 0:3d72bef69191 906 *
charlesmn 0:3d72bef69191 907 * @details Started measurement will depend on preset parameters set through
charlesmn 0:3d72bef69191 908 * @a VL53L1_SetPreseMode()
charlesmn 0:3d72bef69191 909 * This function will change the VL53L1_State from VL53L1_STATE_IDLE to
charlesmn 0:3d72bef69191 910 * VL53L1_STATE_RUNNING.
charlesmn 0:3d72bef69191 911 *
charlesmn 0:3d72bef69191 912 * @note This function Access to the device
charlesmn 0:3d72bef69191 913 *
charlesmn 0:3d72bef69191 914 * @param Dev Device Handle
charlesmn 0:3d72bef69191 915 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 916 * @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when
charlesmn 0:3d72bef69191 917 * PresetMode programmed with @a VL53L1_SetPresetMode
charlesmn 0:3d72bef69191 918 * @return VL53L1_ERROR_TIME_OUT Time out on start measurement
charlesmn 0:3d72bef69191 919 * @return VL53L1_ERROR_INVALID_PARAMS This error might occur in timed mode
charlesmn 0:3d72bef69191 920 * when inter measurement period is smaller or too close to the timing budget.
charlesmn 0:3d72bef69191 921 * In such case measurements are not started and user must correct the timings
charlesmn 0:3d72bef69191 922 * passed to @a VL53L1_SetMeasurementTimingBudgetMicroSeconds() and
charlesmn 0:3d72bef69191 923 * @a VL53L1_SetInterMeasurementPeriodMilliSeconds() functions.
charlesmn 0:3d72bef69191 924 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 925 */
charlesmn 0:3d72bef69191 926 VL53L1_Error VL53L1_StartMeasurement(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 927
charlesmn 0:3d72bef69191 928 /**
charlesmn 0:3d72bef69191 929 * @brief Stop device measurement
charlesmn 0:3d72bef69191 930 *
charlesmn 0:3d72bef69191 931 * @details Will set the device in standby mode at end of current measurement\n
charlesmn 0:3d72bef69191 932 * Not necessary in single mode as device shall return automatically
charlesmn 0:3d72bef69191 933 * in standby mode at end of measurement.
charlesmn 0:3d72bef69191 934 * This function will change the VL53L1_State from VL53L1_STATE_RUNNING
charlesmn 0:3d72bef69191 935 * to VL53L1_STATE_IDLE.
charlesmn 0:3d72bef69191 936 *
charlesmn 0:3d72bef69191 937 * @note This function Access to the device
charlesmn 0:3d72bef69191 938 *
charlesmn 0:3d72bef69191 939 * @param Dev Device Handle
charlesmn 0:3d72bef69191 940 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 941 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 942 */
charlesmn 0:3d72bef69191 943 VL53L1_Error VL53L1_StopMeasurement(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 944
charlesmn 0:3d72bef69191 945 /**
charlesmn 0:3d72bef69191 946 * @brief Clear the Interrupt flag and start new measurement
charlesmn 0:3d72bef69191 947 * *
charlesmn 0:3d72bef69191 948 * @note This function Access to the device
charlesmn 0:3d72bef69191 949 *
charlesmn 0:3d72bef69191 950 * @param Dev Device Handle
charlesmn 0:3d72bef69191 951 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 952 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 953 */
charlesmn 0:3d72bef69191 954 VL53L1_Error VL53L1_ClearInterruptAndStartMeasurement(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 955
charlesmn 0:3d72bef69191 956 /**
charlesmn 0:3d72bef69191 957 * @brief Return Measurement Data Ready
charlesmn 0:3d72bef69191 958 *
charlesmn 0:3d72bef69191 959 * @par Function Description
charlesmn 0:3d72bef69191 960 * This function indicate that a measurement data is ready.
charlesmn 0:3d72bef69191 961 * This function is used for non-blocking capture.
charlesmn 0:3d72bef69191 962 *
charlesmn 0:3d72bef69191 963 * @note This function Access to the device
charlesmn 0:3d72bef69191 964 *
charlesmn 0:3d72bef69191 965 * @param Dev Device Handle
charlesmn 0:3d72bef69191 966 * @param pMeasurementDataReady Pointer to Measurement Data Ready.
charlesmn 0:3d72bef69191 967 * 0 = data not ready, 1 = data ready
charlesmn 0:3d72bef69191 968 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 969 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 970 */
charlesmn 0:3d72bef69191 971 VL53L1_Error VL53L1_GetMeasurementDataReady(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 972 uint8_t *pMeasurementDataReady);
charlesmn 0:3d72bef69191 973
charlesmn 0:3d72bef69191 974 /**
charlesmn 0:3d72bef69191 975 * @brief Wait for measurement data ready.
charlesmn 0:3d72bef69191 976 * Blocking function.
charlesmn 0:3d72bef69191 977 * Note that the timeout is given by:
charlesmn 0:3d72bef69191 978 * VL53L1_RANGE_COMPLETION_POLLING_TIMEOUT_MS defined in def.h
charlesmn 0:3d72bef69191 979 *
charlesmn 0:3d72bef69191 980 *
charlesmn 0:3d72bef69191 981 * @note This function Access to the device
charlesmn 0:3d72bef69191 982 *
charlesmn 0:3d72bef69191 983 * @param Dev Device Handle
charlesmn 0:3d72bef69191 984 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 985 * @return VL53L1_ERROR_TIME_OUT In case of timeout
charlesmn 0:3d72bef69191 986 */
charlesmn 0:3d72bef69191 987 VL53L1_Error VL53L1_WaitMeasurementDataReady(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 988
charlesmn 0:3d72bef69191 989
charlesmn 0:3d72bef69191 990 /**
charlesmn 0:3d72bef69191 991 * @brief Retrieve the measurements from device for a given setup
charlesmn 0:3d72bef69191 992 *
charlesmn 0:3d72bef69191 993 * @par Function Description
charlesmn 0:3d72bef69191 994 * Get data from last successful Ranging measurement
charlesmn 0:3d72bef69191 995 */
charlesmn 0:3d72bef69191 996 /**
charlesmn 0:3d72bef69191 997 * @warning this function will return only the first ROI data and only the
charlesmn 0:3d72bef69191 998 * first object. For multi objects or multi ROI use:
charlesmn 0:3d72bef69191 999 * @a Vl53L1_GetMultiRangingData.
charlesmn 0:3d72bef69191 1000 * In case of RANGING only one output is given, this can
charlesmn 0:3d72bef69191 1001 * be selected with the help of @a VL53L1_SetOutputMode()
charlesmn 0:3d72bef69191 1002 * In case of MULTIZONES_SCANNING and error will be raised because not
charlesmn 0:3d72bef69191 1003 * supported in that function.
charlesmn 0:3d72bef69191 1004 */
charlesmn 0:3d72bef69191 1005 /**
charlesmn 0:3d72bef69191 1006 *
charlesmn 0:3d72bef69191 1007 * @warning USER must call @a VL53L1_ClearInterruptAndStartMeasurement() prior
charlesmn 0:3d72bef69191 1008 * to call again this function
charlesmn 0:3d72bef69191 1009 *
charlesmn 0:3d72bef69191 1010 * @note This function Access to the device
charlesmn 0:3d72bef69191 1011 *
charlesmn 0:3d72bef69191 1012 * @note The first valid value returned by this function will have a range
charlesmn 0:3d72bef69191 1013 * status equal to VL53L1_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK which means that
charlesmn 0:3d72bef69191 1014 * the data is valid but no wrap around check have been done. User should take
charlesmn 0:3d72bef69191 1015 * care about that.
charlesmn 0:3d72bef69191 1016 *
charlesmn 0:3d72bef69191 1017 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1018 * @param pRangingMeasurementData Pointer to the data structure to fill up.
charlesmn 0:3d72bef69191 1019 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1020 * @return VL53L1_ERROR_MODE_NOT_SUPPORTED in case of MULTIZONES_SCANNING
charlesmn 0:3d72bef69191 1021 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1022 */
charlesmn 0:3d72bef69191 1023 VL53L1_Error VL53L1_GetRangingMeasurementData(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1024 VL53L1_RangingMeasurementData_t *pRangingMeasurementData);
charlesmn 0:3d72bef69191 1025
charlesmn 0:3d72bef69191 1026 /**
charlesmn 0:3d72bef69191 1027 * @brief Retrieve all ROI's measurements from device for a given setup
charlesmn 0:3d72bef69191 1028 *
charlesmn 0:3d72bef69191 1029 * @par Function Description
charlesmn 0:3d72bef69191 1030 * Get data from last successful Ranging measurement
charlesmn 0:3d72bef69191 1031 * @warning USER should take care about @a VL53L1_GetNumberOfROI()
charlesmn 0:3d72bef69191 1032 * before get data.
charlesmn 0:3d72bef69191 1033 * Bare driver will fill a NumberOfROI times the corresponding data
charlesmn 0:3d72bef69191 1034 * structure used in the measurement function.
charlesmn 0:3d72bef69191 1035 *
charlesmn 0:3d72bef69191 1036 * @warning USER must call @a VL53L1_ClearInterruptAndStartMeasurement() prior
charlesmn 0:3d72bef69191 1037 * to call again this function
charlesmn 0:3d72bef69191 1038 *
charlesmn 0:3d72bef69191 1039 * @note This function Access to the device
charlesmn 0:3d72bef69191 1040 *
charlesmn 0:3d72bef69191 1041 * @note The first valid value returned by this function will have a range
charlesmn 0:3d72bef69191 1042 * status equal to VL53L1_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK which means that
charlesmn 0:3d72bef69191 1043 * the data is valid but no wrap around check have been done. User should take
charlesmn 0:3d72bef69191 1044 * care about that.
charlesmn 0:3d72bef69191 1045 *
charlesmn 0:3d72bef69191 1046 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1047 * @param pMultiRangingData Pointer to the data structure to fill up.
charlesmn 0:3d72bef69191 1048 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1049 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1050 */
charlesmn 0:3d72bef69191 1051 VL53L1_Error VL53L1_GetMultiRangingData(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1052 VL53L1_MultiRangingData_t *pMultiRangingData);
charlesmn 0:3d72bef69191 1053
charlesmn 0:3d72bef69191 1054 /**
charlesmn 0:3d72bef69191 1055 * @brief Get Additional Data
charlesmn 0:3d72bef69191 1056 *
charlesmn 0:3d72bef69191 1057 * @par Function Description
charlesmn 0:3d72bef69191 1058 * This function is used to get lld debugging data on the last histogram
charlesmn 0:3d72bef69191 1059 * measurement. shall be called when a new measurement is ready (interrupt or
charlesmn 0:3d72bef69191 1060 * positive VL53L1_GetMeasurementDataReady() polling) and before a call to
charlesmn 0:3d72bef69191 1061 * VL53L1_ClearInterruptAndStartMeasurement(). Depending on the PresetMode
charlesmn 0:3d72bef69191 1062 * currently set parts of the returned data structure may be not relevant.
charlesmn 0:3d72bef69191 1063 *
charlesmn 0:3d72bef69191 1064 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1065 * @param pAdditionalData Pointer to Additional data
charlesmn 0:3d72bef69191 1066 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1067 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1068 */
charlesmn 0:3d72bef69191 1069 VL53L1_Error VL53L1_GetAdditionalData(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1070 VL53L1_AdditionalData_t *pAdditionalData);
charlesmn 0:3d72bef69191 1071
charlesmn 0:3d72bef69191 1072
charlesmn 0:3d72bef69191 1073 /** @} VL53L1_measurement_group */
charlesmn 0:3d72bef69191 1074
charlesmn 0:3d72bef69191 1075 /** @defgroup VL53L1_Calibration_group VL53L1 Calibration Functions
charlesmn 0:3d72bef69191 1076 * @brief Functions used for Calibration
charlesmn 0:3d72bef69191 1077 * @{
charlesmn 0:3d72bef69191 1078 */
charlesmn 0:3d72bef69191 1079
charlesmn 0:3d72bef69191 1080
charlesmn 0:3d72bef69191 1081 /**
charlesmn 0:3d72bef69191 1082 * @brief Set Tuning Parameter value for a given parameter ID
charlesmn 0:3d72bef69191 1083 *
charlesmn 0:3d72bef69191 1084 * @par Function Description
charlesmn 0:3d72bef69191 1085 * This function is used to improve the performance of the device. It permit to
charlesmn 0:3d72bef69191 1086 * change a particular value used for a timeout or a threshold or a constant
charlesmn 0:3d72bef69191 1087 * in an algorithm. The function will change the value of the parameter
charlesmn 0:3d72bef69191 1088 * identified by an unique ID.
charlesmn 0:3d72bef69191 1089 *
charlesmn 0:3d72bef69191 1090 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 1091 *
charlesmn 0:3d72bef69191 1092 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1093 * @param TuningParameterId Tuning Parameter ID
charlesmn 0:3d72bef69191 1094 * @param TuningParameterValue Tuning Parameter Value
charlesmn 0:3d72bef69191 1095 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1096 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1097 */
charlesmn 0:3d72bef69191 1098 VL53L1_Error VL53L1_SetTuningParameter(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1099 uint16_t TuningParameterId, int32_t TuningParameterValue);
charlesmn 0:3d72bef69191 1100
charlesmn 0:3d72bef69191 1101 /**
charlesmn 0:3d72bef69191 1102 * @brief Get Tuning Parameter value for a given parameter ID
charlesmn 0:3d72bef69191 1103 *
charlesmn 0:3d72bef69191 1104 * @par Function Description
charlesmn 0:3d72bef69191 1105 * This function is used to get the value of the parameter
charlesmn 0:3d72bef69191 1106 * identified by an unique ID.
charlesmn 0:3d72bef69191 1107 *
charlesmn 0:3d72bef69191 1108 * @note This function doesn't Access to the device
charlesmn 0:3d72bef69191 1109 *
charlesmn 0:3d72bef69191 1110 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1111 * @param TuningParameterId Tuning Parameter ID
charlesmn 0:3d72bef69191 1112 * @param pTuningParameterValue Pointer to Tuning Parameter Value
charlesmn 0:3d72bef69191 1113 * for a given TuningParameterId.
charlesmn 0:3d72bef69191 1114 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1115 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1116 */
charlesmn 0:3d72bef69191 1117 VL53L1_Error VL53L1_GetTuningParameter(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1118 uint16_t TuningParameterId, int32_t *pTuningParameterValue);
charlesmn 0:3d72bef69191 1119
charlesmn 0:3d72bef69191 1120 /**
charlesmn 0:3d72bef69191 1121 * @brief Performs Reference Spad Management
charlesmn 0:3d72bef69191 1122 *
charlesmn 0:3d72bef69191 1123 * @par Function Description
charlesmn 0:3d72bef69191 1124 * The reference SPAD initialization procedure determines the minimum amount
charlesmn 0:3d72bef69191 1125 * of reference spads to be enables to achieve a target reference signal rate
charlesmn 0:3d72bef69191 1126 * and should be performed once during initialization.
charlesmn 0:3d72bef69191 1127 *
charlesmn 0:3d72bef69191 1128 * @note This function Access to the device
charlesmn 0:3d72bef69191 1129 *
charlesmn 0:3d72bef69191 1130 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1131 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1132 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1133 */
charlesmn 0:3d72bef69191 1134 VL53L1_Error VL53L1_PerformRefSpadManagement(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 1135
charlesmn 0:3d72bef69191 1136 /**
charlesmn 0:3d72bef69191 1137 * @brief Enable/Disable dynamic Xtalk compensation feature
charlesmn 0:3d72bef69191 1138 *
charlesmn 0:3d72bef69191 1139 * Enable/Disable dynamic Xtalk compensation (aka smudge correction).
charlesmn 0:3d72bef69191 1140 *
charlesmn 0:3d72bef69191 1141 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1142 * @param Mode Set the smudge correction mode
charlesmn 0:3d72bef69191 1143 * See ::VL53L1_SmudgeCorrectionModes
charlesmn 0:3d72bef69191 1144 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1145 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1146 */
charlesmn 0:3d72bef69191 1147 VL53L1_Error VL53L1_SmudgeCorrectionEnable(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1148 VL53L1_SmudgeCorrectionModes Mode);
charlesmn 0:3d72bef69191 1149
charlesmn 0:3d72bef69191 1150 /**
charlesmn 0:3d72bef69191 1151 * @brief Enable/Disable Cross talk compensation feature
charlesmn 0:3d72bef69191 1152 *
charlesmn 0:3d72bef69191 1153 * Enable/Disable Cross Talk correction.
charlesmn 0:3d72bef69191 1154 *
charlesmn 0:3d72bef69191 1155 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1156 * @param XTalkCompensationEnable Cross talk compensation
charlesmn 0:3d72bef69191 1157 * to be set 0 = disabled or 1 = enabled.
charlesmn 0:3d72bef69191 1158 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1159 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1160 */
charlesmn 0:3d72bef69191 1161 VL53L1_Error VL53L1_SetXTalkCompensationEnable(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1162 uint8_t XTalkCompensationEnable);
charlesmn 0:3d72bef69191 1163
charlesmn 0:3d72bef69191 1164 /**
charlesmn 0:3d72bef69191 1165 * @brief Get Cross talk compensation rate enable
charlesmn 0:3d72bef69191 1166 *
charlesmn 0:3d72bef69191 1167 * Get if the Cross Talk is Enabled or Disabled.
charlesmn 0:3d72bef69191 1168 *
charlesmn 0:3d72bef69191 1169 * @note This function doesn't access to the device
charlesmn 0:3d72bef69191 1170 *
charlesmn 0:3d72bef69191 1171 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1172 * @param pXTalkCompensationEnable Pointer to the Cross talk compensation
charlesmn 0:3d72bef69191 1173 * state 0=disabled or 1 = enabled
charlesmn 0:3d72bef69191 1174 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1175 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1176 */
charlesmn 0:3d72bef69191 1177 VL53L1_Error VL53L1_GetXTalkCompensationEnable(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1178 uint8_t *pXTalkCompensationEnable);
charlesmn 0:3d72bef69191 1179
charlesmn 0:3d72bef69191 1180
charlesmn 0:3d72bef69191 1181 /**
charlesmn 0:3d72bef69191 1182 * @brief Perform XTalk Calibration
charlesmn 0:3d72bef69191 1183 *
charlesmn 0:3d72bef69191 1184 * @details Perform a XTalk calibration of the Device.
charlesmn 0:3d72bef69191 1185 * This function will launch a ranging measurement, if interrupts
charlesmn 0:3d72bef69191 1186 * are enabled an interrupt will be done.
charlesmn 0:3d72bef69191 1187 * This function will clear the interrupt generated automatically.
charlesmn 0:3d72bef69191 1188 * This function will program a new value for the XTalk compensation
charlesmn 0:3d72bef69191 1189 * and it will enable the cross talk before exit.
charlesmn 0:3d72bef69191 1190 *
charlesmn 0:3d72bef69191 1191 * @warning This function is a blocking function
charlesmn 0:3d72bef69191 1192 *
charlesmn 0:3d72bef69191 1193 * @note This function Access to the device
charlesmn 0:3d72bef69191 1194 *
charlesmn 0:3d72bef69191 1195 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1196 * @param CalibrationOption Select the Calibration to be run :
charlesmn 0:3d72bef69191 1197 * @param CalibrationOption
charlesmn 0:3d72bef69191 1198 * @li VL53L1_XTALKCALIBRATIONMODE_SINGLE_TARGET the calibration uses current
charlesmn 0:3d72bef69191 1199 * preset and distance mode without altering them.<br>
charlesmn 0:3d72bef69191 1200 * User must call @a VL53L1_SetPresetMode() with VL53L1_PRESETMODE_AUTONOMOUS,
charlesmn 0:3d72bef69191 1201 * VL53L1_PRESETMODE_LITE_RANGING or VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS
charlesmn 0:3d72bef69191 1202 * parameter prior to launch calibration
charlesmn 0:3d72bef69191 1203 * @li VL53L1_XTALKCALIBRATIONMODE_NO_TARGET the calibration sets appropriate
charlesmn 0:3d72bef69191 1204 * preset and distance mode and thus override existing ones<br>
charlesmn 0:3d72bef69191 1205 * User must call @a VL53L1_SetPresetMode() again after calibration to set the
charlesmn 0:3d72bef69191 1206 * desired one. during this calibration mode no object must be put below a 80cm
charlesmn 0:3d72bef69191 1207 * distance from the target
charlesmn 0:3d72bef69191 1208 * @li VL53L1_XTALKCALIBRATIONMODE_FULL_ROI the calibration sets appropriate
charlesmn 0:3d72bef69191 1209 * preset and distance mode and thus override existing ones<br>
charlesmn 0:3d72bef69191 1210 * User must call @a VL53L1_SetPresetMode() again after calibration to set the
charlesmn 0:3d72bef69191 1211 * desired one.
charlesmn 0:3d72bef69191 1212 * The ROI settings must define a single 16x16 ROI before to launch this
charlesmn 0:3d72bef69191 1213 * function.
charlesmn 0:3d72bef69191 1214 * The calibration uses a target which should be located at least @60cm from the
charlesmn 0:3d72bef69191 1215 * device. The actual location of the target shall be passed
charlesmn 0:3d72bef69191 1216 * through the bare driver tuning parameters table
charlesmn 0:3d72bef69191 1217 *
charlesmn 0:3d72bef69191 1218 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1219 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1220 */
charlesmn 0:3d72bef69191 1221 VL53L1_Error VL53L1_PerformXTalkCalibration(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1222 uint8_t CalibrationOption);
charlesmn 0:3d72bef69191 1223
charlesmn 0:3d72bef69191 1224 /**
charlesmn 0:3d72bef69191 1225 * @brief Define the mode to be used for the offset calibration
charlesmn 0:3d72bef69191 1226 *
charlesmn 0:3d72bef69191 1227 * Define the mode to be used for the offset calibration. This function should
charlesmn 0:3d72bef69191 1228 * be called before run the @a VL53L1_PerformOffsetCalibration()
charlesmn 0:3d72bef69191 1229 *
charlesmn 0:3d72bef69191 1230 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1231 * @param OffsetCalibrationMode Offset Calibration Mode valid values are:
charlesmn 0:3d72bef69191 1232 * @li VL53L1_OFFSETCALIBRATIONMODE_STANDARD
charlesmn 0:3d72bef69191 1233 * @li VL53L1_OFFSETCALIBRATIONMODE_PRERANGE_ONLY
charlesmn 0:3d72bef69191 1234 * @li VL53L1_OFFSETCALIBRATIONMODE_MULTI_ZONE
charlesmn 0:3d72bef69191 1235 *
charlesmn 0:3d72bef69191 1236 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1237 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1238 */
charlesmn 0:3d72bef69191 1239 VL53L1_Error VL53L1_SetOffsetCalibrationMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1240 VL53L1_OffsetCalibrationModes OffsetCalibrationMode);
charlesmn 0:3d72bef69191 1241
charlesmn 0:3d72bef69191 1242 /**
charlesmn 0:3d72bef69191 1243 * @brief Define the mode to be used for the offset correction
charlesmn 0:3d72bef69191 1244 *
charlesmn 0:3d72bef69191 1245 * Define the mode to be used for the offset correction.
charlesmn 0:3d72bef69191 1246 *
charlesmn 0:3d72bef69191 1247 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1248 * @param OffsetCorrectionMode Offset Correction Mode valid values are:
charlesmn 0:3d72bef69191 1249 * @li VL53L1_OFFSETCORRECTIONMODE_STANDARD
charlesmn 0:3d72bef69191 1250 * @li VL53L1_OFFSETCORRECTIONMODE_PERZONE
charlesmn 0:3d72bef69191 1251 * @li VL53L1_OFFSETCORRECTIONMODE_PERVCSEL
charlesmn 0:3d72bef69191 1252 *
charlesmn 0:3d72bef69191 1253 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1254 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1255 */
charlesmn 0:3d72bef69191 1256 VL53L1_Error VL53L1_SetOffsetCorrectionMode(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1257 VL53L1_OffsetCorrectionModes OffsetCorrectionMode);
charlesmn 0:3d72bef69191 1258
charlesmn 0:3d72bef69191 1259
charlesmn 0:3d72bef69191 1260 /**
charlesmn 0:3d72bef69191 1261 * @brief Perform Offset Calibration
charlesmn 0:3d72bef69191 1262 *
charlesmn 0:3d72bef69191 1263 * @details Perform a Offset calibration of the Device.
charlesmn 0:3d72bef69191 1264 * This function will launch a ranging measurement, if interrupts are
charlesmn 0:3d72bef69191 1265 * enabled interrupts will be done.
charlesmn 0:3d72bef69191 1266 * This function will program a new value for the Offset calibration value
charlesmn 0:3d72bef69191 1267 *
charlesmn 0:3d72bef69191 1268 * @warning This function is a blocking function
charlesmn 0:3d72bef69191 1269 *
charlesmn 0:3d72bef69191 1270 * @note This function Access to the device
charlesmn 0:3d72bef69191 1271 *
charlesmn 0:3d72bef69191 1272 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1273 * @param CalDistanceMilliMeter Calibration distance value used for the
charlesmn 0:3d72bef69191 1274 * offset compensation.
charlesmn 0:3d72bef69191 1275 * @param CalReflectancePercent Calibration Target reflectance @ 940nm
charlesmn 0:3d72bef69191 1276 * in percentage.
charlesmn 0:3d72bef69191 1277 *
charlesmn 0:3d72bef69191 1278 * @return VL53L1_ERROR_NONE
charlesmn 0:3d72bef69191 1279 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1280 */
charlesmn 0:3d72bef69191 1281 VL53L1_Error VL53L1_PerformOffsetCalibration(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1282 int32_t CalDistanceMilliMeter,
charlesmn 0:3d72bef69191 1283 FixPoint1616_t CalReflectancePercent);
charlesmn 0:3d72bef69191 1284
charlesmn 0:3d72bef69191 1285 /**
charlesmn 0:3d72bef69191 1286 * @brief Perform Offset simple Calibration
charlesmn 0:3d72bef69191 1287 *
charlesmn 0:3d72bef69191 1288 * @details Perform a very simple offset calibration of the Device.
charlesmn 0:3d72bef69191 1289 * This function will launch few ranging measurements and computes offset
charlesmn 0:3d72bef69191 1290 * calibration. The preset mode and the distance mode MUST be set by the
charlesmn 0:3d72bef69191 1291 * application before to call this function.
charlesmn 0:3d72bef69191 1292 *
charlesmn 0:3d72bef69191 1293 * @warning This function is a blocking function
charlesmn 0:3d72bef69191 1294 *
charlesmn 0:3d72bef69191 1295 * @note This function Access to the device
charlesmn 0:3d72bef69191 1296 *
charlesmn 0:3d72bef69191 1297 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1298 * @param CalDistanceMilliMeter Calibration distance value used for the
charlesmn 0:3d72bef69191 1299 * offset compensation.
charlesmn 0:3d72bef69191 1300 *
charlesmn 0:3d72bef69191 1301 * @return VL53L1_ERROR_NONE
charlesmn 0:3d72bef69191 1302 * @return VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by
charlesmn 0:3d72bef69191 1303 * lack of valid measurements
charlesmn 0:3d72bef69191 1304 * @return VL53L1_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target
charlesmn 0:3d72bef69191 1305 * distance combined to the number of loops performed in the calibration lead to
charlesmn 0:3d72bef69191 1306 * an internal overflow. Try to reduce the distance of the target (140 mm)
charlesmn 0:3d72bef69191 1307 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1308 */
charlesmn 0:3d72bef69191 1309 VL53L1_Error VL53L1_PerformOffsetSimpleCalibration(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1310 int32_t CalDistanceMilliMeter);
charlesmn 0:3d72bef69191 1311
charlesmn 0:3d72bef69191 1312 /**
charlesmn 0:3d72bef69191 1313 * @brief Perform Offset simple Calibration with a "zero distance" target
charlesmn 0:3d72bef69191 1314 *
charlesmn 0:3d72bef69191 1315 * @details Perform a simple offset calibration of the Device.
charlesmn 0:3d72bef69191 1316 * This function will launch few ranging measurements and computes offset
charlesmn 0:3d72bef69191 1317 * calibration. The preset mode and the distance mode MUST be set by the
charlesmn 0:3d72bef69191 1318 * application before to call this function.
charlesmn 0:3d72bef69191 1319 * A target must be place very close to the device.
charlesmn 0:3d72bef69191 1320 * Ideally the target shall be touching the coverglass.
charlesmn 0:3d72bef69191 1321 *
charlesmn 0:3d72bef69191 1322 * @warning This function is a blocking function
charlesmn 0:3d72bef69191 1323 *
charlesmn 0:3d72bef69191 1324 * @note This function Access to the device
charlesmn 0:3d72bef69191 1325 *
charlesmn 0:3d72bef69191 1326 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1327 *
charlesmn 0:3d72bef69191 1328 * @return VL53L1_ERROR_NONE
charlesmn 0:3d72bef69191 1329 * @return VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by
charlesmn 0:3d72bef69191 1330 * lack of valid measurements
charlesmn 0:3d72bef69191 1331 * @return VL53L1_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target
charlesmn 0:3d72bef69191 1332 * distance is too large, try to put the target closer to the device
charlesmn 0:3d72bef69191 1333 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1334 */
charlesmn 0:3d72bef69191 1335 VL53L1_Error VL53L1_PerformOffsetZeroDistanceCalibration(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 1336
charlesmn 0:3d72bef69191 1337 /**
charlesmn 0:3d72bef69191 1338 * @brief Perform Offset per Vcsel Calibration. i.e. per distance mode
charlesmn 0:3d72bef69191 1339 *
charlesmn 0:3d72bef69191 1340 * @details Perform offset calibration of the Device depending on the
charlesmn 0:3d72bef69191 1341 * three distance mode settings: short, medium and long.
charlesmn 0:3d72bef69191 1342 * This function will launch few ranging measurements and computes offset
charlesmn 0:3d72bef69191 1343 * calibration in each of the three distance modes.
charlesmn 0:3d72bef69191 1344 * The preset mode MUST be set by the application before to call this function.
charlesmn 0:3d72bef69191 1345 *
charlesmn 0:3d72bef69191 1346 * @warning This function is a blocking function
charlesmn 0:3d72bef69191 1347 *
charlesmn 0:3d72bef69191 1348 * @note This function Access to the device
charlesmn 0:3d72bef69191 1349 *
charlesmn 0:3d72bef69191 1350 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1351 * @param CalDistanceMilliMeter Distance of the target used for the
charlesmn 0:3d72bef69191 1352 * offset compensation calibration.
charlesmn 0:3d72bef69191 1353 *
charlesmn 0:3d72bef69191 1354 * @return VL53L1_ERROR_NONE
charlesmn 0:3d72bef69191 1355 * @return VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by
charlesmn 0:3d72bef69191 1356 * lack of valid measurements
charlesmn 0:3d72bef69191 1357 * @return VL53L1_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target
charlesmn 0:3d72bef69191 1358 * distance combined to the number of loops performed in the calibration lead to
charlesmn 0:3d72bef69191 1359 * an internal overflow. Try to reduce the distance of the target (140 mm)
charlesmn 0:3d72bef69191 1360 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1361 */
charlesmn 0:3d72bef69191 1362 VL53L1_Error VL53L1_PerformOffsetPerVcselCalibration(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1363 int32_t CalDistanceMilliMeter);
charlesmn 0:3d72bef69191 1364 /**
charlesmn 0:3d72bef69191 1365 * @brief Sets the Calibration Data.
charlesmn 0:3d72bef69191 1366 *
charlesmn 0:3d72bef69191 1367 * @par Function Description
charlesmn 0:3d72bef69191 1368 * This function set all the Calibration Data issued from the functions
charlesmn 0:3d72bef69191 1369 * @a VL53L1_PerformRefSpadManagement(), @a VL53L1_PerformXTalkCalibration,
charlesmn 0:3d72bef69191 1370 * @a VL53L1_PerformOffsetCalibration()
charlesmn 0:3d72bef69191 1371 *
charlesmn 0:3d72bef69191 1372 * @note This function doesn't Accesses the device
charlesmn 0:3d72bef69191 1373 *
charlesmn 0:3d72bef69191 1374 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1375 * @param *pCalibrationData Pointer to Calibration data to be set.
charlesmn 0:3d72bef69191 1376 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1377 * @return VL53L1_ERROR_INVALID_PARAMS pCalibrationData points to an older
charlesmn 0:3d72bef69191 1378 * version of the inner structure. Need for support to convert its content.
charlesmn 0:3d72bef69191 1379 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1380 */
charlesmn 0:3d72bef69191 1381 VL53L1_Error VL53L1_SetCalibrationData(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1382 VL53L1_CalibrationData_t *pCalibrationData);
charlesmn 0:3d72bef69191 1383
charlesmn 0:3d72bef69191 1384 /**
charlesmn 0:3d72bef69191 1385 * @brief Gets the Calibration Data.
charlesmn 0:3d72bef69191 1386 *
charlesmn 0:3d72bef69191 1387 * @par Function Description
charlesmn 0:3d72bef69191 1388 * This function get all the Calibration Data issued from the functions
charlesmn 0:3d72bef69191 1389 * @a VL53L1_PerformRefSpadManagement(), @a VL53L1_PerformXTalkCalibration,
charlesmn 0:3d72bef69191 1390 * @a VL53L1_PerformOffsetCalibration()
charlesmn 0:3d72bef69191 1391 *
charlesmn 0:3d72bef69191 1392 * @note This function doesn't Accesses the device
charlesmn 0:3d72bef69191 1393 *
charlesmn 0:3d72bef69191 1394 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1395 * @param *pCalibrationData pointer where to store Calibration
charlesmn 0:3d72bef69191 1396 * data.
charlesmn 0:3d72bef69191 1397 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1398 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1399 */
charlesmn 0:3d72bef69191 1400 VL53L1_Error VL53L1_GetCalibrationData(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1401 VL53L1_CalibrationData_t *pCalibrationData);
charlesmn 0:3d72bef69191 1402
charlesmn 0:3d72bef69191 1403 /**
charlesmn 0:3d72bef69191 1404 * @brief Sets the Zone Calibration Data.
charlesmn 0:3d72bef69191 1405 *
charlesmn 0:3d72bef69191 1406 * @par Function Description
charlesmn 0:3d72bef69191 1407 * This function set all the Zone nCalibration Data issued from the functions
charlesmn 0:3d72bef69191 1408 * @a VL53L1_PerformOffsetCalibration() in multi zone
charlesmn 0:3d72bef69191 1409 *
charlesmn 0:3d72bef69191 1410 * @note This function doesn't Accesses the device
charlesmn 0:3d72bef69191 1411 *
charlesmn 0:3d72bef69191 1412 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1413 * @param *pZoneCalibrationData Pointer to Zone Calibration data to be
charlesmn 0:3d72bef69191 1414 * set.
charlesmn 0:3d72bef69191 1415 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1416 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1417 */
charlesmn 0:3d72bef69191 1418 VL53L1_Error VL53L1_SetZoneCalibrationData(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1419 VL53L1_ZoneCalibrationData_t *pZoneCalibrationData);
charlesmn 0:3d72bef69191 1420
charlesmn 0:3d72bef69191 1421 /**
charlesmn 0:3d72bef69191 1422 * @brief Gets the Zone Calibration Data.
charlesmn 0:3d72bef69191 1423 *
charlesmn 0:3d72bef69191 1424 * @par Function Description
charlesmn 0:3d72bef69191 1425 * This function get all the Zone Calibration Data issued from the functions
charlesmn 0:3d72bef69191 1426 * @a VL53L1_PerformOffsetCalibration()
charlesmn 0:3d72bef69191 1427 *
charlesmn 0:3d72bef69191 1428 * @note This function doesn't Accesses the device
charlesmn 0:3d72bef69191 1429 *
charlesmn 0:3d72bef69191 1430 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1431 * @param *pZoneCalibrationData pointer where to store Zone Calibration
charlesmn 0:3d72bef69191 1432 * data.
charlesmn 0:3d72bef69191 1433 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1434 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1435 */
charlesmn 0:3d72bef69191 1436 VL53L1_Error VL53L1_GetZoneCalibrationData(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1437 VL53L1_ZoneCalibrationData_t *pZoneCalibrationData);
charlesmn 0:3d72bef69191 1438 /**
charlesmn 0:3d72bef69191 1439 * @brief Gets the optical center.
charlesmn 0:3d72bef69191 1440 *
charlesmn 0:3d72bef69191 1441 * @par Function Description
charlesmn 0:3d72bef69191 1442 * This function get the optical center issued from the nvm set at FTM stage
charlesmn 0:3d72bef69191 1443 * expressed in the same coordinate system as the ROI are
charlesmn 0:3d72bef69191 1444 *
charlesmn 0:3d72bef69191 1445 * @note This function doesn't Accesses the device
charlesmn 0:3d72bef69191 1446 *
charlesmn 0:3d72bef69191 1447 * @param Dev Device Handle
charlesmn 0:3d72bef69191 1448 * @param pOpticalCenterX pointer to the X position of center
charlesmn 0:3d72bef69191 1449 * in 16.16 fix point
charlesmn 0:3d72bef69191 1450 * @param pOpticalCenterY pointer to the Y position of center
charlesmn 0:3d72bef69191 1451 * in 16.16 fix point
charlesmn 0:3d72bef69191 1452 * @return VL53L1_ERROR_NONE Success
charlesmn 0:3d72bef69191 1453 * @return "Other error code" See ::VL53L1_Error
charlesmn 0:3d72bef69191 1454 */
charlesmn 0:3d72bef69191 1455 VL53L1_Error VL53L1_GetOpticalCenter(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1456 FixPoint1616_t *pOpticalCenterX,
charlesmn 0:3d72bef69191 1457 FixPoint1616_t *pOpticalCenterY);
charlesmn 0:3d72bef69191 1458
charlesmn 0:3d72bef69191 1459 /** @} VL53L1_Calibration_group */
charlesmn 0:3d72bef69191 1460
charlesmn 0:3d72bef69191 1461 /** @defgroup VL53L1_Thresholds_group VL53L1 IRQ Triggered events Functions
charlesmn 0:3d72bef69191 1462 * @brief Functions used to configure interrupt to be triggered only when
charlesmn 0:3d72bef69191 1463 * a measurement satisfies some thresholds parameters
charlesmn 0:3d72bef69191 1464 * @{
charlesmn 0:3d72bef69191 1465 */
charlesmn 0:3d72bef69191 1466
charlesmn 0:3d72bef69191 1467 /**
charlesmn 0:3d72bef69191 1468 * @brief Configure the interrupt config, from the given structure
charlesmn 0:3d72bef69191 1469 *
charlesmn 0:3d72bef69191 1470 * @param[in] Dev : Device Handle
charlesmn 0:3d72bef69191 1471 * @param[in] pConfig : pointer to configuration structure
charlesmn 0:3d72bef69191 1472 */
charlesmn 0:3d72bef69191 1473
charlesmn 0:3d72bef69191 1474 VL53L1_Error VL53L1_SetThresholdConfig(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1475 VL53L1_DetectionConfig_t *pConfig);
charlesmn 0:3d72bef69191 1476
charlesmn 0:3d72bef69191 1477 /**
charlesmn 0:3d72bef69191 1478 * @brief Retrieves the interrupt config structure currently programmed
charlesmn 0:3d72bef69191 1479 * into the API
charlesmn 0:3d72bef69191 1480 *
charlesmn 0:3d72bef69191 1481 * @param[in] Dev : Device Handle
charlesmn 0:3d72bef69191 1482 * @param[out] pConfig : pointer to configuration structure
charlesmn 0:3d72bef69191 1483 */
charlesmn 0:3d72bef69191 1484
charlesmn 0:3d72bef69191 1485 VL53L1_Error VL53L1_GetThresholdConfig(VL53L1_DEV Dev,
charlesmn 0:3d72bef69191 1486 VL53L1_DetectionConfig_t *pConfig);
charlesmn 0:3d72bef69191 1487
charlesmn 0:3d72bef69191 1488 /******/
charlesmn 0:3d72bef69191 1489 VL53L1_Error SingleTargetXTalkCalibration(VL53L1_DEV Dev);
charlesmn 0:3d72bef69191 1490
charlesmn 0:3d72bef69191 1491
charlesmn 0:3d72bef69191 1492
charlesmn 0:3d72bef69191 1493 /** @} VL53L1_Thresholds_group */
charlesmn 0:3d72bef69191 1494
charlesmn 0:3d72bef69191 1495
charlesmn 0:3d72bef69191 1496 /** @} VL53L1_cut11_group */
charlesmn 0:3d72bef69191 1497
charlesmn 0:3d72bef69191 1498 #ifdef __cplusplus
charlesmn 0:3d72bef69191 1499 }
charlesmn 0:3d72bef69191 1500 #endif
charlesmn 0:3d72bef69191 1501
charlesmn 0:3d72bef69191 1502 #endif /* _VL53L1_API_H_ */
charlesmn 0:3d72bef69191 1503