Rename library
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: VL53L3CX_NoShield_1Sensor_poll_Mb06x VL53L3_NoShield_1Sensor_polling_Mb63 X_NUCLEO_53L3A2 53L3A2_Ranging
modules/vl53lx_api.h@7:7f1bbf370283, 2021-07-21 (annotated)
- Committer:
- charlesmn
- Date:
- Wed Jul 21 14:07:59 2021 +0000
- Revision:
- 7:7f1bbf370283
- Parent:
- 5:89031b2f5316
Moved vl53l3cx_class.cpp and .h to 53l3a2_RangingClass
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Charles MacNeill |
5:89031b2f5316 | 1 | |
Charles MacNeill |
5:89031b2f5316 | 2 | /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ |
Charles MacNeill |
5:89031b2f5316 | 3 | /****************************************************************************** |
Charles MacNeill |
5:89031b2f5316 | 4 | * Copyright (c) 2020, STMicroelectronics - All Rights Reserved |
Charles MacNeill |
5:89031b2f5316 | 5 | |
Charles MacNeill |
5:89031b2f5316 | 6 | This file is part of VL53LX and is dual licensed, |
Charles MacNeill |
5:89031b2f5316 | 7 | either GPL-2.0+ |
Charles MacNeill |
5:89031b2f5316 | 8 | or 'BSD 3-clause "New" or "Revised" License' , at your option. |
Charles MacNeill |
5:89031b2f5316 | 9 | ****************************************************************************** |
Charles MacNeill |
5:89031b2f5316 | 10 | */ |
Charles MacNeill |
5:89031b2f5316 | 11 | |
Charles MacNeill |
5:89031b2f5316 | 12 | #ifndef _VL53LX_API_H_ |
Charles MacNeill |
5:89031b2f5316 | 13 | #define _VL53LX_API_H_ |
Charles MacNeill |
5:89031b2f5316 | 14 | |
Charles MacNeill |
5:89031b2f5316 | 15 | #include "vl53lx_api_core.h" |
Charles MacNeill |
5:89031b2f5316 | 16 | #include "vl53lx_preset_setup.h" |
Charles MacNeill |
5:89031b2f5316 | 17 | |
Charles MacNeill |
5:89031b2f5316 | 18 | #ifdef __cplusplus |
Charles MacNeill |
5:89031b2f5316 | 19 | extern "C" |
Charles MacNeill |
5:89031b2f5316 | 20 | { |
Charles MacNeill |
5:89031b2f5316 | 21 | #endif |
Charles MacNeill |
5:89031b2f5316 | 22 | |
Charles MacNeill |
5:89031b2f5316 | 23 | /** @defgroup VL53LX_group VL53LX Function Definition |
Charles MacNeill |
5:89031b2f5316 | 24 | * @brief VL53LX Function Definition |
Charles MacNeill |
5:89031b2f5316 | 25 | * @{ |
Charles MacNeill |
5:89031b2f5316 | 26 | */ |
Charles MacNeill |
5:89031b2f5316 | 27 | |
Charles MacNeill |
5:89031b2f5316 | 28 | /** @defgroup VL53LX_general_group VL53LX General Functions |
Charles MacNeill |
5:89031b2f5316 | 29 | * @brief General functions and definitions |
Charles MacNeill |
5:89031b2f5316 | 30 | * @{ |
Charles MacNeill |
5:89031b2f5316 | 31 | */ |
Charles MacNeill |
5:89031b2f5316 | 32 | |
Charles MacNeill |
5:89031b2f5316 | 33 | /** |
Charles MacNeill |
5:89031b2f5316 | 34 | * @brief Return the VL53LX driver Version |
Charles MacNeill |
5:89031b2f5316 | 35 | * |
Charles MacNeill |
5:89031b2f5316 | 36 | * @note This function doesn't access to the device |
Charles MacNeill |
5:89031b2f5316 | 37 | * |
Charles MacNeill |
5:89031b2f5316 | 38 | * @param pVersion Rer to current driver Version |
Charles MacNeill |
5:89031b2f5316 | 39 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 40 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 41 | */ |
Charles MacNeill |
5:89031b2f5316 | 42 | VL53LX_Error VL53LX_GetVersion(VL53LX_Version_t *pVersion); |
Charles MacNeill |
5:89031b2f5316 | 43 | |
Charles MacNeill |
5:89031b2f5316 | 44 | /** |
Charles MacNeill |
5:89031b2f5316 | 45 | * @brief Reads the Product Revision for a for given Device |
Charles MacNeill |
5:89031b2f5316 | 46 | * This function can be used to distinguish cut1.0 from cut1.1. |
Charles MacNeill |
5:89031b2f5316 | 47 | * |
Charles MacNeill |
5:89031b2f5316 | 48 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 49 | * @param pProductRevisionMajor Pointer to Product Revision Major |
Charles MacNeill |
5:89031b2f5316 | 50 | * for a given Device |
Charles MacNeill |
5:89031b2f5316 | 51 | * @param pProductRevisionMinor Pointer to Product Revision Minor |
Charles MacNeill |
5:89031b2f5316 | 52 | * for a given Device |
Charles MacNeill |
5:89031b2f5316 | 53 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 54 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 55 | */ |
Charles MacNeill |
5:89031b2f5316 | 56 | VL53LX_Error VL53LX_GetProductRevision(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 57 | uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor); |
Charles MacNeill |
5:89031b2f5316 | 58 | |
Charles MacNeill |
5:89031b2f5316 | 59 | /** |
Charles MacNeill |
5:89031b2f5316 | 60 | * @brief Reads the Device information for given Device |
Charles MacNeill |
5:89031b2f5316 | 61 | * |
Charles MacNeill |
5:89031b2f5316 | 62 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 63 | * |
Charles MacNeill |
5:89031b2f5316 | 64 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 65 | * @param pVL53LX_DeviceInfo Pointer to current device info for a given |
Charles MacNeill |
5:89031b2f5316 | 66 | * Device |
Charles MacNeill |
5:89031b2f5316 | 67 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 68 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 69 | */ |
Charles MacNeill |
5:89031b2f5316 | 70 | VL53LX_Error VL53LX_GetDeviceInfo(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 71 | VL53LX_DeviceInfo_t *pVL53LX_DeviceInfo); |
Charles MacNeill |
5:89031b2f5316 | 72 | |
Charles MacNeill |
5:89031b2f5316 | 73 | /** |
Charles MacNeill |
5:89031b2f5316 | 74 | * @brief Reads the Device unique identifier |
Charles MacNeill |
5:89031b2f5316 | 75 | * |
Charles MacNeill |
5:89031b2f5316 | 76 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 77 | * |
Charles MacNeill |
5:89031b2f5316 | 78 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 79 | * @param pUid Pointer to current device unique ID |
Charles MacNeill |
5:89031b2f5316 | 80 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 81 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 82 | */ |
Charles MacNeill |
5:89031b2f5316 | 83 | VL53LX_Error VL53LX_GetUID(VL53LX_DEV Dev, uint64_t *pUid); |
Charles MacNeill |
5:89031b2f5316 | 84 | |
Charles MacNeill |
5:89031b2f5316 | 85 | |
Charles MacNeill |
5:89031b2f5316 | 86 | /** @} VL53LX_general_group */ |
Charles MacNeill |
5:89031b2f5316 | 87 | |
Charles MacNeill |
5:89031b2f5316 | 88 | /** @defgroup VL53LX_init_group VL53LX Init Functions |
Charles MacNeill |
5:89031b2f5316 | 89 | * @brief VL53LX Init Functions |
Charles MacNeill |
5:89031b2f5316 | 90 | * @{ |
Charles MacNeill |
5:89031b2f5316 | 91 | */ |
Charles MacNeill |
5:89031b2f5316 | 92 | |
Charles MacNeill |
5:89031b2f5316 | 93 | /** |
Charles MacNeill |
5:89031b2f5316 | 94 | * @brief Set new device address |
Charles MacNeill |
5:89031b2f5316 | 95 | * |
Charles MacNeill |
5:89031b2f5316 | 96 | * After completion the device will answer to the new address programmed. |
Charles MacNeill |
5:89031b2f5316 | 97 | * This function should be called when several devices are used in parallel |
Charles MacNeill |
5:89031b2f5316 | 98 | * before start programming the sensor. |
Charles MacNeill |
5:89031b2f5316 | 99 | * When a single device us used, there is no need to call this function. |
Charles MacNeill |
5:89031b2f5316 | 100 | * |
Charles MacNeill |
5:89031b2f5316 | 101 | * When it is requested for multi devices system this function MUST be called |
Charles MacNeill |
5:89031b2f5316 | 102 | * prior to VL53LX_DataInit() |
Charles MacNeill |
5:89031b2f5316 | 103 | * |
Charles MacNeill |
5:89031b2f5316 | 104 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 105 | * |
Charles MacNeill |
5:89031b2f5316 | 106 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 107 | * @param DeviceAddress The new Device address |
Charles MacNeill |
5:89031b2f5316 | 108 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 109 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 110 | */ |
Charles MacNeill |
5:89031b2f5316 | 111 | VL53LX_Error VL53LX_SetDeviceAddress(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 112 | uint8_t DeviceAddress); |
Charles MacNeill |
5:89031b2f5316 | 113 | |
Charles MacNeill |
5:89031b2f5316 | 114 | /** |
Charles MacNeill |
5:89031b2f5316 | 115 | * |
Charles MacNeill |
5:89031b2f5316 | 116 | * @brief One time device initialization |
Charles MacNeill |
5:89031b2f5316 | 117 | * |
Charles MacNeill |
5:89031b2f5316 | 118 | * To be called after device has been powered on and booted |
Charles MacNeill |
5:89031b2f5316 | 119 | * see @a VL53LX_WaitDeviceBooted() |
Charles MacNeill |
5:89031b2f5316 | 120 | * |
Charles MacNeill |
5:89031b2f5316 | 121 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 122 | * When not used after a fresh device "power up", it may return |
Charles MacNeill |
5:89031b2f5316 | 123 | * @a #VL53LX_ERROR_CALIBRATION_WARNING meaning wrong calibration data |
Charles MacNeill |
5:89031b2f5316 | 124 | * may have been fetched from device that can result in ranging offset error\n |
Charles MacNeill |
5:89031b2f5316 | 125 | * If VL53LX_DataInit is called several times then the application must restore |
Charles MacNeill |
5:89031b2f5316 | 126 | * calibration calling @a VL53LX_SetOffsetCalibrationData() |
Charles MacNeill |
5:89031b2f5316 | 127 | * It implies application has gathered calibration data thanks to |
Charles MacNeill |
5:89031b2f5316 | 128 | * @a VL53LX_GetOffsetCalibrationData() after an initial calibration stage. |
Charles MacNeill |
5:89031b2f5316 | 129 | * |
Charles MacNeill |
5:89031b2f5316 | 130 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 131 | * |
Charles MacNeill |
5:89031b2f5316 | 132 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 133 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 134 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 135 | */ |
Charles MacNeill |
5:89031b2f5316 | 136 | VL53LX_Error VL53LX_DataInit(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 137 | |
Charles MacNeill |
5:89031b2f5316 | 138 | /** |
Charles MacNeill |
5:89031b2f5316 | 139 | * @brief Wait for device booted after chip enable (hardware standby) |
Charles MacNeill |
5:89031b2f5316 | 140 | * |
Charles MacNeill |
5:89031b2f5316 | 141 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 142 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 143 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 144 | * |
Charles MacNeill |
5:89031b2f5316 | 145 | */ |
Charles MacNeill |
5:89031b2f5316 | 146 | VL53LX_Error VL53LX_WaitDeviceBooted(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 147 | |
Charles MacNeill |
5:89031b2f5316 | 148 | |
Charles MacNeill |
5:89031b2f5316 | 149 | /** @} VL53LX_init_group */ |
Charles MacNeill |
5:89031b2f5316 | 150 | |
Charles MacNeill |
5:89031b2f5316 | 151 | /** @defgroup VL53LX_parameters_group VL53LX Parameters Functions |
Charles MacNeill |
5:89031b2f5316 | 152 | * @brief Functions used to prepare and setup the device |
Charles MacNeill |
5:89031b2f5316 | 153 | * @{ |
Charles MacNeill |
5:89031b2f5316 | 154 | */ |
Charles MacNeill |
5:89031b2f5316 | 155 | |
Charles MacNeill |
5:89031b2f5316 | 156 | /** |
Charles MacNeill |
5:89031b2f5316 | 157 | * @brief Set the distance mode |
Charles MacNeill |
5:89031b2f5316 | 158 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 159 | * Set the distance mode to be used for the next ranging.<br> |
Charles MacNeill |
5:89031b2f5316 | 160 | * The modes Short, Medium and Long are used to optimize the ranging accuracy |
Charles MacNeill |
5:89031b2f5316 | 161 | * in a specific range of distance.<br> The user select one of these modes to |
Charles MacNeill |
5:89031b2f5316 | 162 | * select the distance range. |
Charles MacNeill |
5:89031b2f5316 | 163 | * @note This function doesn't Access to the device |
Charles MacNeill |
5:89031b2f5316 | 164 | * |
Charles MacNeill |
5:89031b2f5316 | 165 | * @warning This function should be called after @a VL53LX_DataInit(). |
Charles MacNeill |
5:89031b2f5316 | 166 | |
Charles MacNeill |
5:89031b2f5316 | 167 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 168 | * @param DistanceMode Distance mode to apply, valid values are: |
Charles MacNeill |
5:89031b2f5316 | 169 | * @li VL53LX_DISTANCEMODE_SHORT |
Charles MacNeill |
5:89031b2f5316 | 170 | * @li VL53LX_DISTANCEMODE_MEDIUM |
Charles MacNeill |
5:89031b2f5316 | 171 | * @li VL53LX_DISTANCEMODE_LONG |
Charles MacNeill |
5:89031b2f5316 | 172 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 173 | * @return VL53LX_ERROR_MODE_NOT_SUPPORTED This error occurs when DistanceMode |
Charles MacNeill |
5:89031b2f5316 | 174 | * is not in the supported list |
Charles MacNeill |
5:89031b2f5316 | 175 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 176 | */ |
Charles MacNeill |
5:89031b2f5316 | 177 | VL53LX_Error VL53LX_SetDistanceMode(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 178 | VL53LX_DistanceModes DistanceMode); |
Charles MacNeill |
5:89031b2f5316 | 179 | |
Charles MacNeill |
5:89031b2f5316 | 180 | /** |
Charles MacNeill |
5:89031b2f5316 | 181 | * @brief Get the distance mode |
Charles MacNeill |
5:89031b2f5316 | 182 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 183 | * Get the distance mode used for the next ranging. |
Charles MacNeill |
5:89031b2f5316 | 184 | * |
Charles MacNeill |
5:89031b2f5316 | 185 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 186 | * @param *pDistanceMode Pointer to Distance mode |
Charles MacNeill |
5:89031b2f5316 | 187 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 188 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 189 | */ |
Charles MacNeill |
5:89031b2f5316 | 190 | VL53LX_Error VL53LX_GetDistanceMode(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 191 | VL53LX_DistanceModes *pDistanceMode); |
Charles MacNeill |
5:89031b2f5316 | 192 | |
Charles MacNeill |
5:89031b2f5316 | 193 | |
Charles MacNeill |
5:89031b2f5316 | 194 | /** |
Charles MacNeill |
5:89031b2f5316 | 195 | * @brief Set Ranging Timing Budget in microseconds |
Charles MacNeill |
5:89031b2f5316 | 196 | * |
Charles MacNeill |
5:89031b2f5316 | 197 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 198 | * Defines the maximum time allowed by the user to the device to run a |
Charles MacNeill |
5:89031b2f5316 | 199 | * full ranging sequence for the current mode (ranging, histogram, ASL ...) |
Charles MacNeill |
5:89031b2f5316 | 200 | * |
Charles MacNeill |
5:89031b2f5316 | 201 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 202 | * @param MeasurementTimingBudgetMicroSeconds Max measurement time in |
Charles MacNeill |
5:89031b2f5316 | 203 | * microseconds. |
Charles MacNeill |
5:89031b2f5316 | 204 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 205 | * @return VL53LX_ERROR_INVALID_PARAMS Error timing parameter not |
Charles MacNeill |
5:89031b2f5316 | 206 | * supported. |
Charles MacNeill |
5:89031b2f5316 | 207 | * The maximum accepted value for the |
Charles MacNeill |
5:89031b2f5316 | 208 | * computed timing budget is 10 seconds |
Charles MacNeill |
5:89031b2f5316 | 209 | * the minimum value depends on the preset |
Charles MacNeill |
5:89031b2f5316 | 210 | * mode selected. |
Charles MacNeill |
5:89031b2f5316 | 211 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 212 | */ |
Charles MacNeill |
5:89031b2f5316 | 213 | VL53LX_Error VL53LX_SetMeasurementTimingBudgetMicroSeconds( |
Charles MacNeill |
5:89031b2f5316 | 214 | VL53LX_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds); |
Charles MacNeill |
5:89031b2f5316 | 215 | |
Charles MacNeill |
5:89031b2f5316 | 216 | /** |
Charles MacNeill |
5:89031b2f5316 | 217 | * @brief Get Ranging Timing Budget in microseconds |
Charles MacNeill |
5:89031b2f5316 | 218 | * |
Charles MacNeill |
5:89031b2f5316 | 219 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 220 | * Returns the programmed the maximum time allowed by the user to the |
Charles MacNeill |
5:89031b2f5316 | 221 | * device to run a full ranging sequence for the current mode |
Charles MacNeill |
5:89031b2f5316 | 222 | * (ranging, histogram, ...) |
Charles MacNeill |
5:89031b2f5316 | 223 | * |
Charles MacNeill |
5:89031b2f5316 | 224 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 225 | * @param pMeasurementTimingBudgetMicroSeconds Max measurement time in |
Charles MacNeill |
5:89031b2f5316 | 226 | * microseconds. |
Charles MacNeill |
5:89031b2f5316 | 227 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 228 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 229 | */ |
Charles MacNeill |
5:89031b2f5316 | 230 | VL53LX_Error VL53LX_GetMeasurementTimingBudgetMicroSeconds( |
Charles MacNeill |
5:89031b2f5316 | 231 | VL53LX_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds); |
Charles MacNeill |
5:89031b2f5316 | 232 | /** @} VL53LX_parameters_group */ |
Charles MacNeill |
5:89031b2f5316 | 233 | |
Charles MacNeill |
5:89031b2f5316 | 234 | |
Charles MacNeill |
5:89031b2f5316 | 235 | /** @defgroup VL53LX_ROI_group VL53LX ROI Functions |
Charles MacNeill |
5:89031b2f5316 | 236 | * @brief Functions used to select ROIs |
Charles MacNeill |
5:89031b2f5316 | 237 | * @{ |
Charles MacNeill |
5:89031b2f5316 | 238 | */ |
Charles MacNeill |
5:89031b2f5316 | 239 | |
Charles MacNeill |
5:89031b2f5316 | 240 | /** |
Charles MacNeill |
5:89031b2f5316 | 241 | * @brief Set the ROI to be used for ranging |
Charles MacNeill |
5:89031b2f5316 | 242 | * |
Charles MacNeill |
5:89031b2f5316 | 243 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 244 | * The user defined ROI is a rectangle described as per the following system |
Charles MacNeill |
5:89031b2f5316 | 245 | * from the Top Left corner to the Bottom Right corner. |
Charles MacNeill |
5:89031b2f5316 | 246 | * <br>Minimal ROI size is 4x4 spads |
Charles MacNeill |
5:89031b2f5316 | 247 | * @image html roi_coord.png |
Charles MacNeill |
5:89031b2f5316 | 248 | * |
Charles MacNeill |
5:89031b2f5316 | 249 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 250 | * @param pUserROi Pointer to the Structure definining the ROI |
Charles MacNeill |
5:89031b2f5316 | 251 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 252 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 253 | */ |
Charles MacNeill |
5:89031b2f5316 | 254 | VL53LX_Error VL53LX_SetUserROI(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 255 | VL53LX_UserRoi_t *pUserROi); |
Charles MacNeill |
5:89031b2f5316 | 256 | |
Charles MacNeill |
5:89031b2f5316 | 257 | /** |
Charles MacNeill |
5:89031b2f5316 | 258 | * @brief Get the ROI managed by the Device |
Charles MacNeill |
5:89031b2f5316 | 259 | * |
Charles MacNeill |
5:89031b2f5316 | 260 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 261 | * Get the ROI managed by the Device |
Charles MacNeill |
5:89031b2f5316 | 262 | * |
Charles MacNeill |
5:89031b2f5316 | 263 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 264 | * @param pUserROi Pointer to the Structure definining the ROI |
Charles MacNeill |
5:89031b2f5316 | 265 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 266 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 267 | */ |
Charles MacNeill |
5:89031b2f5316 | 268 | VL53LX_Error VL53LX_GetUserROI(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 269 | VL53LX_UserRoi_t *pUserROi); |
Charles MacNeill |
5:89031b2f5316 | 270 | |
Charles MacNeill |
5:89031b2f5316 | 271 | /** @} VL53LX_ROI_group */ |
Charles MacNeill |
5:89031b2f5316 | 272 | |
Charles MacNeill |
5:89031b2f5316 | 273 | |
Charles MacNeill |
5:89031b2f5316 | 274 | /** @defgroup VL53LX_measurement_group VL53LX Measurement Functions |
Charles MacNeill |
5:89031b2f5316 | 275 | * @brief Functions used for the measurements |
Charles MacNeill |
5:89031b2f5316 | 276 | * @{ |
Charles MacNeill |
5:89031b2f5316 | 277 | */ |
Charles MacNeill |
5:89031b2f5316 | 278 | |
Charles MacNeill |
5:89031b2f5316 | 279 | /** |
Charles MacNeill |
5:89031b2f5316 | 280 | * @brief Start device measurement |
Charles MacNeill |
5:89031b2f5316 | 281 | * |
Charles MacNeill |
5:89031b2f5316 | 282 | * @details Started measurement will depend on distance parameter set through |
Charles MacNeill |
5:89031b2f5316 | 283 | * @a VL53LX_SetDistanceMode() |
Charles MacNeill |
5:89031b2f5316 | 284 | * |
Charles MacNeill |
5:89031b2f5316 | 285 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 286 | * |
Charles MacNeill |
5:89031b2f5316 | 287 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 288 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 289 | * @return VL53LX_ERROR_TIME_OUT Time out on start measurement |
Charles MacNeill |
5:89031b2f5316 | 290 | * @return VL53LX_ERROR_INVALID_PARAMS This error might occur in timed mode |
Charles MacNeill |
5:89031b2f5316 | 291 | * when inter measurement period is smaller or too close to the timing budget. |
Charles MacNeill |
5:89031b2f5316 | 292 | * In such case measurements are not started and user must correct the timings |
Charles MacNeill |
5:89031b2f5316 | 293 | * passed to @a VL53LX_SetMeasurementTimingBudgetMicroSeconds() and |
Charles MacNeill |
5:89031b2f5316 | 294 | * @a VL53LX_SetInterMeasurementPeriodMilliSeconds() functions. |
Charles MacNeill |
5:89031b2f5316 | 295 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 296 | */ |
Charles MacNeill |
5:89031b2f5316 | 297 | VL53LX_Error VL53LX_StartMeasurement(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 298 | |
Charles MacNeill |
5:89031b2f5316 | 299 | /** |
Charles MacNeill |
5:89031b2f5316 | 300 | * @brief Stop device measurement |
Charles MacNeill |
5:89031b2f5316 | 301 | * |
Charles MacNeill |
5:89031b2f5316 | 302 | * @details Will set the device in standby mode at end of current measurement\n |
Charles MacNeill |
5:89031b2f5316 | 303 | * Not necessary in single mode as device shall return automatically |
Charles MacNeill |
5:89031b2f5316 | 304 | * in standby mode at end of measurement. |
Charles MacNeill |
5:89031b2f5316 | 305 | * |
Charles MacNeill |
5:89031b2f5316 | 306 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 307 | * |
Charles MacNeill |
5:89031b2f5316 | 308 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 309 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 310 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 311 | */ |
Charles MacNeill |
5:89031b2f5316 | 312 | VL53LX_Error VL53LX_StopMeasurement(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 313 | |
Charles MacNeill |
5:89031b2f5316 | 314 | /** |
Charles MacNeill |
5:89031b2f5316 | 315 | * @brief Clear the Interrupt flag and start new measurement |
Charles MacNeill |
5:89031b2f5316 | 316 | * * |
Charles MacNeill |
5:89031b2f5316 | 317 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 318 | * |
Charles MacNeill |
5:89031b2f5316 | 319 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 320 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 321 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 322 | */ |
Charles MacNeill |
5:89031b2f5316 | 323 | VL53LX_Error VL53LX_ClearInterruptAndStartMeasurement(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 324 | |
Charles MacNeill |
5:89031b2f5316 | 325 | /** |
Charles MacNeill |
5:89031b2f5316 | 326 | * @brief Return Measurement Data Ready |
Charles MacNeill |
5:89031b2f5316 | 327 | * |
Charles MacNeill |
5:89031b2f5316 | 328 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 329 | * This function indicate that a measurement data is ready. |
Charles MacNeill |
5:89031b2f5316 | 330 | * This function is used for non-blocking capture. |
Charles MacNeill |
5:89031b2f5316 | 331 | * |
Charles MacNeill |
5:89031b2f5316 | 332 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 333 | * |
Charles MacNeill |
5:89031b2f5316 | 334 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 335 | * @param pMeasurementDataReady Pointer to Measurement Data Ready. |
Charles MacNeill |
5:89031b2f5316 | 336 | * 0 = data not ready, 1 = data ready |
Charles MacNeill |
5:89031b2f5316 | 337 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 338 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 339 | */ |
Charles MacNeill |
5:89031b2f5316 | 340 | VL53LX_Error VL53LX_GetMeasurementDataReady(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 341 | uint8_t *pMeasurementDataReady); |
Charles MacNeill |
5:89031b2f5316 | 342 | |
Charles MacNeill |
5:89031b2f5316 | 343 | /** |
Charles MacNeill |
5:89031b2f5316 | 344 | * @brief Wait for measurement data ready. |
Charles MacNeill |
5:89031b2f5316 | 345 | * Blocking function. |
Charles MacNeill |
5:89031b2f5316 | 346 | * Note that the timeout is given by: |
Charles MacNeill |
5:89031b2f5316 | 347 | * VL53LX_RANGE_COMPLETION_POLLING_TIMEOUT_MS defined in def.h |
Charles MacNeill |
5:89031b2f5316 | 348 | * |
Charles MacNeill |
5:89031b2f5316 | 349 | * |
Charles MacNeill |
5:89031b2f5316 | 350 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 351 | * |
Charles MacNeill |
5:89031b2f5316 | 352 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 353 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 354 | * @return VL53LX_ERROR_TIME_OUT In case of timeout |
Charles MacNeill |
5:89031b2f5316 | 355 | */ |
Charles MacNeill |
5:89031b2f5316 | 356 | VL53LX_Error VL53LX_WaitMeasurementDataReady(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 357 | |
Charles MacNeill |
5:89031b2f5316 | 358 | |
Charles MacNeill |
5:89031b2f5316 | 359 | /** |
Charles MacNeill |
5:89031b2f5316 | 360 | * @brief Retrieve all measurements from device with the current setup |
Charles MacNeill |
5:89031b2f5316 | 361 | * |
Charles MacNeill |
5:89031b2f5316 | 362 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 363 | * Get data from last successful Ranging measurement |
Charles MacNeill |
5:89031b2f5316 | 364 | * |
Charles MacNeill |
5:89031b2f5316 | 365 | * @warning USER must call @a VL53LX_ClearInterruptAndStartMeasurement() prior |
Charles MacNeill |
5:89031b2f5316 | 366 | * to call again this function |
Charles MacNeill |
5:89031b2f5316 | 367 | * |
Charles MacNeill |
5:89031b2f5316 | 368 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 369 | * |
Charles MacNeill |
5:89031b2f5316 | 370 | * @note The first valid value returned by this function will have a range |
Charles MacNeill |
5:89031b2f5316 | 371 | * status equal to VL53LX_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK which means that |
Charles MacNeill |
5:89031b2f5316 | 372 | * the data is valid but no wrap around check have been done. User should take |
Charles MacNeill |
5:89031b2f5316 | 373 | * care about that. |
Charles MacNeill |
5:89031b2f5316 | 374 | * |
Charles MacNeill |
5:89031b2f5316 | 375 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 376 | * @param pMultiRangingData Pointer to the data structure to fill up. |
Charles MacNeill |
5:89031b2f5316 | 377 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 378 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 379 | */ |
Charles MacNeill |
5:89031b2f5316 | 380 | VL53LX_Error VL53LX_GetMultiRangingData(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 381 | VL53LX_MultiRangingData_t *pMultiRangingData); |
Charles MacNeill |
5:89031b2f5316 | 382 | |
Charles MacNeill |
5:89031b2f5316 | 383 | /** |
Charles MacNeill |
5:89031b2f5316 | 384 | * @brief Get Additional Data |
Charles MacNeill |
5:89031b2f5316 | 385 | * |
Charles MacNeill |
5:89031b2f5316 | 386 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 387 | * This function is used to get lld debugging data on the last histogram |
Charles MacNeill |
5:89031b2f5316 | 388 | * measurement. shall be called when a new measurement is ready (interrupt or |
Charles MacNeill |
5:89031b2f5316 | 389 | * positive VL53LX_GetMeasurementDataReady() polling) and before a call to |
Charles MacNeill |
5:89031b2f5316 | 390 | * VL53LX_ClearInterruptAndStartMeasurement(). |
Charles MacNeill |
5:89031b2f5316 | 391 | * |
Charles MacNeill |
5:89031b2f5316 | 392 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 393 | * @param pAdditionalData Pointer to Additional data |
Charles MacNeill |
5:89031b2f5316 | 394 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 395 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 396 | */ |
Charles MacNeill |
5:89031b2f5316 | 397 | VL53LX_Error VL53LX_GetAdditionalData(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 398 | VL53LX_AdditionalData_t *pAdditionalData); |
Charles MacNeill |
5:89031b2f5316 | 399 | |
Charles MacNeill |
5:89031b2f5316 | 400 | |
Charles MacNeill |
5:89031b2f5316 | 401 | /** @} VL53LX_measurement_group */ |
Charles MacNeill |
5:89031b2f5316 | 402 | |
Charles MacNeill |
5:89031b2f5316 | 403 | /** @defgroup VL53LX_Calibration_group VL53LX Calibration Functions |
Charles MacNeill |
5:89031b2f5316 | 404 | * @brief Functions used for Calibration |
Charles MacNeill |
5:89031b2f5316 | 405 | * @{ |
Charles MacNeill |
5:89031b2f5316 | 406 | */ |
Charles MacNeill |
5:89031b2f5316 | 407 | |
Charles MacNeill |
5:89031b2f5316 | 408 | |
Charles MacNeill |
5:89031b2f5316 | 409 | /** |
Charles MacNeill |
5:89031b2f5316 | 410 | * @brief Set Tuning Parameter value for a given parameter ID |
Charles MacNeill |
5:89031b2f5316 | 411 | * |
Charles MacNeill |
5:89031b2f5316 | 412 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 413 | * This function is used to improve the performance of the device. It permit to |
Charles MacNeill |
5:89031b2f5316 | 414 | * change a particular value used for a timeout or a threshold or a constant |
Charles MacNeill |
5:89031b2f5316 | 415 | * in an algorithm. The function will change the value of the parameter |
Charles MacNeill |
5:89031b2f5316 | 416 | * identified by an unique ID. |
Charles MacNeill |
5:89031b2f5316 | 417 | * |
Charles MacNeill |
5:89031b2f5316 | 418 | * @note This function doesn't Access to the device |
Charles MacNeill |
5:89031b2f5316 | 419 | * |
Charles MacNeill |
5:89031b2f5316 | 420 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 421 | * @param TuningParameterId Tuning Parameter ID |
Charles MacNeill |
5:89031b2f5316 | 422 | * @param TuningParameterValue Tuning Parameter Value |
Charles MacNeill |
5:89031b2f5316 | 423 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 424 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 425 | */ |
Charles MacNeill |
5:89031b2f5316 | 426 | VL53LX_Error VL53LX_SetTuningParameter(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 427 | uint16_t TuningParameterId, int32_t TuningParameterValue); |
Charles MacNeill |
5:89031b2f5316 | 428 | |
Charles MacNeill |
5:89031b2f5316 | 429 | /** |
Charles MacNeill |
5:89031b2f5316 | 430 | * @brief Get Tuning Parameter value for a given parameter ID |
Charles MacNeill |
5:89031b2f5316 | 431 | * |
Charles MacNeill |
5:89031b2f5316 | 432 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 433 | * This function is used to get the value of the parameter |
Charles MacNeill |
5:89031b2f5316 | 434 | * identified by an unique ID. |
Charles MacNeill |
5:89031b2f5316 | 435 | * |
Charles MacNeill |
5:89031b2f5316 | 436 | * @note This function doesn't Access to the device |
Charles MacNeill |
5:89031b2f5316 | 437 | * |
Charles MacNeill |
5:89031b2f5316 | 438 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 439 | * @param TuningParameterId Tuning Parameter ID |
Charles MacNeill |
5:89031b2f5316 | 440 | * @param pTuningParameterValue Pointer to Tuning Parameter Value |
Charles MacNeill |
5:89031b2f5316 | 441 | * for a given TuningParameterId. |
Charles MacNeill |
5:89031b2f5316 | 442 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 443 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 444 | */ |
Charles MacNeill |
5:89031b2f5316 | 445 | VL53LX_Error VL53LX_GetTuningParameter(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 446 | uint16_t TuningParameterId, int32_t *pTuningParameterValue); |
Charles MacNeill |
5:89031b2f5316 | 447 | |
Charles MacNeill |
5:89031b2f5316 | 448 | /** |
Charles MacNeill |
5:89031b2f5316 | 449 | * @brief Performs Reference Spad Management |
Charles MacNeill |
5:89031b2f5316 | 450 | * |
Charles MacNeill |
5:89031b2f5316 | 451 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 452 | * The reference SPAD initialization procedure determines the minimum amount |
Charles MacNeill |
5:89031b2f5316 | 453 | * of reference spads to be enables to achieve a target reference signal rate |
Charles MacNeill |
5:89031b2f5316 | 454 | * and should be performed once during initialization. |
Charles MacNeill |
5:89031b2f5316 | 455 | * |
Charles MacNeill |
5:89031b2f5316 | 456 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 457 | * |
Charles MacNeill |
5:89031b2f5316 | 458 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 459 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 460 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 461 | */ |
Charles MacNeill |
5:89031b2f5316 | 462 | VL53LX_Error VL53LX_PerformRefSpadManagement(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 463 | |
Charles MacNeill |
5:89031b2f5316 | 464 | /** |
Charles MacNeill |
5:89031b2f5316 | 465 | * @brief Enable/Disable dynamic Xtalk compensation feature |
Charles MacNeill |
5:89031b2f5316 | 466 | * |
Charles MacNeill |
5:89031b2f5316 | 467 | * Enable/Disable dynamic Xtalk compensation (aka smudge correction). |
Charles MacNeill |
5:89031b2f5316 | 468 | * |
Charles MacNeill |
5:89031b2f5316 | 469 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 470 | * @param Mode Set the smudge correction mode |
Charles MacNeill |
5:89031b2f5316 | 471 | * See ::VL53LX_SmudgeCorrectionModes |
Charles MacNeill |
5:89031b2f5316 | 472 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 473 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 474 | */ |
Charles MacNeill |
5:89031b2f5316 | 475 | VL53LX_Error VL53LX_SmudgeCorrectionEnable(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 476 | VL53LX_SmudgeCorrectionModes Mode); |
Charles MacNeill |
5:89031b2f5316 | 477 | |
Charles MacNeill |
5:89031b2f5316 | 478 | |
Charles MacNeill |
5:89031b2f5316 | 479 | /** |
Charles MacNeill |
5:89031b2f5316 | 480 | * @brief Enable/Disable Cross talk compensation feature |
Charles MacNeill |
5:89031b2f5316 | 481 | * |
Charles MacNeill |
5:89031b2f5316 | 482 | * Enable/Disable Cross Talk correction. |
Charles MacNeill |
5:89031b2f5316 | 483 | * |
Charles MacNeill |
5:89031b2f5316 | 484 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 485 | * @param XTalkCompensationEnable Cross talk compensation |
Charles MacNeill |
5:89031b2f5316 | 486 | * to be set 0 = disabled or 1 = enabled. |
Charles MacNeill |
5:89031b2f5316 | 487 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 488 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 489 | */ |
Charles MacNeill |
5:89031b2f5316 | 490 | VL53LX_Error VL53LX_SetXTalkCompensationEnable(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 491 | uint8_t XTalkCompensationEnable); |
Charles MacNeill |
5:89031b2f5316 | 492 | |
Charles MacNeill |
5:89031b2f5316 | 493 | /** |
Charles MacNeill |
5:89031b2f5316 | 494 | * @brief Get Cross talk compensation rate enable |
Charles MacNeill |
5:89031b2f5316 | 495 | * |
Charles MacNeill |
5:89031b2f5316 | 496 | * Get if the Cross Talk is Enabled or Disabled. |
Charles MacNeill |
5:89031b2f5316 | 497 | * |
Charles MacNeill |
5:89031b2f5316 | 498 | * @note This function doesn't access to the device |
Charles MacNeill |
5:89031b2f5316 | 499 | * |
Charles MacNeill |
5:89031b2f5316 | 500 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 501 | * @param pXTalkCompensationEnable Pointer to the Cross talk compensation |
Charles MacNeill |
5:89031b2f5316 | 502 | * state 0=disabled or 1 = enabled |
Charles MacNeill |
5:89031b2f5316 | 503 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 504 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 505 | */ |
Charles MacNeill |
5:89031b2f5316 | 506 | VL53LX_Error VL53LX_GetXTalkCompensationEnable(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 507 | uint8_t *pXTalkCompensationEnable); |
Charles MacNeill |
5:89031b2f5316 | 508 | |
Charles MacNeill |
5:89031b2f5316 | 509 | /** |
Charles MacNeill |
5:89031b2f5316 | 510 | * @brief Perform XTalk Calibration |
Charles MacNeill |
5:89031b2f5316 | 511 | * |
Charles MacNeill |
5:89031b2f5316 | 512 | * @details Perform a XTalk calibration of the Device. |
Charles MacNeill |
5:89031b2f5316 | 513 | * This function will launch a measurement, if interrupts |
Charles MacNeill |
5:89031b2f5316 | 514 | * are enabled an interrupt will be done. |
Charles MacNeill |
5:89031b2f5316 | 515 | * This function will clear the interrupt generated automatically. |
Charles MacNeill |
5:89031b2f5316 | 516 | * This function will program a new value for the XTalk compensation |
Charles MacNeill |
5:89031b2f5316 | 517 | * and it will enable the cross talk before exit. |
Charles MacNeill |
5:89031b2f5316 | 518 | * |
Charles MacNeill |
5:89031b2f5316 | 519 | * @warning This function is a blocking function |
Charles MacNeill |
5:89031b2f5316 | 520 | * |
Charles MacNeill |
5:89031b2f5316 | 521 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 522 | * |
Charles MacNeill |
5:89031b2f5316 | 523 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 524 | * the calibration sets appropriate |
Charles MacNeill |
5:89031b2f5316 | 525 | * distance mode and thus override existing one<br> |
Charles MacNeill |
5:89031b2f5316 | 526 | * The calibration uses a target which should be located at least @60cm from the |
Charles MacNeill |
5:89031b2f5316 | 527 | * device. The actual location of the target shall be passed |
Charles MacNeill |
5:89031b2f5316 | 528 | * through the bare driver tuning parameters table |
Charles MacNeill |
5:89031b2f5316 | 529 | * |
Charles MacNeill |
5:89031b2f5316 | 530 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 531 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 532 | */ |
Charles MacNeill |
5:89031b2f5316 | 533 | VL53LX_Error VL53LX_PerformXTalkCalibration(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 534 | |
Charles MacNeill |
5:89031b2f5316 | 535 | |
Charles MacNeill |
5:89031b2f5316 | 536 | /** |
Charles MacNeill |
5:89031b2f5316 | 537 | * @brief Define the mode to be used for the offset correction |
Charles MacNeill |
5:89031b2f5316 | 538 | * |
Charles MacNeill |
5:89031b2f5316 | 539 | * Define the mode to be used for the offset correction. |
Charles MacNeill |
5:89031b2f5316 | 540 | * |
Charles MacNeill |
5:89031b2f5316 | 541 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 542 | * @param OffsetCorrectionMode Offset Correction Mode valid values are: |
Charles MacNeill |
5:89031b2f5316 | 543 | * @li VL53LX_OFFSETCORRECTIONMODE_STANDARD |
Charles MacNeill |
5:89031b2f5316 | 544 | * @li VL53LX_OFFSETCORRECTIONMODE_PERVCSEL |
Charles MacNeill |
5:89031b2f5316 | 545 | * |
Charles MacNeill |
5:89031b2f5316 | 546 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 547 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 548 | */ |
Charles MacNeill |
5:89031b2f5316 | 549 | VL53LX_Error VL53LX_SetOffsetCorrectionMode(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 550 | VL53LX_OffsetCorrectionModes OffsetCorrectionMode); |
Charles MacNeill |
5:89031b2f5316 | 551 | |
Charles MacNeill |
5:89031b2f5316 | 552 | |
Charles MacNeill |
5:89031b2f5316 | 553 | /** |
Charles MacNeill |
5:89031b2f5316 | 554 | * @brief Perform Offset simple Calibration |
Charles MacNeill |
5:89031b2f5316 | 555 | * |
Charles MacNeill |
5:89031b2f5316 | 556 | * @details Perform a very simple offset calibration of the Device. |
Charles MacNeill |
5:89031b2f5316 | 557 | * This function will launch few ranging measurements and computes offset |
Charles MacNeill |
5:89031b2f5316 | 558 | * calibration. The preset mode and the distance mode MUST be set by the |
Charles MacNeill |
5:89031b2f5316 | 559 | * application before to call this function. |
Charles MacNeill |
5:89031b2f5316 | 560 | * |
Charles MacNeill |
5:89031b2f5316 | 561 | * @warning This function is a blocking function |
Charles MacNeill |
5:89031b2f5316 | 562 | * |
Charles MacNeill |
5:89031b2f5316 | 563 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 564 | * |
Charles MacNeill |
5:89031b2f5316 | 565 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 566 | * @param CalDistanceMilliMeter Calibration distance value used for the |
Charles MacNeill |
5:89031b2f5316 | 567 | * offset compensation. |
Charles MacNeill |
5:89031b2f5316 | 568 | * |
Charles MacNeill |
5:89031b2f5316 | 569 | * @return VL53LX_ERROR_NONE |
Charles MacNeill |
5:89031b2f5316 | 570 | * @return VL53LX_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by |
Charles MacNeill |
5:89031b2f5316 | 571 | * lack of valid measurements |
Charles MacNeill |
5:89031b2f5316 | 572 | * @return VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target |
Charles MacNeill |
5:89031b2f5316 | 573 | * distance combined to the number of loops performed in the calibration lead to |
Charles MacNeill |
5:89031b2f5316 | 574 | * an internal overflow. Try to reduce the distance of the target (140 mm) |
Charles MacNeill |
5:89031b2f5316 | 575 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 576 | */ |
Charles MacNeill |
5:89031b2f5316 | 577 | VL53LX_Error VL53LX_PerformOffsetSimpleCalibration(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 578 | int32_t CalDistanceMilliMeter); |
Charles MacNeill |
5:89031b2f5316 | 579 | |
Charles MacNeill |
5:89031b2f5316 | 580 | /** |
Charles MacNeill |
5:89031b2f5316 | 581 | * @brief Perform Offset simple Calibration with a "zero distance" target |
Charles MacNeill |
5:89031b2f5316 | 582 | * |
Charles MacNeill |
5:89031b2f5316 | 583 | * @details Perform a simple offset calibration of the Device. |
Charles MacNeill |
5:89031b2f5316 | 584 | * This function will launch few ranging measurements and computes offset |
Charles MacNeill |
5:89031b2f5316 | 585 | * calibration. The preset mode and the distance mode MUST be set by the |
Charles MacNeill |
5:89031b2f5316 | 586 | * application before to call this function. |
Charles MacNeill |
5:89031b2f5316 | 587 | * A target must be place very close to the device. |
Charles MacNeill |
5:89031b2f5316 | 588 | * Ideally the target shall be touching the coverglass. |
Charles MacNeill |
5:89031b2f5316 | 589 | * |
Charles MacNeill |
5:89031b2f5316 | 590 | * @warning This function is a blocking function |
Charles MacNeill |
5:89031b2f5316 | 591 | * |
Charles MacNeill |
5:89031b2f5316 | 592 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 593 | * |
Charles MacNeill |
5:89031b2f5316 | 594 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 595 | * |
Charles MacNeill |
5:89031b2f5316 | 596 | * @return VL53LX_ERROR_NONE |
Charles MacNeill |
5:89031b2f5316 | 597 | * @return VL53LX_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by |
Charles MacNeill |
5:89031b2f5316 | 598 | * lack of valid measurements |
Charles MacNeill |
5:89031b2f5316 | 599 | * @return VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target |
Charles MacNeill |
5:89031b2f5316 | 600 | * distance is too large, try to put the target closer to the device |
Charles MacNeill |
5:89031b2f5316 | 601 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 602 | */ |
Charles MacNeill |
5:89031b2f5316 | 603 | VL53LX_Error VL53LX_PerformOffsetZeroDistanceCalibration(VL53LX_DEV Dev); |
Charles MacNeill |
5:89031b2f5316 | 604 | |
Charles MacNeill |
5:89031b2f5316 | 605 | |
Charles MacNeill |
5:89031b2f5316 | 606 | /** |
Charles MacNeill |
5:89031b2f5316 | 607 | * @brief Perform Offset per Vcsel Calibration. i.e. per distance mode |
Charles MacNeill |
5:89031b2f5316 | 608 | * |
Charles MacNeill |
5:89031b2f5316 | 609 | * @details Perform offset calibration of the Device depending on the |
Charles MacNeill |
5:89031b2f5316 | 610 | * three distance mode settings: short, medium and long. |
Charles MacNeill |
5:89031b2f5316 | 611 | * This function will launch few ranging measurements and computes offset |
Charles MacNeill |
5:89031b2f5316 | 612 | * calibration in each of the three distance modes. |
Charles MacNeill |
5:89031b2f5316 | 613 | * The preset mode MUST be set by the application before to call this function. |
Charles MacNeill |
5:89031b2f5316 | 614 | * |
Charles MacNeill |
5:89031b2f5316 | 615 | * @warning This function is a blocking function |
Charles MacNeill |
5:89031b2f5316 | 616 | * |
Charles MacNeill |
5:89031b2f5316 | 617 | * @note This function Access to the device |
Charles MacNeill |
5:89031b2f5316 | 618 | * |
Charles MacNeill |
5:89031b2f5316 | 619 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 620 | * @param CalDistanceMilliMeter Distance of the target used for the |
Charles MacNeill |
5:89031b2f5316 | 621 | * offset compensation calibration. |
Charles MacNeill |
5:89031b2f5316 | 622 | * |
Charles MacNeill |
5:89031b2f5316 | 623 | * @return VL53LX_ERROR_NONE |
Charles MacNeill |
5:89031b2f5316 | 624 | * @return VL53LX_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by |
Charles MacNeill |
5:89031b2f5316 | 625 | * lack of valid measurements |
Charles MacNeill |
5:89031b2f5316 | 626 | * @return VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target |
Charles MacNeill |
5:89031b2f5316 | 627 | * distance combined to the number of loops performed in the calibration lead to |
Charles MacNeill |
5:89031b2f5316 | 628 | * an internal overflow. Try to reduce the distance of the target (140 mm) |
Charles MacNeill |
5:89031b2f5316 | 629 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 630 | */ |
Charles MacNeill |
5:89031b2f5316 | 631 | VL53LX_Error VL53LX_PerformOffsetPerVcselCalibration(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 632 | int32_t CalDistanceMilliMeter); |
Charles MacNeill |
5:89031b2f5316 | 633 | |
Charles MacNeill |
5:89031b2f5316 | 634 | |
Charles MacNeill |
5:89031b2f5316 | 635 | /** |
Charles MacNeill |
5:89031b2f5316 | 636 | * @brief Sets the Calibration Data. |
Charles MacNeill |
5:89031b2f5316 | 637 | * |
Charles MacNeill |
5:89031b2f5316 | 638 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 639 | * This function set all the Calibration Data issued from the functions |
Charles MacNeill |
5:89031b2f5316 | 640 | * @a VL53LX_PerformRefSpadManagement(), @a VL53LX_PerformXTalkCalibration, |
Charles MacNeill |
5:89031b2f5316 | 641 | * @a VL53LX_PerformOffsetCalibration() |
Charles MacNeill |
5:89031b2f5316 | 642 | * |
Charles MacNeill |
5:89031b2f5316 | 643 | * @note This function doesn't Accesses the device |
Charles MacNeill |
5:89031b2f5316 | 644 | * |
Charles MacNeill |
5:89031b2f5316 | 645 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 646 | * @param *pCalibrationData Pointer to Calibration data to be set. |
Charles MacNeill |
5:89031b2f5316 | 647 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 648 | * @return VL53LX_ERROR_INVALID_PARAMS pCalibrationData points to an older |
Charles MacNeill |
5:89031b2f5316 | 649 | * version of the inner structure. Need for support to convert its content. |
Charles MacNeill |
5:89031b2f5316 | 650 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 651 | */ |
Charles MacNeill |
5:89031b2f5316 | 652 | VL53LX_Error VL53LX_SetCalibrationData(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 653 | VL53LX_CalibrationData_t *pCalibrationData); |
Charles MacNeill |
5:89031b2f5316 | 654 | |
Charles MacNeill |
5:89031b2f5316 | 655 | /** |
Charles MacNeill |
5:89031b2f5316 | 656 | * @brief Gets the Calibration Data. |
Charles MacNeill |
5:89031b2f5316 | 657 | * |
Charles MacNeill |
5:89031b2f5316 | 658 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 659 | * This function get all the Calibration Data issued from the functions |
Charles MacNeill |
5:89031b2f5316 | 660 | * @a VL53LX_PerformRefSpadManagement(), @a VL53LX_PerformXTalkCalibration, |
Charles MacNeill |
5:89031b2f5316 | 661 | * @a VL53LX_PerformOffsetCalibration() |
Charles MacNeill |
5:89031b2f5316 | 662 | * |
Charles MacNeill |
5:89031b2f5316 | 663 | * @note This function doesn't Accesses the device |
Charles MacNeill |
5:89031b2f5316 | 664 | * |
Charles MacNeill |
5:89031b2f5316 | 665 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 666 | * @param *pCalibrationData pointer where to store Calibration |
Charles MacNeill |
5:89031b2f5316 | 667 | * data. |
Charles MacNeill |
5:89031b2f5316 | 668 | * @return VL53LX_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 669 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 670 | */ |
Charles MacNeill |
5:89031b2f5316 | 671 | VL53LX_Error VL53LX_GetCalibrationData(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 672 | VL53LX_CalibrationData_t *pCalibrationData); |
Charles MacNeill |
5:89031b2f5316 | 673 | |
Charles MacNeill |
5:89031b2f5316 | 674 | |
Charles MacNeill |
5:89031b2f5316 | 675 | /** |
Charles MacNeill |
5:89031b2f5316 | 676 | * @brief Gets the optical center. |
Charles MacNeill |
5:89031b2f5316 | 677 | * |
Charles MacNeill |
5:89031b2f5316 | 678 | * @par Function Description |
Charles MacNeill |
5:89031b2f5316 | 679 | * This function get the optical center issued from the nvm set at FTM stage |
Charles MacNeill |
5:89031b2f5316 | 680 | * expressed in the same coordinate system as the ROI are |
Charles MacNeill |
5:89031b2f5316 | 681 | * |
Charles MacNeill |
5:89031b2f5316 | 682 | * @note This function doesn't Accesses the device |
Charles MacNeill |
5:89031b2f5316 | 683 | * |
Charles MacNeill |
5:89031b2f5316 | 684 | * @param Dev Device Handle |
Charles MacNeill |
5:89031b2f5316 | 685 | * @param pOpticalCenterX pointer to the X position of center |
Charles MacNeill |
5:89031b2f5316 | 686 | * in 16.16 fix point |
Charles MacNeill |
5:89031b2f5316 | 687 | * @param pOpticalCenterY pointer to the Y position of center |
Charles MacNeill |
5:89031b2f5316 | 688 | * in 16.16 fix point |
Charles MacNeill |
5:89031b2f5316 | 689 | * @return VL53L1_ERROR_NONE Success |
Charles MacNeill |
5:89031b2f5316 | 690 | * @return "Other error code" See ::VL53LX_Error |
Charles MacNeill |
5:89031b2f5316 | 691 | */ |
Charles MacNeill |
5:89031b2f5316 | 692 | VL53LX_Error VL53LX_GetOpticalCenter(VL53LX_DEV Dev, |
Charles MacNeill |
5:89031b2f5316 | 693 | FixPoint1616_t *pOpticalCenterX, |
Charles MacNeill |
5:89031b2f5316 | 694 | FixPoint1616_t *pOpticalCenterY); |
Charles MacNeill |
5:89031b2f5316 | 695 | |
Charles MacNeill |
5:89031b2f5316 | 696 | |
Charles MacNeill |
5:89031b2f5316 | 697 | /** @} VL53LX_Calibration_group */ |
Charles MacNeill |
5:89031b2f5316 | 698 | |
Charles MacNeill |
5:89031b2f5316 | 699 | /** @} VL53LX_group */ |
Charles MacNeill |
5:89031b2f5316 | 700 | |
Charles MacNeill |
5:89031b2f5316 | 701 | #ifdef __cplusplus |
Charles MacNeill |
5:89031b2f5316 | 702 | } |
Charles MacNeill |
5:89031b2f5316 | 703 | #endif |
Charles MacNeill |
5:89031b2f5316 | 704 | |
Charles MacNeill |
5:89031b2f5316 | 705 | #endif /* _VL53LX_API_H_ */ |