Greatly simplified Architecture, Identical Functions Removed: Platform Interfaces, STP6001 interface

Committer:
sepp_nepp
Date:
Thu Jun 27 12:51:34 2019 +0000
Revision:
10:cd1758e186a4
Parent:
9:cb4c6d4e5030
Child:
11:d8dbe3b87f9f
Merged Tuning File into the def File

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sepp_nepp 6:fb11b746ceb5 1 /*******************************************************************************
sepp_nepp 6:fb11b746ceb5 2 Copyright © 2016, STMicroelectronics International N.V.
sepp_nepp 6:fb11b746ceb5 3 All rights reserved.
sepp_nepp 6:fb11b746ceb5 4
sepp_nepp 6:fb11b746ceb5 5 Redistribution and use in source and binary forms, with or without
sepp_nepp 6:fb11b746ceb5 6 modification, are permitted provided that the following conditions are met:
sepp_nepp 6:fb11b746ceb5 7 * Redistributions of source code must retain the above copyright
sepp_nepp 6:fb11b746ceb5 8 notice, this list of conditions and the following disclaimer.
sepp_nepp 6:fb11b746ceb5 9 * Redistributions in binary form must reproduce the above copyright
sepp_nepp 6:fb11b746ceb5 10 notice, this list of conditions and the following disclaimer in the
sepp_nepp 6:fb11b746ceb5 11 documentation and/or other materials provided with the distribution.
sepp_nepp 6:fb11b746ceb5 12 * Neither the name of STMicroelectronics nor the
sepp_nepp 6:fb11b746ceb5 13 names of its contributors may be used to endorse or promote products
sepp_nepp 6:fb11b746ceb5 14 derived from this software without specific prior written permission.
sepp_nepp 6:fb11b746ceb5 15
sepp_nepp 6:fb11b746ceb5 16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
sepp_nepp 6:fb11b746ceb5 17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
sepp_nepp 6:fb11b746ceb5 18 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
sepp_nepp 6:fb11b746ceb5 19 NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
sepp_nepp 6:fb11b746ceb5 20 IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
sepp_nepp 6:fb11b746ceb5 21 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
sepp_nepp 6:fb11b746ceb5 22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
sepp_nepp 6:fb11b746ceb5 23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
sepp_nepp 6:fb11b746ceb5 24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
sepp_nepp 6:fb11b746ceb5 25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
sepp_nepp 6:fb11b746ceb5 26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sepp_nepp 6:fb11b746ceb5 27 *****************************************************************************/
sepp_nepp 6:fb11b746ceb5 28
sepp_nepp 6:fb11b746ceb5 29 #ifndef __VL53L0X_CLASS_H
sepp_nepp 6:fb11b746ceb5 30 #define __VL53L0X_CLASS_H
sepp_nepp 6:fb11b746ceb5 31
sepp_nepp 6:fb11b746ceb5 32
sepp_nepp 6:fb11b746ceb5 33 /* Includes ------------------------------------------------------------------*/
sepp_nepp 6:fb11b746ceb5 34 #include "mbed.h"
sepp_nepp 6:fb11b746ceb5 35 #include "pinmap.h"
sepp_nepp 6:fb11b746ceb5 36 #include "PinNames.h"
sepp_nepp 6:fb11b746ceb5 37 #include "VL53L0X_def.h"
sepp_nepp 6:fb11b746ceb5 38 #include "VL53L0X_tuning.h"
sepp_nepp 6:fb11b746ceb5 39
sepp_nepp 6:fb11b746ceb5 40 /* Classes -------------------------------------------------------------------*/
sepp_nepp 6:fb11b746ceb5 41 /** Class representing a VL53L0 sensor component
sepp_nepp 6:fb11b746ceb5 42 */
sepp_nepp 6:fb11b746ceb5 43 class VL53L0X
sepp_nepp 6:fb11b746ceb5 44 {
sepp_nepp 6:fb11b746ceb5 45 public:
sepp_nepp 6:fb11b746ceb5 46 /** Constructor
sepp_nepp 6:fb11b746ceb5 47 * @param[in] &i2c device I2C to be used for communication
sepp_nepp 6:fb11b746ceb5 48 * @param[in] &pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT
sepp_nepp 6:fb11b746ceb5 49 * @param[in] dev_addr device address, 0x29 by default
sepp_nepp 6:fb11b746ceb5 50 */
sepp_nepp 8:2fd7cb217068 51 VL53L0X(I2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr = VL53L0X_DEFAULT_ADDRESS) : _gpio0(pin), _dev_i2c(i2c)
sepp_nepp 8:2fd7cb217068 52 { I2cDevAddr = dev_addr;
sepp_nepp 7:3a1115c2556b 53 comms_type = 1; // VL53L0X_COMMS_I2C
sepp_nepp 7:3a1115c2556b 54 comms_speed_khz = 400;
sepp_nepp 7:3a1115c2556b 55 if (pin_gpio1 != NC) { _gpio1Int = new InterruptIn(pin_gpio1); }
sepp_nepp 7:3a1115c2556b 56 else { _gpio1Int = NULL; }
sepp_nepp 6:fb11b746ceb5 57 }
sepp_nepp 6:fb11b746ceb5 58
sepp_nepp 6:fb11b746ceb5 59 /** Destructor
sepp_nepp 6:fb11b746ceb5 60 */
sepp_nepp 6:fb11b746ceb5 61 virtual ~VL53L0X()
sepp_nepp 8:2fd7cb217068 62 { if (_gpio1Int != NULL) { delete _gpio1Int; } }
sepp_nepp 6:fb11b746ceb5 63
sepp_nepp 8:2fd7cb217068 64 /*** Interface Methods High level API ***/
sepp_nepp 6:fb11b746ceb5 65 /**
sepp_nepp 6:fb11b746ceb5 66 * @brief PowerOn the sensor
sepp_nepp 6:fb11b746ceb5 67 * @return void
sepp_nepp 6:fb11b746ceb5 68 */
sepp_nepp 6:fb11b746ceb5 69 /* turns on the sensor */
sepp_nepp 6:fb11b746ceb5 70 void VL53L0X_on(void)
sepp_nepp 6:fb11b746ceb5 71 {
sepp_nepp 6:fb11b746ceb5 72 if (_gpio0) { *_gpio0 = 1; }
sepp_nepp 6:fb11b746ceb5 73 wait_ms(10);
sepp_nepp 6:fb11b746ceb5 74 }
sepp_nepp 6:fb11b746ceb5 75
sepp_nepp 6:fb11b746ceb5 76 /**
sepp_nepp 6:fb11b746ceb5 77 * @brief PowerOff the sensor
sepp_nepp 6:fb11b746ceb5 78 * @return void
sepp_nepp 6:fb11b746ceb5 79 */
sepp_nepp 6:fb11b746ceb5 80 /* turns off the sensor */
sepp_nepp 6:fb11b746ceb5 81 void VL53L0X_off(void)
sepp_nepp 6:fb11b746ceb5 82 {
sepp_nepp 6:fb11b746ceb5 83 if (_gpio0) { *_gpio0 = 0; }
sepp_nepp 6:fb11b746ceb5 84 wait_ms(10);
sepp_nepp 6:fb11b746ceb5 85 }
sepp_nepp 6:fb11b746ceb5 86
sepp_nepp 6:fb11b746ceb5 87
sepp_nepp 6:fb11b746ceb5 88 /**
sepp_nepp 6:fb11b746ceb5 89 * @brief Initialize the sensor with default values
sepp_nepp 6:fb11b746ceb5 90 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 91 */
sepp_nepp 6:fb11b746ceb5 92 int init_sensor(uint8_t new_addr = VL53L0X_DEFAULT_ADDRESS);
sepp_nepp 6:fb11b746ceb5 93
sepp_nepp 6:fb11b746ceb5 94 /**
sepp_nepp 6:fb11b746ceb5 95 * @brief Start the measure indicated by operating mode
sepp_nepp 6:fb11b746ceb5 96 * @param[in] operating_mode specifies requested measure
sepp_nepp 6:fb11b746ceb5 97 * @param[in] fptr specifies call back function must be !NULL in case of interrupt measure
sepp_nepp 6:fb11b746ceb5 98 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 99 */
sepp_nepp 6:fb11b746ceb5 100 int start_measurement(OperatingMode operating_mode, void (*fptr)(void),
sepp_nepp 6:fb11b746ceb5 101 VL53L0X_RangingConfig rangingConfig = Range_Config_DEFAULT);
sepp_nepp 6:fb11b746ceb5 102
sepp_nepp 6:fb11b746ceb5 103 /**
sepp_nepp 6:fb11b746ceb5 104 * @brief Get results for the measure indicated by operating mode
sepp_nepp 6:fb11b746ceb5 105 * @param[in] operating_mode specifies requested measure results
sepp_nepp 6:fb11b746ceb5 106 * @param[out] p_data pointer to the MeasureData_t structure to read data in to
sepp_nepp 6:fb11b746ceb5 107 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 108 */
sepp_nepp 6:fb11b746ceb5 109 int get_measurement(OperatingMode operating_mode, VL53L0X_RangingMeasurementData_t *p_data);
sepp_nepp 6:fb11b746ceb5 110
sepp_nepp 6:fb11b746ceb5 111 /**
sepp_nepp 6:fb11b746ceb5 112 * @brief Stop the currently running measure indicate by operating_mode
sepp_nepp 6:fb11b746ceb5 113 * @param[in] operating_mode specifies requested measure to stop
sepp_nepp 6:fb11b746ceb5 114 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 115 */
sepp_nepp 6:fb11b746ceb5 116 int stop_measurement(OperatingMode operating_mode);
sepp_nepp 6:fb11b746ceb5 117
sepp_nepp 6:fb11b746ceb5 118 /**
sepp_nepp 6:fb11b746ceb5 119 * @brief Interrupt handling func to be called by user after an INT is occourred
sepp_nepp 6:fb11b746ceb5 120 * @param[in] opeating_mode indicating the in progress measure
sepp_nepp 6:fb11b746ceb5 121 * @param[out] Data pointer to the MeasureData_t structure to read data in to
sepp_nepp 6:fb11b746ceb5 122 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 123 */
sepp_nepp 6:fb11b746ceb5 124 int handle_irq(OperatingMode operating_mode, VL53L0X_RangingMeasurementData_t *data);
sepp_nepp 6:fb11b746ceb5 125
sepp_nepp 6:fb11b746ceb5 126 /**
sepp_nepp 6:fb11b746ceb5 127 * @brief Enable interrupt measure IRQ
sepp_nepp 6:fb11b746ceb5 128 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 129 */
sepp_nepp 6:fb11b746ceb5 130 void enable_interrupt_measure_detection_irq(void)
sepp_nepp 8:2fd7cb217068 131 { if (_gpio1Int != NULL) { _gpio1Int->enable_irq();} }
sepp_nepp 6:fb11b746ceb5 132
sepp_nepp 6:fb11b746ceb5 133 /**
sepp_nepp 6:fb11b746ceb5 134 * @brief Disable interrupt measure IRQ
sepp_nepp 6:fb11b746ceb5 135 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 136 */
sepp_nepp 6:fb11b746ceb5 137 void disable_interrupt_measure_detection_irq(void)
sepp_nepp 8:2fd7cb217068 138 { if (_gpio1Int != NULL) { _gpio1Int->disable_irq(); } }
sepp_nepp 6:fb11b746ceb5 139
sepp_nepp 6:fb11b746ceb5 140 /**
sepp_nepp 6:fb11b746ceb5 141 * @brief Attach a function to call when an interrupt is detected, i.e. measurement is ready
sepp_nepp 6:fb11b746ceb5 142 * @param[in] fptr pointer to call back function to be called whenever an interrupt occours
sepp_nepp 6:fb11b746ceb5 143 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 144 */
sepp_nepp 6:fb11b746ceb5 145 void attach_interrupt_measure_detection_irq(void (*fptr)(void))
sepp_nepp 8:2fd7cb217068 146 { if (_gpio1Int != NULL) { _gpio1Int->rise(fptr); } }
sepp_nepp 6:fb11b746ceb5 147
sepp_nepp 6:fb11b746ceb5 148 /** Wrapper functions */
sepp_nepp 6:fb11b746ceb5 149 /** @defgroup api_init Init functions
sepp_nepp 6:fb11b746ceb5 150 * @brief API init functions
sepp_nepp 6:fb11b746ceb5 151 * @ingroup api_hl
sepp_nepp 6:fb11b746ceb5 152 * @{
sepp_nepp 6:fb11b746ceb5 153 */
sepp_nepp 6:fb11b746ceb5 154
sepp_nepp 6:fb11b746ceb5 155 /**
sepp_nepp 6:fb11b746ceb5 156 * @brief Prepare device for operation
sepp_nepp 6:fb11b746ceb5 157 * @par Function Description
sepp_nepp 6:fb11b746ceb5 158 * Does static initialization and reprogram common default settings \n
sepp_nepp 6:fb11b746ceb5 159 * Device is prepared for new measure, ready single shot ranging or ALS typical polling operation\n
sepp_nepp 6:fb11b746ceb5 160 * After prepare user can : \n
sepp_nepp 6:fb11b746ceb5 161 * @li Call other API function to set other settings\n
sepp_nepp 6:fb11b746ceb5 162 * @li Configure the interrupt pins, etc... \n
sepp_nepp 6:fb11b746ceb5 163 * @li Then start ranging or ALS operations in single shot or continuous mode
sepp_nepp 6:fb11b746ceb5 164 *
sepp_nepp 6:fb11b746ceb5 165 * @param void
sepp_nepp 6:fb11b746ceb5 166 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 167 */
sepp_nepp 6:fb11b746ceb5 168 int prepare();
sepp_nepp 6:fb11b746ceb5 169
sepp_nepp 6:fb11b746ceb5 170 /**
sepp_nepp 6:fb11b746ceb5 171 * @brief Start continuous ranging mode
sepp_nepp 6:fb11b746ceb5 172 *
sepp_nepp 6:fb11b746ceb5 173 * @details End user should ensure device is in idle state and not already running
sepp_nepp 6:fb11b746ceb5 174 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 175 */
sepp_nepp 6:fb11b746ceb5 176 int range_start_continuous_mode();
sepp_nepp 6:fb11b746ceb5 177
sepp_nepp 6:fb11b746ceb5 178 /**
sepp_nepp 6:fb11b746ceb5 179 * @brief Get ranging result and only that
sepp_nepp 6:fb11b746ceb5 180 *
sepp_nepp 6:fb11b746ceb5 181 * @par Function Description
sepp_nepp 6:fb11b746ceb5 182 * Unlike @a VL53L0X_get_ranging_measurement_data() this function only retrieves the range in millimeter \n
sepp_nepp 6:fb11b746ceb5 183 * It does any required up-scale translation\n
sepp_nepp 6:fb11b746ceb5 184 * It can be called after success status polling or in interrupt mode \n
sepp_nepp 6:fb11b746ceb5 185 * @warning these function is not doing wrap around filtering \n
sepp_nepp 6:fb11b746ceb5 186 * This function doesn't perform any data ready check!
sepp_nepp 6:fb11b746ceb5 187 *
sepp_nepp 6:fb11b746ceb5 188 * @param p_data Pointer to range distance
sepp_nepp 6:fb11b746ceb5 189 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 190 */
sepp_nepp 8:2fd7cb217068 191 int get_distance(uint32_t *p_data);
sepp_nepp 6:fb11b746ceb5 192
sepp_nepp 6:fb11b746ceb5 193 /** @} */
sepp_nepp 6:fb11b746ceb5 194
sepp_nepp 8:2fd7cb217068 195 /** @brief Set new device i2c address
sepp_nepp 6:fb11b746ceb5 196 *
sepp_nepp 6:fb11b746ceb5 197 * After completion the device will answer to the new address programmed.
sepp_nepp 6:fb11b746ceb5 198 *
sepp_nepp 6:fb11b746ceb5 199 * @param new_addr The new i2c address (7bit)
sepp_nepp 6:fb11b746ceb5 200 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 201 */
sepp_nepp 6:fb11b746ceb5 202 int set_device_address(int new_addr)
sepp_nepp 6:fb11b746ceb5 203 {
sepp_nepp 6:fb11b746ceb5 204 int status;
sepp_nepp 6:fb11b746ceb5 205
sepp_nepp 7:3a1115c2556b 206 status = VL53L0X_set_device_address(new_addr);
sepp_nepp 7:3a1115c2556b 207 if (!status) { I2cDevAddr = new_addr; }
sepp_nepp 6:fb11b746ceb5 208 return status;
sepp_nepp 6:fb11b746ceb5 209 }
sepp_nepp 6:fb11b746ceb5 210
sepp_nepp 6:fb11b746ceb5 211 /**
sepp_nepp 6:fb11b746ceb5 212 * @brief Clear given system interrupt condition
sepp_nepp 6:fb11b746ceb5 213 *
sepp_nepp 6:fb11b746ceb5 214 * @par Function Description
sepp_nepp 6:fb11b746ceb5 215 * Clear given interrupt cause by writing into register #SYSTEM_INTERRUPT_CLEAR register.
sepp_nepp 7:3a1115c2556b 216 * @param int_clear Which interrupt source to clear. Use any combinations of #INTERRUPT_CLEAR_RANGING , #INTERRUPT_CLEAR_ALS , #INTERRUPT_CLEAR_ERROR.
sepp_nepp 6:fb11b746ceb5 217 * @return "0" on success
sepp_nepp 6:fb11b746ceb5 218 */
sepp_nepp 6:fb11b746ceb5 219 int clear_interrupt(uint8_t int_clear)
sepp_nepp 7:3a1115c2556b 220 { return VL53L0X_clear_interrupt_mask(int_clear); }
sepp_nepp 6:fb11b746ceb5 221
sepp_nepp 8:2fd7cb217068 222 /** @brief One time device initialization
sepp_nepp 6:fb11b746ceb5 223 *
sepp_nepp 6:fb11b746ceb5 224 * To be called once and only once after device is brought out of reset
sepp_nepp 6:fb11b746ceb5 225 * (Chip enable) and booted see @a VL53L0X_WaitDeviceBooted()
sepp_nepp 6:fb11b746ceb5 226 *
sepp_nepp 6:fb11b746ceb5 227 * @par Function Description
sepp_nepp 6:fb11b746ceb5 228 * When not used after a fresh device "power up" or reset, it may return
sepp_nepp 6:fb11b746ceb5 229 * @a #VL53L0X_ERROR_CALIBRATION_WARNING meaning wrong calibration data
sepp_nepp 6:fb11b746ceb5 230 * may have been fetched from device that can result in ranging offset error\n
sepp_nepp 6:fb11b746ceb5 231 * If application cannot execute device reset or need to run VL53L0X_DataInit
sepp_nepp 6:fb11b746ceb5 232 * multiple time then it must ensure proper offset calibration saving and
sepp_nepp 6:fb11b746ceb5 233 * restore on its own by using @a VL53L0X_GetOffsetCalibrationData() on first
sepp_nepp 6:fb11b746ceb5 234 * power up and then @a VL53L0X_SetOffsetCalibrationData() in all subsequent init
sepp_nepp 6:fb11b746ceb5 235 * This function will change the VL53L0X_State from VL53L0X_STATE_POWERDOWN to
sepp_nepp 6:fb11b746ceb5 236 * VL53L0X_STATE_WAIT_STATICINIT.
sepp_nepp 6:fb11b746ceb5 237 *
sepp_nepp 6:fb11b746ceb5 238 * @note This function accesses to the device
sepp_nepp 6:fb11b746ceb5 239 *
sepp_nepp 7:3a1115c2556b 240 *
sepp_nepp 6:fb11b746ceb5 241 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 242 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 243 */
sepp_nepp 7:3a1115c2556b 244 VL53L0X_Error VL53L0X_data_init(void);
sepp_nepp 6:fb11b746ceb5 245
sepp_nepp 6:fb11b746ceb5 246 /**
sepp_nepp 6:fb11b746ceb5 247 * @brief Do basic device init (and eventually patch loading)
sepp_nepp 6:fb11b746ceb5 248 * This function will change the VL53L0X_State from
sepp_nepp 6:fb11b746ceb5 249 * VL53L0X_STATE_WAIT_STATICINIT to VL53L0X_STATE_IDLE.
sepp_nepp 6:fb11b746ceb5 250 * In this stage all default setting will be applied.
sepp_nepp 6:fb11b746ceb5 251 *
sepp_nepp 6:fb11b746ceb5 252 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 253 *
sepp_nepp 7:3a1115c2556b 254 *
sepp_nepp 6:fb11b746ceb5 255 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 256 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 257 */
sepp_nepp 7:3a1115c2556b 258 VL53L0X_Error VL53L0X_static_init(void);
sepp_nepp 6:fb11b746ceb5 259
sepp_nepp 6:fb11b746ceb5 260 /**
sepp_nepp 6:fb11b746ceb5 261 * @brief Perform Reference Calibration
sepp_nepp 6:fb11b746ceb5 262 *
sepp_nepp 6:fb11b746ceb5 263 * @details Perform a reference calibration of the Device.
sepp_nepp 6:fb11b746ceb5 264 * This function should be run from time to time before doing
sepp_nepp 6:fb11b746ceb5 265 * a ranging measurement.
sepp_nepp 6:fb11b746ceb5 266 * This function will launch a special ranging measurement, so
sepp_nepp 6:fb11b746ceb5 267 * if interrupt are enable an interrupt will be done.
sepp_nepp 6:fb11b746ceb5 268 * This function will clear the interrupt generated automatically.
sepp_nepp 6:fb11b746ceb5 269 *
sepp_nepp 6:fb11b746ceb5 270 * @warning This function is a blocking function
sepp_nepp 6:fb11b746ceb5 271 *
sepp_nepp 6:fb11b746ceb5 272 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 273 *
sepp_nepp 7:3a1115c2556b 274 *
sepp_nepp 6:fb11b746ceb5 275 * @param p_vhv_settings Pointer to vhv settings parameter.
sepp_nepp 6:fb11b746ceb5 276 * @param p_phase_cal Pointer to PhaseCal parameter.
sepp_nepp 6:fb11b746ceb5 277 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 278 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 279 */
sepp_nepp 7:3a1115c2556b 280 VL53L0X_Error VL53L0X_perform_ref_calibration( uint8_t *p_vhv_settings,
sepp_nepp 6:fb11b746ceb5 281 uint8_t *p_phase_cal);
sepp_nepp 6:fb11b746ceb5 282
sepp_nepp 6:fb11b746ceb5 283 /**
sepp_nepp 6:fb11b746ceb5 284 * @brief Get Reference Calibration Parameters
sepp_nepp 6:fb11b746ceb5 285 *
sepp_nepp 6:fb11b746ceb5 286 * @par Function Description
sepp_nepp 6:fb11b746ceb5 287 * Get Reference Calibration Parameters.
sepp_nepp 6:fb11b746ceb5 288 *
sepp_nepp 6:fb11b746ceb5 289 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 290 *
sepp_nepp 7:3a1115c2556b 291 *
sepp_nepp 6:fb11b746ceb5 292 * @param p_vhv_settings Pointer to VHV parameter
sepp_nepp 6:fb11b746ceb5 293 * @param p_phase_cal Pointer to PhaseCal Parameter
sepp_nepp 6:fb11b746ceb5 294 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 295 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 296 */
sepp_nepp 7:3a1115c2556b 297 VL53L0X_Error VL53L0X_get_ref_calibration(
sepp_nepp 6:fb11b746ceb5 298 uint8_t *p_vhv_settings, uint8_t *p_phase_cal);
sepp_nepp 6:fb11b746ceb5 299
sepp_nepp 7:3a1115c2556b 300 VL53L0X_Error VL53L0X_set_ref_calibration(
sepp_nepp 6:fb11b746ceb5 301 uint8_t vhv_settings, uint8_t phase_cal);
sepp_nepp 6:fb11b746ceb5 302
sepp_nepp 6:fb11b746ceb5 303 /**
sepp_nepp 6:fb11b746ceb5 304 * @brief Performs Reference Spad Management
sepp_nepp 6:fb11b746ceb5 305 *
sepp_nepp 6:fb11b746ceb5 306 * @par Function Description
sepp_nepp 6:fb11b746ceb5 307 * The reference SPAD initialization procedure determines the minimum amount
sepp_nepp 6:fb11b746ceb5 308 * of reference spads to be enables to achieve a target reference signal rate
sepp_nepp 6:fb11b746ceb5 309 * and should be performed once during initialization.
sepp_nepp 6:fb11b746ceb5 310 *
sepp_nepp 6:fb11b746ceb5 311 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 312 *
sepp_nepp 6:fb11b746ceb5 313 * @note This function change the device mode to
sepp_nepp 6:fb11b746ceb5 314 * VL53L0X_DEVICEMODE_SINGLE_RANGING
sepp_nepp 6:fb11b746ceb5 315 *
sepp_nepp 7:3a1115c2556b 316 *
sepp_nepp 6:fb11b746ceb5 317 * @param ref_spad_count Reports ref Spad Count
sepp_nepp 6:fb11b746ceb5 318 * @param is_aperture_spads Reports if spads are of type
sepp_nepp 6:fb11b746ceb5 319 * aperture or non-aperture.
sepp_nepp 6:fb11b746ceb5 320 * 1:=aperture, 0:=Non-Aperture
sepp_nepp 6:fb11b746ceb5 321 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 322 * @return VL53L0X_ERROR_REF_SPAD_INIT Error in the Ref Spad procedure.
sepp_nepp 6:fb11b746ceb5 323 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 324 */
sepp_nepp 7:3a1115c2556b 325 VL53L0X_Error VL53L0X_perform_ref_spad_management(
sepp_nepp 6:fb11b746ceb5 326 uint32_t *ref_spad_count, uint8_t *is_aperture_spads);
sepp_nepp 6:fb11b746ceb5 327
sepp_nepp 6:fb11b746ceb5 328 /**
sepp_nepp 6:fb11b746ceb5 329 * @brief Applies Reference SPAD configuration
sepp_nepp 6:fb11b746ceb5 330 *
sepp_nepp 6:fb11b746ceb5 331 * @par Function Description
sepp_nepp 6:fb11b746ceb5 332 * This function applies a given number of reference spads, identified as
sepp_nepp 6:fb11b746ceb5 333 * either Aperture or Non-Aperture.
sepp_nepp 6:fb11b746ceb5 334 * The requested spad count and type are stored within the device specific
sepp_nepp 6:fb11b746ceb5 335 * parameters data for access by the host.
sepp_nepp 6:fb11b746ceb5 336 *
sepp_nepp 6:fb11b746ceb5 337 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 338 *
sepp_nepp 7:3a1115c2556b 339 *
sepp_nepp 6:fb11b746ceb5 340 * @param refSpadCount Number of ref spads.
sepp_nepp 6:fb11b746ceb5 341 * @param is_aperture_spads Defines if spads are of type
sepp_nepp 6:fb11b746ceb5 342 * aperture or non-aperture.
sepp_nepp 6:fb11b746ceb5 343 * 1:=aperture, 0:=Non-Aperture
sepp_nepp 6:fb11b746ceb5 344 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 345 * @return VL53L0X_ERROR_REF_SPAD_INIT Error in the in the reference
sepp_nepp 6:fb11b746ceb5 346 * spad configuration.
sepp_nepp 6:fb11b746ceb5 347 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 348 */
sepp_nepp 7:3a1115c2556b 349 VL53L0X_Error VL53L0X_set_reference_spads(
sepp_nepp 6:fb11b746ceb5 350 uint32_t refSpadCount, uint8_t is_aperture_spads);
sepp_nepp 6:fb11b746ceb5 351
sepp_nepp 6:fb11b746ceb5 352 /**
sepp_nepp 6:fb11b746ceb5 353 * @brief Retrieves SPAD configuration
sepp_nepp 6:fb11b746ceb5 354 *
sepp_nepp 6:fb11b746ceb5 355 * @par Function Description
sepp_nepp 6:fb11b746ceb5 356 * This function retrieves the current number of applied reference spads
sepp_nepp 6:fb11b746ceb5 357 * and also their type : Aperture or Non-Aperture.
sepp_nepp 6:fb11b746ceb5 358 *
sepp_nepp 6:fb11b746ceb5 359 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 360 *
sepp_nepp 7:3a1115c2556b 361 *
sepp_nepp 6:fb11b746ceb5 362 * @param p_spad_count Number ref Spad Count
sepp_nepp 6:fb11b746ceb5 363 * @param p_is_aperture_spads Reports if spads are of type
sepp_nepp 6:fb11b746ceb5 364 * aperture or non-aperture.
sepp_nepp 6:fb11b746ceb5 365 * 1:=aperture, 0:=Non-Aperture
sepp_nepp 6:fb11b746ceb5 366 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 367 * @return VL53L0X_ERROR_REF_SPAD_INIT Error in the in the reference
sepp_nepp 6:fb11b746ceb5 368 * spad configuration.
sepp_nepp 6:fb11b746ceb5 369 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 370 */
sepp_nepp 7:3a1115c2556b 371 VL53L0X_Error VL53L0X_get_reference_spads(
sepp_nepp 6:fb11b746ceb5 372 uint32_t *p_spad_count, uint8_t *p_is_aperture_spads);
sepp_nepp 6:fb11b746ceb5 373
sepp_nepp 6:fb11b746ceb5 374 /**
sepp_nepp 6:fb11b746ceb5 375 * @brief Get part to part calibration offset
sepp_nepp 6:fb11b746ceb5 376 *
sepp_nepp 6:fb11b746ceb5 377 * @par Function Description
sepp_nepp 6:fb11b746ceb5 378 * Should only be used after a successful call to @a VL53L0X_DataInit to backup
sepp_nepp 6:fb11b746ceb5 379 * device NVM value
sepp_nepp 6:fb11b746ceb5 380 *
sepp_nepp 6:fb11b746ceb5 381 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 382 *
sepp_nepp 6:fb11b746ceb5 383 * @param p_offset_calibration_data_micro_meter Return part to part
sepp_nepp 6:fb11b746ceb5 384 * calibration offset from device (microns)
sepp_nepp 6:fb11b746ceb5 385 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 386 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 387 */
sepp_nepp 7:3a1115c2556b 388 VL53L0X_Error VL53L0X_get_offset_calibration_data_micro_meter(
sepp_nepp 6:fb11b746ceb5 389 int32_t *p_offset_calibration_data_micro_meter);
sepp_nepp 6:fb11b746ceb5 390 /**
sepp_nepp 6:fb11b746ceb5 391 * Set or over-hide part to part calibration offset
sepp_nepp 6:fb11b746ceb5 392 * \sa VL53L0X_DataInit() VL53L0X_GetOffsetCalibrationDataMicroMeter()
sepp_nepp 6:fb11b746ceb5 393 *
sepp_nepp 6:fb11b746ceb5 394 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 395 *
sepp_nepp 6:fb11b746ceb5 396 * @param p_offset_calibration_data_micro_meter Offset (microns)
sepp_nepp 6:fb11b746ceb5 397 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 398 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 399 */
sepp_nepp 7:3a1115c2556b 400 VL53L0X_Error VL53L0X_set_offset_calibration_data_micro_meter(
sepp_nepp 6:fb11b746ceb5 401 int32_t offset_calibration_data_micro_meter);
sepp_nepp 6:fb11b746ceb5 402
sepp_nepp 7:3a1115c2556b 403 VL53L0X_Error VL53L0X_perform_offset_calibration(
sepp_nepp 6:fb11b746ceb5 404 FixPoint1616_t cal_distance_milli_meter,
sepp_nepp 6:fb11b746ceb5 405 int32_t *p_offset_micro_meter);
sepp_nepp 6:fb11b746ceb5 406
sepp_nepp 7:3a1115c2556b 407 VL53L0X_Error VL53L0X_perform_xtalk_calibration(
sepp_nepp 6:fb11b746ceb5 408 FixPoint1616_t xtalk_cal_distance,
sepp_nepp 6:fb11b746ceb5 409 FixPoint1616_t *p_xtalk_compensation_rate_mega_cps);
sepp_nepp 6:fb11b746ceb5 410
sepp_nepp 6:fb11b746ceb5 411 /**
sepp_nepp 6:fb11b746ceb5 412 * @brief Perform XTalk Measurement
sepp_nepp 6:fb11b746ceb5 413 *
sepp_nepp 6:fb11b746ceb5 414 * @details Measures the current cross talk from glass in front
sepp_nepp 6:fb11b746ceb5 415 * of the sensor.
sepp_nepp 6:fb11b746ceb5 416 * This functions performs a histogram measurement and uses the results
sepp_nepp 6:fb11b746ceb5 417 * to measure the crosstalk. For the function to be successful, there
sepp_nepp 6:fb11b746ceb5 418 * must be no target in front of the sensor.
sepp_nepp 6:fb11b746ceb5 419 *
sepp_nepp 6:fb11b746ceb5 420 * @warning This function is a blocking function
sepp_nepp 6:fb11b746ceb5 421 *
sepp_nepp 6:fb11b746ceb5 422 * @warning This function is not supported when the final range
sepp_nepp 6:fb11b746ceb5 423 * vcsel clock period is set below 10 PCLKS.
sepp_nepp 6:fb11b746ceb5 424 *
sepp_nepp 6:fb11b746ceb5 425 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 426 *
sepp_nepp 7:3a1115c2556b 427 *
sepp_nepp 6:fb11b746ceb5 428 * @param timeout_ms Histogram measurement duration.
sepp_nepp 6:fb11b746ceb5 429 * @param p_xtalk_per_spad Output parameter containing the crosstalk
sepp_nepp 6:fb11b746ceb5 430 * measurement result, in MCPS/Spad.
sepp_nepp 6:fb11b746ceb5 431 * Format fixpoint 16:16.
sepp_nepp 6:fb11b746ceb5 432 * @param p_ambient_too_high Output parameter which indicate that
sepp_nepp 6:fb11b746ceb5 433 * pXtalkPerSpad is not good if the Ambient
sepp_nepp 6:fb11b746ceb5 434 * is too high.
sepp_nepp 6:fb11b746ceb5 435 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 436 * @return VL53L0X_ERROR_INVALID_PARAMS vcsel clock period not supported
sepp_nepp 6:fb11b746ceb5 437 * for this operation.
sepp_nepp 6:fb11b746ceb5 438 * Must not be less than 10PCLKS.
sepp_nepp 6:fb11b746ceb5 439 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 440 */
sepp_nepp 7:3a1115c2556b 441 VL53L0X_Error VL53L0X_perform_xtalk_measurement(
sepp_nepp 6:fb11b746ceb5 442 uint32_t timeout_ms, FixPoint1616_t *p_xtalk_per_spad,
sepp_nepp 6:fb11b746ceb5 443 uint8_t *p_ambient_too_high);
sepp_nepp 6:fb11b746ceb5 444
sepp_nepp 6:fb11b746ceb5 445 /**
sepp_nepp 6:fb11b746ceb5 446 * @brief Set Cross talk compensation rate
sepp_nepp 6:fb11b746ceb5 447 *
sepp_nepp 6:fb11b746ceb5 448 * @par Function Description
sepp_nepp 6:fb11b746ceb5 449 * Set Cross talk compensation rate.
sepp_nepp 6:fb11b746ceb5 450 *
sepp_nepp 6:fb11b746ceb5 451 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 452 *
sepp_nepp 6:fb11b746ceb5 453 * @param x_talk_compensation_rate_mega_cps Compensation rate in
sepp_nepp 6:fb11b746ceb5 454 * Mega counts per second
sepp_nepp 6:fb11b746ceb5 455 * (16.16 fix point) see
sepp_nepp 6:fb11b746ceb5 456 * datasheet for details
sepp_nepp 6:fb11b746ceb5 457 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 458 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 459 */
sepp_nepp 7:3a1115c2556b 460 VL53L0X_Error VL53L0X_set_x_talk_compensation_rate_mega_cps(
sepp_nepp 6:fb11b746ceb5 461 FixPoint1616_t x_talk_compensation_rate_mega_cps);
sepp_nepp 6:fb11b746ceb5 462
sepp_nepp 6:fb11b746ceb5 463 /**
sepp_nepp 6:fb11b746ceb5 464 * @brief Get Cross talk compensation rate
sepp_nepp 6:fb11b746ceb5 465 *
sepp_nepp 6:fb11b746ceb5 466 * @par Function Description
sepp_nepp 6:fb11b746ceb5 467 * Get Cross talk compensation rate.
sepp_nepp 6:fb11b746ceb5 468 *
sepp_nepp 6:fb11b746ceb5 469 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 470 *
sepp_nepp 6:fb11b746ceb5 471 * @param p_xtalk_compensation_rate_mega_cps Pointer to Compensation rate
sepp_nepp 6:fb11b746ceb5 472 * in Mega counts per second
sepp_nepp 6:fb11b746ceb5 473 * (16.16 fix point) see
sepp_nepp 6:fb11b746ceb5 474 * datasheet for details
sepp_nepp 6:fb11b746ceb5 475 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 476 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 477 */
sepp_nepp 7:3a1115c2556b 478 VL53L0X_Error VL53L0X_get_x_talk_compensation_rate_mega_cps(
sepp_nepp 6:fb11b746ceb5 479 FixPoint1616_t *p_xtalk_compensation_rate_mega_cps);
sepp_nepp 6:fb11b746ceb5 480
sepp_nepp 6:fb11b746ceb5 481 /**
sepp_nepp 7:3a1115c2556b 482 * @brief Get Cross talk enable
sepp_nepp 7:3a1115c2556b 483 *
sepp_nepp 7:3a1115c2556b 484 * Enable/Disable Cross Talk by set to zero the Cross Talk value by
sepp_nepp 7:3a1115c2556b 485 * using @a VL53L0X_SetXTalkCompensationRateMegaCps().
sepp_nepp 7:3a1115c2556b 486 *
sepp_nepp 7:3a1115c2556b 487 * @param dev Device Handle
sepp_nepp 7:3a1115c2556b 488 * @param p_x_talk_compensation_enable Pointer to the Cross talk compensation
sepp_nepp 7:3a1115c2556b 489 * state 0=disabled or 1 = enabled
sepp_nepp 7:3a1115c2556b 490 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 7:3a1115c2556b 491 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 7:3a1115c2556b 492 */
sepp_nepp 7:3a1115c2556b 493 VL53L0X_Error VL53L0X_get_x_talk_compensation_enable(uint8_t *p_x_talk_compensation_enable);
sepp_nepp 7:3a1115c2556b 494
sepp_nepp 7:3a1115c2556b 495 /**
sepp_nepp 6:fb11b746ceb5 496 * @brief Set a new device mode
sepp_nepp 6:fb11b746ceb5 497 * @par Function Description
sepp_nepp 6:fb11b746ceb5 498 * Set device to a new mode (ranging, histogram ...)
sepp_nepp 6:fb11b746ceb5 499 *
sepp_nepp 6:fb11b746ceb5 500 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 501 *
sepp_nepp 6:fb11b746ceb5 502 * @param device_mode New device mode to apply
sepp_nepp 6:fb11b746ceb5 503 * Valid values are:
sepp_nepp 6:fb11b746ceb5 504 * VL53L0X_DEVICEMODE_SINGLE_RANGING
sepp_nepp 6:fb11b746ceb5 505 * VL53L0X_DEVICEMODE_CONTINUOUS_RANGING
sepp_nepp 6:fb11b746ceb5 506 * VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
sepp_nepp 6:fb11b746ceb5 507 * VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
sepp_nepp 6:fb11b746ceb5 508 * VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
sepp_nepp 6:fb11b746ceb5 509 * VL53L0X_HISTOGRAMMODE_RETURN_ONLY
sepp_nepp 6:fb11b746ceb5 510 * VL53L0X_HISTOGRAMMODE_BOTH
sepp_nepp 6:fb11b746ceb5 511 *
sepp_nepp 6:fb11b746ceb5 512 *
sepp_nepp 6:fb11b746ceb5 513 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 514 * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when
sepp_nepp 6:fb11b746ceb5 515 * DeviceMode is not in the
sepp_nepp 6:fb11b746ceb5 516 * supported list
sepp_nepp 6:fb11b746ceb5 517 */
sepp_nepp 7:3a1115c2556b 518 VL53L0X_Error VL53L0X_set_device_mode( VL53L0X_DeviceModes device_mode);
sepp_nepp 6:fb11b746ceb5 519
sepp_nepp 6:fb11b746ceb5 520 /**
sepp_nepp 6:fb11b746ceb5 521 * @brief Get current new device mode
sepp_nepp 6:fb11b746ceb5 522 * @par Function Description
sepp_nepp 6:fb11b746ceb5 523 * Get actual mode of the device(ranging, histogram ...)
sepp_nepp 6:fb11b746ceb5 524 *
sepp_nepp 6:fb11b746ceb5 525 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 526 *
sepp_nepp 6:fb11b746ceb5 527 * @param p_device_mode Pointer to current apply mode value
sepp_nepp 6:fb11b746ceb5 528 * Valid values are:
sepp_nepp 6:fb11b746ceb5 529 * VL53L0X_DEVICEMODE_SINGLE_RANGING
sepp_nepp 6:fb11b746ceb5 530 * VL53L0X_DEVICEMODE_CONTINUOUS_RANGING
sepp_nepp 6:fb11b746ceb5 531 * VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
sepp_nepp 6:fb11b746ceb5 532 * VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
sepp_nepp 6:fb11b746ceb5 533 * VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
sepp_nepp 6:fb11b746ceb5 534 * VL53L0X_HISTOGRAMMODE_RETURN_ONLY
sepp_nepp 6:fb11b746ceb5 535 * VL53L0X_HISTOGRAMMODE_BOTH
sepp_nepp 6:fb11b746ceb5 536 *
sepp_nepp 6:fb11b746ceb5 537 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 538 * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when
sepp_nepp 6:fb11b746ceb5 539 * DeviceMode is not in the
sepp_nepp 6:fb11b746ceb5 540 * supported list
sepp_nepp 6:fb11b746ceb5 541 */
sepp_nepp 8:2fd7cb217068 542 VL53L0X_Error VL53L0X_get_device_mode(VL53L0X_DeviceModes *p_device_mode);
sepp_nepp 6:fb11b746ceb5 543
sepp_nepp 6:fb11b746ceb5 544 /**
sepp_nepp 6:fb11b746ceb5 545 * @brief Get current configuration for GPIO pin for a given device
sepp_nepp 6:fb11b746ceb5 546 *
sepp_nepp 6:fb11b746ceb5 547 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 548 *
sepp_nepp 7:3a1115c2556b 549 *
sepp_nepp 6:fb11b746ceb5 550 * @param pin ID of the GPIO Pin
sepp_nepp 6:fb11b746ceb5 551 * @param p_device_mode Pointer to Device Mode associated to the Gpio.
sepp_nepp 6:fb11b746ceb5 552 * @param p_functionality Pointer to Pin functionality.
sepp_nepp 6:fb11b746ceb5 553 * Refer to ::VL53L0X_GpioFunctionality
sepp_nepp 6:fb11b746ceb5 554 * @param p_polarity Pointer to interrupt polarity.
sepp_nepp 6:fb11b746ceb5 555 * Active high or active low see
sepp_nepp 6:fb11b746ceb5 556 * ::VL53L0X_InterruptPolarity
sepp_nepp 6:fb11b746ceb5 557 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 558 * @return VL53L0X_ERROR_GPIO_NOT_EXISTING Only Pin=0 is accepted.
sepp_nepp 6:fb11b746ceb5 559 * @return VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED
sepp_nepp 6:fb11b746ceb5 560 * This error occurs
sepp_nepp 6:fb11b746ceb5 561 * when Funcionality programmed is not in the supported list:
sepp_nepp 6:fb11b746ceb5 562 * Supported value are:
sepp_nepp 6:fb11b746ceb5 563 * VL53L0X_GPIOFUNCTIONALITY_OFF,
sepp_nepp 6:fb11b746ceb5 564 * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW,
sepp_nepp 6:fb11b746ceb5 565 * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH,
sepp_nepp 6:fb11b746ceb5 566 * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT,
sepp_nepp 6:fb11b746ceb5 567 * VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY
sepp_nepp 6:fb11b746ceb5 568 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 569 */
sepp_nepp 7:3a1115c2556b 570 VL53L0X_Error VL53L0X_get_gpio_config( uint8_t pin,
sepp_nepp 6:fb11b746ceb5 571 VL53L0X_DeviceModes *p_device_mode,
sepp_nepp 6:fb11b746ceb5 572 VL53L0X_GpioFunctionality *p_functionality,
sepp_nepp 6:fb11b746ceb5 573 VL53L0X_InterruptPolarity *p_polarity);
sepp_nepp 6:fb11b746ceb5 574
sepp_nepp 6:fb11b746ceb5 575 /**
sepp_nepp 6:fb11b746ceb5 576 * @brief Set the configuration of GPIO pin for a given device
sepp_nepp 6:fb11b746ceb5 577 *
sepp_nepp 6:fb11b746ceb5 578 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 579 *
sepp_nepp 6:fb11b746ceb5 580 * @param pin ID of the GPIO Pin
sepp_nepp 6:fb11b746ceb5 581 * @param functionality Select Pin functionality.
sepp_nepp 6:fb11b746ceb5 582 * Refer to ::VL53L0X_GpioFunctionality
sepp_nepp 6:fb11b746ceb5 583 * @param device_mode Device Mode associated to the Gpio.
sepp_nepp 6:fb11b746ceb5 584 * @param polarity Set interrupt polarity. Active high
sepp_nepp 6:fb11b746ceb5 585 * or active low see ::VL53L0X_InterruptPolarity
sepp_nepp 6:fb11b746ceb5 586 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 587 * @return VL53L0X_ERROR_GPIO_NOT_EXISTING Only Pin=0 is accepted.
sepp_nepp 6:fb11b746ceb5 588 * @return VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED This error occurs
sepp_nepp 6:fb11b746ceb5 589 * when Functionality programmed is not in the supported list:
sepp_nepp 6:fb11b746ceb5 590 * Supported value are:
sepp_nepp 6:fb11b746ceb5 591 * VL53L0X_GPIOFUNCTIONALITY_OFF,
sepp_nepp 6:fb11b746ceb5 592 * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW,
sepp_nepp 6:fb11b746ceb5 593 * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH,
sepp_nepp 6:fb11b746ceb5 594 VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT,
sepp_nepp 6:fb11b746ceb5 595 * VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY
sepp_nepp 6:fb11b746ceb5 596 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 597 */
sepp_nepp 7:3a1115c2556b 598 VL53L0X_Error VL53L0X_set_gpio_config( uint8_t pin,
sepp_nepp 6:fb11b746ceb5 599 VL53L0X_DeviceModes device_mode, VL53L0X_GpioFunctionality functionality,
sepp_nepp 6:fb11b746ceb5 600 VL53L0X_InterruptPolarity polarity);
sepp_nepp 6:fb11b746ceb5 601
sepp_nepp 6:fb11b746ceb5 602 /**
sepp_nepp 6:fb11b746ceb5 603 * @brief Start device measurement
sepp_nepp 6:fb11b746ceb5 604 *
sepp_nepp 6:fb11b746ceb5 605 * @details Started measurement will depend on device parameters set through
sepp_nepp 6:fb11b746ceb5 606 * @a VL53L0X_SetParameters()
sepp_nepp 6:fb11b746ceb5 607 * This is a non-blocking function.
sepp_nepp 6:fb11b746ceb5 608 * This function will change the VL53L0X_State from VL53L0X_STATE_IDLE to
sepp_nepp 6:fb11b746ceb5 609 * VL53L0X_STATE_RUNNING.
sepp_nepp 6:fb11b746ceb5 610 *
sepp_nepp 6:fb11b746ceb5 611 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 612 *
sepp_nepp 6:fb11b746ceb5 613 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 614 * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when
sepp_nepp 6:fb11b746ceb5 615 * DeviceMode programmed with @a VL53L0X_SetDeviceMode is not in the supported
sepp_nepp 6:fb11b746ceb5 616 * list:
sepp_nepp 6:fb11b746ceb5 617 * Supported mode are:
sepp_nepp 6:fb11b746ceb5 618 * VL53L0X_DEVICEMODE_SINGLE_RANGING,
sepp_nepp 6:fb11b746ceb5 619 * VL53L0X_DEVICEMODE_CONTINUOUS_RANGING,
sepp_nepp 6:fb11b746ceb5 620 * VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING
sepp_nepp 6:fb11b746ceb5 621 * @return VL53L0X_ERROR_TIME_OUT Time out on start measurement
sepp_nepp 6:fb11b746ceb5 622 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 623 */
sepp_nepp 7:3a1115c2556b 624 VL53L0X_Error VL53L0X_start_measurement(void);
sepp_nepp 6:fb11b746ceb5 625
sepp_nepp 6:fb11b746ceb5 626 /**
sepp_nepp 6:fb11b746ceb5 627 * @brief Stop device measurement
sepp_nepp 6:fb11b746ceb5 628 *
sepp_nepp 6:fb11b746ceb5 629 * @details Will set the device in standby mode at end of current measurement\n
sepp_nepp 6:fb11b746ceb5 630 * Not necessary in single mode as device shall return automatically
sepp_nepp 6:fb11b746ceb5 631 * in standby mode at end of measurement.
sepp_nepp 6:fb11b746ceb5 632 * This function will change the VL53L0X_State from VL53L0X_STATE_RUNNING
sepp_nepp 6:fb11b746ceb5 633 * to VL53L0X_STATE_IDLE.
sepp_nepp 6:fb11b746ceb5 634 *
sepp_nepp 6:fb11b746ceb5 635 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 636 *
sepp_nepp 6:fb11b746ceb5 637 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 638 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 639 */
sepp_nepp 7:3a1115c2556b 640 VL53L0X_Error VL53L0X_stop_measurement(void);
sepp_nepp 6:fb11b746ceb5 641
sepp_nepp 6:fb11b746ceb5 642 /**
sepp_nepp 6:fb11b746ceb5 643 * @brief Return device stop completion status
sepp_nepp 6:fb11b746ceb5 644 *
sepp_nepp 6:fb11b746ceb5 645 * @par Function Description
sepp_nepp 6:fb11b746ceb5 646 * Returns stop completiob status.
sepp_nepp 6:fb11b746ceb5 647 * User shall call this function after a stop command
sepp_nepp 6:fb11b746ceb5 648 *
sepp_nepp 6:fb11b746ceb5 649 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 650 *
sepp_nepp 7:3a1115c2556b 651 *
sepp_nepp 6:fb11b746ceb5 652 * @param p_stop_status Pointer to status variable to update
sepp_nepp 6:fb11b746ceb5 653 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 654 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 655 */
sepp_nepp 7:3a1115c2556b 656 VL53L0X_Error VL53L0X_get_stop_completed_status(
sepp_nepp 6:fb11b746ceb5 657 uint32_t *p_stop_status);
sepp_nepp 6:fb11b746ceb5 658
sepp_nepp 6:fb11b746ceb5 659 /**
sepp_nepp 6:fb11b746ceb5 660 * @brief Return Measurement Data Ready
sepp_nepp 6:fb11b746ceb5 661 *
sepp_nepp 6:fb11b746ceb5 662 * @par Function Description
sepp_nepp 6:fb11b746ceb5 663 * This function indicate that a measurement data is ready.
sepp_nepp 6:fb11b746ceb5 664 * This function check if interrupt mode is used then check is done accordingly.
sepp_nepp 6:fb11b746ceb5 665 * If perform function clear the interrupt, this function will not work,
sepp_nepp 6:fb11b746ceb5 666 * like in case of @a VL53L0X_PerformSingleRangingMeasurement().
sepp_nepp 6:fb11b746ceb5 667 * The previous function is blocking function, VL53L0X_GetMeasurementDataReady
sepp_nepp 6:fb11b746ceb5 668 * is used for non-blocking capture.
sepp_nepp 6:fb11b746ceb5 669 *
sepp_nepp 6:fb11b746ceb5 670 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 671 *
sepp_nepp 7:3a1115c2556b 672 *
sepp_nepp 6:fb11b746ceb5 673 * @param p_measurement_data_ready Pointer to Measurement Data Ready.
sepp_nepp 6:fb11b746ceb5 674 * 0=data not ready, 1 = data ready
sepp_nepp 6:fb11b746ceb5 675 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 676 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 677 */
sepp_nepp 7:3a1115c2556b 678 VL53L0X_Error VL53L0X_get_measurement_data_ready(
sepp_nepp 6:fb11b746ceb5 679 uint8_t *p_measurement_data_ready);
sepp_nepp 6:fb11b746ceb5 680
sepp_nepp 6:fb11b746ceb5 681 /**
sepp_nepp 6:fb11b746ceb5 682 * @brief Retrieve the measurements from device for a given setup
sepp_nepp 6:fb11b746ceb5 683 *
sepp_nepp 6:fb11b746ceb5 684 * @par Function Description
sepp_nepp 6:fb11b746ceb5 685 * Get data from last successful Ranging measurement
sepp_nepp 6:fb11b746ceb5 686 * @warning USER should take care about @a VL53L0X_GetNumberOfROIZones()
sepp_nepp 6:fb11b746ceb5 687 * before get data.
sepp_nepp 6:fb11b746ceb5 688 * PAL will fill a NumberOfROIZones times the corresponding data
sepp_nepp 6:fb11b746ceb5 689 * structure used in the measurement function.
sepp_nepp 6:fb11b746ceb5 690 *
sepp_nepp 6:fb11b746ceb5 691 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 692 *
sepp_nepp 7:3a1115c2556b 693 *
sepp_nepp 6:fb11b746ceb5 694 * @param p_ranging_measurement_data Pointer to the data structure to fill up.
sepp_nepp 6:fb11b746ceb5 695 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 696 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 697 */
sepp_nepp 7:3a1115c2556b 698 VL53L0X_Error VL53L0X_get_ranging_measurement_data(
sepp_nepp 6:fb11b746ceb5 699 VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data);
sepp_nepp 6:fb11b746ceb5 700
sepp_nepp 6:fb11b746ceb5 701 /**
sepp_nepp 6:fb11b746ceb5 702 * @brief Clear given system interrupt condition
sepp_nepp 6:fb11b746ceb5 703 *
sepp_nepp 6:fb11b746ceb5 704 * @par Function Description
sepp_nepp 6:fb11b746ceb5 705 * Clear given interrupt(s).
sepp_nepp 6:fb11b746ceb5 706 *
sepp_nepp 6:fb11b746ceb5 707 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 708 *
sepp_nepp 7:3a1115c2556b 709 *
sepp_nepp 6:fb11b746ceb5 710 * @param interrupt_mask Mask of interrupts to clear
sepp_nepp 6:fb11b746ceb5 711 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 712 * @return VL53L0X_ERROR_INTERRUPT_NOT_CLEARED Cannot clear interrupts
sepp_nepp 6:fb11b746ceb5 713 *
sepp_nepp 6:fb11b746ceb5 714 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 715 */
sepp_nepp 7:3a1115c2556b 716 VL53L0X_Error VL53L0X_clear_interrupt_mask( uint32_t interrupt_mask);
sepp_nepp 6:fb11b746ceb5 717
sepp_nepp 6:fb11b746ceb5 718 /**
sepp_nepp 6:fb11b746ceb5 719 * @brief Return device interrupt status
sepp_nepp 6:fb11b746ceb5 720 *
sepp_nepp 6:fb11b746ceb5 721 * @par Function Description
sepp_nepp 6:fb11b746ceb5 722 * Returns currently raised interrupts by the device.
sepp_nepp 6:fb11b746ceb5 723 * User shall be able to activate/deactivate interrupts through
sepp_nepp 6:fb11b746ceb5 724 * @a VL53L0X_SetGpioConfig()
sepp_nepp 6:fb11b746ceb5 725 *
sepp_nepp 6:fb11b746ceb5 726 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 727 *
sepp_nepp 6:fb11b746ceb5 728 * @param p_interrupt_mask_status Pointer to status variable to update
sepp_nepp 6:fb11b746ceb5 729 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 730 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 731 */
sepp_nepp 7:3a1115c2556b 732 VL53L0X_Error VL53L0X_get_interrupt_mask_status(
sepp_nepp 6:fb11b746ceb5 733 uint32_t *p_interrupt_mask_status);
sepp_nepp 6:fb11b746ceb5 734
sepp_nepp 6:fb11b746ceb5 735 /**
sepp_nepp 6:fb11b746ceb5 736 * @brief Performs a single ranging measurement and retrieve the ranging
sepp_nepp 6:fb11b746ceb5 737 * measurement data
sepp_nepp 6:fb11b746ceb5 738 *
sepp_nepp 6:fb11b746ceb5 739 * @par Function Description
sepp_nepp 6:fb11b746ceb5 740 * This function will change the device mode to VL53L0X_DEVICEMODE_SINGLE_RANGING
sepp_nepp 6:fb11b746ceb5 741 * with @a VL53L0X_SetDeviceMode(),
sepp_nepp 6:fb11b746ceb5 742 * It performs measurement with @a VL53L0X_PerformSingleMeasurement()
sepp_nepp 6:fb11b746ceb5 743 * It get data from last successful Ranging measurement with
sepp_nepp 6:fb11b746ceb5 744 * @a VL53L0X_GetRangingMeasurementData.
sepp_nepp 6:fb11b746ceb5 745 * Finally it clear the interrupt with @a VL53L0X_ClearInterruptMask().
sepp_nepp 6:fb11b746ceb5 746 *
sepp_nepp 6:fb11b746ceb5 747 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 748 *
sepp_nepp 6:fb11b746ceb5 749 * @note This function change the device mode to
sepp_nepp 6:fb11b746ceb5 750 * VL53L0X_DEVICEMODE_SINGLE_RANGING
sepp_nepp 6:fb11b746ceb5 751 *
sepp_nepp 7:3a1115c2556b 752 *
sepp_nepp 6:fb11b746ceb5 753 * @param p_ranging_measurement_data Pointer to the data structure to fill up.
sepp_nepp 6:fb11b746ceb5 754 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 755 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 756 */
sepp_nepp 7:3a1115c2556b 757 VL53L0X_Error VL53L0X_perform_single_ranging_measurement(
sepp_nepp 6:fb11b746ceb5 758 VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data);
sepp_nepp 6:fb11b746ceb5 759
sepp_nepp 6:fb11b746ceb5 760 /**
sepp_nepp 6:fb11b746ceb5 761 * @brief Single shot measurement.
sepp_nepp 6:fb11b746ceb5 762 *
sepp_nepp 6:fb11b746ceb5 763 * @par Function Description
sepp_nepp 6:fb11b746ceb5 764 * Perform simple measurement sequence (Start measure, Wait measure to end,
sepp_nepp 6:fb11b746ceb5 765 * and returns when measurement is done).
sepp_nepp 6:fb11b746ceb5 766 * Once function returns, user can get valid data by calling
sepp_nepp 6:fb11b746ceb5 767 * VL53L0X_GetRangingMeasurement or VL53L0X_GetHistogramMeasurement
sepp_nepp 6:fb11b746ceb5 768 * depending on defined measurement mode
sepp_nepp 6:fb11b746ceb5 769 * User should Clear the interrupt in case this are enabled by using the
sepp_nepp 6:fb11b746ceb5 770 * function VL53L0X_ClearInterruptMask().
sepp_nepp 6:fb11b746ceb5 771 *
sepp_nepp 6:fb11b746ceb5 772 * @warning This function is a blocking function
sepp_nepp 6:fb11b746ceb5 773 *
sepp_nepp 6:fb11b746ceb5 774 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 775 *
sepp_nepp 6:fb11b746ceb5 776 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 777 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 778 */
sepp_nepp 7:3a1115c2556b 779 VL53L0X_Error VL53L0X_perform_single_measurement(void);
sepp_nepp 6:fb11b746ceb5 780
sepp_nepp 7:3a1115c2556b 781 VL53L0X_Error VL53L0X_get_total_signal_rate(
sepp_nepp 6:fb11b746ceb5 782 VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data,
sepp_nepp 6:fb11b746ceb5 783 FixPoint1616_t *p_total_signal_rate_mcps);
sepp_nepp 6:fb11b746ceb5 784
sepp_nepp 7:3a1115c2556b 785 VL53L0X_Error VL53L0X_get_total_xtalk_rate(
sepp_nepp 6:fb11b746ceb5 786 VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data,
sepp_nepp 6:fb11b746ceb5 787 FixPoint1616_t *p_total_xtalk_rate_mcps);
sepp_nepp 6:fb11b746ceb5 788
sepp_nepp 6:fb11b746ceb5 789 /**
sepp_nepp 6:fb11b746ceb5 790 * @brief Get Ranging Timing Budget in microseconds
sepp_nepp 6:fb11b746ceb5 791 *
sepp_nepp 6:fb11b746ceb5 792 * @par Function Description
sepp_nepp 6:fb11b746ceb5 793 * Returns the programmed the maximum time allowed by the user to the
sepp_nepp 6:fb11b746ceb5 794 * device to run a full ranging sequence for the current mode
sepp_nepp 6:fb11b746ceb5 795 * (ranging, histogram, ASL ...)
sepp_nepp 6:fb11b746ceb5 796 *
sepp_nepp 6:fb11b746ceb5 797 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 798 *
sepp_nepp 6:fb11b746ceb5 799 * @param p_measurement_timing_budget_micro_seconds Max measurement time in
sepp_nepp 6:fb11b746ceb5 800 * microseconds.
sepp_nepp 6:fb11b746ceb5 801 * Valid values are:
sepp_nepp 6:fb11b746ceb5 802 * >= 17000 microsecs when wraparound enabled
sepp_nepp 6:fb11b746ceb5 803 * >= 12000 microsecs when wraparound disabled
sepp_nepp 6:fb11b746ceb5 804 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 805 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 806 */
sepp_nepp 7:3a1115c2556b 807 VL53L0X_Error VL53L0X_get_measurement_timing_budget_micro_seconds(
sepp_nepp 6:fb11b746ceb5 808 uint32_t *p_measurement_timing_budget_micro_seconds);
sepp_nepp 6:fb11b746ceb5 809
sepp_nepp 6:fb11b746ceb5 810 /**
sepp_nepp 6:fb11b746ceb5 811 * @brief Set Ranging Timing Budget in microseconds
sepp_nepp 6:fb11b746ceb5 812 *
sepp_nepp 6:fb11b746ceb5 813 * @par Function Description
sepp_nepp 6:fb11b746ceb5 814 * Defines the maximum time allowed by the user to the device to run a
sepp_nepp 6:fb11b746ceb5 815 * full ranging sequence for the current mode (ranging, histogram, ASL ...)
sepp_nepp 6:fb11b746ceb5 816 *
sepp_nepp 6:fb11b746ceb5 817 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 818 *
sepp_nepp 6:fb11b746ceb5 819 * @param measurement_timing_budget_micro_seconds Max measurement time in
sepp_nepp 6:fb11b746ceb5 820 * microseconds.
sepp_nepp 6:fb11b746ceb5 821 * Valid values are:
sepp_nepp 6:fb11b746ceb5 822 * >= 17000 microsecs when wraparound enabled
sepp_nepp 6:fb11b746ceb5 823 * >= 12000 microsecs when wraparound disabled
sepp_nepp 6:fb11b746ceb5 824 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 825 * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned if
sepp_nepp 6:fb11b746ceb5 826 MeasurementTimingBudgetMicroSeconds out of range
sepp_nepp 6:fb11b746ceb5 827 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 828 */
sepp_nepp 7:3a1115c2556b 829 VL53L0X_Error VL53L0X_set_measurement_timing_budget_micro_seconds(
sepp_nepp 6:fb11b746ceb5 830 uint32_t measurement_timing_budget_micro_seconds);
sepp_nepp 6:fb11b746ceb5 831
sepp_nepp 6:fb11b746ceb5 832 /**
sepp_nepp 6:fb11b746ceb5 833 * @brief Get specific limit check enable state
sepp_nepp 6:fb11b746ceb5 834 *
sepp_nepp 6:fb11b746ceb5 835 * @par Function Description
sepp_nepp 6:fb11b746ceb5 836 * This function get the enable state of a specific limit check.
sepp_nepp 6:fb11b746ceb5 837 * The limit check is identified with the LimitCheckId.
sepp_nepp 6:fb11b746ceb5 838 *
sepp_nepp 6:fb11b746ceb5 839 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 840 *
sepp_nepp 7:3a1115c2556b 841 *
sepp_nepp 6:fb11b746ceb5 842 * @param limit_check_id Limit Check ID
sepp_nepp 6:fb11b746ceb5 843 * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
sepp_nepp 6:fb11b746ceb5 844 * @param p_limit_check_enable Pointer to the check limit enable
sepp_nepp 6:fb11b746ceb5 845 * value.
sepp_nepp 6:fb11b746ceb5 846 * if 1 the check limit
sepp_nepp 6:fb11b746ceb5 847 * corresponding to LimitCheckId is Enabled
sepp_nepp 6:fb11b746ceb5 848 * if 0 the check limit
sepp_nepp 6:fb11b746ceb5 849 * corresponding to LimitCheckId is disabled
sepp_nepp 6:fb11b746ceb5 850 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 851 * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned
sepp_nepp 6:fb11b746ceb5 852 * when LimitCheckId value is out of range.
sepp_nepp 6:fb11b746ceb5 853 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 854 */
sepp_nepp 7:3a1115c2556b 855 VL53L0X_Error VL53L0X_get_limit_check_enable( uint16_t limit_check_id,
sepp_nepp 6:fb11b746ceb5 856 uint8_t *p_limit_check_enable);
sepp_nepp 6:fb11b746ceb5 857
sepp_nepp 6:fb11b746ceb5 858 /**
sepp_nepp 6:fb11b746ceb5 859 * @brief Enable/Disable a specific limit check
sepp_nepp 6:fb11b746ceb5 860 *
sepp_nepp 6:fb11b746ceb5 861 * @par Function Description
sepp_nepp 6:fb11b746ceb5 862 * This function Enable/Disable a specific limit check.
sepp_nepp 6:fb11b746ceb5 863 * The limit check is identified with the LimitCheckId.
sepp_nepp 6:fb11b746ceb5 864 *
sepp_nepp 6:fb11b746ceb5 865 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 866 *
sepp_nepp 7:3a1115c2556b 867 *
sepp_nepp 6:fb11b746ceb5 868 * @param limit_check_id Limit Check ID
sepp_nepp 6:fb11b746ceb5 869 * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
sepp_nepp 6:fb11b746ceb5 870 * @param limit_check_enable if 1 the check limit
sepp_nepp 6:fb11b746ceb5 871 * corresponding to LimitCheckId is Enabled
sepp_nepp 6:fb11b746ceb5 872 * if 0 the check limit
sepp_nepp 6:fb11b746ceb5 873 * corresponding to LimitCheckId is disabled
sepp_nepp 6:fb11b746ceb5 874 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 875 * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned
sepp_nepp 6:fb11b746ceb5 876 * when LimitCheckId value is out of range.
sepp_nepp 6:fb11b746ceb5 877 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 878 */
sepp_nepp 7:3a1115c2556b 879 VL53L0X_Error VL53L0X_set_limit_check_enable( uint16_t limit_check_id,
sepp_nepp 6:fb11b746ceb5 880 uint8_t limit_check_enable);
sepp_nepp 6:fb11b746ceb5 881
sepp_nepp 6:fb11b746ceb5 882 /**
sepp_nepp 6:fb11b746ceb5 883 * @brief Get a specific limit check value
sepp_nepp 6:fb11b746ceb5 884 *
sepp_nepp 6:fb11b746ceb5 885 * @par Function Description
sepp_nepp 6:fb11b746ceb5 886 * This function get a specific limit check value from device then it updates
sepp_nepp 6:fb11b746ceb5 887 * internal values and check enables.
sepp_nepp 6:fb11b746ceb5 888 * The limit check is identified with the LimitCheckId.
sepp_nepp 6:fb11b746ceb5 889 *
sepp_nepp 6:fb11b746ceb5 890 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 891 *
sepp_nepp 7:3a1115c2556b 892 *
sepp_nepp 6:fb11b746ceb5 893 * @param limit_check_id Limit Check ID
sepp_nepp 6:fb11b746ceb5 894 * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
sepp_nepp 6:fb11b746ceb5 895 * @param p_limit_check_value Pointer to Limit
sepp_nepp 6:fb11b746ceb5 896 * check Value for a given LimitCheckId.
sepp_nepp 6:fb11b746ceb5 897 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 898 * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned
sepp_nepp 6:fb11b746ceb5 899 * when LimitCheckId value is out of range.
sepp_nepp 6:fb11b746ceb5 900 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 901 */
sepp_nepp 7:3a1115c2556b 902 VL53L0X_Error VL53L0X_get_limit_check_value( uint16_t limit_check_id,
sepp_nepp 6:fb11b746ceb5 903 FixPoint1616_t *p_limit_check_value);
sepp_nepp 6:fb11b746ceb5 904
sepp_nepp 6:fb11b746ceb5 905 /**
sepp_nepp 6:fb11b746ceb5 906 * @brief Set a specific limit check value
sepp_nepp 6:fb11b746ceb5 907 *
sepp_nepp 6:fb11b746ceb5 908 * @par Function Description
sepp_nepp 6:fb11b746ceb5 909 * This function set a specific limit check value.
sepp_nepp 6:fb11b746ceb5 910 * The limit check is identified with the LimitCheckId.
sepp_nepp 6:fb11b746ceb5 911 *
sepp_nepp 6:fb11b746ceb5 912 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 913 *
sepp_nepp 7:3a1115c2556b 914 *
sepp_nepp 6:fb11b746ceb5 915 * @param limit_check_id Limit Check ID
sepp_nepp 6:fb11b746ceb5 916 * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
sepp_nepp 6:fb11b746ceb5 917 * @param limit_check_value Limit check Value for a given
sepp_nepp 6:fb11b746ceb5 918 * LimitCheckId
sepp_nepp 6:fb11b746ceb5 919 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 920 * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned when either
sepp_nepp 6:fb11b746ceb5 921 * LimitCheckId or LimitCheckValue value is out of range.
sepp_nepp 6:fb11b746ceb5 922 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 923 */
sepp_nepp 7:3a1115c2556b 924 VL53L0X_Error VL53L0X_set_limit_check_value( uint16_t limit_check_id,
sepp_nepp 6:fb11b746ceb5 925 FixPoint1616_t limit_check_value);
sepp_nepp 6:fb11b746ceb5 926
sepp_nepp 6:fb11b746ceb5 927 /**
sepp_nepp 6:fb11b746ceb5 928 * @brief Get the current value of the signal used for the limit check
sepp_nepp 6:fb11b746ceb5 929 *
sepp_nepp 6:fb11b746ceb5 930 * @par Function Description
sepp_nepp 6:fb11b746ceb5 931 * This function get a the current value of the signal used for the limit check.
sepp_nepp 6:fb11b746ceb5 932 * To obtain the latest value you should run a ranging before.
sepp_nepp 6:fb11b746ceb5 933 * The value reported is linked to the limit check identified with the
sepp_nepp 6:fb11b746ceb5 934 * LimitCheckId.
sepp_nepp 6:fb11b746ceb5 935 *
sepp_nepp 6:fb11b746ceb5 936 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 937 *
sepp_nepp 7:3a1115c2556b 938 *
sepp_nepp 6:fb11b746ceb5 939 * @param limit_check_id Limit Check ID
sepp_nepp 6:fb11b746ceb5 940 * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
sepp_nepp 6:fb11b746ceb5 941 * @param p_limit_check_current Pointer to current Value for a
sepp_nepp 6:fb11b746ceb5 942 * given LimitCheckId.
sepp_nepp 6:fb11b746ceb5 943 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 944 * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned when
sepp_nepp 6:fb11b746ceb5 945 * LimitCheckId value is out of range.
sepp_nepp 6:fb11b746ceb5 946 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 947 */
sepp_nepp 7:3a1115c2556b 948 VL53L0X_Error VL53L0X_get_limit_check_current( uint16_t limit_check_id,
sepp_nepp 6:fb11b746ceb5 949 FixPoint1616_t *p_limit_check_current);
sepp_nepp 6:fb11b746ceb5 950
sepp_nepp 6:fb11b746ceb5 951 /**
sepp_nepp 6:fb11b746ceb5 952 * @brief Return a the Status of the specified check limit
sepp_nepp 6:fb11b746ceb5 953 *
sepp_nepp 6:fb11b746ceb5 954 * @par Function Description
sepp_nepp 6:fb11b746ceb5 955 * This function returns the Status of the specified check limit.
sepp_nepp 6:fb11b746ceb5 956 * The value indicate if the check is fail or not.
sepp_nepp 6:fb11b746ceb5 957 * The limit check is identified with the LimitCheckId.
sepp_nepp 6:fb11b746ceb5 958 *
sepp_nepp 6:fb11b746ceb5 959 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 960 *
sepp_nepp 7:3a1115c2556b 961 *
sepp_nepp 6:fb11b746ceb5 962 * @param limit_check_id Limit Check ID
sepp_nepp 6:fb11b746ceb5 963 (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
sepp_nepp 6:fb11b746ceb5 964 * @param p_limit_check_status Pointer to the
sepp_nepp 6:fb11b746ceb5 965 Limit Check Status of the given check limit.
sepp_nepp 6:fb11b746ceb5 966 * LimitCheckStatus :
sepp_nepp 6:fb11b746ceb5 967 * 0 the check is not fail
sepp_nepp 6:fb11b746ceb5 968 * 1 the check if fail or not enabled
sepp_nepp 6:fb11b746ceb5 969 *
sepp_nepp 6:fb11b746ceb5 970 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 971 * @return VL53L0X_ERROR_INVALID_PARAMS This error is
sepp_nepp 6:fb11b746ceb5 972 returned when LimitCheckId value is out of range.
sepp_nepp 6:fb11b746ceb5 973 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 974 */
sepp_nepp 7:3a1115c2556b 975 VL53L0X_Error VL53L0X_get_limit_check_status(
sepp_nepp 6:fb11b746ceb5 976 uint16_t limit_check_id, uint8_t *p_limit_check_status);
sepp_nepp 6:fb11b746ceb5 977
sepp_nepp 6:fb11b746ceb5 978 /**
sepp_nepp 6:fb11b746ceb5 979 * Get continuous mode Inter-Measurement period in milliseconds
sepp_nepp 6:fb11b746ceb5 980 *
sepp_nepp 6:fb11b746ceb5 981 * @par Function Description
sepp_nepp 6:fb11b746ceb5 982 * When trying to set too short time return INVALID_PARAMS minimal value
sepp_nepp 6:fb11b746ceb5 983 *
sepp_nepp 6:fb11b746ceb5 984 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 985 *
sepp_nepp 7:3a1115c2556b 986 *
sepp_nepp 6:fb11b746ceb5 987 * @param p_inter_measurement_period_milli_seconds Pointer to programmed
sepp_nepp 6:fb11b746ceb5 988 * Inter-Measurement Period in milliseconds.
sepp_nepp 6:fb11b746ceb5 989 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 990 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 991 */
sepp_nepp 7:3a1115c2556b 992 VL53L0X_Error VL53L0X_get_inter_measurement_period_milli_seconds(
sepp_nepp 6:fb11b746ceb5 993 uint32_t *p_inter_measurement_period_milli_seconds);
sepp_nepp 6:fb11b746ceb5 994
sepp_nepp 6:fb11b746ceb5 995 /**
sepp_nepp 6:fb11b746ceb5 996 * Program continuous mode Inter-Measurement period in milliseconds
sepp_nepp 6:fb11b746ceb5 997 *
sepp_nepp 6:fb11b746ceb5 998 * @par Function Description
sepp_nepp 6:fb11b746ceb5 999 * When trying to set too short time return INVALID_PARAMS minimal value
sepp_nepp 6:fb11b746ceb5 1000 *
sepp_nepp 6:fb11b746ceb5 1001 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1002 *
sepp_nepp 7:3a1115c2556b 1003 *
sepp_nepp 6:fb11b746ceb5 1004 * @param inter_measurement_period_milli_seconds Inter-Measurement Period in ms.
sepp_nepp 6:fb11b746ceb5 1005 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1006 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1007 */
sepp_nepp 6:fb11b746ceb5 1008 VL53L0X_Error VL53L0X_set_inter_measurement_period_milli_seconds(
sepp_nepp 7:3a1115c2556b 1009 uint32_t inter_measurement_period_milli_seconds);
sepp_nepp 6:fb11b746ceb5 1010
sepp_nepp 6:fb11b746ceb5 1011 /**
sepp_nepp 6:fb11b746ceb5 1012 * @brief Set new device address
sepp_nepp 6:fb11b746ceb5 1013 *
sepp_nepp 6:fb11b746ceb5 1014 * After completion the device will answer to the new address programmed.
sepp_nepp 6:fb11b746ceb5 1015 * This function should be called when several devices are used in parallel
sepp_nepp 6:fb11b746ceb5 1016 * before start programming the sensor.
sepp_nepp 6:fb11b746ceb5 1017 * When a single device us used, there is no need to call this function.
sepp_nepp 6:fb11b746ceb5 1018 *
sepp_nepp 6:fb11b746ceb5 1019 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1020 *
sepp_nepp 7:3a1115c2556b 1021 *
sepp_nepp 6:fb11b746ceb5 1022 * @param device_address The new Device address
sepp_nepp 6:fb11b746ceb5 1023 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1024 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1025 */
sepp_nepp 7:3a1115c2556b 1026 VL53L0X_Error VL53L0X_set_device_address( uint8_t device_address);
sepp_nepp 6:fb11b746ceb5 1027
sepp_nepp 6:fb11b746ceb5 1028 /**
sepp_nepp 6:fb11b746ceb5 1029 * @brief Do an hard reset or soft reset (depending on implementation) of the
sepp_nepp 6:fb11b746ceb5 1030 * device \nAfter call of this function, device must be in same state as right
sepp_nepp 6:fb11b746ceb5 1031 * after a power-up sequence.This function will change the VL53L0X_State to
sepp_nepp 6:fb11b746ceb5 1032 * VL53L0X_STATE_POWERDOWN.
sepp_nepp 6:fb11b746ceb5 1033 *
sepp_nepp 6:fb11b746ceb5 1034 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1035 *
sepp_nepp 7:3a1115c2556b 1036 *
sepp_nepp 6:fb11b746ceb5 1037 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1038 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1039 */
sepp_nepp 7:3a1115c2556b 1040 VL53L0X_Error VL53L0X_reset_device(void);
sepp_nepp 6:fb11b746ceb5 1041
sepp_nepp 6:fb11b746ceb5 1042 /**
sepp_nepp 6:fb11b746ceb5 1043 * @brief Get setup of Wrap around Check
sepp_nepp 6:fb11b746ceb5 1044 *
sepp_nepp 6:fb11b746ceb5 1045 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1046 * This function get the wrapAround check enable parameters
sepp_nepp 6:fb11b746ceb5 1047 *
sepp_nepp 6:fb11b746ceb5 1048 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1049 *
sepp_nepp 7:3a1115c2556b 1050 *
sepp_nepp 6:fb11b746ceb5 1051 * @param p_wrap_around_check_enable Pointer to the Wrap around Check state
sepp_nepp 6:fb11b746ceb5 1052 * 0=disabled or 1 = enabled
sepp_nepp 6:fb11b746ceb5 1053 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1054 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1055 */
sepp_nepp 7:3a1115c2556b 1056 VL53L0X_Error VL53L0X_get_wrap_around_check_enable(
sepp_nepp 6:fb11b746ceb5 1057 uint8_t *p_wrap_around_check_enable);
sepp_nepp 6:fb11b746ceb5 1058
sepp_nepp 6:fb11b746ceb5 1059 /**
sepp_nepp 6:fb11b746ceb5 1060 * @brief Enable (or disable) Wrap around Check
sepp_nepp 6:fb11b746ceb5 1061 *
sepp_nepp 6:fb11b746ceb5 1062 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1063 *
sepp_nepp 7:3a1115c2556b 1064 *
sepp_nepp 6:fb11b746ceb5 1065 * @param wrap_around_check_enable Wrap around Check to be set
sepp_nepp 6:fb11b746ceb5 1066 * 0=disabled, other = enabled
sepp_nepp 6:fb11b746ceb5 1067 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1068 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1069 */
sepp_nepp 7:3a1115c2556b 1070 VL53L0X_Error VL53L0X_set_wrap_around_check_enable(
sepp_nepp 6:fb11b746ceb5 1071 uint8_t wrap_around_check_enable);
sepp_nepp 6:fb11b746ceb5 1072
sepp_nepp 6:fb11b746ceb5 1073 /**
sepp_nepp 6:fb11b746ceb5 1074 * @brief Gets the VCSEL pulse period.
sepp_nepp 6:fb11b746ceb5 1075 *
sepp_nepp 6:fb11b746ceb5 1076 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1077 * This function retrieves the VCSEL pulse period for the given period type.
sepp_nepp 6:fb11b746ceb5 1078 *
sepp_nepp 6:fb11b746ceb5 1079 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1080 *
sepp_nepp 7:3a1115c2556b 1081 *
sepp_nepp 6:fb11b746ceb5 1082 * @param vcsel_period_type VCSEL period identifier (pre-range|final).
sepp_nepp 6:fb11b746ceb5 1083 * @param p_vcsel_pulse_period_pclk Pointer to VCSEL period value.
sepp_nepp 6:fb11b746ceb5 1084 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1085 * @return VL53L0X_ERROR_INVALID_PARAMS Error VcselPeriodType parameter not
sepp_nepp 6:fb11b746ceb5 1086 * supported.
sepp_nepp 6:fb11b746ceb5 1087 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1088 */
sepp_nepp 7:3a1115c2556b 1089 VL53L0X_Error VL53L0X_get_vcsel_pulse_period(
sepp_nepp 6:fb11b746ceb5 1090 VL53L0X_VcselPeriod vcsel_period_type, uint8_t *p_vcsel_pulse_period_pclk);
sepp_nepp 6:fb11b746ceb5 1091
sepp_nepp 6:fb11b746ceb5 1092 /**
sepp_nepp 6:fb11b746ceb5 1093 * @brief Sets the VCSEL pulse period.
sepp_nepp 6:fb11b746ceb5 1094 *
sepp_nepp 6:fb11b746ceb5 1095 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1096 * This function retrieves the VCSEL pulse period for the given period type.
sepp_nepp 6:fb11b746ceb5 1097 *
sepp_nepp 6:fb11b746ceb5 1098 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1099 *
sepp_nepp 7:3a1115c2556b 1100 *
sepp_nepp 6:fb11b746ceb5 1101 * @param vcsel_period_type VCSEL period identifier (pre-range|final).
sepp_nepp 6:fb11b746ceb5 1102 * @param vcsel_pulse_period VCSEL period value
sepp_nepp 6:fb11b746ceb5 1103 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1104 * @return VL53L0X_ERROR_INVALID_PARAMS Error VcselPeriodType parameter not
sepp_nepp 6:fb11b746ceb5 1105 * supported.
sepp_nepp 6:fb11b746ceb5 1106 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1107 */
sepp_nepp 7:3a1115c2556b 1108 VL53L0X_Error VL53L0X_set_vcsel_pulse_period(
sepp_nepp 6:fb11b746ceb5 1109 VL53L0X_VcselPeriod vcsel_period_type, uint8_t vcsel_pulse_period);
sepp_nepp 6:fb11b746ceb5 1110
sepp_nepp 6:fb11b746ceb5 1111 /**
sepp_nepp 6:fb11b746ceb5 1112 * @brief Set low and high Interrupt thresholds for a given mode
sepp_nepp 6:fb11b746ceb5 1113 * (ranging, ALS, ...) for a given device
sepp_nepp 6:fb11b746ceb5 1114 *
sepp_nepp 6:fb11b746ceb5 1115 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1116 * Set low and high Interrupt thresholds for a given mode (ranging, ALS, ...)
sepp_nepp 6:fb11b746ceb5 1117 * for a given device
sepp_nepp 6:fb11b746ceb5 1118 *
sepp_nepp 6:fb11b746ceb5 1119 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1120 *
sepp_nepp 6:fb11b746ceb5 1121 * @note DeviceMode is ignored for the current device
sepp_nepp 6:fb11b746ceb5 1122 *
sepp_nepp 7:3a1115c2556b 1123 *
sepp_nepp 6:fb11b746ceb5 1124 * @param device_mode Device Mode for which change thresholds
sepp_nepp 6:fb11b746ceb5 1125 * @param threshold_low Low threshold (mm, lux ..., depending on the mode)
sepp_nepp 6:fb11b746ceb5 1126 * @param threshold_high High threshold (mm, lux ..., depending on the mode)
sepp_nepp 6:fb11b746ceb5 1127 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1128 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1129 */
sepp_nepp 7:3a1115c2556b 1130 VL53L0X_Error VL53L0X_set_interrupt_thresholds(
sepp_nepp 6:fb11b746ceb5 1131 VL53L0X_DeviceModes device_mode, FixPoint1616_t threshold_low,
sepp_nepp 6:fb11b746ceb5 1132 FixPoint1616_t threshold_high);
sepp_nepp 6:fb11b746ceb5 1133
sepp_nepp 6:fb11b746ceb5 1134 /**
sepp_nepp 6:fb11b746ceb5 1135 * @brief Get high and low Interrupt thresholds for a given mode
sepp_nepp 6:fb11b746ceb5 1136 * (ranging, ALS, ...) for a given device
sepp_nepp 6:fb11b746ceb5 1137 *
sepp_nepp 6:fb11b746ceb5 1138 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1139 * Get high and low Interrupt thresholds for a given mode (ranging, ALS, ...)
sepp_nepp 6:fb11b746ceb5 1140 * for a given device
sepp_nepp 6:fb11b746ceb5 1141 *
sepp_nepp 6:fb11b746ceb5 1142 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1143 *
sepp_nepp 6:fb11b746ceb5 1144 * @note DeviceMode is ignored for the current device
sepp_nepp 6:fb11b746ceb5 1145 *
sepp_nepp 7:3a1115c2556b 1146 *
sepp_nepp 6:fb11b746ceb5 1147 * @param device_mode Device Mode from which read thresholds
sepp_nepp 6:fb11b746ceb5 1148 * @param p_threshold_low Low threshold (mm, lux ..., depending on the mode)
sepp_nepp 6:fb11b746ceb5 1149 * @param p_threshold_high High threshold (mm, lux ..., depending on the mode)
sepp_nepp 6:fb11b746ceb5 1150 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1151 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1152 */
sepp_nepp 7:3a1115c2556b 1153 VL53L0X_Error VL53L0X_get_interrupt_thresholds(
sepp_nepp 6:fb11b746ceb5 1154 VL53L0X_DeviceModes device_mode, FixPoint1616_t *p_threshold_low,
sepp_nepp 6:fb11b746ceb5 1155 FixPoint1616_t *p_threshold_high);
sepp_nepp 6:fb11b746ceb5 1156
sepp_nepp 6:fb11b746ceb5 1157 /**
sepp_nepp 6:fb11b746ceb5 1158 * @brief Reads the Device information for given Device
sepp_nepp 6:fb11b746ceb5 1159 *
sepp_nepp 6:fb11b746ceb5 1160 * @note This function Access to the device
sepp_nepp 10:cd1758e186a4 1161 * _device_info structure is directly filled
sepp_nepp 6:fb11b746ceb5 1162 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1163 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1164 */
sepp_nepp 10:cd1758e186a4 1165 VL53L0X_Error VL53L0X_get_device_info( );
sepp_nepp 6:fb11b746ceb5 1166
sepp_nepp 6:fb11b746ceb5 1167 /**
sepp_nepp 6:fb11b746ceb5 1168 * @brief Gets the (on/off) state of all sequence steps.
sepp_nepp 6:fb11b746ceb5 1169 *
sepp_nepp 6:fb11b746ceb5 1170 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1171 * This function retrieves the state of all sequence step in the scheduler.
sepp_nepp 6:fb11b746ceb5 1172 *
sepp_nepp 6:fb11b746ceb5 1173 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1174 *
sepp_nepp 7:3a1115c2556b 1175 *
sepp_nepp 6:fb11b746ceb5 1176 * @param p_scheduler_sequence_steps Pointer to struct containing result.
sepp_nepp 6:fb11b746ceb5 1177 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1178 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1179 */
sepp_nepp 7:3a1115c2556b 1180 VL53L0X_Error VL53L0X_get_sequence_step_enables(
sepp_nepp 6:fb11b746ceb5 1181 VL53L0X_SchedulerSequenceSteps_t *p_scheduler_sequence_steps);
sepp_nepp 6:fb11b746ceb5 1182
sepp_nepp 6:fb11b746ceb5 1183 /**
sepp_nepp 6:fb11b746ceb5 1184 * @brief Sets the (on/off) state of a requested sequence step.
sepp_nepp 6:fb11b746ceb5 1185 *
sepp_nepp 6:fb11b746ceb5 1186 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1187 * This function enables/disables a requested sequence step.
sepp_nepp 6:fb11b746ceb5 1188 *
sepp_nepp 6:fb11b746ceb5 1189 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1190 *
sepp_nepp 7:3a1115c2556b 1191 *
sepp_nepp 6:fb11b746ceb5 1192 * @param sequence_step_id Sequence step identifier.
sepp_nepp 6:fb11b746ceb5 1193 * @param sequence_step_enabled Demanded state {0=Off,1=On}
sepp_nepp 6:fb11b746ceb5 1194 * is enabled.
sepp_nepp 6:fb11b746ceb5 1195 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1196 * @return VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
sepp_nepp 6:fb11b746ceb5 1197 * supported.
sepp_nepp 6:fb11b746ceb5 1198 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1199 */
sepp_nepp 7:3a1115c2556b 1200 VL53L0X_Error VL53L0X_set_sequence_step_enable(
sepp_nepp 6:fb11b746ceb5 1201 VL53L0X_SequenceStepId sequence_step_id, uint8_t sequence_step_enabled);
sepp_nepp 6:fb11b746ceb5 1202
sepp_nepp 6:fb11b746ceb5 1203 /**
sepp_nepp 6:fb11b746ceb5 1204 * @brief Gets the fraction enable parameter indicating the resolution of
sepp_nepp 6:fb11b746ceb5 1205 * range measurements.
sepp_nepp 6:fb11b746ceb5 1206 *
sepp_nepp 6:fb11b746ceb5 1207 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1208 * Gets the fraction enable state, which translates to the resolution of
sepp_nepp 6:fb11b746ceb5 1209 * range measurements as follows :Enabled:=0.25mm resolution,
sepp_nepp 6:fb11b746ceb5 1210 * Not Enabled:=1mm resolution.
sepp_nepp 6:fb11b746ceb5 1211 *
sepp_nepp 6:fb11b746ceb5 1212 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1213 *
sepp_nepp 7:3a1115c2556b 1214 *
sepp_nepp 6:fb11b746ceb5 1215 * @param p_enabled Output Parameter reporting the fraction enable state.
sepp_nepp 6:fb11b746ceb5 1216 *
sepp_nepp 6:fb11b746ceb5 1217 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1218 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1219 */
sepp_nepp 7:3a1115c2556b 1220 VL53L0X_Error VL53L0X_get_fraction_enable( uint8_t *p_enabled);
sepp_nepp 6:fb11b746ceb5 1221
sepp_nepp 6:fb11b746ceb5 1222 /**
sepp_nepp 6:fb11b746ceb5 1223 * @brief Sets the resolution of range measurements.
sepp_nepp 6:fb11b746ceb5 1224 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1225 * Set resolution of range measurements to either 0.25mm if
sepp_nepp 6:fb11b746ceb5 1226 * fraction enabled or 1mm if not enabled.
sepp_nepp 6:fb11b746ceb5 1227 *
sepp_nepp 6:fb11b746ceb5 1228 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1229 *
sepp_nepp 7:3a1115c2556b 1230 *
sepp_nepp 6:fb11b746ceb5 1231 * @param enable Enable high resolution
sepp_nepp 6:fb11b746ceb5 1232 *
sepp_nepp 6:fb11b746ceb5 1233 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1234 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1235 */
sepp_nepp 8:2fd7cb217068 1236 VL53L0X_Error VL53L0X_set_range_fraction_enable(uint8_t enable);
sepp_nepp 6:fb11b746ceb5 1237
sepp_nepp 6:fb11b746ceb5 1238 /**
sepp_nepp 6:fb11b746ceb5 1239 * @brief Retrieve current device parameters
sepp_nepp 6:fb11b746ceb5 1240 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1241 * Get actual parameters of the device
sepp_nepp 6:fb11b746ceb5 1242 * @li Then start ranging operation.
sepp_nepp 6:fb11b746ceb5 1243 *
sepp_nepp 6:fb11b746ceb5 1244 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1245 *
sepp_nepp 7:3a1115c2556b 1246 *
sepp_nepp 6:fb11b746ceb5 1247 * @param p_device_parameters Pointer to store current device parameters.
sepp_nepp 6:fb11b746ceb5 1248 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1249 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1250 */
sepp_nepp 7:3a1115c2556b 1251 VL53L0X_Error VL53L0X_get_device_parameters(
sepp_nepp 6:fb11b746ceb5 1252 VL53L0X_DeviceParameters_t *p_device_parameters);
sepp_nepp 6:fb11b746ceb5 1253
sepp_nepp 6:fb11b746ceb5 1254
sepp_nepp 6:fb11b746ceb5 1255 /*** End High level API ***/
sepp_nepp 6:fb11b746ceb5 1256 public:
sepp_nepp 6:fb11b746ceb5 1257 /* api.h functions */
sepp_nepp 6:fb11b746ceb5 1258
sepp_nepp 7:3a1115c2556b 1259 VL53L0X_Error sequence_step_enabled(VL53L0X_SequenceStepId sequence_step_id, uint8_t sequence_config,
sepp_nepp 6:fb11b746ceb5 1260 uint8_t *p_sequence_step_enabled);
sepp_nepp 6:fb11b746ceb5 1261
sepp_nepp 7:3a1115c2556b 1262 VL53L0X_Error VL53L0X_check_and_load_interrupt_settings(
sepp_nepp 6:fb11b746ceb5 1263 uint8_t start_not_stopflag);
sepp_nepp 6:fb11b746ceb5 1264
sepp_nepp 6:fb11b746ceb5 1265
sepp_nepp 6:fb11b746ceb5 1266 /* api_core.h functions */
sepp_nepp 6:fb11b746ceb5 1267
sepp_nepp 7:3a1115c2556b 1268 VL53L0X_Error VL53L0X_get_info_from_device( uint8_t option);
sepp_nepp 6:fb11b746ceb5 1269
sepp_nepp 7:3a1115c2556b 1270 VL53L0X_Error VL53L0X_device_read_strobe(void);
sepp_nepp 6:fb11b746ceb5 1271
sepp_nepp 7:3a1115c2556b 1272 VL53L0X_Error wrapped_VL53L0X_get_measurement_timing_budget_micro_seconds(
sepp_nepp 6:fb11b746ceb5 1273 uint32_t *p_measurement_timing_budget_micro_seconds);
sepp_nepp 6:fb11b746ceb5 1274
sepp_nepp 7:3a1115c2556b 1275 VL53L0X_Error wrapped_VL53L0X_get_vcsel_pulse_period(
sepp_nepp 6:fb11b746ceb5 1276 VL53L0X_VcselPeriod vcsel_period_type, uint8_t *p_vcsel_pulse_period_pclk);
sepp_nepp 6:fb11b746ceb5 1277
sepp_nepp 6:fb11b746ceb5 1278 uint8_t VL53L0X_decode_vcsel_period(uint8_t vcsel_period_reg);
sepp_nepp 6:fb11b746ceb5 1279
sepp_nepp 6:fb11b746ceb5 1280 uint32_t VL53L0X_decode_timeout(uint16_t encoded_timeout);
sepp_nepp 6:fb11b746ceb5 1281
sepp_nepp 7:3a1115c2556b 1282 uint32_t VL53L0X_calc_timeout_us(
sepp_nepp 6:fb11b746ceb5 1283 uint16_t timeout_period_mclks,
sepp_nepp 6:fb11b746ceb5 1284 uint8_t vcsel_period_pclks);
sepp_nepp 6:fb11b746ceb5 1285
sepp_nepp 7:3a1115c2556b 1286 uint32_t VL53L0X_calc_macro_period_ps( uint8_t vcsel_period_pclks);
sepp_nepp 6:fb11b746ceb5 1287
sepp_nepp 7:3a1115c2556b 1288 VL53L0X_Error VL53L0X_measurement_poll_for_completion(void);
sepp_nepp 6:fb11b746ceb5 1289
sepp_nepp 7:3a1115c2556b 1290 VL53L0X_Error VL53L0X_load_tuning_settings(
sepp_nepp 6:fb11b746ceb5 1291 uint8_t *p_tuning_setting_buffer);
sepp_nepp 6:fb11b746ceb5 1292
sepp_nepp 8:2fd7cb217068 1293 VL53L0X_Error VL53L0X_get_pal_range_status( uint8_t device_range_status,
sepp_nepp 8:2fd7cb217068 1294 FixPoint1616_t signal_rate, uint16_t effective_spad_rtn_count,
sepp_nepp 6:fb11b746ceb5 1295 VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data,
sepp_nepp 6:fb11b746ceb5 1296 uint8_t *p_pal_range_status);
sepp_nepp 7:3a1115c2556b 1297 VL53L0X_Error VL53L0X_calc_sigma_estimate(
sepp_nepp 6:fb11b746ceb5 1298 VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data,
sepp_nepp 6:fb11b746ceb5 1299 FixPoint1616_t *p_sigma_estimate,
sepp_nepp 6:fb11b746ceb5 1300 uint32_t *p_dmax_mm);
sepp_nepp 8:2fd7cb217068 1301 uint32_t VL53L0X_calc_timeout_mclks( uint32_t timeout_period_us,
sepp_nepp 6:fb11b746ceb5 1302 uint8_t vcsel_period_pclks);
sepp_nepp 6:fb11b746ceb5 1303 uint32_t VL53L0X_isqrt(uint32_t num);
sepp_nepp 6:fb11b746ceb5 1304
sepp_nepp 6:fb11b746ceb5 1305 uint32_t VL53L0X_quadrature_sum(uint32_t a, uint32_t b);
sepp_nepp 6:fb11b746ceb5 1306
sepp_nepp 6:fb11b746ceb5 1307 VL53L0X_Error VL53L0X_calc_dmax(
sepp_nepp 6:fb11b746ceb5 1308 FixPoint1616_t total_signal_rate_mcps,
sepp_nepp 6:fb11b746ceb5 1309 FixPoint1616_t total_corr_signal_rate_mcps,
sepp_nepp 6:fb11b746ceb5 1310 FixPoint1616_t pw_mult,
sepp_nepp 6:fb11b746ceb5 1311 uint32_t sigma_estimate_p1,
sepp_nepp 6:fb11b746ceb5 1312 FixPoint1616_t sigma_estimate_p2,
sepp_nepp 6:fb11b746ceb5 1313 uint32_t peak_vcsel_duration_us,
sepp_nepp 6:fb11b746ceb5 1314 uint32_t *pd_max_mm);
sepp_nepp 7:3a1115c2556b 1315 VL53L0X_Error wrapped_VL53L0X_set_measurement_timing_budget_micro_seconds(
sepp_nepp 6:fb11b746ceb5 1316 uint32_t measurement_timing_budget_micro_seconds);
sepp_nepp 8:2fd7cb217068 1317 VL53L0X_Error get_sequence_step_timeout(VL53L0X_SequenceStepId sequence_step_id,
sepp_nepp 6:fb11b746ceb5 1318 uint32_t *p_time_out_micro_secs);
sepp_nepp 8:2fd7cb217068 1319 VL53L0X_Error set_sequence_step_timeout(VL53L0X_SequenceStepId sequence_step_id,
sepp_nepp 6:fb11b746ceb5 1320 uint32_t timeout_micro_secs);
sepp_nepp 6:fb11b746ceb5 1321 uint16_t VL53L0X_encode_timeout(uint32_t timeout_macro_clks);
sepp_nepp 7:3a1115c2556b 1322 VL53L0X_Error wrapped_VL53L0X_set_vcsel_pulse_period(
sepp_nepp 6:fb11b746ceb5 1323 VL53L0X_VcselPeriod vcsel_period_type, uint8_t vcsel_pulse_period_pclk);
sepp_nepp 6:fb11b746ceb5 1324 uint8_t lv53l0x_encode_vcsel_period(uint8_t vcsel_period_pclks);
sepp_nepp 6:fb11b746ceb5 1325
sepp_nepp 6:fb11b746ceb5 1326 /* api_calibration.h functions */
sepp_nepp 7:3a1115c2556b 1327 VL53L0X_Error VL53L0X_apply_offset_adjustment(void);
sepp_nepp 7:3a1115c2556b 1328 VL53L0X_Error wrapped_VL53L0X_get_offset_calibration_data_micro_meter(
sepp_nepp 6:fb11b746ceb5 1329 int32_t *p_offset_calibration_data_micro_meter);
sepp_nepp 7:3a1115c2556b 1330 VL53L0X_Error wrapped_VL53L0X_set_offset_calibration_data_micro_meter(
sepp_nepp 6:fb11b746ceb5 1331 int32_t offset_calibration_data_micro_meter);
sepp_nepp 7:3a1115c2556b 1332 VL53L0X_Error wrapped_VL53L0X_perform_ref_spad_management(
sepp_nepp 6:fb11b746ceb5 1333 uint32_t *ref_spad_count,
sepp_nepp 6:fb11b746ceb5 1334 uint8_t *is_aperture_spads);
sepp_nepp 7:3a1115c2556b 1335 VL53L0X_Error VL53L0X_perform_ref_calibration(
sepp_nepp 6:fb11b746ceb5 1336 uint8_t *p_vhv_settings, uint8_t *p_phase_cal, uint8_t get_data_enable);
sepp_nepp 7:3a1115c2556b 1337 VL53L0X_Error VL53L0X_perform_vhv_calibration(
sepp_nepp 6:fb11b746ceb5 1338 uint8_t *p_vhv_settings, const uint8_t get_data_enable,
sepp_nepp 6:fb11b746ceb5 1339 const uint8_t restore_config);
sepp_nepp 7:3a1115c2556b 1340 VL53L0X_Error VL53L0X_perform_single_ref_calibration(
sepp_nepp 6:fb11b746ceb5 1341 uint8_t vhv_init_byte);
sepp_nepp 7:3a1115c2556b 1342 VL53L0X_Error VL53L0X_ref_calibration_io( uint8_t read_not_write,
sepp_nepp 6:fb11b746ceb5 1343 uint8_t vhv_settings, uint8_t phase_cal,
sepp_nepp 6:fb11b746ceb5 1344 uint8_t *p_vhv_settings, uint8_t *p_phase_cal,
sepp_nepp 6:fb11b746ceb5 1345 const uint8_t vhv_enable, const uint8_t phase_enable);
sepp_nepp 7:3a1115c2556b 1346 VL53L0X_Error VL53L0X_perform_phase_calibration(
sepp_nepp 6:fb11b746ceb5 1347 uint8_t *p_phase_cal, const uint8_t get_data_enable,
sepp_nepp 6:fb11b746ceb5 1348 const uint8_t restore_config);
sepp_nepp 8:2fd7cb217068 1349 VL53L0X_Error enable_ref_spads(uint8_t aperture_spads,
sepp_nepp 6:fb11b746ceb5 1350 uint8_t good_spad_array[],
sepp_nepp 6:fb11b746ceb5 1351 uint8_t spad_array[],
sepp_nepp 6:fb11b746ceb5 1352 uint32_t size,
sepp_nepp 6:fb11b746ceb5 1353 uint32_t start,
sepp_nepp 6:fb11b746ceb5 1354 uint32_t offset,
sepp_nepp 6:fb11b746ceb5 1355 uint32_t spad_count,
sepp_nepp 6:fb11b746ceb5 1356 uint32_t *p_last_spad);
sepp_nepp 6:fb11b746ceb5 1357 void get_next_good_spad(uint8_t good_spad_array[], uint32_t size,
sepp_nepp 6:fb11b746ceb5 1358 uint32_t curr, int32_t *p_next);
sepp_nepp 6:fb11b746ceb5 1359 uint8_t is_aperture(uint32_t spad_index);
sepp_nepp 6:fb11b746ceb5 1360 VL53L0X_Error enable_spad_bit(uint8_t spad_array[], uint32_t size,
sepp_nepp 6:fb11b746ceb5 1361 uint32_t spad_index);
sepp_nepp 7:3a1115c2556b 1362 VL53L0X_Error set_ref_spad_map( uint8_t *p_ref_spad_array);
sepp_nepp 7:3a1115c2556b 1363 VL53L0X_Error get_ref_spad_map( uint8_t *p_ref_spad_array);
sepp_nepp 7:3a1115c2556b 1364 VL53L0X_Error perform_ref_signal_measurement(
sepp_nepp 6:fb11b746ceb5 1365 uint16_t *p_ref_signal_rate);
sepp_nepp 7:3a1115c2556b 1366 VL53L0X_Error wrapped_VL53L0X_set_reference_spads(
sepp_nepp 6:fb11b746ceb5 1367 uint32_t count, uint8_t is_aperture_spads);
sepp_nepp 6:fb11b746ceb5 1368
sepp_nepp 6:fb11b746ceb5 1369 /* api_strings.h functions */
sepp_nepp 10:cd1758e186a4 1370 VL53L0X_Error VL53L0X_check_part_used(uint8_t *revision);
sepp_nepp 6:fb11b746ceb5 1371
sepp_nepp 6:fb11b746ceb5 1372 /* Read function of the ID device */
sepp_nepp 6:fb11b746ceb5 1373 // virtual int read_id();
sepp_nepp 6:fb11b746ceb5 1374 virtual int read_id(uint8_t *id);
sepp_nepp 6:fb11b746ceb5 1375
sepp_nepp 7:3a1115c2556b 1376 VL53L0X_Error wait_measurement_data_ready(void);
sepp_nepp 6:fb11b746ceb5 1377
sepp_nepp 7:3a1115c2556b 1378 VL53L0X_Error wait_stop_completed(void);
sepp_nepp 6:fb11b746ceb5 1379
sepp_nepp 6:fb11b746ceb5 1380
sepp_nepp 6:fb11b746ceb5 1381 /**
sepp_nepp 6:fb11b746ceb5 1382 * @brief execute delay in all polling API call
sepp_nepp 6:fb11b746ceb5 1383 *
sepp_nepp 6:fb11b746ceb5 1384 * A typical multi-thread or RTOs implementation is to sleep the task for some 5ms (with 100Hz max rate faster polling is not needed)
sepp_nepp 6:fb11b746ceb5 1385 * if nothing specific is need you can define it as an empty/void macro
sepp_nepp 6:fb11b746ceb5 1386 * @code
sepp_nepp 6:fb11b746ceb5 1387 * #define VL53L0X_PollingDelay(...) (void)0
sepp_nepp 6:fb11b746ceb5 1388 * @endcode
sepp_nepp 7:3a1115c2556b 1389 *
sepp_nepp 6:fb11b746ceb5 1390 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1391 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1392 */
sepp_nepp 7:3a1115c2556b 1393 VL53L0X_Error VL53L0X_polling_delay(void); /* usually best implemented as a real function */
sepp_nepp 6:fb11b746ceb5 1394
sepp_nepp 6:fb11b746ceb5 1395 ///////////////////////////////////////////////////////////////////////////////////////////////////////
sepp_nepp 6:fb11b746ceb5 1396 //Added functions //
sepp_nepp 6:fb11b746ceb5 1397 ///////////////////////////////////////////////////////////////////////////////////////////////////////
sepp_nepp 6:fb11b746ceb5 1398
sepp_nepp 6:fb11b746ceb5 1399 /**
sepp_nepp 6:fb11b746ceb5 1400 * @brief Cycle Power to Device
sepp_nepp 6:fb11b746ceb5 1401 *
sepp_nepp 6:fb11b746ceb5 1402 * @return status - status 0 = ok, 1 = error
sepp_nepp 6:fb11b746ceb5 1403 *
sepp_nepp 6:fb11b746ceb5 1404 */
sepp_nepp 6:fb11b746ceb5 1405 int32_t VL53L0X_cycle_power(void);
sepp_nepp 6:fb11b746ceb5 1406
sepp_nepp 6:fb11b746ceb5 1407 uint8_t VL53L0X_encode_vcsel_period(uint8_t vcsel_period_pclks);
sepp_nepp 6:fb11b746ceb5 1408
sepp_nepp 7:3a1115c2556b 1409 VL53L0X_Error wrapped_VL53L0X_get_limit_check_info( uint16_t limit_check_id,
sepp_nepp 6:fb11b746ceb5 1410 char *p_limit_check_string);
sepp_nepp 6:fb11b746ceb5 1411
sepp_nepp 7:3a1115c2556b 1412 VL53L0X_Error wrapped_VL53L0X_get_ref_calibration(
sepp_nepp 6:fb11b746ceb5 1413 uint8_t *p_vhv_settings, uint8_t *p_phase_cal);
sepp_nepp 6:fb11b746ceb5 1414
sepp_nepp 6:fb11b746ceb5 1415
sepp_nepp 6:fb11b746ceb5 1416 VL53L0X_Error count_enabled_spads(uint8_t spad_array[],
sepp_nepp 6:fb11b746ceb5 1417 uint32_t byte_count, uint32_t max_spads,
sepp_nepp 6:fb11b746ceb5 1418 uint32_t *p_total_spads_enabled, uint8_t *p_is_aperture);
sepp_nepp 6:fb11b746ceb5 1419
sepp_nepp 6:fb11b746ceb5 1420 VL53L0X_Error wrapped_VL53L0X_get_sequence_steps_info(VL53L0X_SequenceStepId sequence_step_id,
sepp_nepp 6:fb11b746ceb5 1421 char *p_sequence_steps_string);
sepp_nepp 6:fb11b746ceb5 1422
sepp_nepp 6:fb11b746ceb5 1423
sepp_nepp 6:fb11b746ceb5 1424 /**
sepp_nepp 6:fb11b746ceb5 1425 * @brief Gets the name of a given sequence step.
sepp_nepp 6:fb11b746ceb5 1426 *
sepp_nepp 6:fb11b746ceb5 1427 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1428 * This function retrieves the name of sequence steps corresponding to
sepp_nepp 6:fb11b746ceb5 1429 * SequenceStepId.
sepp_nepp 6:fb11b746ceb5 1430 *
sepp_nepp 6:fb11b746ceb5 1431 * @note This function doesn't Accesses the device
sepp_nepp 6:fb11b746ceb5 1432 *
sepp_nepp 6:fb11b746ceb5 1433 * @param sequence_step_id Sequence step identifier.
sepp_nepp 6:fb11b746ceb5 1434 * @param p_sequence_steps_string Pointer to Info string
sepp_nepp 6:fb11b746ceb5 1435 *
sepp_nepp 6:fb11b746ceb5 1436 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1437 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1438 */
sepp_nepp 6:fb11b746ceb5 1439 VL53L0X_Error VL53L0X_get_sequence_steps_info(VL53L0X_SequenceStepId sequence_step_id,
sepp_nepp 6:fb11b746ceb5 1440 char *p_sequence_steps_string);
sepp_nepp 6:fb11b746ceb5 1441
sepp_nepp 6:fb11b746ceb5 1442 /**
sepp_nepp 6:fb11b746ceb5 1443 * @brief Get the frequency of the timer used for ranging results time stamps
sepp_nepp 6:fb11b746ceb5 1444 *
sepp_nepp 6:fb11b746ceb5 1445 * @param[out] p_timer_freq_hz : pointer for timer frequency
sepp_nepp 6:fb11b746ceb5 1446 *
sepp_nepp 6:fb11b746ceb5 1447 * @return status : 0 = ok, 1 = error
sepp_nepp 6:fb11b746ceb5 1448 *
sepp_nepp 6:fb11b746ceb5 1449 */
sepp_nepp 6:fb11b746ceb5 1450 int32_t VL53L0X_get_timer_frequency(int32_t *p_timer_freq_hz);
sepp_nepp 6:fb11b746ceb5 1451
sepp_nepp 6:fb11b746ceb5 1452 /**
sepp_nepp 6:fb11b746ceb5 1453 * @brief Get the timer value in units of timer_freq_hz (see VL53L0X_get_timestamp_frequency())
sepp_nepp 6:fb11b746ceb5 1454 *
sepp_nepp 6:fb11b746ceb5 1455 * @param[out] p_timer_count : pointer for timer count value
sepp_nepp 6:fb11b746ceb5 1456 *
sepp_nepp 6:fb11b746ceb5 1457 * @return status : 0 = ok, 1 = error
sepp_nepp 6:fb11b746ceb5 1458 *
sepp_nepp 6:fb11b746ceb5 1459 */
sepp_nepp 6:fb11b746ceb5 1460 int32_t VL53L0X_get_timer_value(int32_t *p_timer_count);
sepp_nepp 6:fb11b746ceb5 1461
sepp_nepp 6:fb11b746ceb5 1462 /**
sepp_nepp 6:fb11b746ceb5 1463 * @brief Get Dmax Calibration Parameters for a given device
sepp_nepp 6:fb11b746ceb5 1464 *
sepp_nepp 6:fb11b746ceb5 1465 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1466 *
sepp_nepp 6:fb11b746ceb5 1467 * @param p_range_milli_meter Pointer to Calibration Distance
sepp_nepp 6:fb11b746ceb5 1468 * @param p_signal_rate_rtn_mega_cps Pointer to Signal rate return
sepp_nepp 6:fb11b746ceb5 1469 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1470 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1471 */
sepp_nepp 7:3a1115c2556b 1472 VL53L0X_Error VL53L0X_get_dmax_cal_parameters(
sepp_nepp 6:fb11b746ceb5 1473 uint16_t *p_range_milli_meter, FixPoint1616_t *p_signal_rate_rtn_mega_cps);
sepp_nepp 6:fb11b746ceb5 1474
sepp_nepp 6:fb11b746ceb5 1475 /**
sepp_nepp 6:fb11b746ceb5 1476 * @brief Set Dmax Calibration Parameters for a given device
sepp_nepp 6:fb11b746ceb5 1477 * When one of the parameter is zero, this function will get parameter
sepp_nepp 6:fb11b746ceb5 1478 * from NVM.
sepp_nepp 6:fb11b746ceb5 1479 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 1480 *
sepp_nepp 7:3a1115c2556b 1481 *
sepp_nepp 6:fb11b746ceb5 1482 * @param range_milli_meter Calibration Distance
sepp_nepp 6:fb11b746ceb5 1483 * @param signal_rate_rtn_mega_cps Signal rate return read at CalDistance
sepp_nepp 6:fb11b746ceb5 1484 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1485 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1486 */
sepp_nepp 7:3a1115c2556b 1487 VL53L0X_Error VL53L0X_get_dmax_cal_parameters(
sepp_nepp 6:fb11b746ceb5 1488 uint16_t range_milli_meter, FixPoint1616_t signal_rate_rtn_mega_cps);
sepp_nepp 6:fb11b746ceb5 1489
sepp_nepp 6:fb11b746ceb5 1490 /**
sepp_nepp 6:fb11b746ceb5 1491 * @brief Get current new device mode
sepp_nepp 6:fb11b746ceb5 1492 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1493 * Get current Histogram mode of a Device
sepp_nepp 6:fb11b746ceb5 1494 *
sepp_nepp 6:fb11b746ceb5 1495 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 1496 *
sepp_nepp 6:fb11b746ceb5 1497 * @param p_histogram_mode Pointer to current Histogram Mode value
sepp_nepp 6:fb11b746ceb5 1498 * Valid values are:
sepp_nepp 6:fb11b746ceb5 1499 * VL53L0X_HISTOGRAMMODE_DISABLED
sepp_nepp 6:fb11b746ceb5 1500 * VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
sepp_nepp 6:fb11b746ceb5 1501 * VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
sepp_nepp 6:fb11b746ceb5 1502 * VL53L0X_HISTOGRAMMODE_RETURN_ONLY
sepp_nepp 6:fb11b746ceb5 1503 * VL53L0X_HISTOGRAMMODE_BOTH
sepp_nepp 6:fb11b746ceb5 1504 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1505 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1506 */
sepp_nepp 7:3a1115c2556b 1507 VL53L0X_Error VL53L0X_get_histogram_mode(
sepp_nepp 6:fb11b746ceb5 1508 VL53L0X_HistogramModes *p_histogram_mode);
sepp_nepp 6:fb11b746ceb5 1509
sepp_nepp 6:fb11b746ceb5 1510 /**
sepp_nepp 6:fb11b746ceb5 1511 * @brief Set a new Histogram mode
sepp_nepp 6:fb11b746ceb5 1512 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1513 * Set device to a new Histogram mode
sepp_nepp 6:fb11b746ceb5 1514 *
sepp_nepp 6:fb11b746ceb5 1515 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 1516 *
sepp_nepp 7:3a1115c2556b 1517 *
sepp_nepp 6:fb11b746ceb5 1518 * @param histogram_mode New device mode to apply
sepp_nepp 6:fb11b746ceb5 1519 * Valid values are:
sepp_nepp 6:fb11b746ceb5 1520 * VL53L0X_HISTOGRAMMODE_DISABLED
sepp_nepp 6:fb11b746ceb5 1521 * VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM
sepp_nepp 6:fb11b746ceb5 1522 * VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY
sepp_nepp 6:fb11b746ceb5 1523 * VL53L0X_HISTOGRAMMODE_RETURN_ONLY
sepp_nepp 6:fb11b746ceb5 1524 * VL53L0X_HISTOGRAMMODE_BOTH
sepp_nepp 6:fb11b746ceb5 1525 *
sepp_nepp 6:fb11b746ceb5 1526 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1527 * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when
sepp_nepp 6:fb11b746ceb5 1528 * HistogramMode is not in the supported list
sepp_nepp 6:fb11b746ceb5 1529 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1530 */
sepp_nepp 7:3a1115c2556b 1531 VL53L0X_Error VL53L0X_set_histogram_mode(
sepp_nepp 6:fb11b746ceb5 1532 VL53L0X_HistogramModes histogram_mode);
sepp_nepp 6:fb11b746ceb5 1533
sepp_nepp 6:fb11b746ceb5 1534 /**
sepp_nepp 6:fb11b746ceb5 1535 * @brief Return a description string for a given limit check number
sepp_nepp 6:fb11b746ceb5 1536 *
sepp_nepp 6:fb11b746ceb5 1537 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1538 * This function returns a description string for a given limit check number.
sepp_nepp 6:fb11b746ceb5 1539 * The limit check is identified with the LimitCheckId.
sepp_nepp 6:fb11b746ceb5 1540 *
sepp_nepp 6:fb11b746ceb5 1541 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 1542 *
sepp_nepp 7:3a1115c2556b 1543 *
sepp_nepp 6:fb11b746ceb5 1544 * @param limit_check_id Limit Check ID
sepp_nepp 6:fb11b746ceb5 1545 (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ).
sepp_nepp 6:fb11b746ceb5 1546 * @param p_limit_check_string Pointer to the
sepp_nepp 6:fb11b746ceb5 1547 description string of the given check limit.
sepp_nepp 6:fb11b746ceb5 1548 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1549 * @return VL53L0X_ERROR_INVALID_PARAMS This error is
sepp_nepp 6:fb11b746ceb5 1550 returned when LimitCheckId value is out of range.
sepp_nepp 6:fb11b746ceb5 1551 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1552 */
sepp_nepp 7:3a1115c2556b 1553 VL53L0X_Error VL53L0X_get_limit_check_info(
sepp_nepp 6:fb11b746ceb5 1554 uint16_t limit_check_id, char *p_limit_check_string);
sepp_nepp 6:fb11b746ceb5 1555
sepp_nepp 6:fb11b746ceb5 1556 /**
sepp_nepp 6:fb11b746ceb5 1557 * @brief Get the linearity corrective gain
sepp_nepp 6:fb11b746ceb5 1558 *
sepp_nepp 6:fb11b746ceb5 1559 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1560 * Should only be used after a successful call to @a VL53L0X_DataInit to backup
sepp_nepp 6:fb11b746ceb5 1561 * device NVM value
sepp_nepp 6:fb11b746ceb5 1562 *
sepp_nepp 6:fb11b746ceb5 1563 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1564 *
sepp_nepp 7:3a1115c2556b 1565 *
sepp_nepp 6:fb11b746ceb5 1566 * @param p_linearity_corrective_gain Pointer to the linearity
sepp_nepp 6:fb11b746ceb5 1567 * corrective gain in x1000
sepp_nepp 6:fb11b746ceb5 1568 * if value is 1000 then no modification is applied.
sepp_nepp 6:fb11b746ceb5 1569 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1570 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1571 */
sepp_nepp 7:3a1115c2556b 1572 VL53L0X_Error VL53L0X_get_linearity_corrective_gain(
sepp_nepp 6:fb11b746ceb5 1573 uint16_t *p_linearity_corrective_gain);
sepp_nepp 6:fb11b746ceb5 1574
sepp_nepp 6:fb11b746ceb5 1575 /**
sepp_nepp 6:fb11b746ceb5 1576 * Set the linearity corrective gain
sepp_nepp 6:fb11b746ceb5 1577 *
sepp_nepp 6:fb11b746ceb5 1578 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1579 *
sepp_nepp 7:3a1115c2556b 1580 *
sepp_nepp 6:fb11b746ceb5 1581 * @param linearity_corrective_gain Linearity corrective
sepp_nepp 6:fb11b746ceb5 1582 * gain in x1000
sepp_nepp 6:fb11b746ceb5 1583 * if value is 1000 then no modification is applied.
sepp_nepp 6:fb11b746ceb5 1584 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1585 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1586 */
sepp_nepp 7:3a1115c2556b 1587 VL53L0X_Error VL53L0X_set_linearity_corrective_gain(
sepp_nepp 6:fb11b746ceb5 1588 int16_t linearity_corrective_gain);
sepp_nepp 6:fb11b746ceb5 1589
sepp_nepp 6:fb11b746ceb5 1590 /**
sepp_nepp 6:fb11b746ceb5 1591 * @brief Get the Maximum number of ROI Zones managed by the Device
sepp_nepp 6:fb11b746ceb5 1592 *
sepp_nepp 6:fb11b746ceb5 1593 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1594 * Get Maximum number of ROI Zones managed by the Device.
sepp_nepp 6:fb11b746ceb5 1595 *
sepp_nepp 6:fb11b746ceb5 1596 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 1597 *
sepp_nepp 7:3a1115c2556b 1598 *
sepp_nepp 6:fb11b746ceb5 1599 * @param p_max_number_of_roi_zones Pointer to the Maximum Number
sepp_nepp 6:fb11b746ceb5 1600 * of ROI Zones value.
sepp_nepp 6:fb11b746ceb5 1601 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1602 */
sepp_nepp 7:3a1115c2556b 1603 VL53L0X_Error VL53L0X_get_max_number_of_roi_zones(
sepp_nepp 6:fb11b746ceb5 1604 uint8_t *p_max_number_of_roi_zones);
sepp_nepp 6:fb11b746ceb5 1605
sepp_nepp 6:fb11b746ceb5 1606 /**
sepp_nepp 6:fb11b746ceb5 1607 * @brief Retrieve the Reference Signal after a measurements
sepp_nepp 6:fb11b746ceb5 1608 *
sepp_nepp 6:fb11b746ceb5 1609 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1610 * Get Reference Signal from last successful Ranging measurement
sepp_nepp 6:fb11b746ceb5 1611 * This function return a valid value after that you call the
sepp_nepp 6:fb11b746ceb5 1612 * @a VL53L0X_GetRangingMeasurementData().
sepp_nepp 6:fb11b746ceb5 1613 *
sepp_nepp 6:fb11b746ceb5 1614 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1615 *
sepp_nepp 7:3a1115c2556b 1616 *
sepp_nepp 6:fb11b746ceb5 1617 * @param p_measurement_ref_signal Pointer to the Ref Signal to fill up.
sepp_nepp 6:fb11b746ceb5 1618 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1619 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1620 */
sepp_nepp 7:3a1115c2556b 1621 VL53L0X_Error VL53L0X_get_measurement_ref_signal(
sepp_nepp 6:fb11b746ceb5 1622 FixPoint1616_t *p_measurement_ref_signal);
sepp_nepp 6:fb11b746ceb5 1623
sepp_nepp 6:fb11b746ceb5 1624 /**
sepp_nepp 6:fb11b746ceb5 1625 * @brief Get the number of the check limit managed by a given Device
sepp_nepp 6:fb11b746ceb5 1626 *
sepp_nepp 6:fb11b746ceb5 1627 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1628 * This function give the number of the check limit managed by the Device
sepp_nepp 6:fb11b746ceb5 1629 *
sepp_nepp 6:fb11b746ceb5 1630 * @note This function doesn't Access to the device
sepp_nepp 6:fb11b746ceb5 1631 *
sepp_nepp 6:fb11b746ceb5 1632 * @param p_number_of_limit_check Pointer to the number of check limit.
sepp_nepp 6:fb11b746ceb5 1633 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1634 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1635 */
sepp_nepp 6:fb11b746ceb5 1636 VL53L0X_Error VL53L0X_get_number_of_limit_check(
sepp_nepp 6:fb11b746ceb5 1637 uint16_t *p_number_of_limit_check);
sepp_nepp 6:fb11b746ceb5 1638
sepp_nepp 6:fb11b746ceb5 1639 /**
sepp_nepp 6:fb11b746ceb5 1640 * @brief Gets number of sequence steps managed by the API.
sepp_nepp 6:fb11b746ceb5 1641 *
sepp_nepp 6:fb11b746ceb5 1642 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1643 * This function retrieves the number of sequence steps currently managed
sepp_nepp 6:fb11b746ceb5 1644 * by the API
sepp_nepp 6:fb11b746ceb5 1645 *
sepp_nepp 6:fb11b746ceb5 1646 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1647 *
sepp_nepp 6:fb11b746ceb5 1648 * @param p_number_of_sequence_steps Out parameter reporting the number of
sepp_nepp 6:fb11b746ceb5 1649 * sequence steps.
sepp_nepp 6:fb11b746ceb5 1650 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1651 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1652 */
sepp_nepp 7:3a1115c2556b 1653 VL53L0X_Error VL53L0X_get_number_of_sequence_steps(
sepp_nepp 6:fb11b746ceb5 1654 uint8_t *p_number_of_sequence_steps);
sepp_nepp 6:fb11b746ceb5 1655 /**
sepp_nepp 6:fb11b746ceb5 1656 * @brief Get the power mode for a given Device
sepp_nepp 6:fb11b746ceb5 1657 *
sepp_nepp 6:fb11b746ceb5 1658 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1659 *
sepp_nepp 7:3a1115c2556b 1660 *
sepp_nepp 6:fb11b746ceb5 1661 * @param p_power_mode Pointer to the current value of the power
sepp_nepp 6:fb11b746ceb5 1662 * mode. see ::VL53L0X_PowerModes
sepp_nepp 6:fb11b746ceb5 1663 * Valid values are:
sepp_nepp 6:fb11b746ceb5 1664 * VL53L0X_POWERMODE_STANDBY_LEVEL1,
sepp_nepp 6:fb11b746ceb5 1665 * VL53L0X_POWERMODE_IDLE_LEVEL1
sepp_nepp 6:fb11b746ceb5 1666 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1667 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1668 */
sepp_nepp 7:3a1115c2556b 1669 VL53L0X_Error VL53L0X_get_power_mode(
sepp_nepp 6:fb11b746ceb5 1670 VL53L0X_PowerModes *p_power_mode);
sepp_nepp 6:fb11b746ceb5 1671
sepp_nepp 6:fb11b746ceb5 1672 /**
sepp_nepp 6:fb11b746ceb5 1673 * @brief Set the power mode for a given Device
sepp_nepp 6:fb11b746ceb5 1674 * The power mode can be Standby or Idle. Different level of both Standby and
sepp_nepp 6:fb11b746ceb5 1675 * Idle can exists.
sepp_nepp 6:fb11b746ceb5 1676 * This function should not be used when device is in Ranging state.
sepp_nepp 6:fb11b746ceb5 1677 *
sepp_nepp 6:fb11b746ceb5 1678 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1679 *
sepp_nepp 6:fb11b746ceb5 1680 * @param power_mode The value of the power mode to set.
sepp_nepp 6:fb11b746ceb5 1681 * see ::VL53L0X_PowerModes
sepp_nepp 6:fb11b746ceb5 1682 * Valid values are:
sepp_nepp 6:fb11b746ceb5 1683 * VL53L0X_POWERMODE_STANDBY_LEVEL1,
sepp_nepp 6:fb11b746ceb5 1684 * VL53L0X_POWERMODE_IDLE_LEVEL1
sepp_nepp 6:fb11b746ceb5 1685 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1686 * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when PowerMode
sepp_nepp 6:fb11b746ceb5 1687 * is not in the supported list
sepp_nepp 6:fb11b746ceb5 1688 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1689 */
sepp_nepp 8:2fd7cb217068 1690 VL53L0X_Error VL53L0X_set_power_mode(VL53L0X_PowerModes power_mode);
sepp_nepp 6:fb11b746ceb5 1691
sepp_nepp 6:fb11b746ceb5 1692 /**
sepp_nepp 6:fb11b746ceb5 1693 * @brief Retrieves SPAD configuration
sepp_nepp 6:fb11b746ceb5 1694 *
sepp_nepp 6:fb11b746ceb5 1695 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1696 * This function retrieves the current number of applied reference spads
sepp_nepp 6:fb11b746ceb5 1697 * and also their type : Aperture or Non-Aperture.
sepp_nepp 6:fb11b746ceb5 1698 *
sepp_nepp 6:fb11b746ceb5 1699 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1700 *
sepp_nepp 7:3a1115c2556b 1701 *
sepp_nepp 6:fb11b746ceb5 1702 * @param p_spad_count Number ref Spad Count
sepp_nepp 6:fb11b746ceb5 1703 * @param p_is_aperture_spads Reports if spads are of type
sepp_nepp 6:fb11b746ceb5 1704 * aperture or non-aperture.
sepp_nepp 6:fb11b746ceb5 1705 * 1:=aperture, 0:=Non-Aperture
sepp_nepp 6:fb11b746ceb5 1706 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1707 * @return VL53L0X_ERROR_REF_SPAD_INIT Error in the in the reference
sepp_nepp 6:fb11b746ceb5 1708 * spad configuration.
sepp_nepp 6:fb11b746ceb5 1709 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1710 */
sepp_nepp 7:3a1115c2556b 1711 VL53L0X_Error wrapped_VL53L0X_get_reference_spads(
sepp_nepp 6:fb11b746ceb5 1712 uint32_t *p_spad_count, uint8_t *p_is_aperture_spads);
sepp_nepp 6:fb11b746ceb5 1713
sepp_nepp 6:fb11b746ceb5 1714 /**
sepp_nepp 6:fb11b746ceb5 1715 * @brief Gets the (on/off) state of a requested sequence step.
sepp_nepp 6:fb11b746ceb5 1716 *
sepp_nepp 6:fb11b746ceb5 1717 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1718 * This function retrieves the state of a requested sequence step, i.e. on/off.
sepp_nepp 6:fb11b746ceb5 1719 *
sepp_nepp 6:fb11b746ceb5 1720 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1721 *
sepp_nepp 7:3a1115c2556b 1722 *
sepp_nepp 6:fb11b746ceb5 1723 * @param sequence_step_id Sequence step identifier.
sepp_nepp 6:fb11b746ceb5 1724 * @param p_sequence_step_enabled Out parameter reporting if the sequence step
sepp_nepp 6:fb11b746ceb5 1725 * is enabled {0=Off,1=On}.
sepp_nepp 6:fb11b746ceb5 1726 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1727 * @return VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
sepp_nepp 6:fb11b746ceb5 1728 * supported.
sepp_nepp 6:fb11b746ceb5 1729 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1730 */
sepp_nepp 7:3a1115c2556b 1731 VL53L0X_Error VL53L0X_get_sequence_step_enable(
sepp_nepp 6:fb11b746ceb5 1732 VL53L0X_SequenceStepId sequence_step_id, uint8_t *p_sequence_step_enabled);
sepp_nepp 6:fb11b746ceb5 1733
sepp_nepp 6:fb11b746ceb5 1734 /**
sepp_nepp 6:fb11b746ceb5 1735 * @brief Gets the timeout of a requested sequence step.
sepp_nepp 6:fb11b746ceb5 1736 *
sepp_nepp 6:fb11b746ceb5 1737 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1738 * This function retrieves the timeout of a requested sequence step.
sepp_nepp 6:fb11b746ceb5 1739 *
sepp_nepp 6:fb11b746ceb5 1740 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1741 *
sepp_nepp 6:fb11b746ceb5 1742 * @param sequence_step_id Sequence step identifier.
sepp_nepp 6:fb11b746ceb5 1743 * @param p_time_out_milli_secs Timeout value.
sepp_nepp 6:fb11b746ceb5 1744 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1745 * @return VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
sepp_nepp 6:fb11b746ceb5 1746 * supported.
sepp_nepp 6:fb11b746ceb5 1747 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1748 */
sepp_nepp 8:2fd7cb217068 1749 VL53L0X_Error VL53L0X_get_sequence_step_timeout(VL53L0X_SequenceStepId sequence_step_id,
sepp_nepp 6:fb11b746ceb5 1750 FixPoint1616_t *p_time_out_milli_secs);
sepp_nepp 6:fb11b746ceb5 1751
sepp_nepp 6:fb11b746ceb5 1752 /**
sepp_nepp 6:fb11b746ceb5 1753 * @brief Sets the timeout of a requested sequence step.
sepp_nepp 6:fb11b746ceb5 1754 *
sepp_nepp 6:fb11b746ceb5 1755 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1756 * This function sets the timeout of a requested sequence step.
sepp_nepp 6:fb11b746ceb5 1757 *
sepp_nepp 6:fb11b746ceb5 1758 * @note This function Accesses the device
sepp_nepp 6:fb11b746ceb5 1759 *
sepp_nepp 7:3a1115c2556b 1760 *
sepp_nepp 6:fb11b746ceb5 1761 * @param sequence_step_id Sequence step identifier.
sepp_nepp 6:fb11b746ceb5 1762 * @param time_out_milli_secs Demanded timeout
sepp_nepp 6:fb11b746ceb5 1763 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1764 * @return VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not
sepp_nepp 6:fb11b746ceb5 1765 * supported.
sepp_nepp 6:fb11b746ceb5 1766 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1767 */
sepp_nepp 7:3a1115c2556b 1768 VL53L0X_Error VL53L0X_set_sequence_step_timeout(
sepp_nepp 6:fb11b746ceb5 1769 VL53L0X_SequenceStepId sequence_step_id, FixPoint1616_t time_out_milli_secs);
sepp_nepp 6:fb11b746ceb5 1770
sepp_nepp 6:fb11b746ceb5 1771 /**
sepp_nepp 6:fb11b746ceb5 1772 * @brief Get the tuning settings pointer and the internal external switch
sepp_nepp 6:fb11b746ceb5 1773 * value.
sepp_nepp 6:fb11b746ceb5 1774 *
sepp_nepp 6:fb11b746ceb5 1775 * This function is used to get the Tuning settings buffer pointer and the
sepp_nepp 6:fb11b746ceb5 1776 * value.
sepp_nepp 6:fb11b746ceb5 1777 * of the switch to select either external or internal tuning settings.
sepp_nepp 6:fb11b746ceb5 1778 *
sepp_nepp 6:fb11b746ceb5 1779 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1780 *
sepp_nepp 7:3a1115c2556b 1781 *
sepp_nepp 6:fb11b746ceb5 1782 * @param pp_tuning_setting_buffer Pointer to tuning settings buffer.
sepp_nepp 6:fb11b746ceb5 1783 * @param p_use_internal_tuning_settings Pointer to store Use internal tuning
sepp_nepp 6:fb11b746ceb5 1784 * settings value.
sepp_nepp 6:fb11b746ceb5 1785 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1786 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1787 */
sepp_nepp 7:3a1115c2556b 1788 VL53L0X_Error VL53L0X_get_tuning_setting_buffer(
sepp_nepp 6:fb11b746ceb5 1789 uint8_t **pp_tuning_setting_buffer, uint8_t *p_use_internal_tuning_settings);
sepp_nepp 6:fb11b746ceb5 1790
sepp_nepp 6:fb11b746ceb5 1791 /**
sepp_nepp 6:fb11b746ceb5 1792 * @brief Set the tuning settings pointer
sepp_nepp 6:fb11b746ceb5 1793 *
sepp_nepp 6:fb11b746ceb5 1794 * This function is used to specify the Tuning settings buffer to be used
sepp_nepp 6:fb11b746ceb5 1795 * for a given device. The buffer contains all the necessary data to permit
sepp_nepp 6:fb11b746ceb5 1796 * the API to write tuning settings.
sepp_nepp 6:fb11b746ceb5 1797 * This function permit to force the usage of either external or internal
sepp_nepp 6:fb11b746ceb5 1798 * tuning settings.
sepp_nepp 6:fb11b746ceb5 1799 *
sepp_nepp 6:fb11b746ceb5 1800 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1801 *
sepp_nepp 7:3a1115c2556b 1802 *
sepp_nepp 6:fb11b746ceb5 1803 * @param p_tuning_setting_buffer Pointer to tuning settings buffer.
sepp_nepp 6:fb11b746ceb5 1804 * @param use_internal_tuning_settings Use internal tuning settings value.
sepp_nepp 6:fb11b746ceb5 1805 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1806 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1807 */
sepp_nepp 7:3a1115c2556b 1808 VL53L0X_Error VL53L0X_set_tuning_setting_buffer(
sepp_nepp 6:fb11b746ceb5 1809 uint8_t *p_tuning_setting_buffer, uint8_t use_internal_tuning_settings);
sepp_nepp 6:fb11b746ceb5 1810
sepp_nepp 6:fb11b746ceb5 1811 /**
sepp_nepp 6:fb11b746ceb5 1812 * @defgroup VL53L0X_registerAccess_group PAL Register Access Functions
sepp_nepp 6:fb11b746ceb5 1813 * @brief PAL Register Access Functions
sepp_nepp 6:fb11b746ceb5 1814 * @{
sepp_nepp 6:fb11b746ceb5 1815 */
sepp_nepp 6:fb11b746ceb5 1816
sepp_nepp 6:fb11b746ceb5 1817 /**
sepp_nepp 6:fb11b746ceb5 1818 * @brief Prepare device for operation
sepp_nepp 6:fb11b746ceb5 1819 * @par Function Description
sepp_nepp 6:fb11b746ceb5 1820 * Update device with provided parameters
sepp_nepp 6:fb11b746ceb5 1821 * @li Then start ranging operation.
sepp_nepp 6:fb11b746ceb5 1822 *
sepp_nepp 6:fb11b746ceb5 1823 * @note This function Access to the device
sepp_nepp 6:fb11b746ceb5 1824 *
sepp_nepp 7:3a1115c2556b 1825 *
sepp_nepp 6:fb11b746ceb5 1826 * @param pDeviceParameters Pointer to store current device parameters.
sepp_nepp 6:fb11b746ceb5 1827 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 6:fb11b746ceb5 1828 * @return "Other error code" See ::VL53L0X_Error
sepp_nepp 6:fb11b746ceb5 1829 */
sepp_nepp 7:3a1115c2556b 1830 VL53L0X_Error vl53L0x_set_device_parameters(
sepp_nepp 6:fb11b746ceb5 1831 const VL53L0X_DeviceParameters_t *pDeviceParameters);
sepp_nepp 6:fb11b746ceb5 1832
sepp_nepp 6:fb11b746ceb5 1833 VL53L0X_Error VL53L0X_reverse_bytes(uint8_t *data, uint32_t size);
sepp_nepp 6:fb11b746ceb5 1834
sepp_nepp 6:fb11b746ceb5 1835 int range_meas_int_continuous_mode(void (*fptr)(void));
sepp_nepp 6:fb11b746ceb5 1836
sepp_nepp 6:fb11b746ceb5 1837 /* Digital out pin */
sepp_nepp 6:fb11b746ceb5 1838 DigitalOut *_gpio0;
sepp_nepp 6:fb11b746ceb5 1839 /* Measure detection IRQ */
sepp_nepp 6:fb11b746ceb5 1840 InterruptIn *_gpio1Int;
sepp_nepp 8:2fd7cb217068 1841
sepp_nepp 8:2fd7cb217068 1842 VL53L0X_DevData_t Data;
sepp_nepp 10:cd1758e186a4 1843 VL53L0X_DeviceInfo_t Device_Info;
sepp_nepp 10:cd1758e186a4 1844 VL53L0X_DeviceParameters_t CurrentParameters; /*!< Current Device Parameter */
sepp_nepp 8:2fd7cb217068 1845
sepp_nepp 10:cd1758e186a4 1846 public:
sepp_nepp 8:2fd7cb217068 1847 /* IO Device */
sepp_nepp 8:2fd7cb217068 1848 I2C *_dev_i2c;
sepp_nepp 7:3a1115c2556b 1849 uint8_t I2cDevAddr; /*!< i2c device address user specific field */
sepp_nepp 7:3a1115c2556b 1850 uint8_t comms_type; /*!< Type of comms : VL53L0X_COMMS_I2C or VL53L0X_COMMS_SPI */
sepp_nepp 7:3a1115c2556b 1851 uint16_t comms_speed_khz; /*!< Comms speed [kHz] : typically 400kHz for I2C */
sepp_nepp 10:cd1758e186a4 1852
sepp_nepp 10:cd1758e186a4 1853 /* Write and read functions from I2C */
sepp_nepp 10:cd1758e186a4 1854 /** Write single byte register
sepp_nepp 10:cd1758e186a4 1855 *
sepp_nepp 10:cd1758e186a4 1856 * @param index The register index
sepp_nepp 10:cd1758e186a4 1857 * @param data 8 bit register data
sepp_nepp 10:cd1758e186a4 1858 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1859 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1860
sepp_nepp 10:cd1758e186a4 1861 VL53L0X_Error VL53L0X_write_byte( uint8_t index, uint8_t data);
sepp_nepp 10:cd1758e186a4 1862 /** Write word register
sepp_nepp 10:cd1758e186a4 1863 *
sepp_nepp 10:cd1758e186a4 1864 * @param index The register index
sepp_nepp 10:cd1758e186a4 1865 * @param data 16 bit register data
sepp_nepp 10:cd1758e186a4 1866 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1867 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1868
sepp_nepp 10:cd1758e186a4 1869 VL53L0X_Error VL53L0X_write_word( uint8_t index, uint16_t data);
sepp_nepp 10:cd1758e186a4 1870 /** Write double word (4 byte) register
sepp_nepp 10:cd1758e186a4 1871 *
sepp_nepp 10:cd1758e186a4 1872 * @param index The register index
sepp_nepp 10:cd1758e186a4 1873 * @param data 32 bit register data
sepp_nepp 10:cd1758e186a4 1874 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1875 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1876
sepp_nepp 10:cd1758e186a4 1877 VL53L0X_Error VL53L0X_write_dword( uint8_t index, uint32_t data);
sepp_nepp 10:cd1758e186a4 1878 /** Read single byte register
sepp_nepp 10:cd1758e186a4 1879 *
sepp_nepp 10:cd1758e186a4 1880 * @param index The register index
sepp_nepp 10:cd1758e186a4 1881 * @param data pointer to 8 bit data
sepp_nepp 10:cd1758e186a4 1882 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1883 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1884
sepp_nepp 10:cd1758e186a4 1885 VL53L0X_Error VL53L0X_read_byte( uint8_t index, uint8_t *p_data);
sepp_nepp 10:cd1758e186a4 1886 /** Read word (2byte) register
sepp_nepp 10:cd1758e186a4 1887 *
sepp_nepp 10:cd1758e186a4 1888 * @param index The register index
sepp_nepp 10:cd1758e186a4 1889 * @param data pointer to 16 bit data
sepp_nepp 10:cd1758e186a4 1890 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1891 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1892
sepp_nepp 10:cd1758e186a4 1893 VL53L0X_Error VL53L0X_read_word( uint8_t index, uint16_t *p_data);
sepp_nepp 10:cd1758e186a4 1894 /** Read dword (4byte) register
sepp_nepp 10:cd1758e186a4 1895 *
sepp_nepp 10:cd1758e186a4 1896 * @param index The register index
sepp_nepp 10:cd1758e186a4 1897 * @param data pointer to 32 bit data
sepp_nepp 10:cd1758e186a4 1898 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1899 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1900 VL53L0X_Error VL53L0X_read_dword( uint8_t index, uint32_t *p_data);
sepp_nepp 10:cd1758e186a4 1901
sepp_nepp 10:cd1758e186a4 1902 /** Thread safe Update (read/modify/write) single byte register
sepp_nepp 10:cd1758e186a4 1903 *
sepp_nepp 10:cd1758e186a4 1904 * Final_reg = (Initial_reg & and_data) |or_data
sepp_nepp 10:cd1758e186a4 1905 *
sepp_nepp 10:cd1758e186a4 1906 * @param index The register index
sepp_nepp 10:cd1758e186a4 1907 * @param and_data 8 bit and data
sepp_nepp 10:cd1758e186a4 1908 * @param or_data 8 bit or data
sepp_nepp 10:cd1758e186a4 1909 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1910 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1911 VL53L0X_Error VL53L0X_update_byte( uint8_t index, uint8_t and_data, uint8_t or_data);
sepp_nepp 10:cd1758e186a4 1912
sepp_nepp 10:cd1758e186a4 1913 /** Reads the requested number of bytes from the device
sepp_nepp 10:cd1758e186a4 1914 *
sepp_nepp 10:cd1758e186a4 1915 * @param index The register index
sepp_nepp 10:cd1758e186a4 1916 * @param p_data Pointer to the uint8_t buffer to store read data
sepp_nepp 10:cd1758e186a4 1917 * @param count Number of uint8_t's to read
sepp_nepp 10:cd1758e186a4 1918 * @return VL53L0X_ERROR_NONE Success
sepp_nepp 10:cd1758e186a4 1919 * @return "Other error code" See ::VL53L0X_Error */
sepp_nepp 10:cd1758e186a4 1920 VL53L0X_Error VL53L0X_read_multi( uint8_t index, uint8_t *p_data, uint32_t count);
sepp_nepp 10:cd1758e186a4 1921
sepp_nepp 10:cd1758e186a4 1922 /** @brief Writes a buffer towards the I2C peripheral device.
sepp_nepp 8:2fd7cb217068 1923 *
sepp_nepp 8:2fd7cb217068 1924 * @param p_data pointer to the byte-array data to send
sepp_nepp 8:2fd7cb217068 1925 * @param number_of_bytes number of bytes to be written.
sepp_nepp 6:fb11b746ceb5 1926 * @retval 0 if ok,
sepp_nepp 6:fb11b746ceb5 1927 * @retval -1 if an I2C error has occured
sepp_nepp 6:fb11b746ceb5 1928 * @note On some devices if NumByteToWrite is greater
sepp_nepp 10:cd1758e186a4 1929 * than one, the RegisterAddr must be masked correctly! */
sepp_nepp 8:2fd7cb217068 1930 VL53L0X_Error VL53L0X_i2c_write(uint8_t index, uint8_t *p_data, uint16_t number_of_bytes);
sepp_nepp 8:2fd7cb217068 1931
sepp_nepp 10:cd1758e186a4 1932 /** @brief Reads a buffer from the I2C peripheral device.
sepp_nepp 8:2fd7cb217068 1933 *
sepp_nepp 8:2fd7cb217068 1934 * @param p_data pointer to the byte-array to read data in to
sepp_nepp 8:2fd7cb217068 1935 * @param number_of_bytes number of bytes to be read.
sepp_nepp 8:2fd7cb217068 1936 * @retval 0 if ok,
sepp_nepp 8:2fd7cb217068 1937 * @retval -1 if an I2C error has occured
sepp_nepp 8:2fd7cb217068 1938 * @note On some devices if NumByteToWrite is greater
sepp_nepp 10:cd1758e186a4 1939 * than one, the RegisterAddr must be masked correctly! */
sepp_nepp 8:2fd7cb217068 1940 VL53L0X_Error VL53L0X_i2c_read(uint8_t index, uint8_t *p_data, uint16_t number_of_bytes);
sepp_nepp 6:fb11b746ceb5 1941 };
sepp_nepp 6:fb11b746ceb5 1942
sepp_nepp 6:fb11b746ceb5 1943 #endif /* _VL53L0X_CLASS_H_ */