Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: VL53L3ExpansionBoard
vl53lx_class.h
00001 /******************************************************************************* 00002 Copyright © 2018, STMicroelectronics International N.V. 00003 All rights reserved. 00004 Redistribution and use in source and binary forms, with or without 00005 modification, are permitted provided that the following conditions are met: 00006 * Redistributions of source code must retain the above copyright 00007 notice, this list of conditions and the following disclaimer. 00008 * Redistributions in binary form must reproduce the above copyright 00009 notice, this list of conditions and the following disclaimer in the 00010 documentation and/or other materials provided with the distribution. 00011 * Neither the name of STMicroelectronics nor the 00012 names of its contributors may be used to endorse or promote products 00013 derived from this software without specific prior written permission. 00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00015 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00016 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND 00017 NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED. 00018 IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY 00019 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00020 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00021 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00022 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00023 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 *****************************************************************************/ 00026 00027 #ifndef __VL53LX_CLASS_H 00028 #define __VL53LX_CLASS_H 00029 00030 #ifdef _MSC_VER 00031 #ifdef VL53LX_API_EXPORTS 00032 #define VL53LX_API __declspec(dllexport) 00033 #else 00034 #define VL53LX_API 00035 #endif 00036 #else 00037 #define VL53LX_API 00038 #endif 00039 00040 /* Includes ------------------------------------------------------------------*/ 00041 //#include "Arduino.h" 00042 #include "mbed.h" 00043 #include "RangeSensor.h" 00044 #include "vl53lx_def.h" 00045 #include "vl53L3_I2c.h" 00046 //#include <Wire.h> 00047 00048 00049 #include "PinNames.h" 00050 #include "vl53lx_error_codes.h" 00051 #include "vl53lx_platform_user_data.h" 00052 00053 #include "Stmpe1600.h" 00054 /**********************************************************/ 00055 00056 00057 #define VL53LX_DEFAULT_DEVICE_ADDRESS 0x52 00058 00059 00060 /* vl53lx_api_core.c */ 00061 #define VL53LX_MAX_I2C_XFER_SIZE 256 00062 /* vl53lx_core.c */ 00063 // VL53LX_Error VL53LX_dynamic_xtalk_correction_corrector() 00064 #define CONT_CONTINUE 0 00065 #define CONT_NEXT_LOOP 1 00066 #define CONT_RESET 2 00067 00068 00069 /* vl53lx_api.c */ 00070 00071 #ifndef MIN 00072 #define MIN(v1, v2) ((v1) < (v2) ? (v1) : (v2)) 00073 #endif 00074 #ifndef MAX 00075 #define MAX(v1, v2) ((v1) < (v2) ? (v2) : (v1)) 00076 #endif 00077 00078 #define DMAX_REFLECTANCE_IDX 2 00079 00080 00081 00082 #define LOWPOWER_AUTO_VHV_LOOP_DURATION_US 245 00083 #define LOWPOWER_AUTO_OVERHEAD_BEFORE_A_RANGING 1448 00084 #define LOWPOWER_AUTO_OVERHEAD_BETWEEN_A_B_RANGING 2100 00085 00086 #define FDA_MAX_TIMING_BUDGET_US 550000 00087 00088 00089 #define VL53LX_NVM_POWER_UP_DELAY_US 50 00090 #define VL53LX_NVM_READ_TRIGGER_DELAY_US 5 00091 00092 00093 #define VL53LX_D_002 0xFFFF 00094 #define VL53LX_D_008 0xFFFF 00095 #define VL53LX_D_003 0xFFFFFF 00096 #define VL53LX_D_007 0xFFFFFFFF 00097 #define VL53LX_D_005 0x7FFFFFFFFF 00098 #define VL53LX_D_009 0xFFFFFFFFFF 00099 #define VL53LX_D_010 0xFFFFFFFFFFFF 00100 #define VL53LX_D_004 0xFFFFFFFFFFFFFF 00101 #define VL53LX_D_006 0x7FFFFFFFFFFFFFFF 00102 #define VL53LX_D_011 0xFFFFFFFFFFFFFFFF 00103 00104 #define VL53L1X_DEFAULT_DEVICE_ADDRESS 0x52 00105 #define HIGH 1 00106 /* 00107 00108 int BDTable[11] = { 00109 TUNING_VERSION, 00110 TUNING_PROXY_MIN, 00111 TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM, 00112 TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER, 00113 TUNING_MIN_AMBIENT_DMAX_VALID, 00114 TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER, 00115 TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM, 00116 TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT, 00117 TUNING_XTALK_FULL_ROI_BIN_SUM_MARGIN, 00118 TUNING_XTALK_FULL_ROI_DEFAULT_OFFSET, 00119 TUNING_ZERO_DISTANCE_OFFSET_NON_LINEAR_FACTOR_DEFAULT 00120 }; 00121 */ 00122 00123 /* Classes -------------------------------------------------------------------*/ 00124 /** Class representing a VL53LX sensor component 00125 */ 00126 00127 class VL53LX : public RangeSensor { 00128 public: 00129 /** Constructor 00130 * @param[in] &i2c device I2C to be used for communication 00131 * @param[in] &pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT 00132 * @param[in] DevAddr device address, 0x52 by default 00133 */ 00134 VL53LX(vl53L3_DevI2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr = VL53L1X_DEFAULT_DEVICE_ADDRESS) 00135 : RangeSensor(), dev_i2c(i2c), _gpio0(pin) 00136 { 00137 MyDevice.I2cDevAddr = dev_addr; 00138 MyDevice.I2cHandle = i2c; 00139 Dev = &MyDevice; 00140 00141 _expgpio0 = NULL; 00142 if (pin_gpio1 != NC) { 00143 _gpio1Int = new InterruptIn(pin_gpio1); 00144 } else { 00145 _gpio1Int = NULL; 00146 } 00147 } 00148 00149 00150 00151 VL53LX(vl53L3_DevI2C *i2c, Stmpe1600DigiOut *pin, PinName pin_gpio1, uint8_t dev_addr = VL53LX_DEFAULT_DEVICE_ADDRESS) 00152 : RangeSensor(), dev_i2c(i2c), _expgpio0(pin) 00153 { 00154 MyDevice.I2cDevAddr=dev_addr; 00155 MyDevice.I2cHandle = i2c; 00156 Dev = &MyDevice; 00157 00158 _gpio0 = NULL; 00159 if (pin_gpio1 != NC) { 00160 _gpio1Int = new InterruptIn(pin_gpio1); 00161 } else { 00162 _gpio1Int = NULL; 00163 } 00164 00165 // i2c_inst = i2c; 00166 } 00167 00168 00169 /** Destructor 00170 */ 00171 virtual ~VL53LX() {} 00172 /* warning: VL53LX class inherits from GenericSensor, RangeSensor and LightSensor, that haven`t a destructor. 00173 The warning should request to introduce a virtual destructor to make sure to delete the object */ 00174 00175 /*** Interface Methods ***/ 00176 /*** High level API ***/ 00177 /** 00178 * @brief PowerOn the sensor 00179 * @return void 00180 */ 00181 /* turns on the sensor */ 00182 00183 00184 /* turns on the sensor */ 00185 virtual void VL53LX_On(void) 00186 { 00187 printf("VL53L1_On\r\n"); 00188 if (_gpio0) { 00189 *_gpio0 = 1; 00190 } else { 00191 if (_expgpio0) { 00192 *_expgpio0 = 1; 00193 } 00194 } 00195 wait_ms(10); 00196 } 00197 00198 /** 00199 * @brief PowerOff the sensor 00200 * @return void 00201 */ 00202 /* turns off the sensor */ 00203 virtual void VL53LX_Off(void) 00204 { 00205 printf("VL53L1_Off\r\n"); 00206 if (_gpio0) { 00207 *_gpio0 = 0; 00208 } else { 00209 if (_expgpio0) { 00210 *_expgpio0 = 0; 00211 } 00212 } 00213 wait_ms(10); 00214 } 00215 /* 00216 virtual void VL53LX_On(void) 00217 { 00218 if (gpio0 >= 0) { 00219 digitalWrite(gpio0, HIGH); 00220 } 00221 delay(10); 00222 } 00223 */ 00224 00225 /** 00226 * @brief PowerOff the sensor 00227 * @return void 00228 */ 00229 /* turns off the sensor */ 00230 /* 00231 virtual void VL53LX_Off(void) 00232 { 00233 if (gpio0 >= 0) { 00234 digitalWrite(gpio0, LOW); 00235 } 00236 delay(10); 00237 } 00238 */ 00239 00240 /** 00241 * @brief Initialize the sensor with default values 00242 * @return 0 on Success 00243 */ 00244 00245 VL53LX_Error InitSensor(uint8_t address) 00246 { 00247 VL53LX_Error status = VL53LX_ERROR_NONE; 00248 VL53LX_Off(); 00249 VL53LX_On(); 00250 00251 status = VL53LX_SetDeviceAddress(address); 00252 00253 if (status == VL53LX_ERROR_NONE) { 00254 status = VL53LX_WaitDeviceBooted(); 00255 } 00256 00257 if (status == VL53LX_ERROR_NONE) { 00258 status = VL53LX_DataInit(); 00259 } 00260 return status; 00261 } 00262 00263 00264 00265 /** 00266 * 00267 * @brief One time device initialization 00268 * @param void 00269 * @return 0 on success 00270 */ 00271 // virtual int Init() 00272 virtual int init(void *init) 00273 { 00274 return VL53LX_DataInit(); 00275 } 00276 00277 00278 00279 /* Read function of the ID device */ 00280 // virtual int ReadID() 00281 virtual int read_id(uint8_t *id) 00282 { 00283 uint64_t Uid; 00284 VL53LX_GetUID(&Uid); 00285 if (Uid == 0x00FF000000FF) { 00286 return 0; 00287 } 00288 return -1; 00289 } 00290 00291 00292 00293 /** 00294 * @brief Get ranging result and only that 00295 * @param pRange_mm Pointer to range distance 00296 * @return 0 on success 00297 */ 00298 // virtual int GetDistance(uint32_t *piData) 00299 virtual int get_distance(uint32_t *pi_data) 00300 { 00301 int status; 00302 uint16_t distance = 0; 00303 // status = vl53l1x_get_distance(&distance); 00304 *pi_data = (uint32_t) distance; 00305 return status; 00306 } 00307 00308 00309 /* vl53lx_api.h */ 00310 00311 /** @defgroup VL53LX_group VL53LX Function Definition 00312 * @brief VL53LX Function Definition 00313 * @{ 00314 */ 00315 00316 /** @defgroup VL53LX_general_group VL53LX General Functions 00317 * @brief General functions and definitions 00318 * @{ 00319 */ 00320 00321 /** 00322 * @brief Return the VL53LX driver Version 00323 * 00324 * @note This function doesn't access to the device 00325 * 00326 * @param pVersion Rer to current driver Version 00327 * @return VL53LX_Error_NONE Success 00328 * @return "Other error code" See ::VL53LX_Error 00329 */ 00330 VL53LX_Error VL53LX_GetVersion(VL53LX_Version_t *pVersion); 00331 00332 /** 00333 * @brief Reads the Product Revision for a for given Device 00334 * This function can be used to distinguish cut1.0 from cut1.1. 00335 * 00336 * @param Dev Device Handle 00337 * @param pProductRevisionMajor Pointer to Product Revision Major 00338 * for a given Device 00339 * @param pProductRevisionMinor Pointer to Product Revision Minor 00340 * for a given Device 00341 * @return VL53LX_Error_NONE Success 00342 * @return "Other error code" See ::VL53LX_Error 00343 */ 00344 VL53LX_Error VL53LX_GetProductRevision(uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor); 00345 00346 /** 00347 * @brief Reads the Device information for given Device 00348 * 00349 * @note This function Access to the device 00350 * 00351 * @param Dev Device Handle 00352 * @param pVL53LX_DeviceInfo Pointer to current device info for a given 00353 * Device 00354 * @return VL53LX_Error_NONE Success 00355 * @return "Other error code" See ::VL53LX_Error 00356 */ 00357 VL53LX_Error VL53LX_GetDeviceInfo( 00358 VL53LX_DeviceInfo_t *pVL53LX_DeviceInfo); 00359 00360 /** 00361 * @brief Reads the Device unique identifier 00362 * 00363 * @note This function Access to the device 00364 * 00365 * @param Dev Device Handle 00366 * @param pUid Pointer to current device unique ID 00367 * @return VL53LX_Error_NONE Success 00368 * @return "Other error code" See ::VL53LX_Error 00369 */ 00370 VL53LX_Error VL53LX_GetUID(uint64_t *pUid); 00371 00372 00373 /** @} VL53LX_general_group */ 00374 00375 /** @defgroup VL53LX_init_group VL53LX Init Functions 00376 * @brief VL53LX Init Functions 00377 * @{ 00378 */ 00379 00380 /** 00381 * @brief Set new device address 00382 * 00383 * After completion the device will answer to the new address programmed. 00384 * This function should be called when several devices are used in parallel 00385 * before start programming the sensor. 00386 * When a single device us used, there is no need to call this function. 00387 * 00388 * When it is requested for multi devices system this function MUST be called 00389 * prior to VL53LX_DataInit() 00390 * 00391 * @note This function Access to the device 00392 * 00393 * @param Dev Device Handle 00394 * @param DeviceAddress The new Device address 00395 * @return VL53LX_Error_NONE Success 00396 * @return "Other error code" See ::VL53LX_Error 00397 */ 00398 VL53LX_Error VL53LX_SetDeviceAddress(uint8_t DeviceAddress); 00399 00400 /** 00401 * 00402 * @brief One time device initialization 00403 * 00404 * To be called after device has been powered on and booted 00405 * see @a VL53LX_WaitDeviceBooted() 00406 * 00407 * @par Function Description 00408 * When not used after a fresh device "power up", it may return 00409 * @a #VL53LX_Error_CALIBRATION_WARNING meaning wrong calibration data 00410 * may have been fetched from device that can result in ranging offset error\n 00411 * If VL53LX_DataInit is called several times then the application must restore 00412 * calibration calling @a VL53LX_SetOffsetCalibrationData() 00413 * It implies application has gathered calibration data thanks to 00414 * @a VL53LX_GetOffsetCalibrationData() after an initial calibration stage. 00415 * 00416 * @note This function Access to the device 00417 * 00418 * @param Dev Device Handle 00419 * @return VL53LX_Error_NONE Success 00420 * @return "Other error code" See ::VL53LX_Error 00421 */ 00422 VL53LX_Error VL53LX_DataInit(); 00423 00424 /** 00425 * @brief Wait for device booted after chip enable (hardware standby) 00426 * 00427 * @param Dev Device Handle 00428 * @return VL53LX_Error_NONE Success 00429 * @return "Other error code" See ::VL53LX_Error 00430 * 00431 */ 00432 VL53LX_Error VL53LX_WaitDeviceBooted(); 00433 00434 00435 /** @} VL53LX_init_group */ 00436 00437 /** @defgroup VL53LX_parameters_group VL53LX Parameters Functions 00438 * @brief Functions used to prepare and setup the device 00439 * @{ 00440 */ 00441 00442 /** 00443 * @brief Set the distance mode 00444 * @par Function Description 00445 * Set the distance mode to be used for the next ranging.<br> 00446 * The modes Short, Medium and Long are used to optimize the ranging accuracy 00447 * in a specific range of distance.<br> The user select one of these modes to 00448 * select the distance range. 00449 * @note This function doesn't Access to the device 00450 * 00451 * @warning This function should be called after @a VL53LX_DataInit(). 00452 00453 * @param Dev Device Handle 00454 * @param DistanceMode Distance mode to apply, valid values are: 00455 * @li VL53LX_DISTANCEMODE_SHORT 00456 * @li VL53LX_DISTANCEMODE_MEDIUM 00457 * @li VL53LX_DISTANCEMODE_LONG 00458 * @return VL53LX_Error_NONE Success 00459 * @return VL53LX_Error_MODE_NOT_SUPPORTED This error occurs when DistanceMode 00460 * is not in the supported list 00461 * @return "Other error code" See ::VL53LX_Error 00462 */ 00463 VL53LX_Error VL53LX_SetDistanceMode( 00464 VL53LX_DistanceModes DistanceMode); 00465 00466 /** 00467 * @brief Get the distance mode 00468 * @par Function Description 00469 * Get the distance mode used for the next ranging. 00470 * 00471 * @param Dev Device Handle 00472 * @param *pDistanceMode Pointer to Distance mode 00473 * @return VL53LX_Error_NONE Success 00474 * @return "Other error code" See ::VL53LX_Error 00475 */ 00476 VL53LX_Error VL53LX_GetDistanceMode( 00477 VL53LX_DistanceModes *pDistanceMode); 00478 00479 00480 /** 00481 * @brief Set Ranging Timing Budget in microseconds 00482 * 00483 * @par Function Description 00484 * Defines the maximum time allowed by the user to the device to run a 00485 * full ranging sequence for the current mode (ranging, histogram, ASL ...) 00486 * 00487 * @param Dev Device Handle 00488 * @param MeasurementTimingBudgetMicroSeconds Max measurement time in 00489 * microseconds. 00490 * @return VL53LX_Error_NONE Success 00491 * @return VL53LX_Error_INVALID_PARAMS Error timing parameter not 00492 * supported. 00493 * The maximum accepted value for the 00494 * computed timing budget is 10 seconds 00495 * the minimum value depends on the preset 00496 * mode selected. 00497 * @return "Other error code" See ::VL53LX_Error 00498 */ 00499 VL53LX_Error VL53LX_SetMeasurementTimingBudgetMicroSeconds(uint32_t MeasurementTimingBudgetMicroSeconds); 00500 00501 /** 00502 * @brief Get Ranging Timing Budget in microseconds 00503 * 00504 * @par Function Description 00505 * Returns the programmed the maximum time allowed by the user to the 00506 * device to run a full ranging sequence for the current mode 00507 * (ranging, histogram, ...) 00508 * 00509 * @param Dev Device Handle 00510 * @param pMeasurementTimingBudgetMicroSeconds Max measurement time in 00511 * microseconds. 00512 * @return VL53LX_Error_NONE Success 00513 * @return "Other error code" See ::VL53LX_Error 00514 */ 00515 VL53LX_Error VL53LX_GetMeasurementTimingBudgetMicroSeconds(uint32_t *pMeasurementTimingBudgetMicroSeconds); 00516 /** @} VL53LX_parameters_group */ 00517 00518 00519 /** @defgroup VL53LX_measurement_group VL53LX Measurement Functions 00520 * @brief Functions used for the measurements 00521 * @{ 00522 */ 00523 00524 /** 00525 * @brief Start device measurement 00526 * 00527 * @details Started measurement will depend on distance parameter set through 00528 * @a VL53LX_SetDistanceMode() 00529 * 00530 * @note This function Access to the device 00531 * 00532 * @param Dev Device Handle 00533 * @return VL53LX_Error_NONE Success 00534 * @return VL53LX_Error_TIME_OUT Time out on start measurement 00535 * @return VL53LX_Error_INVALID_PARAMS This error might occur in timed mode 00536 * when inter measurement period is smaller or too close to the timing budget. 00537 * In such case measurements are not started and user must correct the timings 00538 * passed to @a VL53LX_SetMeasurementTimingBudgetMicroSeconds() and 00539 * @a VL53LX_SetInterMeasurementPeriodMilliSeconds() functions. 00540 * @return "Other error code" See ::VL53LX_Error 00541 */ 00542 VL53LX_Error VL53LX_StartMeasurement(); 00543 00544 /** 00545 * @brief Stop device measurement 00546 * 00547 * @details Will set the device in standby mode at end of current measurement\n 00548 * Not necessary in single mode as device shall return automatically 00549 * in standby mode at end of measurement. 00550 * 00551 * @note This function Access to the device 00552 * 00553 * @param Dev Device Handle 00554 * @return VL53LX_Error_NONE Success 00555 * @return "Other error code" See ::VL53LX_Error 00556 */ 00557 VL53LX_Error VL53LX_StopMeasurement(); 00558 00559 /** 00560 * @brief Clear the Interrupt flag and start new measurement 00561 * * 00562 * @note This function Access to the device 00563 * 00564 * @param Dev Device Handle 00565 * @return VL53LX_Error_NONE Success 00566 * @return "Other error code" See ::VL53LX_Error 00567 */ 00568 VL53LX_Error VL53LX_ClearInterruptAndStartMeasurement(); 00569 00570 /** 00571 * @brief Return Measurement Data Ready 00572 * 00573 * @par Function Description 00574 * This function indicate that a measurement data is ready. 00575 * This function is used for non-blocking capture. 00576 * 00577 * @note This function Access to the device 00578 * 00579 * @param Dev Device Handle 00580 * @param pMeasurementDataReady Pointer to Measurement Data Ready. 00581 * 0 = data not ready, 1 = data ready 00582 * @return VL53LX_Error_NONE Success 00583 * @return "Other error code" See ::VL53LX_Error 00584 */ 00585 VL53LX_Error VL53LX_GetMeasurementDataReady( 00586 uint8_t *pMeasurementDataReady); 00587 00588 /** 00589 * @brief Wait for measurement data ready. 00590 * Blocking function. 00591 * Note that the timeout is given by: 00592 * VL53LX_RANGE_COMPLETION_POLLING_TIMEOUT_MS defined in def.h 00593 * 00594 * 00595 * @note This function Access to the device 00596 * 00597 * @param Dev Device Handle 00598 * @return VL53LX_Error_NONE Success 00599 * @return VL53LX_Error_TIME_OUT In case of timeout 00600 */ 00601 VL53LX_Error VL53LX_WaitMeasurementDataReady(); 00602 00603 00604 /** 00605 * @brief Retrieve all measurements from device with the current setup 00606 * 00607 * @par Function Description 00608 * Get data from last successful Ranging measurement 00609 * 00610 * @warning USER must call @a VL53LX_ClearInterruptAndStartMeasurement() prior 00611 * to call again this function 00612 * 00613 * @note This function Access to the device 00614 * 00615 * @note The first valid value returned by this function will have a range 00616 * status equal to VL53LX_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK which means that 00617 * the data is valid but no wrap around check have been done. User should take 00618 * care about that. 00619 * 00620 * @param Dev Device Handle 00621 * @param pMultiRangingData Pointer to the data structure to fill up. 00622 * @return VL53LX_Error_NONE Success 00623 * @return "Other error code" See ::VL53LX_Error 00624 */ 00625 VL53LX_Error VL53LX_GetMultiRangingData(VL53LX_MultiRangingData_t *pMultiRangingData); 00626 00627 /** 00628 * @brief Get Additional Data 00629 * 00630 * @par Function Description 00631 * This function is used to get lld debugging data on the last histogram 00632 * measurement. shall be called when a new measurement is ready (interrupt or 00633 * positive VL53LX_GetMeasurementDataReady() polling) and before a call to 00634 * VL53LX_ClearInterruptAndStartMeasurement(). 00635 * 00636 * @param Dev Device Handle 00637 * @param pAdditionalData Pointer to Additional data 00638 * @return VL53LX_Error_NONE Success 00639 * @return "Other error code" See ::VL53LX_Error 00640 */ 00641 //VL53LX_Error VL53LX_GetAdditionalData( VL53LX_AdditionalData_t *pAdditionalData); 00642 00643 00644 /** @} VL53LX_measurement_group */ 00645 00646 /** @defgroup VL53LX_Calibration_group VL53LX Calibration Functions 00647 * @brief Functions used for Calibration 00648 * @{ 00649 */ 00650 00651 00652 /** 00653 * @brief Set Tuning Parameter value for a given parameter ID 00654 * 00655 * @par Function Description 00656 * This function is used to improve the performance of the device. It permit to 00657 * change a particular value used for a timeout or a threshold or a constant 00658 * in an algorithm. The function will change the value of the parameter 00659 * identified by an unique ID. 00660 * 00661 * @note This function doesn't Access to the device 00662 * 00663 * @param Dev Device Handle 00664 * @param TuningParameterId Tuning Parameter ID 00665 * @param TuningParameterValue Tuning Parameter Value 00666 * @return VL53LX_Error_NONE Success 00667 * @return "Other error code" See ::VL53LX_Error 00668 */ 00669 VL53LX_Error VL53LX_SetTuningParameter( 00670 uint16_t TuningParameterId, int32_t TuningParameterValue); 00671 00672 /** 00673 * @brief Get Tuning Parameter value for a given parameter ID 00674 * 00675 * @par Function Description 00676 * This function is used to get the value of the parameter 00677 * identified by an unique ID. 00678 * 00679 * @note This function doesn't Access to the device 00680 * 00681 * @param Dev Device Handle 00682 * @param TuningParameterId Tuning Parameter ID 00683 * @param pTuningParameterValue Pointer to Tuning Parameter Value 00684 * for a given TuningParameterId. 00685 * @return VL53LX_Error_NONE Success 00686 * @return "Other error code" See ::VL53LX_Error 00687 */ 00688 VL53LX_Error VL53LX_GetTuningParameter( 00689 uint16_t TuningParameterId, int32_t *pTuningParameterValue); 00690 00691 /** 00692 * @brief Performs Reference Spad Management 00693 * 00694 * @par Function Description 00695 * The reference SPAD initialization procedure determines the minimum amount 00696 * of reference spads to be enables to achieve a target reference signal rate 00697 * and should be performed once during initialization. 00698 * 00699 * @note This function Access to the device 00700 * 00701 * @param Dev Device Handle 00702 * @return VL53LX_Error_NONE Success 00703 * @return "Other error code" See ::VL53LX_Error 00704 */ 00705 VL53LX_Error VL53LX_PerformRefSpadManagement(); 00706 00707 /** 00708 * @brief Enable/Disable dynamic Xtalk compensation feature 00709 * 00710 * Enable/Disable dynamic Xtalk compensation (aka smudge correction). 00711 * 00712 * @param Dev Device Handle 00713 * @param Mode Set the smudge correction mode 00714 * See ::VL53LX_SmudgeCorrectionModes 00715 * @return VL53LX_Error_NONE Success 00716 * @return "Other error code" See ::VL53LX_Error 00717 */ 00718 VL53LX_Error VL53LX_SmudgeCorrectionEnable( 00719 VL53LX_SmudgeCorrectionModes Mode); 00720 00721 00722 /** 00723 * @brief Enable/Disable Cross talk compensation feature 00724 * 00725 * Enable/Disable Cross Talk correction. 00726 * 00727 * @param Dev Device Handle 00728 * @param XTalkCompensationEnable Cross talk compensation 00729 * to be set 0 = disabled or 1 = enabled. 00730 * @return VL53LX_Error_NONE Success 00731 * @return "Other error code" See ::VL53LX_Error 00732 */ 00733 VL53LX_Error VL53LX_SetXTalkCompensationEnable( 00734 uint8_t XTalkCompensationEnable); 00735 00736 /** 00737 * @brief Get Cross talk compensation rate enable 00738 * 00739 * Get if the Cross Talk is Enabled or Disabled. 00740 * 00741 * @note This function doesn't access to the device 00742 * 00743 * @param Dev Device Handle 00744 * @param pXTalkCompensationEnable Pointer to the Cross talk compensation 00745 * state 0=disabled or 1 = enabled 00746 * @return VL53LX_Error_NONE Success 00747 * @return "Other error code" See ::VL53LX_Error 00748 */ 00749 VL53LX_Error VL53LX_GetXTalkCompensationEnable( 00750 uint8_t *pXTalkCompensationEnable); 00751 00752 /** 00753 * @brief Perform XTalk Calibration 00754 * 00755 * @details Perform a XTalk calibration of the Device. 00756 * This function will launch a measurement, if interrupts 00757 * are enabled an interrupt will be done. 00758 * This function will clear the interrupt generated automatically. 00759 * This function will program a new value for the XTalk compensation 00760 * and it will enable the cross talk before exit. 00761 * 00762 * @warning This function is a blocking function 00763 * 00764 * @note This function Access to the device 00765 * 00766 * @param Dev Device Handle 00767 * the calibration sets appropriate 00768 * distance mode and thus override existing one<br> 00769 * The calibration uses a target which should be located at least @60cm from the 00770 * device. The actual location of the target shall be passed 00771 * through the bare driver tuning parameters table 00772 * 00773 * @return VL53LX_Error_NONE Success 00774 * @return "Other error code" See ::VL53LX_Error 00775 */ 00776 VL53LX_Error VL53LX_PerformXTalkCalibration(); 00777 00778 00779 /** 00780 * @brief Define the mode to be used for the offset correction 00781 * 00782 * Define the mode to be used for the offset correction. 00783 * 00784 * @param Dev Device Handle 00785 * @param OffsetCorrectionMode Offset Correction Mode valid values are: 00786 * @li VL53LX_OFFSETCORRECTIONMODE_STANDARD 00787 * @li VL53LX_OFFSETCORRECTIONMODE_PERVCSEL 00788 * 00789 * @return VL53LX_Error_NONE Success 00790 * @return "Other error code" See ::VL53LX_Error 00791 */ 00792 VL53LX_Error VL53LX_SetOffsetCorrectionMode( 00793 VL53LX_OffsetCorrectionModes OffsetCorrectionMode); 00794 00795 00796 /** 00797 * @brief Perform Offset simple Calibration 00798 * 00799 * @details Perform a very simple offset calibration of the Device. 00800 * This function will launch few ranging measurements and computes offset 00801 * calibration. The preset mode and the distance mode MUST be set by the 00802 * application before to call this function. 00803 * 00804 * @warning This function is a blocking function 00805 * 00806 * @note This function Access to the device 00807 * 00808 * @param Dev Device Handle 00809 * @param CalDistanceMilliMeter Calibration distance value used for the 00810 * offset compensation. 00811 * 00812 * @return VL53LX_Error_NONE 00813 * @return VL53LX_Error_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by 00814 * lack of valid measurements 00815 * @return VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target 00816 * distance combined to the number of loops performed in the calibration lead to 00817 * an internal overflow. Try to reduce the distance of the target (140 mm) 00818 * @return "Other error code" See ::VL53LX_Error 00819 */ 00820 VL53LX_Error VL53LX_PerformOffsetSimpleCalibration( 00821 int32_t CalDistanceMilliMeter); 00822 00823 /** 00824 * @brief Perform Offset simple Calibration with a "zero distance" target 00825 * 00826 * @details Perform a simple offset calibration of the Device. 00827 * This function will launch few ranging measurements and computes offset 00828 * calibration. The preset mode and the distance mode MUST be set by the 00829 * application before to call this function. 00830 * A target must be place very close to the device. 00831 * Ideally the target shall be touching the coverglass. 00832 * 00833 * @warning This function is a blocking function 00834 * 00835 * @note This function Access to the device 00836 * 00837 * @param Dev Device Handle 00838 * 00839 * @return VL53LX_Error_NONE 00840 * @return VL53LX_Error_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by 00841 * lack of valid measurements 00842 * @return VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target 00843 * distance is too large, try to put the target closer to the device 00844 * @return "Other error code" See ::VL53LX_Error 00845 */ 00846 VL53LX_Error VL53LX_PerformOffsetZeroDistanceCalibration(); 00847 00848 00849 /** 00850 * @brief Perform Offset per Vcsel Calibration. i.e. per distance mode 00851 * 00852 * @details Perform offset calibration of the Device depending on the 00853 * three distance mode settings: short, medium and long. 00854 * This function will launch few ranging measurements and computes offset 00855 * calibration in each of the three distance modes. 00856 * The preset mode MUST be set by the application before to call this function. 00857 * 00858 * @warning This function is a blocking function 00859 * 00860 * @note This function Access to the device 00861 * 00862 * @param Dev Device Handle 00863 * @param CalDistanceMilliMeter Distance of the target used for the 00864 * offset compensation calibration. 00865 * 00866 * @return VL53LX_Error_NONE 00867 * @return VL53LX_Error_OFFSET_CAL_NO_SAMPLE_FAIL the calibration failed by 00868 * lack of valid measurements 00869 * @return VL53LX_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH means that the target 00870 * distance combined to the number of loops performed in the calibration lead to 00871 * an internal overflow. Try to reduce the distance of the target (140 mm) 00872 * @return "Other error code" See ::VL53LX_Error 00873 */ 00874 VL53LX_Error VL53LX_PerformOffsetPerVcselCalibration( 00875 int32_t CalDistanceMilliMeter); 00876 00877 00878 /** 00879 * @brief Sets the Calibration Data. 00880 * 00881 * @par Function Description 00882 * This function set all the Calibration Data issued from the functions 00883 * @a VL53LX_PerformRefSpadManagement(), @a VL53LX_PerformXTalkCalibration, 00884 * @a VL53LX_PerformOffsetCalibration() 00885 * 00886 * @note This function doesn't Accesses the device 00887 * 00888 * @param Dev Device Handle 00889 * @param *pCalibrationData Pointer to Calibration data to be set. 00890 * @return VL53LX_Error_NONE Success 00891 * @return VL53LX_Error_INVALID_PARAMS pCalibrationData points to an older 00892 * version of the inner structure. Need for support to convert its content. 00893 * @return "Other error code" See ::VL53LX_Error 00894 */ 00895 VL53LX_Error VL53LX_SetCalibrationData( 00896 VL53LX_CalibrationData_t *pCalibrationData); 00897 00898 /** 00899 * @brief Gets the Calibration Data. 00900 * 00901 * @par Function Description 00902 * This function get all the Calibration Data issued from the functions 00903 * @a VL53LX_PerformRefSpadManagement(), @a VL53LX_PerformXTalkCalibration, 00904 * @a VL53LX_PerformOffsetCalibration() 00905 * 00906 * @note This function doesn't Accesses the device 00907 * 00908 * @param Dev Device Handle 00909 * @param *pCalibrationData pointer where to store Calibration 00910 * data. 00911 * @return VL53LX_Error_NONE Success 00912 * @return "Other error code" See ::VL53LX_Error 00913 */ 00914 VL53LX_Error VL53LX_GetCalibrationData( 00915 VL53LX_CalibrationData_t *pCalibrationData); 00916 00917 /** @} VL53LX_Calibration_group */ 00918 00919 /** @} VL53LX_group */ 00920 VL53LX_Error VL53LX_RdWord(VL53LX_DEV Dev, uint16_t index, uint16_t *data); 00921 00922 protected: 00923 00924 /* vl53lx_api_core.h functions */ 00925 00926 VL53LX_Error VL53LX_get_version(VL53LX_ll_version_t *pversion); 00927 VL53LX_Error VL53LX_get_device_firmware_version(uint16_t *pfw_version); 00928 VL53LX_Error VL53LX_data_init(uint8_t read_p2p_data); 00929 VL53LX_Error VL53LX_read_p2p_data(); 00930 VL53LX_Error VL53LX_software_reset(); 00931 VL53LX_Error VL53LX_set_part_to_part_data(VL53LX_calibration_data_t *pcal_data); 00932 VL53LX_Error VL53LX_get_part_to_part_data(VL53LX_calibration_data_t *pcal_data); 00933 VL53LX_Error VL53LX_get_tuning_debug_data(VL53LX_tuning_parameters_t *ptun_data); 00934 VL53LX_Error VL53LX_set_inter_measurement_period_ms(uint32_t inter_measurement_period_ms); 00935 VL53LX_Error VL53LX_get_inter_measurement_period_ms(uint32_t *pinter_measurement_period_ms); 00936 VL53LX_Error VL53LX_set_timeouts_us( 00937 uint32_t phasecal_config_timeout_us, 00938 uint32_t mm_config_timeout_us, 00939 uint32_t range_config_timeout_us); 00940 00941 VL53LX_Error VL53LX_get_timeouts_us( 00942 uint32_t *pphasecal_config_timeout_us, 00943 uint32_t *pmm_config_timeout_us, 00944 uint32_t *prange_config_timeout_us); 00945 00946 VL53LX_Error VL53LX_set_calibration_repeat_period( 00947 uint16_t cal_config__repeat_period); 00948 00949 VL53LX_Error VL53LX_get_calibration_repeat_period( 00950 uint16_t *pcal_config__repeat_period); 00951 00952 VL53LX_Error VL53LX_set_sequence_config_bit( 00953 VL53LX_DeviceSequenceConfig bit_id, 00954 uint8_t value); 00955 00956 VL53LX_Error VL53LX_get_sequence_config_bit( 00957 VL53LX_DeviceSequenceConfig bit_id, 00958 uint8_t *pvalue); 00959 00960 VL53LX_Error VL53LX_set_interrupt_polarity( 00961 VL53LX_DeviceInterruptPolarity interrupt_polarity); 00962 00963 VL53LX_Error VL53LX_get_interrupt_polarity( 00964 VL53LX_DeviceInterruptPolarity *pinterrupt_polarity); 00965 00966 VL53LX_Error VL53LX_get_refspadchar_config_struct( 00967 VL53LX_refspadchar_config_t *pdata); 00968 00969 VL53LX_Error VL53LX_set_refspadchar_config_struct( 00970 VL53LX_refspadchar_config_t *pdata); 00971 00972 VL53LX_Error VL53LX_set_range_ignore_threshold( 00973 uint8_t range_ignore_thresh_mult, 00974 uint16_t range_ignore_threshold_mcps); 00975 00976 VL53LX_Error VL53LX_get_range_ignore_threshold( 00977 uint8_t *prange_ignore_thresh_mult, 00978 uint16_t *prange_ignore_threshold_mcps_internal, 00979 uint16_t *prange_ignore_threshold_mcps_current); 00980 00981 VL53LX_Error VL53LX_set_user_zone( 00982 VL53LX_user_zone_t *puser_zone); 00983 00984 VL53LX_Error VL53LX_get_user_zone( 00985 VL53LX_user_zone_t *puser_zone); 00986 00987 00988 VL53LX_Error VL53LX_get_mode_mitigation_roi( 00989 VL53LX_user_zone_t *pmm_roi); 00990 00991 00992 VL53LX_Error VL53LX_set_zone_config( 00993 VL53LX_zone_config_t *pzone_cfg); 00994 00995 VL53LX_Error VL53LX_get_zone_config( 00996 VL53LX_zone_config_t *pzone_cfg); 00997 00998 00999 VL53LX_Error VL53LX_set_preset_mode( 01000 VL53LX_DevicePresetModes device_preset_mode, 01001 uint16_t dss_config__target_total_rate_mcps, 01002 uint32_t phasecal_config_timeout_us, 01003 uint32_t mm_config_timeout_us, 01004 uint32_t range_config_timeout_us, 01005 uint32_t inter_measurement_period_ms); 01006 01007 VL53LX_Error VL53LX_get_preset_mode_timing_cfg( 01008 VL53LX_DevicePresetModes device_preset_mode, 01009 uint16_t *pdss_config__target_total_rate_mcps, 01010 uint32_t *pphasecal_config_timeout_us, 01011 uint32_t *pmm_config_timeout_us, 01012 uint32_t *prange_config_timeout_us); 01013 01014 01015 VL53LX_Error VL53LX_set_zone_preset( 01016 VL53LX_DeviceZonePreset zone_preset); 01017 01018 01019 VL53LX_Error VL53LX_enable_xtalk_compensation(); 01020 01021 VL53LX_Error VL53LX_disable_xtalk_compensation(); 01022 01023 01024 void VL53LX_get_xtalk_compensation_enable( 01025 uint8_t *pcrosstalk_compensation_enable); 01026 01027 01028 VL53LX_Error VL53LX_init_and_start_range( 01029 uint8_t measurement_mode, 01030 VL53LX_DeviceConfigLevel device_config_level); 01031 01032 01033 VL53LX_Error VL53LX_stop_range(); 01034 01035 VL53LX_Error VL53LX_get_measurement_results( 01036 VL53LX_DeviceResultsLevel device_result_level); 01037 01038 01039 VL53LX_Error VL53LX_get_device_results( 01040 VL53LX_DeviceResultsLevel device_result_level, 01041 VL53LX_range_results_t *prange_results); 01042 01043 01044 VL53LX_Error VL53LX_clear_interrupt_and_enable_next_range( 01045 uint8_t measurement_mode); 01046 01047 01048 VL53LX_Error VL53LX_get_histogram_bin_data( 01049 VL53LX_histogram_bin_data_t *phist_data); 01050 01051 void VL53LX_copy_sys_and_core_results_to_range_results( 01052 int32_t gain_factor, 01053 VL53LX_system_results_t *psys, 01054 VL53LX_core_results_t *pcore, 01055 VL53LX_range_results_t *presults); 01056 01057 01058 01059 VL53LX_Error VL53LX_set_zone_dss_config( 01060 VL53LX_zone_private_dyn_cfg_t *pzone_dyn_cfg); 01061 01062 01063 VL53LX_Error VL53LX_calc_ambient_dmax( 01064 uint16_t target_reflectance, 01065 int16_t *pambient_dmax_mm); 01066 01067 01068 VL53LX_Error VL53LX_set_GPIO_interrupt_config( 01069 VL53LX_GPIO_Interrupt_Mode intr_mode_distance, 01070 VL53LX_GPIO_Interrupt_Mode intr_mode_rate, 01071 uint8_t intr_new_measure_ready, 01072 uint8_t intr_no_target, 01073 uint8_t intr_combined_mode, 01074 uint16_t thresh_distance_high, 01075 uint16_t thresh_distance_low, 01076 uint16_t thresh_rate_high, 01077 uint16_t thresh_rate_low 01078 ); 01079 01080 01081 01082 VL53LX_Error VL53LX_set_GPIO_interrupt_config_struct( 01083 VL53LX_GPIO_interrupt_config_t intconf); 01084 01085 01086 VL53LX_Error VL53LX_get_GPIO_interrupt_config( 01087 VL53LX_GPIO_interrupt_config_t *pintconf); 01088 01089 01090 VL53LX_Error VL53LX_set_dmax_mode( 01091 VL53LX_DeviceDmaxMode dmax_mode); 01092 01093 01094 VL53LX_Error VL53LX_get_dmax_mode( 01095 VL53LX_DeviceDmaxMode *pdmax_mode); 01096 01097 01098 VL53LX_Error VL53LX_get_dmax_calibration_data( 01099 VL53LX_DeviceDmaxMode dmax_mode, 01100 VL53LX_dmax_calibration_data_t *pdmax_cal); 01101 01102 01103 VL53LX_Error VL53LX_set_hist_dmax_config( 01104 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg); 01105 01106 VL53LX_Error VL53LX_get_hist_dmax_config( 01107 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg); 01108 01109 01110 VL53LX_Error VL53LX_set_offset_calibration_mode( 01111 VL53LX_OffsetCalibrationMode offset_cal_mode); 01112 01113 01114 VL53LX_Error VL53LX_get_offset_calibration_mode( 01115 VL53LX_OffsetCalibrationMode *poffset_cal_mode); 01116 01117 01118 VL53LX_Error VL53LX_set_offset_correction_mode( 01119 VL53LX_OffsetCalibrationMode offset_cor_mode); 01120 01121 01122 VL53LX_Error VL53LX_get_offset_correction_mode( 01123 VL53LX_OffsetCorrectionMode *poffset_cor_mode); 01124 01125 01126 VL53LX_Error VL53LX_set_zone_calibration_data( 01127 VL53LX_zone_calibration_results_t *pzone_cal); 01128 01129 01130 VL53LX_Error VL53LX_get_zone_calibration_data( 01131 VL53LX_zone_calibration_results_t *pzone_cal); 01132 01133 01134 VL53LX_Error VL53LX_get_lite_xtalk_margin_kcps( 01135 int16_t *pxtalk_margin); 01136 01137 01138 VL53LX_Error VL53LX_set_lite_xtalk_margin_kcps( 01139 int16_t xtalk_margin); 01140 01141 01142 VL53LX_Error VL53LX_get_histogram_xtalk_margin_kcps( 01143 int16_t *pxtalk_margin); 01144 01145 01146 VL53LX_Error VL53LX_set_histogram_xtalk_margin_kcps( 01147 int16_t xtalk_margin); 01148 01149 VL53LX_Error VL53LX_get_histogram_phase_consistency( 01150 uint8_t *pphase_consistency); 01151 01152 01153 01154 VL53LX_Error VL53LX_set_histogram_phase_consistency( 01155 uint8_t phase_consistency); 01156 01157 01158 01159 VL53LX_Error VL53LX_get_histogram_event_consistency( 01160 uint8_t *pevent_consistency); 01161 01162 01163 01164 VL53LX_Error VL53LX_set_histogram_event_consistency( 01165 uint8_t event_consistency); 01166 01167 01168 01169 VL53LX_Error VL53LX_get_histogram_ambient_threshold_sigma( 01170 uint8_t *pamb_thresh_sigma); 01171 01172 01173 01174 VL53LX_Error VL53LX_set_histogram_ambient_threshold_sigma( 01175 01176 uint8_t amb_thresh_sigma); 01177 01178 01179 01180 VL53LX_Error VL53LX_get_lite_min_count_rate( 01181 01182 uint16_t *plite_mincountrate); 01183 01184 01185 01186 01187 VL53LX_Error VL53LX_set_lite_min_count_rate( 01188 01189 uint16_t lite_mincountrate); 01190 01191 01192 01193 01194 01195 VL53LX_Error VL53LX_get_lite_sigma_threshold( 01196 01197 uint16_t *plite_sigma); 01198 01199 01200 01201 01202 VL53LX_Error VL53LX_set_lite_sigma_threshold( 01203 01204 uint16_t lite_sigma); 01205 01206 01207 01208 01209 VL53LX_Error VL53LX_restore_xtalk_nvm_default(); 01210 01211 01212 01213 VL53LX_Error VL53LX_get_xtalk_detect_config( 01214 01215 int16_t *pmax_valid_range_mm, 01216 int16_t *pmin_valid_range_mm, 01217 uint16_t *pmax_valid_rate_kcps, 01218 uint16_t *pmax_sigma_mm); 01219 01220 01221 01222 VL53LX_Error VL53LX_set_xtalk_detect_config( 01223 01224 int16_t max_valid_range_mm, 01225 int16_t min_valid_range_mm, 01226 uint16_t max_valid_rate_kcps, 01227 uint16_t max_sigma_mm); 01228 01229 01230 01231 VL53LX_Error VL53LX_get_target_order_mode( 01232 01233 VL53LX_HistTargetOrder *phist_target_order); 01234 01235 01236 01237 VL53LX_Error VL53LX_set_target_order_mode( 01238 01239 VL53LX_HistTargetOrder hist_target_order); 01240 01241 01242 01243 01244 VL53LX_Error VL53LX_set_dmax_reflectance_values( 01245 01246 VL53LX_dmax_reflectance_array_t *pdmax_reflectances); 01247 01248 01249 01250 VL53LX_Error VL53LX_get_dmax_reflectance_values( 01251 01252 VL53LX_dmax_reflectance_array_t *pdmax_reflectances); 01253 01254 01255 01256 VL53LX_Error VL53LX_set_vhv_config( 01257 uint8_t vhv_init_en, 01258 uint8_t vhv_init_value); 01259 01260 01261 01262 VL53LX_Error VL53LX_get_vhv_config( 01263 uint8_t *pvhv_init_en, 01264 uint8_t *pvhv_init_value); 01265 01266 01267 01268 VL53LX_Error VL53LX_set_vhv_loopbound( 01269 01270 uint8_t vhv_loopbound); 01271 01272 01273 01274 VL53LX_Error VL53LX_get_vhv_loopbound( 01275 01276 uint8_t *pvhv_loopbound); 01277 01278 01279 01280 VL53LX_Error VL53LX_get_tuning_parm( 01281 VL53LX_TuningParms tuning_parm_key, 01282 int32_t *ptuning_parm_value); 01283 01284 01285 01286 VL53LX_Error VL53LX_set_tuning_parm( 01287 VL53LX_TuningParms tuning_parm_key, 01288 int32_t tuning_parm_value); 01289 01290 01291 01292 VL53LX_Error VL53LX_dynamic_xtalk_correction_enable(); 01293 01294 01295 01296 VL53LX_Error VL53LX_dynamic_xtalk_correction_disable(); 01297 01298 01299 01300 01301 VL53LX_Error VL53LX_dynamic_xtalk_correction_apply_enable(); 01302 01303 01304 01305 VL53LX_Error VL53LX_dynamic_xtalk_correction_apply_disable(); 01306 01307 01308 01309 VL53LX_Error VL53LX_dynamic_xtalk_correction_single_apply_enable(); 01310 01311 01312 01313 VL53LX_Error VL53LX_dynamic_xtalk_correction_single_apply_disable(); 01314 01315 01316 01317 VL53LX_Error VL53LX_dynamic_xtalk_correction_set_scalers( 01318 int16_t x_scaler_in, 01319 int16_t y_scaler_in, 01320 uint8_t user_scaler_set_in 01321 ); 01322 01323 01324 01325 VL53LX_Error VL53LX_get_current_xtalk_settings( 01326 01327 VL53LX_xtalk_calibration_results_t *pxtalk 01328 ); 01329 01330 01331 01332 VL53LX_Error VL53LX_set_current_xtalk_settings( 01333 01334 VL53LX_xtalk_calibration_results_t *pxtalk 01335 ); 01336 01337 VL53LX_Error VL53LX_load_patch(); 01338 01339 VL53LX_Error VL53LX_unload_patch(); 01340 01341 01342 /* vl53lx_register_funcs.h */ 01343 01344 01345 VL53LX_Error VL53LX_i2c_encode_static_nvm_managed( 01346 VL53LX_static_nvm_managed_t *pdata, 01347 uint16_t buf_size, 01348 uint8_t *pbuffer); 01349 01350 01351 01352 01353 VL53LX_Error VL53LX_i2c_decode_static_nvm_managed( 01354 uint16_t buf_size, 01355 uint8_t *pbuffer, 01356 VL53LX_static_nvm_managed_t *pdata); 01357 01358 01359 01360 01361 VL53LX_Error VL53LX_set_static_nvm_managed( 01362 VL53LX_static_nvm_managed_t *pdata); 01363 01364 01365 01366 01367 VL53LX_Error VL53LX_get_static_nvm_managed( 01368 VL53LX_static_nvm_managed_t *pdata); 01369 01370 01371 01372 01373 VL53LX_Error VL53LX_i2c_encode_customer_nvm_managed( 01374 VL53LX_customer_nvm_managed_t *pdata, 01375 uint16_t buf_size, 01376 uint8_t *pbuffer); 01377 01378 01379 01380 01381 VL53LX_Error VL53LX_i2c_decode_customer_nvm_managed( 01382 uint16_t buf_size, 01383 uint8_t *pbuffer, 01384 VL53LX_customer_nvm_managed_t *pdata); 01385 01386 01387 01388 01389 VL53LX_Error VL53LX_set_customer_nvm_managed( 01390 VL53LX_customer_nvm_managed_t *pdata); 01391 01392 01393 01394 01395 VL53LX_Error VL53LX_get_customer_nvm_managed( 01396 VL53LX_customer_nvm_managed_t *pdata); 01397 01398 01399 01400 01401 VL53LX_Error VL53LX_i2c_encode_static_config( 01402 VL53LX_static_config_t *pdata, 01403 uint16_t buf_size, 01404 uint8_t *pbuffer); 01405 01406 01407 01408 01409 VL53LX_Error VL53LX_i2c_decode_static_config( 01410 uint16_t buf_size, 01411 uint8_t *pbuffer, 01412 VL53LX_static_config_t *pdata); 01413 01414 01415 01416 01417 VL53LX_Error VL53LX_set_static_config( 01418 VL53LX_static_config_t *pdata); 01419 01420 01421 01422 01423 VL53LX_Error VL53LX_get_static_config( 01424 VL53LX_static_config_t *pdata); 01425 01426 01427 01428 01429 VL53LX_Error VL53LX_i2c_encode_general_config( 01430 VL53LX_general_config_t *pdata, 01431 uint16_t buf_size, 01432 uint8_t *pbuffer); 01433 01434 01435 01436 01437 VL53LX_Error VL53LX_i2c_decode_general_config( 01438 uint16_t buf_size, 01439 uint8_t *pbuffer, 01440 VL53LX_general_config_t *pdata); 01441 01442 01443 01444 01445 VL53LX_Error VL53LX_set_general_config( 01446 VL53LX_general_config_t *pdata); 01447 01448 01449 01450 01451 VL53LX_Error VL53LX_get_general_config( 01452 VL53LX_general_config_t *pdata); 01453 01454 01455 01456 01457 VL53LX_Error VL53LX_i2c_encode_timing_config( 01458 VL53LX_timing_config_t *pdata, 01459 uint16_t buf_size, 01460 uint8_t *pbuffer); 01461 01462 01463 01464 01465 VL53LX_Error VL53LX_i2c_decode_timing_config( 01466 uint16_t buf_size, 01467 uint8_t *pbuffer, 01468 VL53LX_timing_config_t *pdata); 01469 01470 01471 01472 01473 VL53LX_Error VL53LX_set_timing_config( 01474 VL53LX_timing_config_t *pdata); 01475 01476 01477 01478 01479 VL53LX_Error VL53LX_get_timing_config( 01480 VL53LX_timing_config_t *pdata); 01481 01482 01483 01484 01485 VL53LX_Error VL53LX_i2c_encode_dynamic_config( 01486 VL53LX_dynamic_config_t *pdata, 01487 uint16_t buf_size, 01488 uint8_t *pbuffer); 01489 01490 01491 01492 01493 VL53LX_Error VL53LX_i2c_decode_dynamic_config( 01494 uint16_t buf_size, 01495 uint8_t *pbuffer, 01496 VL53LX_dynamic_config_t *pdata); 01497 01498 01499 01500 01501 VL53LX_Error VL53LX_set_dynamic_config( 01502 VL53LX_dynamic_config_t *pdata); 01503 01504 01505 01506 01507 VL53LX_Error VL53LX_get_dynamic_config( 01508 VL53LX_dynamic_config_t *pdata); 01509 01510 01511 01512 01513 VL53LX_Error VL53LX_i2c_encode_system_control( 01514 VL53LX_system_control_t *pdata, 01515 uint16_t buf_size, 01516 uint8_t *pbuffer); 01517 01518 01519 01520 01521 VL53LX_Error VL53LX_i2c_decode_system_control( 01522 uint16_t buf_size, 01523 uint8_t *pbuffer, 01524 VL53LX_system_control_t *pdata); 01525 01526 01527 01528 01529 VL53LX_Error VL53LX_set_system_control( 01530 VL53LX_system_control_t *pdata); 01531 01532 01533 01534 01535 VL53LX_Error VL53LX_get_system_control( 01536 VL53LX_system_control_t *pdata); 01537 01538 01539 01540 01541 VL53LX_Error VL53LX_i2c_encode_system_results( 01542 VL53LX_system_results_t *pdata, 01543 uint16_t buf_size, 01544 uint8_t *pbuffer); 01545 01546 01547 01548 01549 VL53LX_Error VL53LX_i2c_decode_system_results( 01550 uint16_t buf_size, 01551 uint8_t *pbuffer, 01552 VL53LX_system_results_t *pdata); 01553 01554 01555 01556 01557 VL53LX_Error VL53LX_set_system_results( 01558 VL53LX_system_results_t *pdata); 01559 01560 01561 01562 01563 VL53LX_Error VL53LX_get_system_results( 01564 VL53LX_system_results_t *pdata); 01565 01566 01567 01568 01569 VL53LX_Error VL53LX_i2c_encode_core_results( 01570 VL53LX_core_results_t *pdata, 01571 uint16_t buf_size, 01572 uint8_t *pbuffer); 01573 01574 01575 01576 01577 VL53LX_Error VL53LX_i2c_decode_core_results( 01578 uint16_t buf_size, 01579 uint8_t *pbuffer, 01580 VL53LX_core_results_t *pdata); 01581 01582 01583 01584 01585 VL53LX_Error VL53LX_set_core_results( 01586 VL53LX_core_results_t *pdata); 01587 01588 01589 01590 01591 VL53LX_Error VL53LX_get_core_results( 01592 VL53LX_core_results_t *pdata); 01593 01594 01595 01596 01597 VL53LX_Error VL53LX_i2c_encode_debug_results( 01598 VL53LX_debug_results_t *pdata, 01599 uint16_t buf_size, 01600 uint8_t *pbuffer); 01601 01602 01603 01604 01605 VL53LX_Error VL53LX_i2c_decode_debug_results( 01606 uint16_t buf_size, 01607 uint8_t *pbuffer, 01608 VL53LX_debug_results_t *pdata); 01609 01610 01611 01612 01613 VL53LX_Error VL53LX_set_debug_results( 01614 VL53LX_debug_results_t *pdata); 01615 01616 01617 01618 01619 VL53LX_Error VL53LX_get_debug_results( 01620 VL53LX_debug_results_t *pdata); 01621 01622 01623 01624 01625 VL53LX_Error VL53LX_i2c_encode_nvm_copy_data( 01626 VL53LX_nvm_copy_data_t *pdata, 01627 uint16_t buf_size, 01628 uint8_t *pbuffer); 01629 01630 01631 01632 01633 VL53LX_Error VL53LX_i2c_decode_nvm_copy_data( 01634 uint16_t buf_size, 01635 uint8_t *pbuffer, 01636 VL53LX_nvm_copy_data_t *pdata); 01637 01638 01639 01640 01641 VL53LX_Error VL53LX_set_nvm_copy_data( 01642 VL53LX_nvm_copy_data_t *pdata); 01643 01644 01645 01646 01647 VL53LX_Error VL53LX_get_nvm_copy_data( 01648 VL53LX_nvm_copy_data_t *pdata); 01649 01650 01651 01652 01653 VL53LX_Error VL53LX_i2c_encode_prev_shadow_system_results( 01654 VL53LX_prev_shadow_system_results_t *pdata, 01655 uint16_t buf_size, 01656 uint8_t *pbuffer); 01657 01658 01659 01660 01661 VL53LX_Error VL53LX_i2c_decode_prev_shadow_system_results( 01662 uint16_t buf_size, 01663 uint8_t *pbuffer, 01664 VL53LX_prev_shadow_system_results_t *pdata); 01665 01666 01667 01668 01669 VL53LX_Error VL53LX_set_prev_shadow_system_results( 01670 VL53LX_prev_shadow_system_results_t *pdata); 01671 01672 01673 01674 01675 VL53LX_Error VL53LX_get_prev_shadow_system_results( 01676 VL53LX_prev_shadow_system_results_t *pdata); 01677 01678 01679 01680 01681 VL53LX_Error VL53LX_i2c_encode_prev_shadow_core_results( 01682 VL53LX_prev_shadow_core_results_t *pdata, 01683 uint16_t buf_size, 01684 uint8_t *pbuffer); 01685 01686 01687 01688 01689 VL53LX_Error VL53LX_i2c_decode_prev_shadow_core_results( 01690 uint16_t buf_size, 01691 uint8_t *pbuffer, 01692 VL53LX_prev_shadow_core_results_t *pdata); 01693 01694 01695 01696 01697 VL53LX_Error VL53LX_set_prev_shadow_core_results( 01698 VL53LX_prev_shadow_core_results_t *pdata); 01699 01700 01701 01702 01703 VL53LX_Error VL53LX_get_prev_shadow_core_results( 01704 VL53LX_prev_shadow_core_results_t *pdata); 01705 01706 01707 01708 01709 VL53LX_Error VL53LX_i2c_encode_patch_debug( 01710 VL53LX_patch_debug_t *pdata, 01711 uint16_t buf_size, 01712 uint8_t *pbuffer); 01713 01714 01715 01716 01717 VL53LX_Error VL53LX_i2c_decode_patch_debug( 01718 uint16_t buf_size, 01719 uint8_t *pbuffer, 01720 VL53LX_patch_debug_t *pdata); 01721 01722 01723 01724 01725 VL53LX_Error VL53LX_set_patch_debug( 01726 VL53LX_patch_debug_t *pdata); 01727 01728 01729 01730 01731 VL53LX_Error VL53LX_get_patch_debug( 01732 VL53LX_patch_debug_t *pdata); 01733 01734 01735 01736 01737 VL53LX_Error VL53LX_i2c_encode_gph_general_config( 01738 VL53LX_gph_general_config_t *pdata, 01739 uint16_t buf_size, 01740 uint8_t *pbuffer); 01741 01742 01743 01744 01745 VL53LX_Error VL53LX_i2c_decode_gph_general_config( 01746 uint16_t buf_size, 01747 uint8_t *pbuffer, 01748 VL53LX_gph_general_config_t *pdata); 01749 01750 01751 01752 01753 VL53LX_Error VL53LX_set_gph_general_config( 01754 VL53LX_gph_general_config_t *pdata); 01755 01756 01757 01758 01759 VL53LX_Error VL53LX_get_gph_general_config( 01760 VL53LX_gph_general_config_t *pdata); 01761 01762 01763 01764 01765 VL53LX_Error VL53LX_i2c_encode_gph_static_config( 01766 VL53LX_gph_static_config_t *pdata, 01767 uint16_t buf_size, 01768 uint8_t *pbuffer); 01769 01770 01771 01772 01773 VL53LX_Error VL53LX_i2c_decode_gph_static_config( 01774 uint16_t buf_size, 01775 uint8_t *pbuffer, 01776 VL53LX_gph_static_config_t *pdata); 01777 01778 01779 01780 01781 VL53LX_Error VL53LX_set_gph_static_config( 01782 VL53LX_gph_static_config_t *pdata); 01783 01784 01785 01786 01787 VL53LX_Error VL53LX_get_gph_static_config( 01788 VL53LX_gph_static_config_t *pdata); 01789 01790 01791 01792 01793 VL53LX_Error VL53LX_i2c_encode_gph_timing_config( 01794 VL53LX_gph_timing_config_t *pdata, 01795 uint16_t buf_size, 01796 uint8_t *pbuffer); 01797 01798 01799 01800 01801 VL53LX_Error VL53LX_i2c_decode_gph_timing_config( 01802 uint16_t buf_size, 01803 uint8_t *pbuffer, 01804 VL53LX_gph_timing_config_t *pdata); 01805 01806 01807 01808 01809 VL53LX_Error VL53LX_set_gph_timing_config( 01810 VL53LX_gph_timing_config_t *pdata); 01811 01812 01813 01814 01815 VL53LX_Error VL53LX_get_gph_timing_config( 01816 VL53LX_gph_timing_config_t *pdata); 01817 01818 01819 01820 01821 VL53LX_Error VL53LX_i2c_encode_fw_internal( 01822 VL53LX_fw_internal_t *pdata, 01823 uint16_t buf_size, 01824 uint8_t *pbuffer); 01825 01826 01827 01828 01829 VL53LX_Error VL53LX_i2c_decode_fw_internal( 01830 uint16_t buf_size, 01831 uint8_t *pbuffer, 01832 VL53LX_fw_internal_t *pdata); 01833 01834 01835 01836 01837 VL53LX_Error VL53LX_set_fw_internal( 01838 VL53LX_fw_internal_t *pdata); 01839 01840 01841 01842 01843 VL53LX_Error VL53LX_get_fw_internal( 01844 VL53LX_fw_internal_t *pdata); 01845 01846 01847 01848 01849 VL53LX_Error VL53LX_i2c_encode_patch_results( 01850 VL53LX_patch_results_t *pdata, 01851 uint16_t buf_size, 01852 uint8_t *pbuffer); 01853 01854 01855 01856 01857 VL53LX_Error VL53LX_i2c_decode_patch_results( 01858 uint16_t buf_size, 01859 uint8_t *pbuffer, 01860 VL53LX_patch_results_t *pdata); 01861 01862 01863 01864 01865 VL53LX_Error VL53LX_set_patch_results( 01866 VL53LX_patch_results_t *pdata); 01867 01868 01869 01870 01871 VL53LX_Error VL53LX_get_patch_results( 01872 VL53LX_patch_results_t *pdata); 01873 01874 01875 01876 01877 VL53LX_Error VL53LX_i2c_encode_shadow_system_results( 01878 VL53LX_shadow_system_results_t *pdata, 01879 uint16_t buf_size, 01880 uint8_t *pbuffer); 01881 01882 01883 01884 01885 VL53LX_Error VL53LX_i2c_decode_shadow_system_results( 01886 uint16_t buf_size, 01887 uint8_t *pbuffer, 01888 VL53LX_shadow_system_results_t *pdata); 01889 01890 01891 01892 01893 VL53LX_Error VL53LX_set_shadow_system_results( 01894 VL53LX_shadow_system_results_t *pdata); 01895 01896 01897 01898 01899 VL53LX_Error VL53LX_get_shadow_system_results( 01900 VL53LX_shadow_system_results_t *pdata); 01901 01902 01903 01904 01905 VL53LX_Error VL53LX_i2c_encode_shadow_core_results( 01906 VL53LX_shadow_core_results_t *pdata, 01907 uint16_t buf_size, 01908 uint8_t *pbuffer); 01909 01910 01911 01912 01913 VL53LX_Error VL53LX_i2c_decode_shadow_core_results( 01914 uint16_t buf_size, 01915 uint8_t *pbuffer, 01916 VL53LX_shadow_core_results_t *pdata); 01917 01918 01919 01920 01921 VL53LX_Error VL53LX_set_shadow_core_results( 01922 VL53LX_shadow_core_results_t *pdata); 01923 01924 01925 01926 01927 VL53LX_Error VL53LX_get_shadow_core_results( 01928 VL53LX_shadow_core_results_t *pdata); 01929 01930 01931 01932 /* vl53lx_nvm.h */ 01933 01934 01935 VL53LX_Error VL53LX_nvm_enable( 01936 uint16_t nvm_ctrl_pulse_width, 01937 int32_t nvm_power_up_delay_us); 01938 01939 01940 01941 01942 VL53LX_Error VL53LX_nvm_read( 01943 uint8_t start_address, 01944 uint8_t count, 01945 uint8_t *pdata); 01946 01947 01948 01949 01950 VL53LX_Error VL53LX_nvm_disable(); 01951 01952 01953 01954 01955 VL53LX_Error VL53LX_nvm_format_decode( 01956 uint16_t buf_size, 01957 uint8_t *pbuffer, 01958 VL53LX_decoded_nvm_data_t *pdata); 01959 01960 01961 01962 01963 VL53LX_Error VL53LX_nvm_decode_optical_centre( 01964 uint16_t buf_size, 01965 uint8_t *pbuffer, 01966 VL53LX_optical_centre_t *pdata); 01967 01968 01969 01970 01971 VL53LX_Error VL53LX_nvm_decode_cal_peak_rate_map( 01972 uint16_t buf_size, 01973 uint8_t *pbuffer, 01974 VL53LX_cal_peak_rate_map_t *pdata); 01975 01976 01977 01978 01979 VL53LX_Error VL53LX_nvm_decode_additional_offset_cal_data( 01980 uint16_t buf_size, 01981 uint8_t *pbuffer, 01982 VL53LX_additional_offset_cal_data_t *pdata); 01983 01984 01985 01986 01987 VL53LX_Error VL53LX_nvm_decode_fmt_range_results_data( 01988 uint16_t buf_size, 01989 uint8_t *pbuffer, 01990 VL53LX_decoded_nvm_fmt_range_data_t *pdata); 01991 01992 01993 01994 01995 VL53LX_Error VL53LX_nvm_decode_fmt_info( 01996 uint16_t buf_size, 01997 uint8_t *pbuffer, 01998 VL53LX_decoded_nvm_fmt_info_t *pdata); 01999 02000 02001 02002 02003 VL53LX_Error VL53LX_nvm_decode_ews_info( 02004 uint16_t buf_size, 02005 uint8_t *pbuffer, 02006 VL53LX_decoded_nvm_ews_info_t *pdata); 02007 02008 02009 02010 02011 void VL53LX_nvm_format_encode( 02012 VL53LX_decoded_nvm_data_t *pnvm_info, 02013 uint8_t *pnvm_data); 02014 02015 02016 02017 02018 VL53LX_Error VL53LX_read_nvm_raw_data( 02019 uint8_t start_address, 02020 uint8_t count, 02021 uint8_t *pnvm_raw_data); 02022 02023 02024 02025 02026 VL53LX_Error VL53LX_read_nvm( 02027 uint8_t nvm_format, 02028 VL53LX_decoded_nvm_data_t *pnvm_info); 02029 02030 02031 02032 02033 VL53LX_Error VL53LX_read_nvm_optical_centre( 02034 VL53LX_optical_centre_t *pcentre); 02035 02036 02037 02038 02039 VL53LX_Error VL53LX_read_nvm_cal_peak_rate_map( 02040 VL53LX_cal_peak_rate_map_t *pcal_data); 02041 02042 02043 02044 02045 VL53LX_Error VL53LX_read_nvm_additional_offset_cal_data( 02046 VL53LX_additional_offset_cal_data_t *pcal_data); 02047 02048 02049 02050 02051 VL53LX_Error VL53LX_read_nvm_fmt_range_results_data( 02052 uint16_t range_results_select, 02053 VL53LX_decoded_nvm_fmt_range_data_t *prange_data); 02054 02055 02056 02057 /* vl53lx_platform_ipp.h */ 02058 02059 VL53LX_Error VL53LX_ipp_hist_process_data( 02060 VL53LX_dmax_calibration_data_t *pdmax_cal, 02061 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg, 02062 VL53LX_hist_post_process_config_t *ppost_cfg, 02063 VL53LX_histogram_bin_data_t *pbins, 02064 VL53LX_xtalk_histogram_data_t *pxtalk, 02065 uint8_t *pArea1, 02066 uint8_t *pArea2, 02067 uint8_t *phisto_merge_nb, 02068 VL53LX_range_results_t *presults); 02069 02070 VL53LX_Error VL53LX_ipp_hist_ambient_dmax( 02071 uint16_t target_reflectance, 02072 VL53LX_dmax_calibration_data_t *pdmax_cal, 02073 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg, 02074 VL53LX_histogram_bin_data_t *pbins, 02075 int16_t *pambient_dmax_mm); 02076 02077 VL53LX_Error VL53LX_ipp_xtalk_calibration_process_data( 02078 VL53LX_xtalk_range_results_t *pxtalk_ranges, 02079 VL53LX_xtalk_histogram_data_t *pxtalk_shape, 02080 VL53LX_xtalk_calibration_results_t *pxtalk_cal); 02081 02082 VL53LX_Error VL53LX_ipp_hist_xtalk_correction( 02083 VL53LX_customer_nvm_managed_t *pcustomer, 02084 VL53LX_dynamic_config_t *pdyn_cfg, 02085 VL53LX_xtalk_histogram_data_t *pxtalk_shape, 02086 VL53LX_histogram_bin_data_t *pip_hist_data, 02087 VL53LX_histogram_bin_data_t *pop_hist_data, 02088 VL53LX_histogram_bin_data_t *pxtalk_count_data); 02089 02090 VL53LX_Error VL53LX_ipp_generate_dual_reflectance_xtalk_samples( 02091 VL53LX_xtalk_range_results_t *pxtalk_results, 02092 uint16_t expected_target_distance_mm, 02093 uint8_t higher_reflectance, 02094 VL53LX_histogram_bin_data_t *pxtalk_avg_samples); 02095 02096 02097 /* vl53lx_hist_funcs.h */ 02098 02099 02100 VL53LX_Error VL53LX_hist_process_data( 02101 VL53LX_dmax_calibration_data_t *pdmax_cal, 02102 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg, 02103 VL53LX_hist_post_process_config_t *ppost_cfg, 02104 VL53LX_histogram_bin_data_t *pbins, 02105 VL53LX_xtalk_histogram_data_t *pxtalk, 02106 uint8_t *pArea1, 02107 uint8_t *pArea2, 02108 VL53LX_range_results_t *presults, 02109 uint8_t *HistMergeNumber); 02110 02111 02112 VL53LX_Error VL53LX_hist_ambient_dmax( 02113 uint16_t target_reflectance, 02114 VL53LX_dmax_calibration_data_t *pdmax_cal, 02115 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg, 02116 VL53LX_histogram_bin_data_t *pbins, 02117 int16_t *pambient_dmax_mm); 02118 02119 02120 /* vl53lx_core_support.h */ 02121 02122 uint32_t VL53LX_calc_pll_period_us( 02123 uint16_t fast_osc_frequency); 02124 02125 uint32_t VL53LX_duration_maths( 02126 uint32_t pll_period_us, 02127 uint32_t vcsel_parm_pclks, 02128 uint32_t window_vclks, 02129 uint32_t periods_elapsed_mclks); 02130 02131 uint32_t VL53LX_events_per_spad_maths( 02132 int32_t VL53LX_p_010, 02133 uint16_t num_spads, 02134 uint32_t duration); 02135 02136 uint32_t VL53LX_isqrt( 02137 uint32_t num); 02138 02139 void VL53LX_hist_calc_zero_distance_phase( 02140 VL53LX_histogram_bin_data_t *pdata); 02141 02142 void VL53LX_hist_estimate_ambient_from_thresholded_bins( 02143 int32_t ambient_threshold_sigma, 02144 VL53LX_histogram_bin_data_t *pdata); 02145 02146 void VL53LX_hist_remove_ambient_bins( 02147 VL53LX_histogram_bin_data_t *pdata); 02148 02149 uint32_t VL53LX_calc_pll_period_mm( 02150 uint16_t fast_osc_frequency); 02151 02152 uint16_t VL53LX_rate_maths( 02153 int32_t VL53LX_p_018, 02154 uint32_t time_us); 02155 02156 uint16_t VL53LX_rate_per_spad_maths( 02157 uint32_t frac_bits, 02158 uint32_t peak_count_rate, 02159 uint16_t num_spads, 02160 uint32_t max_output_value); 02161 02162 int32_t VL53LX_range_maths( 02163 uint16_t fast_osc_frequency, 02164 uint16_t VL53LX_p_014, 02165 uint16_t zero_distance_phase, 02166 uint8_t fractional_bits, 02167 int32_t gain_factor, 02168 int32_t range_offset_mm); 02169 02170 uint8_t VL53LX_decode_vcsel_period( 02171 uint8_t vcsel_period_reg); 02172 02173 void VL53LX_copy_xtalk_bin_data_to_histogram_data_struct( 02174 VL53LX_xtalk_histogram_shape_t *pxtalk, 02175 VL53LX_histogram_bin_data_t *phist); 02176 02177 void VL53LX_init_histogram_bin_data_struct( 02178 int32_t bin_value, 02179 uint16_t VL53LX_p_021, 02180 VL53LX_histogram_bin_data_t *pdata); 02181 02182 void VL53LX_decode_row_col( 02183 uint8_t spad_number, 02184 uint8_t *prow, 02185 uint8_t *pcol); 02186 02187 void VL53LX_hist_find_min_max_bin_values( 02188 VL53LX_histogram_bin_data_t *pdata); 02189 02190 void VL53LX_hist_estimate_ambient_from_ambient_bins( 02191 VL53LX_histogram_bin_data_t *pdata); 02192 02193 02194 02195 /* vl53lx_core.h */ 02196 02197 void VL53LX_init_version(); 02198 02199 void VL53LX_init_ll_driver_state( 02200 VL53LX_DeviceState ll_state); 02201 02202 VL53LX_Error VL53LX_update_ll_driver_rd_state(); 02203 02204 VL53LX_Error VL53LX_check_ll_driver_rd_state(); 02205 02206 VL53LX_Error VL53LX_update_ll_driver_cfg_state(); 02207 02208 void VL53LX_copy_rtn_good_spads_to_buffer( 02209 VL53LX_nvm_copy_data_t *pdata, 02210 uint8_t *pbuffer); 02211 02212 void VL53LX_init_system_results( 02213 VL53LX_system_results_t *pdata); 02214 02215 void V53L1_init_zone_results_structure( 02216 uint8_t active_zones, 02217 VL53LX_zone_results_t *pdata); 02218 02219 void V53L1_init_zone_dss_configs(); 02220 02221 void VL53LX_init_histogram_config_structure( 02222 uint8_t even_bin0, 02223 uint8_t even_bin1, 02224 uint8_t even_bin2, 02225 uint8_t even_bin3, 02226 uint8_t even_bin4, 02227 uint8_t even_bin5, 02228 uint8_t odd_bin0, 02229 uint8_t odd_bin1, 02230 uint8_t odd_bin2, 02231 uint8_t odd_bin3, 02232 uint8_t odd_bin4, 02233 uint8_t odd_bin5, 02234 VL53LX_histogram_config_t *pdata); 02235 02236 void VL53LX_init_histogram_multizone_config_structure( 02237 uint8_t even_bin0, 02238 uint8_t even_bin1, 02239 uint8_t even_bin2, 02240 uint8_t even_bin3, 02241 uint8_t even_bin4, 02242 uint8_t even_bin5, 02243 uint8_t odd_bin0, 02244 uint8_t odd_bin1, 02245 uint8_t odd_bin2, 02246 uint8_t odd_bin3, 02247 uint8_t odd_bin4, 02248 uint8_t odd_bin5, 02249 VL53LX_histogram_config_t *pdata); 02250 02251 void VL53LX_init_xtalk_bin_data_struct( 02252 uint32_t bin_value, 02253 uint16_t VL53LX_p_021, 02254 VL53LX_xtalk_histogram_shape_t *pdata); 02255 02256 void VL53LX_i2c_encode_uint16_t( 02257 uint16_t ip_value, 02258 uint16_t count, 02259 uint8_t *pbuffer); 02260 02261 uint16_t VL53LX_i2c_decode_uint16_t( 02262 uint16_t count, 02263 uint8_t *pbuffer); 02264 02265 void VL53LX_i2c_encode_int16_t( 02266 int16_t ip_value, 02267 uint16_t count, 02268 uint8_t *pbuffer); 02269 02270 int16_t VL53LX_i2c_decode_int16_t( 02271 uint16_t count, 02272 uint8_t *pbuffer); 02273 02274 void VL53LX_i2c_encode_uint32_t( 02275 uint32_t ip_value, 02276 uint16_t count, 02277 uint8_t *pbuffer); 02278 02279 uint32_t VL53LX_i2c_decode_uint32_t( 02280 uint16_t count, 02281 uint8_t *pbuffer); 02282 02283 uint32_t VL53LX_i2c_decode_with_mask( 02284 uint16_t count, 02285 uint8_t *pbuffer, 02286 uint32_t bit_mask, 02287 uint32_t down_shift, 02288 uint32_t offset); 02289 02290 void VL53LX_i2c_encode_int32_t( 02291 int32_t ip_value, 02292 uint16_t count, 02293 uint8_t *pbuffer); 02294 02295 int32_t VL53LX_i2c_decode_int32_t( 02296 uint16_t count, 02297 uint8_t *pbuffer); 02298 02299 VL53LX_Error VL53LX_start_test( 02300 uint8_t test_mode__ctrl); 02301 02302 VL53LX_Error VL53LX_set_firmware_enable_register(uint8_t value); 02303 02304 VL53LX_Error VL53LX_enable_firmware(); 02305 02306 VL53LX_Error VL53LX_disable_firmware(); 02307 02308 VL53LX_Error VL53LX_set_powerforce_register( 02309 uint8_t value); 02310 02311 VL53LX_Error VL53LX_enable_powerforce(); 02312 02313 VL53LX_Error VL53LX_disable_powerforce(); 02314 02315 VL53LX_Error VL53LX_clear_interrupt(); 02316 02317 VL53LX_Error VL53LX_force_shadow_stream_count_to_zero(); 02318 02319 uint32_t VL53LX_calc_macro_period_us( 02320 uint16_t fast_osc_frequency, 02321 uint8_t VL53LX_p_005); 02322 02323 uint16_t VL53LX_calc_range_ignore_threshold( 02324 uint32_t central_rate, 02325 int16_t x_gradient, 02326 int16_t y_gradient, 02327 uint8_t rate_mult); 02328 02329 uint32_t VL53LX_calc_timeout_mclks( 02330 uint32_t timeout_us, 02331 uint32_t macro_period_us); 02332 02333 uint16_t VL53LX_calc_encoded_timeout( 02334 uint32_t timeout_us, 02335 uint32_t macro_period_us); 02336 02337 uint32_t VL53LX_calc_timeout_us( 02338 uint32_t timeout_mclks, 02339 uint32_t macro_period_us); 02340 02341 uint32_t VL53LX_calc_decoded_timeout_us( 02342 uint16_t timeout_encoded, 02343 uint32_t macro_period_us); 02344 02345 uint16_t VL53LX_encode_timeout( 02346 uint32_t timeout_mclks); 02347 02348 uint32_t VL53LX_decode_timeout( 02349 uint16_t encoded_timeout); 02350 02351 VL53LX_Error VL53LX_calc_timeout_register_values( 02352 uint32_t phasecal_config_timeout_us, 02353 uint32_t mm_config_timeout_us, 02354 uint32_t range_config_timeout_us, 02355 uint16_t fast_osc_frequency, 02356 VL53LX_general_config_t *pgeneral, 02357 VL53LX_timing_config_t *ptiming); 02358 02359 uint8_t VL53LX_encode_vcsel_period( 02360 uint8_t VL53LX_p_030); 02361 02362 uint32_t VL53LX_decode_unsigned_integer( 02363 uint8_t *pbuffer, 02364 uint8_t no_of_bytes); 02365 02366 void VL53LX_encode_unsigned_integer( 02367 uint32_t ip_value, 02368 uint8_t no_of_bytes, 02369 uint8_t *pbuffer); 02370 02371 VL53LX_Error VL53LX_hist_copy_and_scale_ambient_info( 02372 VL53LX_zone_hist_info_t *pidata, 02373 VL53LX_histogram_bin_data_t *podata); 02374 02375 void VL53LX_hist_get_bin_sequence_config( 02376 VL53LX_histogram_bin_data_t *pdata); 02377 02378 VL53LX_Error VL53LX_hist_phase_consistency_check( 02379 VL53LX_zone_hist_info_t *phist_prev, 02380 VL53LX_zone_objects_t *prange_prev, 02381 VL53LX_range_results_t *prange_curr); 02382 02383 VL53LX_Error VL53LX_hist_events_consistency_check( 02384 uint8_t event_sigma, 02385 uint16_t min_effective_spad_count, 02386 VL53LX_zone_hist_info_t *phist_prev, 02387 VL53LX_object_data_t *prange_prev, 02388 VL53LX_range_data_t *prange_curr, 02389 int32_t *pevents_tolerance, 02390 int32_t *pevents_delta, 02391 VL53LX_DeviceError *prange_status); 02392 02393 VL53LX_Error VL53LX_hist_merged_pulse_check( 02394 int16_t min_max_tolerance_mm, 02395 VL53LX_range_data_t *pdata, 02396 VL53LX_DeviceError *prange_status); 02397 02398 VL53LX_Error VL53LX_hist_xmonitor_consistency_check( 02399 VL53LX_zone_hist_info_t *phist_prev, 02400 VL53LX_zone_objects_t *prange_prev, 02401 VL53LX_range_data_t *prange_curr); 02402 02403 VL53LX_Error VL53LX_hist_wrap_dmax( 02404 VL53LX_hist_post_process_config_t *phistpostprocess, 02405 VL53LX_histogram_bin_data_t *pcurrent, 02406 int16_t *pwrap_dmax_mm); 02407 02408 void VL53LX_hist_combine_mm1_mm2_offsets( 02409 int16_t mm1_offset_mm, 02410 int16_t mm2_offset_mm, 02411 uint8_t encoded_mm_roi_centre, 02412 uint8_t encoded_mm_roi_size, 02413 uint8_t encoded_zone_centre, 02414 uint8_t encoded_zone_size, 02415 VL53LX_additional_offset_cal_data_t *pcal_data, 02416 uint8_t *pgood_spads, 02417 uint16_t aperture_attenuation, 02418 int16_t *prange_offset_mm); 02419 02420 VL53LX_Error VL53LX_hist_xtalk_extract_calc_window( 02421 int16_t target_distance_mm, 02422 uint16_t target_width_oversize, 02423 VL53LX_histogram_bin_data_t *phist_bins, 02424 VL53LX_hist_xtalk_extract_data_t *pxtalk_data); 02425 02426 VL53LX_Error VL53LX_hist_xtalk_extract_calc_event_sums( 02427 VL53LX_histogram_bin_data_t *phist_bins, 02428 VL53LX_hist_xtalk_extract_data_t *pxtalk_data); 02429 02430 VL53LX_Error VL53LX_hist_xtalk_extract_calc_rate_per_spad( 02431 VL53LX_hist_xtalk_extract_data_t *pxtalk_data); 02432 02433 VL53LX_Error VL53LX_hist_xtalk_extract_calc_shape( 02434 VL53LX_hist_xtalk_extract_data_t *pxtalk_data, 02435 VL53LX_xtalk_histogram_shape_t *pxtalk_shape); 02436 02437 VL53LX_Error VL53LX_hist_xtalk_shape_model( 02438 uint16_t events_per_bin, 02439 uint16_t pulse_centre, 02440 uint16_t pulse_width, 02441 VL53LX_xtalk_histogram_shape_t *pxtalk_shape); 02442 02443 uint16_t VL53LX_hist_xtalk_shape_model_interp( 02444 uint16_t events_per_bin, 02445 uint32_t phase_delta); 02446 02447 void VL53LX_spad_number_to_byte_bit_index( 02448 uint8_t spad_number, 02449 uint8_t *pbyte_index, 02450 uint8_t *pbit_index, 02451 uint8_t *pbit_mask); 02452 02453 void VL53LX_encode_row_col( 02454 uint8_t row, 02455 uint8_t col, 02456 uint8_t *pspad_number); 02457 02458 void VL53LX_decode_zone_size( 02459 uint8_t encoded_xy_size, 02460 uint8_t *pwidth, 02461 uint8_t *pheight); 02462 02463 void VL53LX_encode_zone_size( 02464 uint8_t width, 02465 uint8_t height, 02466 uint8_t *pencoded_xy_size); 02467 02468 void VL53LX_decode_zone_limits( 02469 uint8_t encoded_xy_centre, 02470 uint8_t encoded_xy_size, 02471 int16_t *px_ll, 02472 int16_t *py_ll, 02473 int16_t *px_ur, 02474 int16_t *py_ur); 02475 02476 uint8_t VL53LX_is_aperture_location( 02477 uint8_t row, 02478 uint8_t col); 02479 02480 void VL53LX_calc_max_effective_spads( 02481 uint8_t encoded_zone_centre, 02482 uint8_t encoded_zone_size, 02483 uint8_t *pgood_spads, 02484 uint16_t aperture_attenuation, 02485 uint16_t *pmax_effective_spads); 02486 02487 void VL53LX_calc_mm_effective_spads( 02488 uint8_t encoded_mm_roi_centre, 02489 uint8_t encoded_mm_roi_size, 02490 uint8_t encoded_zone_centre, 02491 uint8_t encoded_zone_size, 02492 uint8_t *pgood_spads, 02493 uint16_t aperture_attenuation, 02494 uint16_t *pmm_inner_effective_spads, 02495 uint16_t *pmm_outer_effective_spads); 02496 02497 void VL53LX_hist_copy_results_to_sys_and_core( 02498 VL53LX_histogram_bin_data_t *pbins, 02499 VL53LX_range_results_t *phist, 02500 VL53LX_system_results_t *psys, 02501 VL53LX_core_results_t *pcore); 02502 02503 VL53LX_Error VL53LX_sum_histogram_data( 02504 VL53LX_histogram_bin_data_t *phist_input, 02505 VL53LX_histogram_bin_data_t *phist_output); 02506 02507 VL53LX_Error VL53LX_avg_histogram_data( 02508 uint8_t no_of_samples, 02509 VL53LX_histogram_bin_data_t *phist_sum, 02510 VL53LX_histogram_bin_data_t *phist_avg); 02511 02512 VL53LX_Error VL53LX_save_cfg_data(); 02513 02514 VL53LX_Error VL53LX_dynamic_zone_update( 02515 VL53LX_range_results_t *presults); 02516 02517 VL53LX_Error VL53LX_update_internal_stream_counters( 02518 uint8_t external_stream_count, 02519 uint8_t *pinternal_stream_count, 02520 uint8_t *pinternal_stream_count_val 02521 ); 02522 02523 VL53LX_Error VL53LX_multizone_hist_bins_update(); 02524 02525 VL53LX_Error VL53LX_set_histogram_multizone_initial_bin_config( 02526 VL53LX_zone_config_t *pzone_cfg, 02527 VL53LX_histogram_config_t *phist_cfg, 02528 VL53LX_histogram_config_t *pmulti_hist 02529 ); 02530 02531 uint8_t VL53LX_encode_GPIO_interrupt_config( 02532 VL53LX_GPIO_interrupt_config_t *pintconf); 02533 02534 VL53LX_GPIO_interrupt_config_t VL53LX_decode_GPIO_interrupt_config( 02535 uint8_t system__interrupt_config); 02536 02537 VL53LX_Error VL53LX_set_GPIO_distance_threshold( 02538 uint16_t threshold_high, 02539 uint16_t threshold_low); 02540 02541 VL53LX_Error VL53LX_set_GPIO_rate_threshold( 02542 uint16_t threshold_high, 02543 uint16_t threshold_low); 02544 02545 VL53LX_Error VL53LX_set_GPIO_thresholds_from_struct( 02546 VL53LX_GPIO_interrupt_config_t *pintconf); 02547 02548 VL53LX_Error VL53LX_set_ref_spad_char_config( 02549 uint8_t vcsel_period_a, 02550 uint32_t phasecal_timeout_us, 02551 uint16_t total_rate_target_mcps, 02552 uint16_t max_count_rate_rtn_limit_mcps, 02553 uint16_t min_count_rate_rtn_limit_mcps, 02554 uint16_t fast_osc_frequency); 02555 02556 VL53LX_Error VL53LX_set_ssc_config( 02557 VL53LX_ssc_config_t *pssc_cfg, 02558 uint16_t fast_osc_frequency); 02559 02560 VL53LX_Error VL53LX_get_spad_rate_data( 02561 VL53LX_spad_rate_data_t *pspad_rates); 02562 02563 uint32_t VL53LX_calc_crosstalk_plane_offset_with_margin( 02564 uint32_t plane_offset_kcps, 02565 int16_t margin_offset_kcps); 02566 02567 VL53LX_Error VL53LX_low_power_auto_data_init(); 02568 02569 VL53LX_Error VL53LX_low_power_auto_data_stop_range(); 02570 02571 VL53LX_Error VL53LX_dynamic_xtalk_correction_calc_required_samples(); 02572 02573 VL53LX_Error VL53LX_dynamic_xtalk_correction_calc_new_xtalk( 02574 uint32_t xtalk_offset_out, 02575 VL53LX_smudge_corrector_config_t *pconfig, 02576 VL53LX_smudge_corrector_data_t *pout, 02577 uint8_t add_smudge, 02578 uint8_t soft_update 02579 ); 02580 02581 VL53LX_Error VL53LX_dynamic_xtalk_correction_corrector(); 02582 02583 VL53LX_Error VL53LX_dynamic_xtalk_correction_data_init(); 02584 02585 VL53LX_Error VL53LX_dynamic_xtalk_correction_output_init( 02586 VL53LX_LLDriverResults_t *pres 02587 ); 02588 02589 VL53LX_Error VL53LX_xtalk_cal_data_init(); 02590 02591 VL53LX_Error VL53LX_config_low_power_auto_mode( 02592 VL53LX_general_config_t *pgeneral, 02593 VL53LX_dynamic_config_t *pdynamic, 02594 VL53LX_low_power_auto_data_t *plpadata 02595 ); 02596 02597 VL53LX_Error VL53LX_low_power_auto_setup_manual_calibration(); 02598 02599 VL53LX_Error VL53LX_low_power_auto_update_DSS(); 02600 02601 VL53LX_Error VL53LX_compute_histo_merge_nb(uint8_t *histo_merge_nb); 02602 02603 02604 02605 /* vl53lx_wait.h */ 02606 02607 VL53LX_Error VL53LX_wait_for_boot_completion(); 02608 02609 VL53LX_Error VL53LX_wait_for_firmware_ready(); 02610 02611 VL53LX_Error VL53LX_wait_for_range_completion(); 02612 02613 VL53LX_Error VL53LX_wait_for_test_completion(); 02614 02615 VL53LX_Error VL53LX_is_boot_complete(uint8_t *pready); 02616 02617 VL53LX_Error VL53LX_is_firmware_ready(uint8_t *pready); 02618 02619 VL53LX_Error VL53LX_is_new_data_ready(uint8_t *pready); 02620 02621 VL53LX_Error VL53LX_poll_for_boot_completion(uint32_t timeout_ms); 02622 02623 VL53LX_Error VL53LX_poll_for_firmware_ready(uint32_t timeout_ms); 02624 02625 VL53LX_Error VL53LX_poll_for_range_completion(uint32_t timeout_ms); 02626 02627 02628 /* vl53lx_zone_presets.h */ 02629 02630 VL53LX_Error VL53LX_init_zone_config_structure( 02631 uint8_t x_off, 02632 uint8_t x_inc, 02633 uint8_t x_zones, 02634 uint8_t y_off, 02635 uint8_t y_inc, 02636 uint8_t y_zones, 02637 uint8_t width, 02638 uint8_t height, 02639 VL53LX_zone_config_t *pdata); 02640 02641 02642 VL53LX_Error VL53LX_zone_preset_xtalk_planar( 02643 VL53LX_general_config_t *pgeneral, 02644 VL53LX_zone_config_t *pzone_cfg); 02645 02646 02647 02648 VL53LX_Error VL53LX_init_zone_config_histogram_bins( 02649 VL53LX_zone_config_t *pdata); 02650 02651 02652 /* vl53lx_api_preset_modes.h */ 02653 02654 VL53LX_Error VL53LX_init_refspadchar_config_struct( 02655 VL53LX_refspadchar_config_t *pdata); 02656 02657 VL53LX_Error VL53LX_init_ssc_config_struct( 02658 VL53LX_ssc_config_t *pdata); 02659 02660 VL53LX_Error VL53LX_init_xtalk_config_struct( 02661 VL53LX_customer_nvm_managed_t *pnvm, 02662 VL53LX_xtalk_config_t *pdata); 02663 02664 VL53LX_Error VL53LX_init_xtalk_extract_config_struct( 02665 VL53LX_xtalkextract_config_t *pdata); 02666 02667 VL53LX_Error VL53LX_init_offset_cal_config_struct( 02668 VL53LX_offsetcal_config_t *pdata); 02669 02670 VL53LX_Error VL53LX_init_zone_cal_config_struct( 02671 VL53LX_zonecal_config_t *pdata); 02672 02673 VL53LX_Error VL53LX_init_hist_post_process_config_struct( 02674 uint8_t xtalk_compensation_enable, 02675 VL53LX_hist_post_process_config_t *pdata); 02676 02677 VL53LX_Error VL53LX_init_dmax_calibration_data_struct( 02678 VL53LX_dmax_calibration_data_t *pdata); 02679 02680 VL53LX_Error VL53LX_init_tuning_parm_storage_struct( 02681 VL53LX_tuning_parm_storage_t *pdata); 02682 02683 VL53LX_Error VL53LX_init_hist_gen3_dmax_config_struct( 02684 VL53LX_hist_gen3_dmax_config_t *pdata); 02685 02686 VL53LX_Error VL53LX_preset_mode_standard_ranging( 02687 VL53LX_static_config_t *pstatic, 02688 VL53LX_histogram_config_t *phistogram, 02689 VL53LX_general_config_t *pgeneral, 02690 VL53LX_timing_config_t *ptiming, 02691 VL53LX_dynamic_config_t *pdynamic, 02692 VL53LX_system_control_t *psystem, 02693 VL53LX_tuning_parm_storage_t *ptuning_parms, 02694 VL53LX_zone_config_t *pzone_cfg); 02695 02696 VL53LX_Error VL53LX_preset_mode_standard_ranging_short_range( 02697 VL53LX_static_config_t *pstatic, 02698 VL53LX_histogram_config_t *phistogram, 02699 VL53LX_general_config_t *pgeneral, 02700 VL53LX_timing_config_t *ptiming, 02701 VL53LX_dynamic_config_t *pdynamic, 02702 VL53LX_system_control_t *psystem, 02703 VL53LX_tuning_parm_storage_t *ptuning_parms, 02704 VL53LX_zone_config_t *pzone_cfg); 02705 02706 VL53LX_Error VL53LX_preset_mode_standard_ranging_long_range( 02707 VL53LX_static_config_t *pstatic, 02708 VL53LX_histogram_config_t *phistogram, 02709 VL53LX_general_config_t *pgeneral, 02710 VL53LX_timing_config_t *ptiming, 02711 VL53LX_dynamic_config_t *pdynamic, 02712 VL53LX_system_control_t *psystem, 02713 VL53LX_tuning_parm_storage_t *ptuning_parms, 02714 VL53LX_zone_config_t *pzone_cfg); 02715 02716 VL53LX_Error VL53LX_preset_mode_standard_ranging_mm1_cal( 02717 VL53LX_static_config_t *pstatic, 02718 VL53LX_histogram_config_t *phistogram, 02719 VL53LX_general_config_t *pgeneral, 02720 VL53LX_timing_config_t *ptiming, 02721 VL53LX_dynamic_config_t *pdynamic, 02722 VL53LX_system_control_t *psystem, 02723 VL53LX_tuning_parm_storage_t *ptuning_parms, 02724 VL53LX_zone_config_t *pzone_cfg); 02725 02726 VL53LX_Error VL53LX_preset_mode_standard_ranging_mm2_cal( 02727 VL53LX_static_config_t *pstatic, 02728 VL53LX_histogram_config_t *phistogram, 02729 VL53LX_general_config_t *pgeneral, 02730 VL53LX_timing_config_t *ptiming, 02731 VL53LX_dynamic_config_t *pdynamic, 02732 VL53LX_system_control_t *psystem, 02733 VL53LX_tuning_parm_storage_t *ptuning_parms, 02734 VL53LX_zone_config_t *pzone_cfg); 02735 02736 VL53LX_Error VL53LX_preset_mode_timed_ranging( 02737 02738 VL53LX_static_config_t *pstatic, 02739 VL53LX_histogram_config_t *phistogram, 02740 VL53LX_general_config_t *pgeneral, 02741 VL53LX_timing_config_t *ptiming, 02742 VL53LX_dynamic_config_t *pdynamic, 02743 VL53LX_system_control_t *psystem, 02744 VL53LX_tuning_parm_storage_t *ptuning_parms, 02745 VL53LX_zone_config_t *pzone_cfg); 02746 02747 VL53LX_Error VL53LX_preset_mode_timed_ranging_short_range( 02748 02749 VL53LX_static_config_t *pstatic, 02750 VL53LX_histogram_config_t *phistogram, 02751 VL53LX_general_config_t *pgeneral, 02752 VL53LX_timing_config_t *ptiming, 02753 VL53LX_dynamic_config_t *pdynamic, 02754 VL53LX_system_control_t *psystem, 02755 VL53LX_tuning_parm_storage_t *ptuning_parms, 02756 VL53LX_zone_config_t *pzone_cfg); 02757 02758 VL53LX_Error VL53LX_preset_mode_timed_ranging_long_range( 02759 02760 VL53LX_static_config_t *pstatic, 02761 VL53LX_histogram_config_t *phistogram, 02762 VL53LX_general_config_t *pgeneral, 02763 VL53LX_timing_config_t *ptiming, 02764 VL53LX_dynamic_config_t *pdynamic, 02765 VL53LX_system_control_t *psystem, 02766 VL53LX_tuning_parm_storage_t *ptuning_parms, 02767 VL53LX_zone_config_t *pzone_cfg); 02768 02769 VL53LX_Error VL53LX_preset_mode_low_power_auto_ranging( 02770 02771 VL53LX_static_config_t *pstatic, 02772 VL53LX_histogram_config_t *phistogram, 02773 VL53LX_general_config_t *pgeneral, 02774 VL53LX_timing_config_t *ptiming, 02775 VL53LX_dynamic_config_t *pdynamic, 02776 VL53LX_system_control_t *psystem, 02777 VL53LX_tuning_parm_storage_t *ptuning_parms, 02778 VL53LX_zone_config_t *pzone_cfg, 02779 VL53LX_low_power_auto_data_t *plpadata); 02780 02781 VL53LX_Error VL53LX_preset_mode_low_power_auto_short_ranging( 02782 02783 VL53LX_static_config_t *pstatic, 02784 VL53LX_histogram_config_t *phistogram, 02785 VL53LX_general_config_t *pgeneral, 02786 VL53LX_timing_config_t *ptiming, 02787 VL53LX_dynamic_config_t *pdynamic, 02788 VL53LX_system_control_t *psystem, 02789 VL53LX_tuning_parm_storage_t *ptuning_parms, 02790 VL53LX_zone_config_t *pzone_cfg, 02791 VL53LX_low_power_auto_data_t *plpadata); 02792 02793 VL53LX_Error VL53LX_preset_mode_low_power_auto_long_ranging( 02794 02795 VL53LX_static_config_t *pstatic, 02796 VL53LX_histogram_config_t *phistogram, 02797 VL53LX_general_config_t *pgeneral, 02798 VL53LX_timing_config_t *ptiming, 02799 VL53LX_dynamic_config_t *pdynamic, 02800 VL53LX_system_control_t *psystem, 02801 VL53LX_tuning_parm_storage_t *ptuning_parms, 02802 VL53LX_zone_config_t *pzone_cfg, 02803 VL53LX_low_power_auto_data_t *plpadata); 02804 02805 VL53LX_Error VL53LX_preset_mode_histogram_ranging( 02806 VL53LX_hist_post_process_config_t *phistpostprocess, 02807 VL53LX_static_config_t *pstatic, 02808 VL53LX_histogram_config_t *phistogram, 02809 VL53LX_general_config_t *pgeneral, 02810 VL53LX_timing_config_t *ptiming, 02811 VL53LX_dynamic_config_t *pdynamic, 02812 VL53LX_system_control_t *psystem, 02813 VL53LX_tuning_parm_storage_t *ptuning_parms, 02814 VL53LX_zone_config_t *pzone_cfg); 02815 02816 VL53LX_Error VL53LX_preset_mode_histogram_ranging_with_mm1( 02817 VL53LX_hist_post_process_config_t *phistpostprocess, 02818 VL53LX_static_config_t *pstatic, 02819 VL53LX_histogram_config_t *phistogram, 02820 VL53LX_general_config_t *pgeneral, 02821 VL53LX_timing_config_t *ptiming, 02822 VL53LX_dynamic_config_t *pdynamic, 02823 VL53LX_system_control_t *psystem, 02824 VL53LX_tuning_parm_storage_t *ptuning_parms, 02825 VL53LX_zone_config_t *pzone_cfg); 02826 02827 VL53LX_Error VL53LX_preset_mode_histogram_ranging_with_mm2( 02828 VL53LX_hist_post_process_config_t *phistpostprocess, 02829 VL53LX_static_config_t *pstatic, 02830 VL53LX_histogram_config_t *phistogram, 02831 VL53LX_general_config_t *pgeneral, 02832 VL53LX_timing_config_t *ptiming, 02833 VL53LX_dynamic_config_t *pdynamic, 02834 VL53LX_system_control_t *psystem, 02835 VL53LX_tuning_parm_storage_t *ptuning_parms, 02836 VL53LX_zone_config_t *pzone_cfg); 02837 02838 VL53LX_Error VL53LX_preset_mode_histogram_ranging_mm1_cal( 02839 VL53LX_hist_post_process_config_t *phistpostprocess, 02840 VL53LX_static_config_t *pstatic, 02841 VL53LX_histogram_config_t *phistogram, 02842 VL53LX_general_config_t *pgeneral, 02843 VL53LX_timing_config_t *ptiming, 02844 VL53LX_dynamic_config_t *pdynamic, 02845 VL53LX_system_control_t *psystem, 02846 VL53LX_tuning_parm_storage_t *ptuning_parms, 02847 VL53LX_zone_config_t *pzone_cfg); 02848 02849 VL53LX_Error VL53LX_preset_mode_histogram_ranging_mm2_cal( 02850 VL53LX_hist_post_process_config_t *phistpostprocess, 02851 VL53LX_static_config_t *pstatic, 02852 VL53LX_histogram_config_t *phistogram, 02853 VL53LX_general_config_t *pgeneral, 02854 VL53LX_timing_config_t *ptiming, 02855 VL53LX_dynamic_config_t *pdynamic, 02856 VL53LX_system_control_t *psystem, 02857 VL53LX_tuning_parm_storage_t *ptuning_parms, 02858 VL53LX_zone_config_t *pzone_cfg); 02859 02860 VL53LX_Error VL53LX_preset_mode_histogram_ranging_ref( 02861 VL53LX_hist_post_process_config_t *phistpostprocess, 02862 VL53LX_static_config_t *pstatic, 02863 VL53LX_histogram_config_t *phistogram, 02864 VL53LX_general_config_t *pgeneral, 02865 VL53LX_timing_config_t *ptiming, 02866 VL53LX_dynamic_config_t *pdynamic, 02867 VL53LX_system_control_t *psystem, 02868 VL53LX_tuning_parm_storage_t *ptuning_parms, 02869 VL53LX_zone_config_t *pzone_cfg); 02870 02871 VL53LX_Error VL53LX_preset_mode_histogram_characterisation( 02872 VL53LX_hist_post_process_config_t *phistpostprocess, 02873 VL53LX_static_config_t *pstatic, 02874 VL53LX_histogram_config_t *phistogram, 02875 VL53LX_general_config_t *pgeneral, 02876 VL53LX_timing_config_t *ptiming, 02877 VL53LX_dynamic_config_t *pdynamic, 02878 VL53LX_system_control_t *psystem, 02879 VL53LX_tuning_parm_storage_t *ptuning_parms, 02880 VL53LX_zone_config_t *pzone_cfg); 02881 02882 VL53LX_Error VL53LX_preset_mode_histogram_xtalk_planar( 02883 VL53LX_hist_post_process_config_t *phistpostprocess, 02884 VL53LX_static_config_t *pstatic, 02885 VL53LX_histogram_config_t *phistogram, 02886 VL53LX_general_config_t *pgeneral, 02887 VL53LX_timing_config_t *ptiming, 02888 VL53LX_dynamic_config_t *pdynamic, 02889 VL53LX_system_control_t *psystem, 02890 VL53LX_tuning_parm_storage_t *ptuning_parms, 02891 VL53LX_zone_config_t *pzone_cfg); 02892 02893 VL53LX_Error VL53LX_preset_mode_histogram_xtalk_mm1( 02894 VL53LX_hist_post_process_config_t *phistpostprocess, 02895 VL53LX_static_config_t *pstatic, 02896 VL53LX_histogram_config_t *phistogram, 02897 VL53LX_general_config_t *pgeneral, 02898 VL53LX_timing_config_t *ptiming, 02899 VL53LX_dynamic_config_t *pdynamic, 02900 VL53LX_system_control_t *psystem, 02901 VL53LX_tuning_parm_storage_t *ptuning_parms, 02902 VL53LX_zone_config_t *pzone_cfg); 02903 02904 VL53LX_Error VL53LX_preset_mode_histogram_xtalk_mm2( 02905 VL53LX_hist_post_process_config_t *phistpostprocess, 02906 VL53LX_static_config_t *pstatic, 02907 VL53LX_histogram_config_t *phistogram, 02908 VL53LX_general_config_t *pgeneral, 02909 VL53LX_timing_config_t *ptiming, 02910 VL53LX_dynamic_config_t *pdynamic, 02911 VL53LX_system_control_t *psystem, 02912 VL53LX_tuning_parm_storage_t *ptuning_parms, 02913 VL53LX_zone_config_t *pzone_cfg); 02914 02915 VL53LX_Error VL53LX_preset_mode_histogram_multizone( 02916 VL53LX_hist_post_process_config_t *phistpostprocess, 02917 VL53LX_static_config_t *pstatic, 02918 VL53LX_histogram_config_t *phistogram, 02919 VL53LX_general_config_t *pgeneral, 02920 VL53LX_timing_config_t *ptiming, 02921 VL53LX_dynamic_config_t *pdynamic, 02922 VL53LX_system_control_t *psystem, 02923 VL53LX_tuning_parm_storage_t *ptuning_parms, 02924 VL53LX_zone_config_t *pzone_cfg); 02925 02926 VL53LX_Error VL53LX_preset_mode_histogram_multizone_short_range( 02927 VL53LX_hist_post_process_config_t *phistpostprocess, 02928 VL53LX_static_config_t *pstatic, 02929 VL53LX_histogram_config_t *phistogram, 02930 VL53LX_general_config_t *pgeneral, 02931 VL53LX_timing_config_t *ptiming, 02932 VL53LX_dynamic_config_t *pdynamic, 02933 VL53LX_system_control_t *psystem, 02934 VL53LX_tuning_parm_storage_t *ptuning_parms, 02935 VL53LX_zone_config_t *pzone_cfg); 02936 02937 VL53LX_Error VL53LX_preset_mode_histogram_multizone_long_range( 02938 VL53LX_hist_post_process_config_t *phistpostprocess, 02939 VL53LX_static_config_t *pstatic, 02940 VL53LX_histogram_config_t *phistogram, 02941 VL53LX_general_config_t *pgeneral, 02942 VL53LX_timing_config_t *ptiming, 02943 VL53LX_dynamic_config_t *pdynamic, 02944 VL53LX_system_control_t *psystem, 02945 VL53LX_tuning_parm_storage_t *ptuning_parms, 02946 VL53LX_zone_config_t *pzone_cfg); 02947 02948 VL53LX_Error VL53LX_preset_mode_histogram_ranging_short_timing( 02949 VL53LX_hist_post_process_config_t *phistpostprocess, 02950 VL53LX_static_config_t *pstatic, 02951 VL53LX_histogram_config_t *phistogram, 02952 VL53LX_general_config_t *pgeneral, 02953 VL53LX_timing_config_t *ptiming, 02954 VL53LX_dynamic_config_t *pdynamic, 02955 VL53LX_system_control_t *psystem, 02956 VL53LX_tuning_parm_storage_t *ptuning_parms, 02957 VL53LX_zone_config_t *pzone_cfg); 02958 02959 VL53LX_Error VL53LX_preset_mode_histogram_long_range( 02960 VL53LX_hist_post_process_config_t *phistpostprocess, 02961 VL53LX_static_config_t *pstatic, 02962 VL53LX_histogram_config_t *phistogram, 02963 VL53LX_general_config_t *pgeneral, 02964 VL53LX_timing_config_t *ptiming, 02965 VL53LX_dynamic_config_t *pdynamic, 02966 VL53LX_system_control_t *psystem, 02967 VL53LX_tuning_parm_storage_t *ptuning_parms, 02968 VL53LX_zone_config_t *pzone_cfg); 02969 02970 VL53LX_Error VL53LX_preset_mode_histogram_medium_range( 02971 VL53LX_hist_post_process_config_t *phistpostprocess, 02972 VL53LX_static_config_t *pstatic, 02973 VL53LX_histogram_config_t *phistogram, 02974 VL53LX_general_config_t *pgeneral, 02975 VL53LX_timing_config_t *ptiming, 02976 VL53LX_dynamic_config_t *pdynamic, 02977 VL53LX_system_control_t *psystem, 02978 VL53LX_tuning_parm_storage_t *ptuning_parms, 02979 VL53LX_zone_config_t *pzone_cfg); 02980 02981 VL53LX_Error VL53LX_preset_mode_histogram_short_range( 02982 VL53LX_hist_post_process_config_t *phistpostprocess, 02983 VL53LX_static_config_t *pstatic, 02984 VL53LX_histogram_config_t *phistogram, 02985 VL53LX_general_config_t *pgeneral, 02986 VL53LX_timing_config_t *ptiming, 02987 VL53LX_dynamic_config_t *pdynamic, 02988 VL53LX_system_control_t *psystem, 02989 VL53LX_tuning_parm_storage_t *ptuning_parms, 02990 VL53LX_zone_config_t *pzone_cfg); 02991 02992 VL53LX_Error VL53LX_preset_mode_special_histogram_short_range( 02993 VL53LX_hist_post_process_config_t *phistpostprocess, 02994 VL53LX_static_config_t *pstatic, 02995 VL53LX_histogram_config_t *phistogram, 02996 VL53LX_general_config_t *pgeneral, 02997 VL53LX_timing_config_t *ptiming, 02998 VL53LX_dynamic_config_t *pdynamic, 02999 VL53LX_system_control_t *psystem, 03000 VL53LX_tuning_parm_storage_t *ptuning_parms, 03001 VL53LX_zone_config_t *pzone_cfg); 03002 03003 VL53LX_Error VL53LX_preset_mode_histogram_long_range_mm1( 03004 VL53LX_hist_post_process_config_t *phistpostprocess, 03005 VL53LX_static_config_t *pstatic, 03006 VL53LX_histogram_config_t *phistogram, 03007 VL53LX_general_config_t *pgeneral, 03008 VL53LX_timing_config_t *ptiming, 03009 VL53LX_dynamic_config_t *pdynamic, 03010 VL53LX_system_control_t *psystem, 03011 VL53LX_tuning_parm_storage_t *ptuning_parms, 03012 VL53LX_zone_config_t *pzone_cfg); 03013 03014 VL53LX_Error VL53LX_preset_mode_histogram_long_range_mm2( 03015 VL53LX_hist_post_process_config_t *phistpostprocess, 03016 VL53LX_static_config_t *pstatic, 03017 VL53LX_histogram_config_t *phistogram, 03018 VL53LX_general_config_t *pgeneral, 03019 VL53LX_timing_config_t *ptiming, 03020 VL53LX_dynamic_config_t *pdynamic, 03021 VL53LX_system_control_t *psystem, 03022 VL53LX_tuning_parm_storage_t *ptuning_parms, 03023 VL53LX_zone_config_t *pzone_cfg); 03024 03025 VL53LX_Error VL53LX_preset_mode_histogram_medium_range_mm1( 03026 VL53LX_hist_post_process_config_t *phistpostprocess, 03027 VL53LX_static_config_t *pstatic, 03028 VL53LX_histogram_config_t *phistogram, 03029 VL53LX_general_config_t *pgeneral, 03030 VL53LX_timing_config_t *ptiming, 03031 VL53LX_dynamic_config_t *pdynamic, 03032 VL53LX_system_control_t *psystem, 03033 VL53LX_tuning_parm_storage_t *ptuning_parms, 03034 VL53LX_zone_config_t *pzone_cfg); 03035 03036 VL53LX_Error VL53LX_preset_mode_histogram_medium_range_mm2( 03037 VL53LX_hist_post_process_config_t *phistpostprocess, 03038 VL53LX_static_config_t *pstatic, 03039 VL53LX_histogram_config_t *phistogram, 03040 VL53LX_general_config_t *pgeneral, 03041 VL53LX_timing_config_t *ptiming, 03042 VL53LX_dynamic_config_t *pdynamic, 03043 VL53LX_system_control_t *psystem, 03044 VL53LX_tuning_parm_storage_t *ptuning_parms, 03045 VL53LX_zone_config_t *pzone_cfg); 03046 03047 VL53LX_Error VL53LX_preset_mode_histogram_short_range_mm1( 03048 VL53LX_hist_post_process_config_t *phistpostprocess, 03049 VL53LX_static_config_t *pstatic, 03050 VL53LX_histogram_config_t *phistogram, 03051 VL53LX_general_config_t *pgeneral, 03052 VL53LX_timing_config_t *ptiming, 03053 VL53LX_dynamic_config_t *pdynamic, 03054 VL53LX_system_control_t *psystem, 03055 VL53LX_tuning_parm_storage_t *ptuning_parms, 03056 VL53LX_zone_config_t *pzone_cfg); 03057 03058 VL53LX_Error VL53LX_preset_mode_histogram_short_range_mm2( 03059 VL53LX_hist_post_process_config_t *phistpostprocess, 03060 VL53LX_static_config_t *pstatic, 03061 VL53LX_histogram_config_t *phistogram, 03062 VL53LX_general_config_t *pgeneral, 03063 VL53LX_timing_config_t *ptiming, 03064 VL53LX_dynamic_config_t *pdynamic, 03065 VL53LX_system_control_t *psystem, 03066 VL53LX_tuning_parm_storage_t *ptuning_parms, 03067 VL53LX_zone_config_t *pzone_cfg); 03068 03069 VL53LX_Error VL53LX_preset_mode_olt( 03070 VL53LX_static_config_t *pstatic, 03071 VL53LX_histogram_config_t *phistogram, 03072 VL53LX_general_config_t *pgeneral, 03073 VL53LX_timing_config_t *ptiming, 03074 VL53LX_dynamic_config_t *pdynamic, 03075 VL53LX_system_control_t *psystem, 03076 VL53LX_tuning_parm_storage_t *ptuning_parms, 03077 VL53LX_zone_config_t *pzone_cfg); 03078 03079 VL53LX_Error VL53LX_preset_mode_singleshot_ranging( 03080 03081 VL53LX_static_config_t *pstatic, 03082 VL53LX_histogram_config_t *phistogram, 03083 VL53LX_general_config_t *pgeneral, 03084 VL53LX_timing_config_t *ptiming, 03085 VL53LX_dynamic_config_t *pdynamic, 03086 VL53LX_system_control_t *psystem, 03087 VL53LX_tuning_parm_storage_t *ptuning_parms, 03088 VL53LX_zone_config_t *pzone_cfg); 03089 03090 void VL53LX_copy_hist_cfg_to_static_cfg( 03091 VL53LX_histogram_config_t *phistogram, 03092 VL53LX_static_config_t *pstatic, 03093 VL53LX_general_config_t *pgeneral, 03094 VL53LX_timing_config_t *ptiming, 03095 VL53LX_dynamic_config_t *pdynamic); 03096 03097 void VL53LX_copy_hist_bins_to_static_cfg( 03098 VL53LX_histogram_config_t *phistogram, 03099 VL53LX_static_config_t *pstatic, 03100 VL53LX_timing_config_t *ptiming); 03101 03102 03103 /* vl53lx_silicon_core.h */ 03104 VL53LX_Error VL53LX_is_firmware_ready_silicon( 03105 uint8_t *pready); 03106 03107 03108 /* vl53lx_hist_core.h */ 03109 03110 void VL53LX_f_022( 03111 uint8_t VL53LX_p_032, 03112 uint8_t filter_woi, 03113 VL53LX_histogram_bin_data_t *pbins, 03114 int32_t *pa, 03115 int32_t *pb, 03116 int32_t *pc); 03117 03118 VL53LX_Error VL53LX_f_018( 03119 uint16_t vcsel_width, 03120 uint16_t fast_osc_frequency, 03121 uint32_t total_periods_elapsed, 03122 uint16_t VL53LX_p_004, 03123 VL53LX_range_data_t *pdata); 03124 03125 void VL53LX_f_019( 03126 uint16_t gain_factor, 03127 int16_t range_offset_mm, 03128 VL53LX_range_data_t *pdata); 03129 03130 void VL53LX_f_029( 03131 VL53LX_histogram_bin_data_t *pdata, 03132 int32_t ambient_estimate_counts_per_bin); 03133 03134 void VL53LX_f_005( 03135 VL53LX_histogram_bin_data_t *pxtalk, 03136 VL53LX_histogram_bin_data_t *pbins, 03137 VL53LX_histogram_bin_data_t *pxtalk_realigned); 03138 03139 int8_t VL53LX_f_030( 03140 VL53LX_histogram_bin_data_t *pdata1, 03141 VL53LX_histogram_bin_data_t *pdata2); 03142 03143 VL53LX_Error VL53LX_f_031( 03144 VL53LX_histogram_bin_data_t *pidata, 03145 VL53LX_histogram_bin_data_t *podata); 03146 03147 03148 /* vl53lx_xtalk.h */ 03149 03150 VL53LX_Error VL53LX_xtalk_calibration_process_data( 03151 VL53LX_xtalk_range_results_t *pxtalk_ranges, 03152 VL53LX_xtalk_histogram_data_t *pxtalk_shape, 03153 VL53LX_xtalk_calibration_results_t *pxtalk_cal); 03154 03155 VL53LX_Error VL53LX_f_041( 03156 VL53LX_histogram_bin_data_t *pavg_bins, 03157 VL53LX_xtalk_algo_data_t *pdebug, 03158 VL53LX_xtalk_range_data_t *pxtalk_data, 03159 uint8_t histogram__window_start, 03160 uint8_t histogram__window_end, 03161 VL53LX_xtalk_histogram_shape_t *pxtalk_shape); 03162 03163 VL53LX_Error VL53LX_f_039( 03164 VL53LX_xtalk_range_results_t *pxtalk_results, 03165 VL53LX_xtalk_algo_data_t *pdebug, 03166 int16_t *xgradient, 03167 int16_t *ygradient); 03168 03169 VL53LX_Error VL53LX_f_040( 03170 VL53LX_xtalk_range_data_t *pxtalk_data, 03171 VL53LX_xtalk_algo_data_t *pdebug, 03172 uint32_t *xtalk_mean_offset_kcps); 03173 03174 VL53LX_Error VL53LX_f_045( 03175 VL53LX_histogram_bin_data_t *phist_data, 03176 VL53LX_xtalk_range_data_t *pxtalk_data, 03177 VL53LX_xtalk_algo_data_t *pdebug, 03178 VL53LX_xtalk_histogram_shape_t *pxtalk_histo); 03179 03180 VL53LX_Error VL53LX_f_032( 03181 uint32_t mean_offset, 03182 int16_t xgradient, 03183 int16_t ygradient, 03184 int8_t centre_offset_x, 03185 int8_t centre_offset_y, 03186 uint16_t roi_effective_spads, 03187 uint8_t roi_centre_spad, 03188 uint8_t roi_xy_size, 03189 uint32_t *xtalk_rate_kcps); 03190 03191 VL53LX_Error VL53LX_f_033( 03192 VL53LX_histogram_bin_data_t *phist_data, 03193 VL53LX_xtalk_histogram_shape_t *pxtalk_data, 03194 uint32_t xtalk_rate_kcps, 03195 VL53LX_histogram_bin_data_t *pxtalkcount_data); 03196 03197 VL53LX_Error VL53LX_f_047( 03198 VL53LX_histogram_bin_data_t *phist_data, 03199 VL53LX_histogram_bin_data_t *pxtalk_data, 03200 uint8_t xtalk_bin_offset); 03201 03202 VL53LX_Error VL53LX_f_044( 03203 VL53LX_histogram_bin_data_t *pxtalk_data, 03204 uint32_t amb_threshold, 03205 uint8_t VL53LX_p_019, 03206 uint8_t VL53LX_p_024); 03207 03208 VL53LX_Error VL53LX_f_046( 03209 VL53LX_customer_nvm_managed_t *pcustomer, 03210 VL53LX_dynamic_config_t *pdyn_cfg, 03211 VL53LX_xtalk_histogram_data_t *pxtalk_shape, 03212 VL53LX_histogram_bin_data_t *pip_hist_data, 03213 VL53LX_histogram_bin_data_t *pop_hist_data, 03214 VL53LX_histogram_bin_data_t *pxtalk_count_data); 03215 03216 VL53LX_Error VL53LX_f_043( 03217 uint8_t sigma_mult, 03218 int32_t VL53LX_p_028, 03219 uint32_t *ambient_noise); 03220 03221 03222 VL53LX_Error VL53LX_generate_dual_reflectance_xtalk_samples( 03223 VL53LX_xtalk_range_results_t *pxtalk_results, 03224 uint16_t expected_target_distance_mm, 03225 uint8_t higher_reflectance, 03226 VL53LX_histogram_bin_data_t *pxtalk_avg_samples 03227 ); 03228 03229 VL53LX_Error VL53LX_f_042( 03230 VL53LX_histogram_bin_data_t *pzone_avg_1, 03231 VL53LX_histogram_bin_data_t *pzone_avg_2, 03232 uint16_t expected_target_distance, 03233 uint8_t subtract_amb, 03234 uint8_t higher_reflectance, 03235 VL53LX_histogram_bin_data_t *pxtalk_output 03236 ); 03237 03238 03239 /* vl53lx_sigma_estimate.h */ 03240 03241 uint16_t VL53LX_f_034( 03242 uint8_t sigma_estimator__effective_pulse_width_ns, 03243 uint8_t sigma_estimator__effective_ambient_width_ns, 03244 uint8_t sigma_estimator__sigma_ref_mm, 03245 VL53LX_range_data_t *pdata); 03246 03247 uint16_t VL53LX_f_036( 03248 uint8_t sigma_estimator__effective_pulse_width_ns, 03249 uint8_t sigma_estimator__effective_ambient_width_ns, 03250 uint8_t sigma_estimator__sigma_ref_mm, 03251 VL53LX_range_data_t *pdata); 03252 03253 VL53LX_Error VL53LX_f_037( 03254 uint8_t sigma_estimator__sigma_ref_mm, 03255 uint32_t VL53LX_p_007, 03256 uint32_t VL53LX_p_032, 03257 uint32_t VL53LX_p_001, 03258 uint32_t a_zp, 03259 uint32_t c_zp, 03260 uint32_t bx, 03261 uint32_t ax_zp, 03262 uint32_t cx_zp, 03263 uint32_t VL53LX_p_028, 03264 uint16_t fast_osc_frequency, 03265 uint16_t *psigma_est); 03266 03267 VL53LX_Error VL53LX_f_023( 03268 uint8_t sigma_estimator__sigma_ref_mm, 03269 uint32_t VL53LX_p_007, 03270 uint32_t VL53LX_p_032, 03271 uint32_t VL53LX_p_001, 03272 uint32_t a_zp, 03273 uint32_t c_zp, 03274 uint32_t bx, 03275 uint32_t ax_zp, 03276 uint32_t cx_zp, 03277 uint32_t VL53LX_p_028, 03278 uint16_t fast_osc_frequency, 03279 uint16_t *psigma_est); 03280 03281 uint32_t VL53LX_f_038( 03282 uint64_t VL53LX_p_007, 03283 uint32_t size 03284 ); 03285 03286 uint32_t VL53LX_f_035( 03287 uint32_t VL53LX_p_007, 03288 uint32_t VL53LX_p_032); 03289 03290 03291 /* vl53lx_hist_algos_gen3.h */ 03292 03293 void VL53LX_f_003( 03294 VL53LX_hist_gen3_algo_private_data_t *palgo); 03295 03296 VL53LX_Error VL53LX_f_004( 03297 VL53LX_dmax_calibration_data_t *pdmax_cal, 03298 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg, 03299 VL53LX_hist_post_process_config_t *ppost_cfg, 03300 VL53LX_histogram_bin_data_t *pbins, 03301 VL53LX_histogram_bin_data_t *pxtalk, 03302 VL53LX_hist_gen3_algo_private_data_t *palgo, 03303 VL53LX_hist_gen3_dmax_private_data_t *pdmax_algo, 03304 VL53LX_range_results_t *presults); 03305 03306 VL53LX_Error VL53LX_f_006( 03307 uint16_t ambient_threshold_events_scaler, 03308 int32_t ambient_threshold_sigma, 03309 int32_t min_ambient_threshold_events, 03310 uint8_t algo__crosstalk_compensation_enable, 03311 VL53LX_histogram_bin_data_t *pbins, 03312 VL53LX_histogram_bin_data_t *pxtalk, 03313 VL53LX_hist_gen3_algo_private_data_t *palgo); 03314 03315 03316 VL53LX_Error VL53LX_f_007( 03317 VL53LX_hist_gen3_algo_private_data_t *palgo); 03318 03319 VL53LX_Error VL53LX_f_008( 03320 VL53LX_hist_gen3_algo_private_data_t *palgo); 03321 03322 VL53LX_Error VL53LX_f_009( 03323 VL53LX_hist_gen3_algo_private_data_t *palgo); 03324 03325 VL53LX_Error VL53LX_f_016( 03326 VL53LX_HistTargetOrder target_order, 03327 VL53LX_hist_gen3_algo_private_data_t *palgo); 03328 03329 VL53LX_Error VL53LX_f_010( 03330 uint8_t pulse_no, 03331 VL53LX_histogram_bin_data_t *pbins, 03332 VL53LX_hist_gen3_algo_private_data_t *palgo); 03333 03334 VL53LX_Error VL53LX_f_015( 03335 uint8_t pulse_no, 03336 uint8_t clip_events, 03337 VL53LX_histogram_bin_data_t *pbins, 03338 VL53LX_hist_gen3_algo_private_data_t *palgo); 03339 03340 VL53LX_Error VL53LX_f_020( 03341 int16_t VL53LX_p_019, 03342 int16_t VL53LX_p_024, 03343 uint8_t VL53LX_p_030, 03344 uint8_t clip_events, 03345 VL53LX_histogram_bin_data_t *pbins, 03346 uint32_t *pphase); 03347 03348 03349 VL53LX_Error VL53LX_f_011( 03350 uint8_t pulse_no, 03351 VL53LX_histogram_bin_data_t *pbins, 03352 VL53LX_hist_gen3_algo_private_data_t *palgo, 03353 int32_t pad_value, 03354 VL53LX_histogram_bin_data_t *ppulse); 03355 03356 VL53LX_Error VL53LX_f_012( 03357 uint8_t pulse_no, 03358 VL53LX_histogram_bin_data_t *ppulse, 03359 VL53LX_hist_gen3_algo_private_data_t *palgo); 03360 03361 VL53LX_Error VL53LX_f_013( 03362 uint8_t pulse_no, 03363 uint16_t noise_threshold, 03364 VL53LX_hist_gen3_algo_private_data_t *palgo); 03365 03366 VL53LX_Error VL53LX_f_021( 03367 uint8_t bin, 03368 int32_t filta0, 03369 int32_t filta1, 03370 uint8_t VL53LX_p_030, 03371 uint32_t *pmedian_phase); 03372 03373 03374 VL53LX_Error VL53LX_f_014( 03375 uint8_t bin, 03376 uint8_t sigma_estimator__sigma_ref_mm, 03377 uint8_t VL53LX_p_030, 03378 uint8_t VL53LX_p_051, 03379 uint8_t crosstalk_compensation_enable, 03380 VL53LX_histogram_bin_data_t *phist_data_ap, 03381 VL53LX_histogram_bin_data_t *phist_data_zp, 03382 VL53LX_histogram_bin_data_t *pxtalk_hist, 03383 uint16_t *psigma_est); 03384 03385 03386 void VL53LX_f_017( 03387 uint8_t range_id, 03388 uint8_t valid_phase_low, 03389 uint8_t valid_phase_high, 03390 uint16_t sigma_thres, 03391 VL53LX_histogram_bin_data_t *pbins, 03392 VL53LX_hist_pulse_data_t *ppulse, 03393 VL53LX_range_data_t *pdata); 03394 03395 03396 /* vl53lx_hist_algos_gen4.h */ 03397 03398 void VL53LX_f_024( 03399 VL53LX_hist_gen4_algo_filtered_data_t *palgo); 03400 03401 VL53LX_Error VL53LX_f_025( 03402 VL53LX_dmax_calibration_data_t *pdmax_cal, 03403 VL53LX_hist_gen3_dmax_config_t *pdmax_cfg, 03404 VL53LX_hist_post_process_config_t *ppost_cfg, 03405 VL53LX_histogram_bin_data_t *pbins, 03406 VL53LX_histogram_bin_data_t *pxtalk, 03407 VL53LX_hist_gen3_algo_private_data_t *palgo, 03408 VL53LX_hist_gen4_algo_filtered_data_t *pfiltered, 03409 VL53LX_hist_gen3_dmax_private_data_t *pdmax_algo, 03410 VL53LX_range_results_t *presults); 03411 03412 VL53LX_Error VL53LX_f_026( 03413 uint8_t pulse_no, 03414 VL53LX_histogram_bin_data_t *ppulse, 03415 VL53LX_hist_gen3_algo_private_data_t *palgo, 03416 VL53LX_hist_gen4_algo_filtered_data_t *pfiltered); 03417 03418 VL53LX_Error VL53LX_f_027( 03419 uint8_t pulse_no, 03420 uint16_t noise_threshold, 03421 VL53LX_hist_gen4_algo_filtered_data_t *pfiltered, 03422 VL53LX_hist_gen3_algo_private_data_t *palgo); 03423 03424 VL53LX_Error VL53LX_f_028( 03425 uint8_t bin, 03426 int32_t VL53LX_p_007, 03427 int32_t VL53LX_p_032, 03428 int32_t VL53LX_p_001, 03429 int32_t ax, 03430 int32_t bx, 03431 int32_t cx, 03432 int32_t VL53LX_p_028, 03433 uint8_t VL53LX_p_030, 03434 uint32_t *pmedian_phase); 03435 03436 03437 03438 /* vl53lx_dmax.h */ 03439 03440 VL53LX_Error VL53LX_f_001( 03441 uint16_t target_reflectance, 03442 VL53LX_dmax_calibration_data_t *pcal, 03443 VL53LX_hist_gen3_dmax_config_t *pcfg, 03444 VL53LX_histogram_bin_data_t *pbins, 03445 VL53LX_hist_gen3_dmax_private_data_t *pdata, 03446 int16_t *pambient_dmax_mm); 03447 03448 uint32_t VL53LX_f_002( 03449 uint32_t events_threshold, 03450 uint32_t ref_signal_events, 03451 uint32_t ref_distance_mm, 03452 uint32_t signal_thresh_sigma); 03453 03454 03455 03456 /* vl53lx_api_calibration.h */ 03457 03458 VL53LX_Error VL53LX_run_ref_spad_char( 03459 VL53LX_Error *pcal_status); 03460 03461 03462 03463 03464 VL53LX_Error VL53LX_run_device_test( 03465 VL53LX_DeviceTestMode device_test_mode); 03466 03467 03468 03469 03470 VL53LX_Error VL53LX_run_spad_rate_map( 03471 VL53LX_DeviceTestMode device_test_mode, 03472 VL53LX_DeviceSscArray array_select, 03473 uint32_t ssc_config_timeout_us, 03474 VL53LX_spad_rate_data_t *pspad_rate_data); 03475 03476 03477 03478 03479 VL53LX_Error VL53LX_run_xtalk_extraction( 03480 VL53LX_Error *pcal_status); 03481 03482 03483 03484 VL53LX_Error VL53LX_get_and_avg_xtalk_samples( 03485 uint8_t num_of_samples, 03486 uint8_t measurement_mode, 03487 int16_t xtalk_filter_thresh_max_mm, 03488 int16_t xtalk_filter_thresh_min_mm, 03489 uint16_t xtalk_max_valid_rate_kcps, 03490 uint8_t xtalk_result_id, 03491 uint8_t xtalk_histo_id, 03492 VL53LX_xtalk_range_results_t *pxtalk_results, 03493 VL53LX_histogram_bin_data_t *psum_histo, 03494 VL53LX_histogram_bin_data_t *pavg_histo); 03495 03496 03497 03498 VL53LX_Error VL53LX_run_offset_calibration( 03499 int16_t cal_distance_mm, 03500 uint16_t cal_reflectance_pc, 03501 VL53LX_Error *pcal_status); 03502 03503 03504 03505 03506 VL53LX_Error VL53LX_run_phasecal_average( 03507 uint8_t measurement_mode, 03508 uint8_t phasecal_result__vcsel_start, 03509 uint16_t phasecal_num_of_samples, 03510 VL53LX_range_results_t *prange_results, 03511 uint16_t *pphasecal_result__reference_phase, 03512 uint16_t *pzero_distance_phase); 03513 03514 03515 03516 03517 VL53LX_Error VL53LX_run_zone_calibration( 03518 VL53LX_DevicePresetModes device_preset_mode, 03519 VL53LX_DeviceZonePreset zone_preset, 03520 VL53LX_zone_config_t *pzone_cfg, 03521 int16_t cal_distance_mm, 03522 uint16_t cal_reflectance_pc, 03523 VL53LX_Error *pcal_status); 03524 03525 03526 03527 03528 void VL53LX_hist_xtalk_extract_data_init( 03529 VL53LX_hist_xtalk_extract_data_t *pxtalk_data); 03530 03531 03532 03533 VL53LX_Error VL53LX_hist_xtalk_extract_update( 03534 int16_t target_distance_mm, 03535 uint16_t target_width_oversize, 03536 VL53LX_histogram_bin_data_t *phist_bins, 03537 VL53LX_hist_xtalk_extract_data_t *pxtalk_data); 03538 03539 03540 03541 VL53LX_Error VL53LX_hist_xtalk_extract_fini( 03542 VL53LX_histogram_bin_data_t *phist_bins, 03543 VL53LX_hist_xtalk_extract_data_t *pxtalk_data, 03544 VL53LX_xtalk_calibration_results_t *pxtalk_cal, 03545 VL53LX_xtalk_histogram_shape_t *pxtalk_shape); 03546 03547 03548 03549 03550 VL53LX_Error VL53LX_run_hist_xtalk_extraction( 03551 int16_t cal_distance_mm, 03552 VL53LX_Error *pcal_status); 03553 03554 /* vl53lx_api_core.c static functions */ 03555 VL53LX_Error select_offset_per_vcsel(VL53LX_LLDriverData_t *pdev, int16_t *poffset); 03556 void vl53lx_diff_histo_stddev(VL53LX_LLDriverData_t *pdev, VL53LX_histogram_bin_data_t *pdata, uint8_t timing, uint8_t HighIndex, uint8_t prev_pos, int32_t *pdiff_histo_stddev) ; 03557 void vl53lx_histo_merge(VL53LX_histogram_bin_data_t *pdata); 03558 03559 /* vl53lx_api.c static functions */ 03560 03561 03562 03563 // int32_t BDTable[VL53LX_TUNING_MAX_TUNABLE_KEY] = { 03564 int BDTable[11]; 03565 03566 03567 /* 03568 03569 int32_t BDTable[11] = { 03570 TUNING_VERSION, 03571 TUNING_PROXY_MIN, 03572 TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM, 03573 TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER, 03574 TUNING_MIN_AMBIENT_DMAX_VALID, 03575 TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER, 03576 TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM, 03577 TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT, 03578 TUNING_XTALK_FULL_ROI_BIN_SUM_MARGIN, 03579 TUNING_XTALK_FULL_ROI_DEFAULT_OFFSET, 03580 TUNING_ZERO_DISTANCE_OFFSET_NON_LINEAR_FACTOR_DEFAULT 03581 }; 03582 */ 03583 03584 03585 VL53LX_Error ComputeDevicePresetMode( 03586 VL53LX_DistanceModes DistanceMode, 03587 VL53LX_DevicePresetModes *pDevicePresetMode); 03588 03589 VL53LX_Error SetPresetModeL3CX( 03590 VL53LX_DistanceModes DistanceMode, 03591 uint32_t inter_measurement_period_ms); 03592 03593 VL53LX_Error SetInterMeasurementPeriodMilliSeconds(uint32_t InterMeasurementPeriodMilliSeconds); 03594 03595 VL53LX_Error GetInterMeasurementPeriodMilliSeconds(uint32_t *pInterMeasurementPeriodMilliSeconds); 03596 03597 uint8_t ConvertStatusHisto(uint8_t FilteredRangeStatus); 03598 03599 VL53LX_Error SetTargetData( 03600 uint8_t active_results, uint8_t device_status, 03601 VL53LX_range_data_t *presults_data, 03602 VL53LX_TargetRangeData_t *pRangeData); 03603 03604 VL53LX_Error SetMeasurementData( 03605 VL53LX_range_results_t *presults, 03606 VL53LX_MultiRangingData_t *pMultiRangingData); 03607 03608 03609 /* Write and read functions from I2C */ 03610 03611 VL53LX_Error VL53LX_WrByte(VL53LX_DEV Dev, uint16_t index, uint8_t data); 03612 VL53LX_Error VL53LX_WrWord(VL53LX_DEV Dev, uint16_t index, uint16_t data); 03613 VL53LX_Error VL53LX_WrDWord(VL53LX_DEV Dev, uint16_t index, uint32_t data); 03614 VL53LX_Error VL53LX_RdByte(VL53LX_DEV Dev, uint16_t index, uint8_t *data); 03615 // VL53LX_Error VL53LX_RdWord(VL53LX_DEV Dev, uint16_t index, uint16_t *data); 03616 VL53LX_Error VL53LX_RdDWord(VL53LX_DEV Dev, uint16_t index, uint32_t *data); 03617 VL53LX_Error VL53LX_UpdateByte(VL53LX_DEV Dev, uint16_t index, uint8_t AndData, uint8_t OrData); 03618 03619 VL53LX_Error VL53LX_WriteMulti(VL53LX_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count); 03620 VL53LX_Error VL53LX_ReadMulti(VL53LX_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count); 03621 03622 VL53LX_Error VL53LX_I2CWrite(uint8_t DeviceAddr, uint16_t RegisterAddr, uint8_t *pBuffer, uint16_t NumByteToWrite); 03623 VL53LX_Error VL53LX_I2CRead(uint8_t DeviceAddr, uint16_t RegisterAddr, uint8_t *pBuffer, uint16_t NumByteToRead); 03624 VL53LX_Error VL53LX_GetTickCount(uint32_t *ptick_count_ms); 03625 VL53LX_Error VL53LX_WaitUs(VL53LX_Dev_t *pdev, int32_t wait_us); 03626 VL53LX_Error VL53LX_WaitMs(VL53LX_Dev_t *pdev, int32_t wait_ms); 03627 03628 VL53LX_Error VL53LX_WaitValueMaskEx(VL53LX_Dev_t *pdev, uint32_t timeout_ms, uint16_t index, uint8_t value, uint8_t mask, uint32_t poll_delay_ms); 03629 03630 03631 protected: 03632 03633 /* IO Device */ 03634 vl53L3_DevI2C *dev_i2c; 03635 03636 /* Device data */ 03637 VL53LX_Dev_t MyDevice; 03638 VL53LX_DEV Dev; 03639 03640 // vl53L3_DevI2C *i2c_inst; 03641 03642 /* Digital out pin */ 03643 DigitalOut *_gpio0; 03644 /* GPIO expander */ 03645 Stmpe1600DigiOut *_expgpio0; 03646 /* Measure detection IRQ */ 03647 InterruptIn *_gpio1Int; 03648 03649 }; 03650 03651 #endif /* _VL53LX_CLASS_H_ */ 03652
Generated on Fri Jul 15 2022 05:39:18 by
 1.7.2
 1.7.2