Pablo Henrique
/
STM32F103C8T6_VL53l0x_CAN
code for read VL53l0x sensor with CAN
VL53L0X_simple/VL53L0X_2nd.h@1:7bbfe329c62b, 2019-03-18 (annotated)
- Committer:
- pablo_bmxrp
- Date:
- Mon Mar 18 22:45:39 2019 +0000
- Revision:
- 1:7bbfe329c62b
- Parent:
- STM32F103C8T6_MPA/VL53L0X_simple/VL53L0X_2nd.h@0:44429c0a71d4
V1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pablo_bmxrp | 0:44429c0a71d4 | 1 | |
pablo_bmxrp | 0:44429c0a71d4 | 2 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 3 | * @brief Start the measure indicated by operating mode |
pablo_bmxrp | 0:44429c0a71d4 | 4 | * @param[in] operating_mode specifies requested measure |
pablo_bmxrp | 0:44429c0a71d4 | 5 | * @param[in] fptr specifies call back function must be !NULL in case of interrupt measure |
pablo_bmxrp | 0:44429c0a71d4 | 6 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 7 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 8 | int start_measurement(OperatingMode operating_mode, void (*fptr)(void)); |
pablo_bmxrp | 0:44429c0a71d4 | 9 | |
pablo_bmxrp | 0:44429c0a71d4 | 10 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 11 | * @brief Get results for the measure indicated by operating mode |
pablo_bmxrp | 0:44429c0a71d4 | 12 | * @param[in] operating_mode specifies requested measure results |
pablo_bmxrp | 0:44429c0a71d4 | 13 | * @param[out] p_data pointer to the MeasureData_t structure to read data in to |
pablo_bmxrp | 0:44429c0a71d4 | 14 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 15 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 16 | int get_measurement(OperatingMode operating_mode, VL53L0X_RangingMeasurementData_t *p_data); |
pablo_bmxrp | 0:44429c0a71d4 | 17 | |
pablo_bmxrp | 0:44429c0a71d4 | 18 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 19 | * @brief Stop the currently running measure indicate by operating_mode |
pablo_bmxrp | 0:44429c0a71d4 | 20 | * @param[in] operating_mode specifies requested measure to stop |
pablo_bmxrp | 0:44429c0a71d4 | 21 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 22 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 23 | int stop_measurement(OperatingMode operating_mode); |
pablo_bmxrp | 0:44429c0a71d4 | 24 | |
pablo_bmxrp | 0:44429c0a71d4 | 25 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 26 | * @brief Interrupt handling func to be called by user after an INT is occourred |
pablo_bmxrp | 0:44429c0a71d4 | 27 | * @param[in] opeating_mode indicating the in progress measure |
pablo_bmxrp | 0:44429c0a71d4 | 28 | * @param[out] Data pointer to the MeasureData_t structure to read data in to |
pablo_bmxrp | 0:44429c0a71d4 | 29 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 30 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 31 | int handle_irq(OperatingMode operating_mode, VL53L0X_RangingMeasurementData_t *data); |
pablo_bmxrp | 0:44429c0a71d4 | 32 | |
pablo_bmxrp | 0:44429c0a71d4 | 33 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 34 | * @brief Enable interrupt measure IRQ |
pablo_bmxrp | 0:44429c0a71d4 | 35 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 36 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 37 | void enable_interrupt_measure_detection_irq(void) |
pablo_bmxrp | 0:44429c0a71d4 | 38 | { |
pablo_bmxrp | 0:44429c0a71d4 | 39 | if (_gpio1Int != NULL) { |
pablo_bmxrp | 0:44429c0a71d4 | 40 | _gpio1Int->enable_irq(); |
pablo_bmxrp | 0:44429c0a71d4 | 41 | } |
pablo_bmxrp | 0:44429c0a71d4 | 42 | } |
pablo_bmxrp | 0:44429c0a71d4 | 43 | |
pablo_bmxrp | 0:44429c0a71d4 | 44 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 45 | * @brief Disable interrupt measure IRQ |
pablo_bmxrp | 0:44429c0a71d4 | 46 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 47 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 48 | void disable_interrupt_measure_detection_irq(void) |
pablo_bmxrp | 0:44429c0a71d4 | 49 | { |
pablo_bmxrp | 0:44429c0a71d4 | 50 | if (_gpio1Int != NULL) { |
pablo_bmxrp | 0:44429c0a71d4 | 51 | _gpio1Int->disable_irq(); |
pablo_bmxrp | 0:44429c0a71d4 | 52 | } |
pablo_bmxrp | 0:44429c0a71d4 | 53 | } |
pablo_bmxrp | 0:44429c0a71d4 | 54 | |
pablo_bmxrp | 0:44429c0a71d4 | 55 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 56 | * @brief Attach a function to call when an interrupt is detected, i.e. measurement is ready |
pablo_bmxrp | 0:44429c0a71d4 | 57 | * @param[in] fptr pointer to call back function to be called whenever an interrupt occours |
pablo_bmxrp | 0:44429c0a71d4 | 58 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 59 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 60 | void attach_interrupt_measure_detection_irq(void (*fptr)(void)) |
pablo_bmxrp | 0:44429c0a71d4 | 61 | { |
pablo_bmxrp | 0:44429c0a71d4 | 62 | if (_gpio1Int != NULL) { |
pablo_bmxrp | 0:44429c0a71d4 | 63 | _gpio1Int->rise(fptr); |
pablo_bmxrp | 0:44429c0a71d4 | 64 | } |
pablo_bmxrp | 0:44429c0a71d4 | 65 | } |
pablo_bmxrp | 0:44429c0a71d4 | 66 | |
pablo_bmxrp | 0:44429c0a71d4 | 67 | |
pablo_bmxrp | 0:44429c0a71d4 | 68 | /** Wrapper functions */ |
pablo_bmxrp | 0:44429c0a71d4 | 69 | /** @defgroup api_init Init functions |
pablo_bmxrp | 0:44429c0a71d4 | 70 | * @brief API init functions |
pablo_bmxrp | 0:44429c0a71d4 | 71 | * @ingroup api_hl |
pablo_bmxrp | 0:44429c0a71d4 | 72 | * @{ |
pablo_bmxrp | 0:44429c0a71d4 | 73 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 74 | |
pablo_bmxrp | 0:44429c0a71d4 | 75 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 76 | * |
pablo_bmxrp | 0:44429c0a71d4 | 77 | * @brief One time device initialization |
pablo_bmxrp | 0:44429c0a71d4 | 78 | * |
pablo_bmxrp | 0:44429c0a71d4 | 79 | * To be called once and only once after device is brought out of reset (Chip enable) and booted. |
pablo_bmxrp | 0:44429c0a71d4 | 80 | * |
pablo_bmxrp | 0:44429c0a71d4 | 81 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 82 | * When not used after a fresh device "power up" or reset, it may return @a #CALIBRATION_WARNING |
pablo_bmxrp | 0:44429c0a71d4 | 83 | * meaning wrong calibration data may have been fetched from device that can result in ranging offset error\n |
pablo_bmxrp | 0:44429c0a71d4 | 84 | * If application cannot execute device reset or need to run VL53L0X_data_init multiple time |
pablo_bmxrp | 0:44429c0a71d4 | 85 | * then it must ensure proper offset calibration saving and restore on its own |
pablo_bmxrp | 0:44429c0a71d4 | 86 | * by using @a VL53L0X_get_offset_calibration_data_micro_meter() on first power up and then @a VL53L0X_set_offset_calibration_data_micro_meter() all all subsequent init |
pablo_bmxrp | 0:44429c0a71d4 | 87 | * |
pablo_bmxrp | 0:44429c0a71d4 | 88 | * @param void |
pablo_bmxrp | 0:44429c0a71d4 | 89 | * @return "0" on success, @a #CALIBRATION_WARNING if failed |
pablo_bmxrp | 0:44429c0a71d4 | 90 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 91 | virtual int init(void *init) |
pablo_bmxrp | 0:44429c0a71d4 | 92 | { |
pablo_bmxrp | 0:44429c0a71d4 | 93 | return VL53L0X_data_init(_device); |
pablo_bmxrp | 0:44429c0a71d4 | 94 | } |
pablo_bmxrp | 0:44429c0a71d4 | 95 | |
pablo_bmxrp | 0:44429c0a71d4 | 96 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 97 | * @brief Prepare device for operation |
pablo_bmxrp | 0:44429c0a71d4 | 98 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 99 | * Does static initialization and reprogram common default settings \n |
pablo_bmxrp | 0:44429c0a71d4 | 100 | * Device is prepared for new measure, ready single shot ranging or ALS typical polling operation\n |
pablo_bmxrp | 0:44429c0a71d4 | 101 | * After prepare user can : \n |
pablo_bmxrp | 0:44429c0a71d4 | 102 | * @li Call other API function to set other settings\n |
pablo_bmxrp | 0:44429c0a71d4 | 103 | * @li Configure the interrupt pins, etc... \n |
pablo_bmxrp | 0:44429c0a71d4 | 104 | * @li Then start ranging or ALS operations in single shot or continuous mode |
pablo_bmxrp | 0:44429c0a71d4 | 105 | * |
pablo_bmxrp | 0:44429c0a71d4 | 106 | * @param void |
pablo_bmxrp | 0:44429c0a71d4 | 107 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 108 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 109 | int prepare() |
pablo_bmxrp | 0:44429c0a71d4 | 110 | { |
pablo_bmxrp | 0:44429c0a71d4 | 111 | VL53L0X_Error status = VL53L0X_ERROR_NONE; |
pablo_bmxrp | 0:44429c0a71d4 | 112 | uint32_t ref_spad_count; |
pablo_bmxrp | 0:44429c0a71d4 | 113 | uint8_t is_aperture_spads; |
pablo_bmxrp | 0:44429c0a71d4 | 114 | uint8_t vhv_settings; |
pablo_bmxrp | 0:44429c0a71d4 | 115 | uint8_t phase_cal; |
pablo_bmxrp | 0:44429c0a71d4 | 116 | |
pablo_bmxrp | 0:44429c0a71d4 | 117 | if (status == VL53L0X_ERROR_NONE) { |
pablo_bmxrp | 0:44429c0a71d4 | 118 | //printf("Call of VL53L0X_StaticInit\r\n"); |
pablo_bmxrp | 0:44429c0a71d4 | 119 | status = VL53L0X_static_init(_device); // Device Initialization |
pablo_bmxrp | 0:44429c0a71d4 | 120 | } |
pablo_bmxrp | 0:44429c0a71d4 | 121 | |
pablo_bmxrp | 0:44429c0a71d4 | 122 | if (status == VL53L0X_ERROR_NONE) { |
pablo_bmxrp | 0:44429c0a71d4 | 123 | //printf("Call of VL53L0X_PerformRefCalibration\r\n"); |
pablo_bmxrp | 0:44429c0a71d4 | 124 | status = VL53L0X_perform_ref_calibration(_device, |
pablo_bmxrp | 0:44429c0a71d4 | 125 | &vhv_settings, &phase_cal); // Device Initialization |
pablo_bmxrp | 0:44429c0a71d4 | 126 | } |
pablo_bmxrp | 0:44429c0a71d4 | 127 | |
pablo_bmxrp | 0:44429c0a71d4 | 128 | if (status == VL53L0X_ERROR_NONE) { |
pablo_bmxrp | 0:44429c0a71d4 | 129 | //printf("Call of VL53L0X_PerformRefSpadManagement\r\n"); |
pablo_bmxrp | 0:44429c0a71d4 | 130 | status = VL53L0X_perform_ref_spad_management(_device, |
pablo_bmxrp | 0:44429c0a71d4 | 131 | &ref_spad_count, &is_aperture_spads); // Device Initialization |
pablo_bmxrp | 0:44429c0a71d4 | 132 | // printf ("refSpadCount = %d, isApertureSpads = %d\r\n", refSpadCount, isApertureSpads); |
pablo_bmxrp | 0:44429c0a71d4 | 133 | } |
pablo_bmxrp | 0:44429c0a71d4 | 134 | |
pablo_bmxrp | 0:44429c0a71d4 | 135 | return status; |
pablo_bmxrp | 0:44429c0a71d4 | 136 | } |
pablo_bmxrp | 0:44429c0a71d4 | 137 | |
pablo_bmxrp | 0:44429c0a71d4 | 138 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 139 | * @brief Start continuous ranging mode |
pablo_bmxrp | 0:44429c0a71d4 | 140 | * |
pablo_bmxrp | 0:44429c0a71d4 | 141 | * @details End user should ensure device is in idle state and not already running |
pablo_bmxrp | 0:44429c0a71d4 | 142 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 143 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 144 | int range_start_continuous_mode() |
pablo_bmxrp | 0:44429c0a71d4 | 145 | { |
pablo_bmxrp | 0:44429c0a71d4 | 146 | int status; |
pablo_bmxrp | 0:44429c0a71d4 | 147 | status = VL53L0X_set_device_mode(_device, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING); |
pablo_bmxrp | 0:44429c0a71d4 | 148 | |
pablo_bmxrp | 0:44429c0a71d4 | 149 | if (status == VL53L0X_ERROR_NONE) { |
pablo_bmxrp | 0:44429c0a71d4 | 150 | //printf ("Call of VL53L0X_StartMeasurement\r\n"); |
pablo_bmxrp | 0:44429c0a71d4 | 151 | status = VL53L0X_start_measurement(_device); |
pablo_bmxrp | 0:44429c0a71d4 | 152 | } |
pablo_bmxrp | 0:44429c0a71d4 | 153 | |
pablo_bmxrp | 0:44429c0a71d4 | 154 | return status; |
pablo_bmxrp | 0:44429c0a71d4 | 155 | } |
pablo_bmxrp | 0:44429c0a71d4 | 156 | |
pablo_bmxrp | 0:44429c0a71d4 | 157 | //------- Feburary 4th, 2018 by JH1PJL / K.Arai -------------------------------- |
pablo_bmxrp | 0:44429c0a71d4 | 158 | #if ORIGINAL |
pablo_bmxrp | 0:44429c0a71d4 | 159 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 160 | * @brief Get ranging result and only that |
pablo_bmxrp | 0:44429c0a71d4 | 161 | * |
pablo_bmxrp | 0:44429c0a71d4 | 162 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 163 | * Unlike @a VL53L0X_get_ranging_measurement_data() this function only retrieves the range in millimeter \n |
pablo_bmxrp | 0:44429c0a71d4 | 164 | * It does any required up-scale translation\n |
pablo_bmxrp | 0:44429c0a71d4 | 165 | * It can be called after success status polling or in interrupt mode \n |
pablo_bmxrp | 0:44429c0a71d4 | 166 | * @warning these function is not doing wrap around filtering \n |
pablo_bmxrp | 0:44429c0a71d4 | 167 | * This function doesn't perform any data ready check! |
pablo_bmxrp | 0:44429c0a71d4 | 168 | * |
pablo_bmxrp | 0:44429c0a71d4 | 169 | * @param p_data Pointer to range distance |
pablo_bmxrp | 0:44429c0a71d4 | 170 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 171 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 172 | virtual int get_distance(uint32_t *p_data) |
pablo_bmxrp | 0:44429c0a71d4 | 173 | { |
pablo_bmxrp | 0:44429c0a71d4 | 174 | int status = 0; |
pablo_bmxrp | 0:44429c0a71d4 | 175 | VL53L0X_RangingMeasurementData_t p_ranging_measurement_data; |
pablo_bmxrp | 0:44429c0a71d4 | 176 | |
pablo_bmxrp | 0:44429c0a71d4 | 177 | status = start_measurement(range_single_shot_polling, NULL); |
pablo_bmxrp | 0:44429c0a71d4 | 178 | if (!status) { |
pablo_bmxrp | 0:44429c0a71d4 | 179 | status = get_measurement(range_single_shot_polling, &p_ranging_measurement_data); |
pablo_bmxrp | 0:44429c0a71d4 | 180 | } |
pablo_bmxrp | 0:44429c0a71d4 | 181 | if (p_ranging_measurement_data.RangeStatus == 0) { |
pablo_bmxrp | 0:44429c0a71d4 | 182 | // we have a valid range. |
pablo_bmxrp | 0:44429c0a71d4 | 183 | *p_data = p_ranging_measurement_data.RangeMilliMeter; |
pablo_bmxrp | 0:44429c0a71d4 | 184 | } else { |
pablo_bmxrp | 0:44429c0a71d4 | 185 | *p_data = 0; |
pablo_bmxrp | 0:44429c0a71d4 | 186 | status = VL53L0X_ERROR_RANGE_ERROR; |
pablo_bmxrp | 0:44429c0a71d4 | 187 | } |
pablo_bmxrp | 0:44429c0a71d4 | 188 | stop_measurement(range_single_shot_polling); |
pablo_bmxrp | 0:44429c0a71d4 | 189 | return status; |
pablo_bmxrp | 0:44429c0a71d4 | 190 | } |
pablo_bmxrp | 0:44429c0a71d4 | 191 | #endif |
pablo_bmxrp | 0:44429c0a71d4 | 192 | |
pablo_bmxrp | 0:44429c0a71d4 | 193 | /** @} */ |
pablo_bmxrp | 0:44429c0a71d4 | 194 | |
pablo_bmxrp | 0:44429c0a71d4 | 195 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 196 | * @brief Set new device i2c address |
pablo_bmxrp | 0:44429c0a71d4 | 197 | * |
pablo_bmxrp | 0:44429c0a71d4 | 198 | * After completion the device will answer to the new address programmed. |
pablo_bmxrp | 0:44429c0a71d4 | 199 | * |
pablo_bmxrp | 0:44429c0a71d4 | 200 | * @param new_addr The new i2c address (7bit) |
pablo_bmxrp | 0:44429c0a71d4 | 201 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 202 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 203 | int set_device_address(int new_addr) |
pablo_bmxrp | 0:44429c0a71d4 | 204 | { |
pablo_bmxrp | 0:44429c0a71d4 | 205 | int status; |
pablo_bmxrp | 0:44429c0a71d4 | 206 | |
pablo_bmxrp | 0:44429c0a71d4 | 207 | status = VL53L0X_set_device_address(_device, new_addr); |
pablo_bmxrp | 0:44429c0a71d4 | 208 | if (!status) { |
pablo_bmxrp | 0:44429c0a71d4 | 209 | _device->I2cDevAddr = new_addr; |
pablo_bmxrp | 0:44429c0a71d4 | 210 | } |
pablo_bmxrp | 0:44429c0a71d4 | 211 | return status; |
pablo_bmxrp | 0:44429c0a71d4 | 212 | |
pablo_bmxrp | 0:44429c0a71d4 | 213 | } |
pablo_bmxrp | 0:44429c0a71d4 | 214 | |
pablo_bmxrp | 0:44429c0a71d4 | 215 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 216 | * @brief Clear given system interrupt condition |
pablo_bmxrp | 0:44429c0a71d4 | 217 | * |
pablo_bmxrp | 0:44429c0a71d4 | 218 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 219 | * Clear given interrupt cause by writing into register #SYSTEM_INTERRUPT_CLEAR register. |
pablo_bmxrp | 0:44429c0a71d4 | 220 | * @param dev The device |
pablo_bmxrp | 0:44429c0a71d4 | 221 | * @param int_clear Which interrupt source to clear. Use any combinations of #INTERRUPT_CLEAR_RANGING , #INTERRUPT_CLEAR_ALS , #INTERRUPT_CLEAR_ERROR. |
pablo_bmxrp | 0:44429c0a71d4 | 222 | * @return "0" on success |
pablo_bmxrp | 0:44429c0a71d4 | 223 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 224 | int clear_interrupt(uint8_t int_clear) |
pablo_bmxrp | 0:44429c0a71d4 | 225 | { |
pablo_bmxrp | 0:44429c0a71d4 | 226 | return VL53L0X_clear_interrupt_mask(_device, int_clear); |
pablo_bmxrp | 0:44429c0a71d4 | 227 | } |
pablo_bmxrp | 0:44429c0a71d4 | 228 | |
pablo_bmxrp | 0:44429c0a71d4 | 229 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 230 | * |
pablo_bmxrp | 0:44429c0a71d4 | 231 | * @brief Get the 53L0 device |
pablo_bmxrp | 0:44429c0a71d4 | 232 | * |
pablo_bmxrp | 0:44429c0a71d4 | 233 | * To be called to retrive the internal device descriptor to allow usage of |
pablo_bmxrp | 0:44429c0a71d4 | 234 | * low level API having device as parameter. To be called after set_device_address() |
pablo_bmxrp | 0:44429c0a71d4 | 235 | * (if any). |
pablo_bmxrp | 0:44429c0a71d4 | 236 | * |
pablo_bmxrp | 0:44429c0a71d4 | 237 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 238 | * To be called if low level API usage is needed as those functions requires |
pablo_bmxrp | 0:44429c0a71d4 | 239 | * device as a parameter.TICINIT. |
pablo_bmxrp | 0:44429c0a71d4 | 240 | * |
pablo_bmxrp | 0:44429c0a71d4 | 241 | * @note This function return a pointer to an object internal structure |
pablo_bmxrp | 0:44429c0a71d4 | 242 | * |
pablo_bmxrp | 0:44429c0a71d4 | 243 | * @param dev ptr to ptr to Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 244 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 245 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 246 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 247 | VL53L0X_Error vl53l0x_get_device(VL53L0X_DEV *dev) |
pablo_bmxrp | 0:44429c0a71d4 | 248 | { |
pablo_bmxrp | 0:44429c0a71d4 | 249 | *dev = _device; |
pablo_bmxrp | 0:44429c0a71d4 | 250 | return VL53L0X_ERROR_NONE; |
pablo_bmxrp | 0:44429c0a71d4 | 251 | } |
pablo_bmxrp | 0:44429c0a71d4 | 252 | |
pablo_bmxrp | 0:44429c0a71d4 | 253 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 254 | * |
pablo_bmxrp | 0:44429c0a71d4 | 255 | * @brief One time device initialization |
pablo_bmxrp | 0:44429c0a71d4 | 256 | * |
pablo_bmxrp | 0:44429c0a71d4 | 257 | * To be called once and only once after device is brought out of reset |
pablo_bmxrp | 0:44429c0a71d4 | 258 | * (Chip enable) and booted see @a VL53L0X_WaitDeviceBooted() |
pablo_bmxrp | 0:44429c0a71d4 | 259 | * |
pablo_bmxrp | 0:44429c0a71d4 | 260 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 261 | * When not used after a fresh device "power up" or reset, it may return |
pablo_bmxrp | 0:44429c0a71d4 | 262 | * @a #VL53L0X_ERROR_CALIBRATION_WARNING meaning wrong calibration data |
pablo_bmxrp | 0:44429c0a71d4 | 263 | * may have been fetched from device that can result in ranging offset error\n |
pablo_bmxrp | 0:44429c0a71d4 | 264 | * If application cannot execute device reset or need to run VL53L0X_DataInit |
pablo_bmxrp | 0:44429c0a71d4 | 265 | * multiple time then it must ensure proper offset calibration saving and |
pablo_bmxrp | 0:44429c0a71d4 | 266 | * restore on its own by using @a VL53L0X_GetOffsetCalibrationData() on first |
pablo_bmxrp | 0:44429c0a71d4 | 267 | * power up and then @a VL53L0X_SetOffsetCalibrationData() in all subsequent init |
pablo_bmxrp | 0:44429c0a71d4 | 268 | * This function will change the VL53L0X_State from VL53L0X_STATE_POWERDOWN to |
pablo_bmxrp | 0:44429c0a71d4 | 269 | * VL53L0X_STATE_WAIT_STATICINIT. |
pablo_bmxrp | 0:44429c0a71d4 | 270 | * |
pablo_bmxrp | 0:44429c0a71d4 | 271 | * @note This function accesses to the device |
pablo_bmxrp | 0:44429c0a71d4 | 272 | * |
pablo_bmxrp | 0:44429c0a71d4 | 273 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 274 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 275 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 276 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 277 | VL53L0X_Error VL53L0X_data_init(VL53L0X_DEV dev); |
pablo_bmxrp | 0:44429c0a71d4 | 278 | |
pablo_bmxrp | 0:44429c0a71d4 | 279 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 280 | * @brief Do basic device init (and eventually patch loading) |
pablo_bmxrp | 0:44429c0a71d4 | 281 | * This function will change the VL53L0X_State from |
pablo_bmxrp | 0:44429c0a71d4 | 282 | * VL53L0X_STATE_WAIT_STATICINIT to VL53L0X_STATE_IDLE. |
pablo_bmxrp | 0:44429c0a71d4 | 283 | * In this stage all default setting will be applied. |
pablo_bmxrp | 0:44429c0a71d4 | 284 | * |
pablo_bmxrp | 0:44429c0a71d4 | 285 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 286 | * |
pablo_bmxrp | 0:44429c0a71d4 | 287 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 288 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 289 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 290 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 291 | VL53L0X_Error VL53L0X_static_init(VL53L0X_DEV dev); |
pablo_bmxrp | 0:44429c0a71d4 | 292 | |
pablo_bmxrp | 0:44429c0a71d4 | 293 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 294 | * @brief Perform Reference Calibration |
pablo_bmxrp | 0:44429c0a71d4 | 295 | * |
pablo_bmxrp | 0:44429c0a71d4 | 296 | * @details Perform a reference calibration of the Device. |
pablo_bmxrp | 0:44429c0a71d4 | 297 | * This function should be run from time to time before doing |
pablo_bmxrp | 0:44429c0a71d4 | 298 | * a ranging measurement. |
pablo_bmxrp | 0:44429c0a71d4 | 299 | * This function will launch a special ranging measurement, so |
pablo_bmxrp | 0:44429c0a71d4 | 300 | * if interrupt are enable an interrupt will be done. |
pablo_bmxrp | 0:44429c0a71d4 | 301 | * This function will clear the interrupt generated automatically. |
pablo_bmxrp | 0:44429c0a71d4 | 302 | * |
pablo_bmxrp | 0:44429c0a71d4 | 303 | * @warning This function is a blocking function |
pablo_bmxrp | 0:44429c0a71d4 | 304 | * |
pablo_bmxrp | 0:44429c0a71d4 | 305 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 306 | * |
pablo_bmxrp | 0:44429c0a71d4 | 307 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 308 | * @param p_vhv_settings Pointer to vhv settings parameter. |
pablo_bmxrp | 0:44429c0a71d4 | 309 | * @param p_phase_cal Pointer to PhaseCal parameter. |
pablo_bmxrp | 0:44429c0a71d4 | 310 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 311 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 312 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 313 | VL53L0X_Error VL53L0X_perform_ref_calibration(VL53L0X_DEV dev, uint8_t *p_vhv_settings, |
pablo_bmxrp | 0:44429c0a71d4 | 314 | uint8_t *p_phase_cal); |
pablo_bmxrp | 0:44429c0a71d4 | 315 | |
pablo_bmxrp | 0:44429c0a71d4 | 316 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 317 | * @brief Get Reference Calibration Parameters |
pablo_bmxrp | 0:44429c0a71d4 | 318 | * |
pablo_bmxrp | 0:44429c0a71d4 | 319 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 320 | * Get Reference Calibration Parameters. |
pablo_bmxrp | 0:44429c0a71d4 | 321 | * |
pablo_bmxrp | 0:44429c0a71d4 | 322 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 323 | * |
pablo_bmxrp | 0:44429c0a71d4 | 324 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 325 | * @param p_vhv_settings Pointer to VHV parameter |
pablo_bmxrp | 0:44429c0a71d4 | 326 | * @param p_phase_cal Pointer to PhaseCal Parameter |
pablo_bmxrp | 0:44429c0a71d4 | 327 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 328 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 329 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 330 | VL53L0X_Error VL53L0X_get_ref_calibration(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 331 | uint8_t *p_vhv_settings, uint8_t *p_phase_cal); |
pablo_bmxrp | 0:44429c0a71d4 | 332 | |
pablo_bmxrp | 0:44429c0a71d4 | 333 | VL53L0X_Error VL53L0X_set_ref_calibration(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 334 | uint8_t vhv_settings, uint8_t phase_cal); |
pablo_bmxrp | 0:44429c0a71d4 | 335 | |
pablo_bmxrp | 0:44429c0a71d4 | 336 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 337 | * @brief Performs Reference Spad Management |
pablo_bmxrp | 0:44429c0a71d4 | 338 | * |
pablo_bmxrp | 0:44429c0a71d4 | 339 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 340 | * The reference SPAD initialization procedure determines the minimum amount |
pablo_bmxrp | 0:44429c0a71d4 | 341 | * of reference spads to be enables to achieve a target reference signal rate |
pablo_bmxrp | 0:44429c0a71d4 | 342 | * and should be performed once during initialization. |
pablo_bmxrp | 0:44429c0a71d4 | 343 | * |
pablo_bmxrp | 0:44429c0a71d4 | 344 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 345 | * |
pablo_bmxrp | 0:44429c0a71d4 | 346 | * @note This function change the device mode to |
pablo_bmxrp | 0:44429c0a71d4 | 347 | * VL53L0X_DEVICEMODE_SINGLE_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 348 | * |
pablo_bmxrp | 0:44429c0a71d4 | 349 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 350 | * @param ref_spad_count Reports ref Spad Count |
pablo_bmxrp | 0:44429c0a71d4 | 351 | * @param is_aperture_spads Reports if spads are of type |
pablo_bmxrp | 0:44429c0a71d4 | 352 | * aperture or non-aperture. |
pablo_bmxrp | 0:44429c0a71d4 | 353 | * 1:=aperture, 0:=Non-Aperture |
pablo_bmxrp | 0:44429c0a71d4 | 354 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 355 | * @return VL53L0X_ERROR_REF_SPAD_INIT Error in the Ref Spad procedure. |
pablo_bmxrp | 0:44429c0a71d4 | 356 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 357 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 358 | VL53L0X_Error VL53L0X_perform_ref_spad_management(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 359 | uint32_t *ref_spad_count, uint8_t *is_aperture_spads); |
pablo_bmxrp | 0:44429c0a71d4 | 360 | |
pablo_bmxrp | 0:44429c0a71d4 | 361 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 362 | * @brief Applies Reference SPAD configuration |
pablo_bmxrp | 0:44429c0a71d4 | 363 | * |
pablo_bmxrp | 0:44429c0a71d4 | 364 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 365 | * This function applies a given number of reference spads, identified as |
pablo_bmxrp | 0:44429c0a71d4 | 366 | * either Aperture or Non-Aperture. |
pablo_bmxrp | 0:44429c0a71d4 | 367 | * The requested spad count and type are stored within the device specific |
pablo_bmxrp | 0:44429c0a71d4 | 368 | * parameters data for access by the host. |
pablo_bmxrp | 0:44429c0a71d4 | 369 | * |
pablo_bmxrp | 0:44429c0a71d4 | 370 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 371 | * |
pablo_bmxrp | 0:44429c0a71d4 | 372 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 373 | * @param refSpadCount Number of ref spads. |
pablo_bmxrp | 0:44429c0a71d4 | 374 | * @param is_aperture_spads Defines if spads are of type |
pablo_bmxrp | 0:44429c0a71d4 | 375 | * aperture or non-aperture. |
pablo_bmxrp | 0:44429c0a71d4 | 376 | * 1:=aperture, 0:=Non-Aperture |
pablo_bmxrp | 0:44429c0a71d4 | 377 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 378 | * @return VL53L0X_ERROR_REF_SPAD_INIT Error in the in the reference |
pablo_bmxrp | 0:44429c0a71d4 | 379 | * spad configuration. |
pablo_bmxrp | 0:44429c0a71d4 | 380 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 381 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 382 | VL53L0X_Error VL53L0X_set_reference_spads(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 383 | uint32_t refSpadCount, uint8_t is_aperture_spads); |
pablo_bmxrp | 0:44429c0a71d4 | 384 | |
pablo_bmxrp | 0:44429c0a71d4 | 385 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 386 | * @brief Retrieves SPAD configuration |
pablo_bmxrp | 0:44429c0a71d4 | 387 | * |
pablo_bmxrp | 0:44429c0a71d4 | 388 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 389 | * This function retrieves the current number of applied reference spads |
pablo_bmxrp | 0:44429c0a71d4 | 390 | * and also their type : Aperture or Non-Aperture. |
pablo_bmxrp | 0:44429c0a71d4 | 391 | * |
pablo_bmxrp | 0:44429c0a71d4 | 392 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 393 | * |
pablo_bmxrp | 0:44429c0a71d4 | 394 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 395 | * @param p_spad_count Number ref Spad Count |
pablo_bmxrp | 0:44429c0a71d4 | 396 | * @param p_is_aperture_spads Reports if spads are of type |
pablo_bmxrp | 0:44429c0a71d4 | 397 | * aperture or non-aperture. |
pablo_bmxrp | 0:44429c0a71d4 | 398 | * 1:=aperture, 0:=Non-Aperture |
pablo_bmxrp | 0:44429c0a71d4 | 399 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 400 | * @return VL53L0X_ERROR_REF_SPAD_INIT Error in the in the reference |
pablo_bmxrp | 0:44429c0a71d4 | 401 | * spad configuration. |
pablo_bmxrp | 0:44429c0a71d4 | 402 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 403 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 404 | VL53L0X_Error VL53L0X_get_reference_spads(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 405 | uint32_t *p_spad_count, uint8_t *p_is_aperture_spads); |
pablo_bmxrp | 0:44429c0a71d4 | 406 | |
pablo_bmxrp | 0:44429c0a71d4 | 407 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 408 | * @brief Get part to part calibration offset |
pablo_bmxrp | 0:44429c0a71d4 | 409 | * |
pablo_bmxrp | 0:44429c0a71d4 | 410 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 411 | * Should only be used after a successful call to @a VL53L0X_DataInit to backup |
pablo_bmxrp | 0:44429c0a71d4 | 412 | * device NVM value |
pablo_bmxrp | 0:44429c0a71d4 | 413 | * |
pablo_bmxrp | 0:44429c0a71d4 | 414 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 415 | * |
pablo_bmxrp | 0:44429c0a71d4 | 416 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 417 | * @param p_offset_calibration_data_micro_meter Return part to part |
pablo_bmxrp | 0:44429c0a71d4 | 418 | * calibration offset from device (microns) |
pablo_bmxrp | 0:44429c0a71d4 | 419 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 420 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 421 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 422 | VL53L0X_Error VL53L0X_get_offset_calibration_data_micro_meter(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 423 | int32_t *p_offset_calibration_data_micro_meter); |
pablo_bmxrp | 0:44429c0a71d4 | 424 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 425 | * Set or over-hide part to part calibration offset |
pablo_bmxrp | 0:44429c0a71d4 | 426 | * \sa VL53L0X_DataInit() VL53L0X_GetOffsetCalibrationDataMicroMeter() |
pablo_bmxrp | 0:44429c0a71d4 | 427 | * |
pablo_bmxrp | 0:44429c0a71d4 | 428 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 429 | * |
pablo_bmxrp | 0:44429c0a71d4 | 430 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 431 | * @param p_offset_calibration_data_micro_meter Offset (microns) |
pablo_bmxrp | 0:44429c0a71d4 | 432 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 433 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 434 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 435 | VL53L0X_Error VL53L0X_set_offset_calibration_data_micro_meter(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 436 | int32_t offset_calibration_data_micro_meter); |
pablo_bmxrp | 0:44429c0a71d4 | 437 | |
pablo_bmxrp | 0:44429c0a71d4 | 438 | VL53L0X_Error VL53L0X_perform_offset_calibration(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 439 | FixPoint1616_t cal_distance_milli_meter, |
pablo_bmxrp | 0:44429c0a71d4 | 440 | int32_t *p_offset_micro_meter); |
pablo_bmxrp | 0:44429c0a71d4 | 441 | |
pablo_bmxrp | 0:44429c0a71d4 | 442 | VL53L0X_Error VL53L0X_perform_xtalk_calibration(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 443 | FixPoint1616_t xtalk_cal_distance, |
pablo_bmxrp | 0:44429c0a71d4 | 444 | FixPoint1616_t *p_xtalk_compensation_rate_mega_cps); |
pablo_bmxrp | 0:44429c0a71d4 | 445 | |
pablo_bmxrp | 0:44429c0a71d4 | 446 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 447 | * @brief Perform XTalk Measurement |
pablo_bmxrp | 0:44429c0a71d4 | 448 | * |
pablo_bmxrp | 0:44429c0a71d4 | 449 | * @details Measures the current cross talk from glass in front |
pablo_bmxrp | 0:44429c0a71d4 | 450 | * of the sensor. |
pablo_bmxrp | 0:44429c0a71d4 | 451 | * This functions performs a histogram measurement and uses the results |
pablo_bmxrp | 0:44429c0a71d4 | 452 | * to measure the crosstalk. For the function to be successful, there |
pablo_bmxrp | 0:44429c0a71d4 | 453 | * must be no target in front of the sensor. |
pablo_bmxrp | 0:44429c0a71d4 | 454 | * |
pablo_bmxrp | 0:44429c0a71d4 | 455 | * @warning This function is a blocking function |
pablo_bmxrp | 0:44429c0a71d4 | 456 | * |
pablo_bmxrp | 0:44429c0a71d4 | 457 | * @warning This function is not supported when the final range |
pablo_bmxrp | 0:44429c0a71d4 | 458 | * vcsel clock period is set below 10 PCLKS. |
pablo_bmxrp | 0:44429c0a71d4 | 459 | * |
pablo_bmxrp | 0:44429c0a71d4 | 460 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 461 | * |
pablo_bmxrp | 0:44429c0a71d4 | 462 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 463 | * @param timeout_ms Histogram measurement duration. |
pablo_bmxrp | 0:44429c0a71d4 | 464 | * @param p_xtalk_per_spad Output parameter containing the crosstalk |
pablo_bmxrp | 0:44429c0a71d4 | 465 | * measurement result, in MCPS/Spad. |
pablo_bmxrp | 0:44429c0a71d4 | 466 | * Format fixpoint 16:16. |
pablo_bmxrp | 0:44429c0a71d4 | 467 | * @param p_ambient_too_high Output parameter which indicate that |
pablo_bmxrp | 0:44429c0a71d4 | 468 | * pXtalkPerSpad is not good if the Ambient |
pablo_bmxrp | 0:44429c0a71d4 | 469 | * is too high. |
pablo_bmxrp | 0:44429c0a71d4 | 470 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 471 | * @return VL53L0X_ERROR_INVALID_PARAMS vcsel clock period not supported |
pablo_bmxrp | 0:44429c0a71d4 | 472 | * for this operation. |
pablo_bmxrp | 0:44429c0a71d4 | 473 | * Must not be less than 10PCLKS. |
pablo_bmxrp | 0:44429c0a71d4 | 474 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 475 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 476 | VL53L0X_Error VL53L0X_perform_xtalk_measurement(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 477 | uint32_t timeout_ms, FixPoint1616_t *p_xtalk_per_spad, |
pablo_bmxrp | 0:44429c0a71d4 | 478 | uint8_t *p_ambient_too_high); |
pablo_bmxrp | 0:44429c0a71d4 | 479 | |
pablo_bmxrp | 0:44429c0a71d4 | 480 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 481 | * @brief Enable/Disable Cross talk compensation feature |
pablo_bmxrp | 0:44429c0a71d4 | 482 | * |
pablo_bmxrp | 0:44429c0a71d4 | 483 | * @note This function is not Implemented. |
pablo_bmxrp | 0:44429c0a71d4 | 484 | * Enable/Disable Cross Talk by set to zero the Cross Talk value |
pablo_bmxrp | 0:44429c0a71d4 | 485 | * by using @a VL53L0X_SetXTalkCompensationRateMegaCps(). |
pablo_bmxrp | 0:44429c0a71d4 | 486 | * |
pablo_bmxrp | 0:44429c0a71d4 | 487 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 488 | * @param x_talk_compensation_enable Cross talk compensation |
pablo_bmxrp | 0:44429c0a71d4 | 489 | * to be set 0=disabled else = enabled |
pablo_bmxrp | 0:44429c0a71d4 | 490 | * @return VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented |
pablo_bmxrp | 0:44429c0a71d4 | 491 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 492 | VL53L0X_Error VL53L0X_set_x_talk_compensation_enable(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 493 | uint8_t x_talk_compensation_enable); |
pablo_bmxrp | 0:44429c0a71d4 | 494 | |
pablo_bmxrp | 0:44429c0a71d4 | 495 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 496 | * @brief Get Cross talk compensation rate |
pablo_bmxrp | 0:44429c0a71d4 | 497 | * |
pablo_bmxrp | 0:44429c0a71d4 | 498 | * @note This function is not Implemented. |
pablo_bmxrp | 0:44429c0a71d4 | 499 | * Enable/Disable Cross Talk by set to zero the Cross Talk value by |
pablo_bmxrp | 0:44429c0a71d4 | 500 | * using @a VL53L0X_SetXTalkCompensationRateMegaCps(). |
pablo_bmxrp | 0:44429c0a71d4 | 501 | * |
pablo_bmxrp | 0:44429c0a71d4 | 502 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 503 | * @param p_x_talk_compensation_enable Pointer to the Cross talk compensation |
pablo_bmxrp | 0:44429c0a71d4 | 504 | * state 0=disabled or 1 = enabled |
pablo_bmxrp | 0:44429c0a71d4 | 505 | * @return VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented |
pablo_bmxrp | 0:44429c0a71d4 | 506 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 507 | VL53L0X_Error VL53L0X_get_x_talk_compensation_enable(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 508 | uint8_t *p_x_talk_compensation_enable); |
pablo_bmxrp | 0:44429c0a71d4 | 509 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 510 | * @brief Set Cross talk compensation rate |
pablo_bmxrp | 0:44429c0a71d4 | 511 | * |
pablo_bmxrp | 0:44429c0a71d4 | 512 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 513 | * Set Cross talk compensation rate. |
pablo_bmxrp | 0:44429c0a71d4 | 514 | * |
pablo_bmxrp | 0:44429c0a71d4 | 515 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 516 | * |
pablo_bmxrp | 0:44429c0a71d4 | 517 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 518 | * @param x_talk_compensation_rate_mega_cps Compensation rate in |
pablo_bmxrp | 0:44429c0a71d4 | 519 | * Mega counts per second |
pablo_bmxrp | 0:44429c0a71d4 | 520 | * (16.16 fix point) see |
pablo_bmxrp | 0:44429c0a71d4 | 521 | * datasheet for details |
pablo_bmxrp | 0:44429c0a71d4 | 522 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 523 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 524 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 525 | VL53L0X_Error VL53L0X_set_x_talk_compensation_rate_mega_cps(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 526 | FixPoint1616_t x_talk_compensation_rate_mega_cps); |
pablo_bmxrp | 0:44429c0a71d4 | 527 | |
pablo_bmxrp | 0:44429c0a71d4 | 528 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 529 | * @brief Get Cross talk compensation rate |
pablo_bmxrp | 0:44429c0a71d4 | 530 | * |
pablo_bmxrp | 0:44429c0a71d4 | 531 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 532 | * Get Cross talk compensation rate. |
pablo_bmxrp | 0:44429c0a71d4 | 533 | * |
pablo_bmxrp | 0:44429c0a71d4 | 534 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 535 | * |
pablo_bmxrp | 0:44429c0a71d4 | 536 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 537 | * @param p_xtalk_compensation_rate_mega_cps Pointer to Compensation rate |
pablo_bmxrp | 0:44429c0a71d4 | 538 | * in Mega counts per second |
pablo_bmxrp | 0:44429c0a71d4 | 539 | * (16.16 fix point) see |
pablo_bmxrp | 0:44429c0a71d4 | 540 | * datasheet for details |
pablo_bmxrp | 0:44429c0a71d4 | 541 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 542 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 543 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 544 | VL53L0X_Error VL53L0X_get_x_talk_compensation_rate_mega_cps(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 545 | FixPoint1616_t *p_xtalk_compensation_rate_mega_cps); |
pablo_bmxrp | 0:44429c0a71d4 | 546 | |
pablo_bmxrp | 0:44429c0a71d4 | 547 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 548 | * @brief Set a new device mode |
pablo_bmxrp | 0:44429c0a71d4 | 549 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 550 | * Set device to a new mode (ranging, histogram ...) |
pablo_bmxrp | 0:44429c0a71d4 | 551 | * |
pablo_bmxrp | 0:44429c0a71d4 | 552 | * @note This function doesn't Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 553 | * |
pablo_bmxrp | 0:44429c0a71d4 | 554 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 555 | * @param device_mode New device mode to apply |
pablo_bmxrp | 0:44429c0a71d4 | 556 | * Valid values are: |
pablo_bmxrp | 0:44429c0a71d4 | 557 | * VL53L0X_DEVICEMODE_SINGLE_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 558 | * VL53L0X_DEVICEMODE_CONTINUOUS_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 559 | * VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 560 | * VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM |
pablo_bmxrp | 0:44429c0a71d4 | 561 | * VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY |
pablo_bmxrp | 0:44429c0a71d4 | 562 | * VL53L0X_HISTOGRAMMODE_RETURN_ONLY |
pablo_bmxrp | 0:44429c0a71d4 | 563 | * VL53L0X_HISTOGRAMMODE_BOTH |
pablo_bmxrp | 0:44429c0a71d4 | 564 | * |
pablo_bmxrp | 0:44429c0a71d4 | 565 | * |
pablo_bmxrp | 0:44429c0a71d4 | 566 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 567 | * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when |
pablo_bmxrp | 0:44429c0a71d4 | 568 | * DeviceMode is not in the |
pablo_bmxrp | 0:44429c0a71d4 | 569 | * supported list |
pablo_bmxrp | 0:44429c0a71d4 | 570 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 571 | VL53L0X_Error VL53L0X_set_device_mode(VL53L0X_DEV dev, VL53L0X_DeviceModes device_mode); |
pablo_bmxrp | 0:44429c0a71d4 | 572 | |
pablo_bmxrp | 0:44429c0a71d4 | 573 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 574 | * @brief Get current new device mode |
pablo_bmxrp | 0:44429c0a71d4 | 575 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 576 | * Get actual mode of the device(ranging, histogram ...) |
pablo_bmxrp | 0:44429c0a71d4 | 577 | * |
pablo_bmxrp | 0:44429c0a71d4 | 578 | * @note This function doesn't Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 579 | * |
pablo_bmxrp | 0:44429c0a71d4 | 580 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 581 | * @param p_device_mode Pointer to current apply mode value |
pablo_bmxrp | 0:44429c0a71d4 | 582 | * Valid values are: |
pablo_bmxrp | 0:44429c0a71d4 | 583 | * VL53L0X_DEVICEMODE_SINGLE_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 584 | * VL53L0X_DEVICEMODE_CONTINUOUS_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 585 | * VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 586 | * VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM |
pablo_bmxrp | 0:44429c0a71d4 | 587 | * VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY |
pablo_bmxrp | 0:44429c0a71d4 | 588 | * VL53L0X_HISTOGRAMMODE_RETURN_ONLY |
pablo_bmxrp | 0:44429c0a71d4 | 589 | * VL53L0X_HISTOGRAMMODE_BOTH |
pablo_bmxrp | 0:44429c0a71d4 | 590 | * |
pablo_bmxrp | 0:44429c0a71d4 | 591 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 592 | * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when |
pablo_bmxrp | 0:44429c0a71d4 | 593 | * DeviceMode is not in the |
pablo_bmxrp | 0:44429c0a71d4 | 594 | * supported list |
pablo_bmxrp | 0:44429c0a71d4 | 595 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 596 | VL53L0X_Error VL53L0X_get_device_mode(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 597 | VL53L0X_DeviceModes *p_device_mode); |
pablo_bmxrp | 0:44429c0a71d4 | 598 | |
pablo_bmxrp | 0:44429c0a71d4 | 599 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 600 | * @brief Get current configuration for GPIO pin for a given device |
pablo_bmxrp | 0:44429c0a71d4 | 601 | * |
pablo_bmxrp | 0:44429c0a71d4 | 602 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 603 | * |
pablo_bmxrp | 0:44429c0a71d4 | 604 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 605 | * @param pin ID of the GPIO Pin |
pablo_bmxrp | 0:44429c0a71d4 | 606 | * @param p_device_mode Pointer to Device Mode associated to the Gpio. |
pablo_bmxrp | 0:44429c0a71d4 | 607 | * @param p_functionality Pointer to Pin functionality. |
pablo_bmxrp | 0:44429c0a71d4 | 608 | * Refer to ::VL53L0X_GpioFunctionality |
pablo_bmxrp | 0:44429c0a71d4 | 609 | * @param p_polarity Pointer to interrupt polarity. |
pablo_bmxrp | 0:44429c0a71d4 | 610 | * Active high or active low see |
pablo_bmxrp | 0:44429c0a71d4 | 611 | * ::VL53L0X_InterruptPolarity |
pablo_bmxrp | 0:44429c0a71d4 | 612 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 613 | * @return VL53L0X_ERROR_GPIO_NOT_EXISTING Only Pin=0 is accepted. |
pablo_bmxrp | 0:44429c0a71d4 | 614 | * @return VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED |
pablo_bmxrp | 0:44429c0a71d4 | 615 | * This error occurs |
pablo_bmxrp | 0:44429c0a71d4 | 616 | * when Funcionality programmed is not in the supported list: |
pablo_bmxrp | 0:44429c0a71d4 | 617 | * Supported value are: |
pablo_bmxrp | 0:44429c0a71d4 | 618 | * VL53L0X_GPIOFUNCTIONALITY_OFF, |
pablo_bmxrp | 0:44429c0a71d4 | 619 | * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW, |
pablo_bmxrp | 0:44429c0a71d4 | 620 | * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH, |
pablo_bmxrp | 0:44429c0a71d4 | 621 | * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT, |
pablo_bmxrp | 0:44429c0a71d4 | 622 | * VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY |
pablo_bmxrp | 0:44429c0a71d4 | 623 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 624 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 625 | VL53L0X_Error VL53L0X_get_gpio_config(VL53L0X_DEV dev, uint8_t pin, |
pablo_bmxrp | 0:44429c0a71d4 | 626 | VL53L0X_DeviceModes *p_device_mode, |
pablo_bmxrp | 0:44429c0a71d4 | 627 | VL53L0X_GpioFunctionality *p_functionality, |
pablo_bmxrp | 0:44429c0a71d4 | 628 | VL53L0X_InterruptPolarity *p_polarity); |
pablo_bmxrp | 0:44429c0a71d4 | 629 | |
pablo_bmxrp | 0:44429c0a71d4 | 630 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 631 | * @brief Set the configuration of GPIO pin for a given device |
pablo_bmxrp | 0:44429c0a71d4 | 632 | * |
pablo_bmxrp | 0:44429c0a71d4 | 633 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 634 | * |
pablo_bmxrp | 0:44429c0a71d4 | 635 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 636 | * @param pin ID of the GPIO Pin |
pablo_bmxrp | 0:44429c0a71d4 | 637 | * @param functionality Select Pin functionality. |
pablo_bmxrp | 0:44429c0a71d4 | 638 | * Refer to ::VL53L0X_GpioFunctionality |
pablo_bmxrp | 0:44429c0a71d4 | 639 | * @param device_mode Device Mode associated to the Gpio. |
pablo_bmxrp | 0:44429c0a71d4 | 640 | * @param polarity Set interrupt polarity. Active high |
pablo_bmxrp | 0:44429c0a71d4 | 641 | * or active low see ::VL53L0X_InterruptPolarity |
pablo_bmxrp | 0:44429c0a71d4 | 642 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 643 | * @return VL53L0X_ERROR_GPIO_NOT_EXISTING Only Pin=0 is accepted. |
pablo_bmxrp | 0:44429c0a71d4 | 644 | * @return VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED This error occurs |
pablo_bmxrp | 0:44429c0a71d4 | 645 | * when Functionality programmed is not in the supported list: |
pablo_bmxrp | 0:44429c0a71d4 | 646 | * Supported value are: |
pablo_bmxrp | 0:44429c0a71d4 | 647 | * VL53L0X_GPIOFUNCTIONALITY_OFF, |
pablo_bmxrp | 0:44429c0a71d4 | 648 | * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW, |
pablo_bmxrp | 0:44429c0a71d4 | 649 | * VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH, |
pablo_bmxrp | 0:44429c0a71d4 | 650 | VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT, |
pablo_bmxrp | 0:44429c0a71d4 | 651 | * VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY |
pablo_bmxrp | 0:44429c0a71d4 | 652 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 653 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 654 | VL53L0X_Error VL53L0X_set_gpio_config(VL53L0X_DEV dev, uint8_t pin, |
pablo_bmxrp | 0:44429c0a71d4 | 655 | VL53L0X_DeviceModes device_mode, VL53L0X_GpioFunctionality functionality, |
pablo_bmxrp | 0:44429c0a71d4 | 656 | VL53L0X_InterruptPolarity polarity); |
pablo_bmxrp | 0:44429c0a71d4 | 657 | |
pablo_bmxrp | 0:44429c0a71d4 | 658 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 659 | * @brief Start device measurement |
pablo_bmxrp | 0:44429c0a71d4 | 660 | * |
pablo_bmxrp | 0:44429c0a71d4 | 661 | * @details Started measurement will depend on device parameters set through |
pablo_bmxrp | 0:44429c0a71d4 | 662 | * @a VL53L0X_SetParameters() |
pablo_bmxrp | 0:44429c0a71d4 | 663 | * This is a non-blocking function. |
pablo_bmxrp | 0:44429c0a71d4 | 664 | * This function will change the VL53L0X_State from VL53L0X_STATE_IDLE to |
pablo_bmxrp | 0:44429c0a71d4 | 665 | * VL53L0X_STATE_RUNNING. |
pablo_bmxrp | 0:44429c0a71d4 | 666 | * |
pablo_bmxrp | 0:44429c0a71d4 | 667 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 668 | * |
pablo_bmxrp | 0:44429c0a71d4 | 669 | |
pablo_bmxrp | 0:44429c0a71d4 | 670 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 671 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 672 | * @return VL53L0X_ERROR_MODE_NOT_SUPPORTED This error occurs when |
pablo_bmxrp | 0:44429c0a71d4 | 673 | * DeviceMode programmed with @a VL53L0X_SetDeviceMode is not in the supported |
pablo_bmxrp | 0:44429c0a71d4 | 674 | * list: |
pablo_bmxrp | 0:44429c0a71d4 | 675 | * Supported mode are: |
pablo_bmxrp | 0:44429c0a71d4 | 676 | * VL53L0X_DEVICEMODE_SINGLE_RANGING, |
pablo_bmxrp | 0:44429c0a71d4 | 677 | * VL53L0X_DEVICEMODE_CONTINUOUS_RANGING, |
pablo_bmxrp | 0:44429c0a71d4 | 678 | * VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 679 | * @return VL53L0X_ERROR_TIME_OUT Time out on start measurement |
pablo_bmxrp | 0:44429c0a71d4 | 680 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 681 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 682 | VL53L0X_Error VL53L0X_start_measurement(VL53L0X_DEV dev); |
pablo_bmxrp | 0:44429c0a71d4 | 683 | |
pablo_bmxrp | 0:44429c0a71d4 | 684 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 685 | * @brief Stop device measurement |
pablo_bmxrp | 0:44429c0a71d4 | 686 | * |
pablo_bmxrp | 0:44429c0a71d4 | 687 | * @details Will set the device in standby mode at end of current measurement\n |
pablo_bmxrp | 0:44429c0a71d4 | 688 | * Not necessary in single mode as device shall return automatically |
pablo_bmxrp | 0:44429c0a71d4 | 689 | * in standby mode at end of measurement. |
pablo_bmxrp | 0:44429c0a71d4 | 690 | * This function will change the VL53L0X_State from VL53L0X_STATE_RUNNING |
pablo_bmxrp | 0:44429c0a71d4 | 691 | * to VL53L0X_STATE_IDLE. |
pablo_bmxrp | 0:44429c0a71d4 | 692 | * |
pablo_bmxrp | 0:44429c0a71d4 | 693 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 694 | * |
pablo_bmxrp | 0:44429c0a71d4 | 695 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 696 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 697 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 698 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 699 | VL53L0X_Error VL53L0X_stop_measurement(VL53L0X_DEV dev); |
pablo_bmxrp | 0:44429c0a71d4 | 700 | |
pablo_bmxrp | 0:44429c0a71d4 | 701 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 702 | * @brief Return device stop completion status |
pablo_bmxrp | 0:44429c0a71d4 | 703 | * |
pablo_bmxrp | 0:44429c0a71d4 | 704 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 705 | * Returns stop completiob status. |
pablo_bmxrp | 0:44429c0a71d4 | 706 | * User shall call this function after a stop command |
pablo_bmxrp | 0:44429c0a71d4 | 707 | * |
pablo_bmxrp | 0:44429c0a71d4 | 708 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 709 | * |
pablo_bmxrp | 0:44429c0a71d4 | 710 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 711 | * @param p_stop_status Pointer to status variable to update |
pablo_bmxrp | 0:44429c0a71d4 | 712 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 713 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 714 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 715 | VL53L0X_Error VL53L0X_get_stop_completed_status(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 716 | uint32_t *p_stop_status); |
pablo_bmxrp | 0:44429c0a71d4 | 717 | |
pablo_bmxrp | 0:44429c0a71d4 | 718 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 719 | * @brief Return Measurement Data Ready |
pablo_bmxrp | 0:44429c0a71d4 | 720 | * |
pablo_bmxrp | 0:44429c0a71d4 | 721 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 722 | * This function indicate that a measurement data is ready. |
pablo_bmxrp | 0:44429c0a71d4 | 723 | * This function check if interrupt mode is used then check is done accordingly. |
pablo_bmxrp | 0:44429c0a71d4 | 724 | * If perform function clear the interrupt, this function will not work, |
pablo_bmxrp | 0:44429c0a71d4 | 725 | * like in case of @a VL53L0X_PerformSingleRangingMeasurement(). |
pablo_bmxrp | 0:44429c0a71d4 | 726 | * The previous function is blocking function, VL53L0X_GetMeasurementDataReady |
pablo_bmxrp | 0:44429c0a71d4 | 727 | * is used for non-blocking capture. |
pablo_bmxrp | 0:44429c0a71d4 | 728 | * |
pablo_bmxrp | 0:44429c0a71d4 | 729 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 730 | * |
pablo_bmxrp | 0:44429c0a71d4 | 731 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 732 | * @param p_measurement_data_ready Pointer to Measurement Data Ready. |
pablo_bmxrp | 0:44429c0a71d4 | 733 | * 0=data not ready, 1 = data ready |
pablo_bmxrp | 0:44429c0a71d4 | 734 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 735 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 736 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 737 | VL53L0X_Error VL53L0X_get_measurement_data_ready(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 738 | uint8_t *p_measurement_data_ready); |
pablo_bmxrp | 0:44429c0a71d4 | 739 | |
pablo_bmxrp | 0:44429c0a71d4 | 740 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 741 | * @brief Retrieve the measurements from device for a given setup |
pablo_bmxrp | 0:44429c0a71d4 | 742 | * |
pablo_bmxrp | 0:44429c0a71d4 | 743 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 744 | * Get data from last successful Ranging measurement |
pablo_bmxrp | 0:44429c0a71d4 | 745 | * @warning USER should take care about @a VL53L0X_GetNumberOfROIZones() |
pablo_bmxrp | 0:44429c0a71d4 | 746 | * before get data. |
pablo_bmxrp | 0:44429c0a71d4 | 747 | * PAL will fill a NumberOfROIZones times the corresponding data |
pablo_bmxrp | 0:44429c0a71d4 | 748 | * structure used in the measurement function. |
pablo_bmxrp | 0:44429c0a71d4 | 749 | * |
pablo_bmxrp | 0:44429c0a71d4 | 750 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 751 | * |
pablo_bmxrp | 0:44429c0a71d4 | 752 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 753 | * @param p_ranging_measurement_data Pointer to the data structure to fill up. |
pablo_bmxrp | 0:44429c0a71d4 | 754 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 755 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 756 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 757 | VL53L0X_Error VL53L0X_get_ranging_measurement_data(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 758 | VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data); |
pablo_bmxrp | 0:44429c0a71d4 | 759 | |
pablo_bmxrp | 0:44429c0a71d4 | 760 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 761 | * @brief Clear given system interrupt condition |
pablo_bmxrp | 0:44429c0a71d4 | 762 | * |
pablo_bmxrp | 0:44429c0a71d4 | 763 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 764 | * Clear given interrupt(s). |
pablo_bmxrp | 0:44429c0a71d4 | 765 | * |
pablo_bmxrp | 0:44429c0a71d4 | 766 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 767 | * |
pablo_bmxrp | 0:44429c0a71d4 | 768 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 769 | * @param interrupt_mask Mask of interrupts to clear |
pablo_bmxrp | 0:44429c0a71d4 | 770 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 771 | * @return VL53L0X_ERROR_INTERRUPT_NOT_CLEARED Cannot clear interrupts |
pablo_bmxrp | 0:44429c0a71d4 | 772 | * |
pablo_bmxrp | 0:44429c0a71d4 | 773 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 774 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 775 | VL53L0X_Error VL53L0X_clear_interrupt_mask(VL53L0X_DEV dev, uint32_t interrupt_mask); |
pablo_bmxrp | 0:44429c0a71d4 | 776 | |
pablo_bmxrp | 0:44429c0a71d4 | 777 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 778 | * @brief Return device interrupt status |
pablo_bmxrp | 0:44429c0a71d4 | 779 | * |
pablo_bmxrp | 0:44429c0a71d4 | 780 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 781 | * Returns currently raised interrupts by the device. |
pablo_bmxrp | 0:44429c0a71d4 | 782 | * User shall be able to activate/deactivate interrupts through |
pablo_bmxrp | 0:44429c0a71d4 | 783 | * @a VL53L0X_SetGpioConfig() |
pablo_bmxrp | 0:44429c0a71d4 | 784 | * |
pablo_bmxrp | 0:44429c0a71d4 | 785 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 786 | * |
pablo_bmxrp | 0:44429c0a71d4 | 787 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 788 | * @param p_interrupt_mask_status Pointer to status variable to update |
pablo_bmxrp | 0:44429c0a71d4 | 789 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 790 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 791 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 792 | VL53L0X_Error VL53L0X_get_interrupt_mask_status(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 793 | uint32_t *p_interrupt_mask_status); |
pablo_bmxrp | 0:44429c0a71d4 | 794 | |
pablo_bmxrp | 0:44429c0a71d4 | 795 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 796 | * @brief Performs a single ranging measurement and retrieve the ranging |
pablo_bmxrp | 0:44429c0a71d4 | 797 | * measurement data |
pablo_bmxrp | 0:44429c0a71d4 | 798 | * |
pablo_bmxrp | 0:44429c0a71d4 | 799 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 800 | * This function will change the device mode to VL53L0X_DEVICEMODE_SINGLE_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 801 | * with @a VL53L0X_SetDeviceMode(), |
pablo_bmxrp | 0:44429c0a71d4 | 802 | * It performs measurement with @a VL53L0X_PerformSingleMeasurement() |
pablo_bmxrp | 0:44429c0a71d4 | 803 | * It get data from last successful Ranging measurement with |
pablo_bmxrp | 0:44429c0a71d4 | 804 | * @a VL53L0X_GetRangingMeasurementData. |
pablo_bmxrp | 0:44429c0a71d4 | 805 | * Finally it clear the interrupt with @a VL53L0X_ClearInterruptMask(). |
pablo_bmxrp | 0:44429c0a71d4 | 806 | * |
pablo_bmxrp | 0:44429c0a71d4 | 807 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 808 | * |
pablo_bmxrp | 0:44429c0a71d4 | 809 | * @note This function change the device mode to |
pablo_bmxrp | 0:44429c0a71d4 | 810 | * VL53L0X_DEVICEMODE_SINGLE_RANGING |
pablo_bmxrp | 0:44429c0a71d4 | 811 | * |
pablo_bmxrp | 0:44429c0a71d4 | 812 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 813 | * @param p_ranging_measurement_data Pointer to the data structure to fill up. |
pablo_bmxrp | 0:44429c0a71d4 | 814 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 815 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 816 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 817 | VL53L0X_Error VL53L0X_perform_single_ranging_measurement(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 818 | VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data); |
pablo_bmxrp | 0:44429c0a71d4 | 819 | |
pablo_bmxrp | 0:44429c0a71d4 | 820 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 821 | * @brief Single shot measurement. |
pablo_bmxrp | 0:44429c0a71d4 | 822 | * |
pablo_bmxrp | 0:44429c0a71d4 | 823 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 824 | * Perform simple measurement sequence (Start measure, Wait measure to end, |
pablo_bmxrp | 0:44429c0a71d4 | 825 | * and returns when measurement is done). |
pablo_bmxrp | 0:44429c0a71d4 | 826 | * Once function returns, user can get valid data by calling |
pablo_bmxrp | 0:44429c0a71d4 | 827 | * VL53L0X_GetRangingMeasurement or VL53L0X_GetHistogramMeasurement |
pablo_bmxrp | 0:44429c0a71d4 | 828 | * depending on defined measurement mode |
pablo_bmxrp | 0:44429c0a71d4 | 829 | * User should Clear the interrupt in case this are enabled by using the |
pablo_bmxrp | 0:44429c0a71d4 | 830 | * function VL53L0X_ClearInterruptMask(). |
pablo_bmxrp | 0:44429c0a71d4 | 831 | * |
pablo_bmxrp | 0:44429c0a71d4 | 832 | * @warning This function is a blocking function |
pablo_bmxrp | 0:44429c0a71d4 | 833 | * |
pablo_bmxrp | 0:44429c0a71d4 | 834 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 835 | * |
pablo_bmxrp | 0:44429c0a71d4 | 836 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 837 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 838 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 839 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 840 | VL53L0X_Error VL53L0X_perform_single_measurement(VL53L0X_DEV dev); |
pablo_bmxrp | 0:44429c0a71d4 | 841 | |
pablo_bmxrp | 0:44429c0a71d4 | 842 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 843 | * @brief Read current status of the error register for the selected device |
pablo_bmxrp | 0:44429c0a71d4 | 844 | * |
pablo_bmxrp | 0:44429c0a71d4 | 845 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 846 | * |
pablo_bmxrp | 0:44429c0a71d4 | 847 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 848 | * @param p_device_error_status Pointer to current error code of the device |
pablo_bmxrp | 0:44429c0a71d4 | 849 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 850 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 851 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 852 | VL53L0X_Error VL53L0X_get_device_error_status(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 853 | VL53L0X_DeviceError *p_device_error_status); |
pablo_bmxrp | 0:44429c0a71d4 | 854 | |
pablo_bmxrp | 0:44429c0a71d4 | 855 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 856 | * @brief Human readable error string for a given Error Code |
pablo_bmxrp | 0:44429c0a71d4 | 857 | * |
pablo_bmxrp | 0:44429c0a71d4 | 858 | * @note This function doesn't access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 859 | * |
pablo_bmxrp | 0:44429c0a71d4 | 860 | * @param error_code The error code as stored on ::VL53L0X_DeviceError |
pablo_bmxrp | 0:44429c0a71d4 | 861 | * @param p_device_error_string The error string corresponding to the ErrorCode |
pablo_bmxrp | 0:44429c0a71d4 | 862 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 863 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 864 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 865 | VL53L0X_Error VL53L0X_get_device_error_string( |
pablo_bmxrp | 0:44429c0a71d4 | 866 | VL53L0X_DeviceError error_code, char *p_device_error_string); |
pablo_bmxrp | 0:44429c0a71d4 | 867 | |
pablo_bmxrp | 0:44429c0a71d4 | 868 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 869 | * @brief Human readable Range Status string for a given RangeStatus |
pablo_bmxrp | 0:44429c0a71d4 | 870 | * |
pablo_bmxrp | 0:44429c0a71d4 | 871 | * @note This function doesn't access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 872 | * |
pablo_bmxrp | 0:44429c0a71d4 | 873 | * @param range_status The RangeStatus code as stored on |
pablo_bmxrp | 0:44429c0a71d4 | 874 | * @a VL53L0X_RangingMeasurementData_t |
pablo_bmxrp | 0:44429c0a71d4 | 875 | * @param p_range_status_string The returned RangeStatus string. |
pablo_bmxrp | 0:44429c0a71d4 | 876 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 877 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 878 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 879 | VL53L0X_Error VL53L0X_get_range_status_string(uint8_t range_status, |
pablo_bmxrp | 0:44429c0a71d4 | 880 | char *p_range_status_string); |
pablo_bmxrp | 0:44429c0a71d4 | 881 | |
pablo_bmxrp | 0:44429c0a71d4 | 882 | VL53L0X_Error VL53L0X_get_total_signal_rate(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 883 | VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data, |
pablo_bmxrp | 0:44429c0a71d4 | 884 | FixPoint1616_t *p_total_signal_rate_mcps); |
pablo_bmxrp | 0:44429c0a71d4 | 885 | |
pablo_bmxrp | 0:44429c0a71d4 | 886 | VL53L0X_Error VL53L0X_get_total_xtalk_rate(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 887 | VL53L0X_RangingMeasurementData_t *p_ranging_measurement_data, |
pablo_bmxrp | 0:44429c0a71d4 | 888 | FixPoint1616_t *p_total_xtalk_rate_mcps); |
pablo_bmxrp | 0:44429c0a71d4 | 889 | |
pablo_bmxrp | 0:44429c0a71d4 | 890 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 891 | * @brief Get Ranging Timing Budget in microseconds |
pablo_bmxrp | 0:44429c0a71d4 | 892 | * |
pablo_bmxrp | 0:44429c0a71d4 | 893 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 894 | * Returns the programmed the maximum time allowed by the user to the |
pablo_bmxrp | 0:44429c0a71d4 | 895 | * device to run a full ranging sequence for the current mode |
pablo_bmxrp | 0:44429c0a71d4 | 896 | * (ranging, histogram, ASL ...) |
pablo_bmxrp | 0:44429c0a71d4 | 897 | * |
pablo_bmxrp | 0:44429c0a71d4 | 898 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 899 | * |
pablo_bmxrp | 0:44429c0a71d4 | 900 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 901 | * @param p_measurement_timing_budget_micro_seconds Max measurement time in |
pablo_bmxrp | 0:44429c0a71d4 | 902 | * microseconds. |
pablo_bmxrp | 0:44429c0a71d4 | 903 | * Valid values are: |
pablo_bmxrp | 0:44429c0a71d4 | 904 | * >= 17000 microsecs when wraparound enabled |
pablo_bmxrp | 0:44429c0a71d4 | 905 | * >= 12000 microsecs when wraparound disabled |
pablo_bmxrp | 0:44429c0a71d4 | 906 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 907 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 908 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 909 | VL53L0X_Error VL53L0X_get_measurement_timing_budget_micro_seconds(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 910 | uint32_t *p_measurement_timing_budget_micro_seconds); |
pablo_bmxrp | 0:44429c0a71d4 | 911 | |
pablo_bmxrp | 0:44429c0a71d4 | 912 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 913 | * @brief Set Ranging Timing Budget in microseconds |
pablo_bmxrp | 0:44429c0a71d4 | 914 | * |
pablo_bmxrp | 0:44429c0a71d4 | 915 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 916 | * Defines the maximum time allowed by the user to the device to run a |
pablo_bmxrp | 0:44429c0a71d4 | 917 | * full ranging sequence for the current mode (ranging, histogram, ASL ...) |
pablo_bmxrp | 0:44429c0a71d4 | 918 | * |
pablo_bmxrp | 0:44429c0a71d4 | 919 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 920 | * |
pablo_bmxrp | 0:44429c0a71d4 | 921 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 922 | * @param measurement_timing_budget_micro_seconds Max measurement time in |
pablo_bmxrp | 0:44429c0a71d4 | 923 | * microseconds. |
pablo_bmxrp | 0:44429c0a71d4 | 924 | * Valid values are: |
pablo_bmxrp | 0:44429c0a71d4 | 925 | * >= 17000 microsecs when wraparound enabled |
pablo_bmxrp | 0:44429c0a71d4 | 926 | * >= 12000 microsecs when wraparound disabled |
pablo_bmxrp | 0:44429c0a71d4 | 927 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 928 | * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned if |
pablo_bmxrp | 0:44429c0a71d4 | 929 | MeasurementTimingBudgetMicroSeconds out of range |
pablo_bmxrp | 0:44429c0a71d4 | 930 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 931 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 932 | VL53L0X_Error VL53L0X_set_measurement_timing_budget_micro_seconds(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 933 | uint32_t measurement_timing_budget_micro_seconds); |
pablo_bmxrp | 0:44429c0a71d4 | 934 | |
pablo_bmxrp | 0:44429c0a71d4 | 935 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 936 | * @brief Get specific limit check enable state |
pablo_bmxrp | 0:44429c0a71d4 | 937 | * |
pablo_bmxrp | 0:44429c0a71d4 | 938 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 939 | * This function get the enable state of a specific limit check. |
pablo_bmxrp | 0:44429c0a71d4 | 940 | * The limit check is identified with the LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 941 | * |
pablo_bmxrp | 0:44429c0a71d4 | 942 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 943 | * |
pablo_bmxrp | 0:44429c0a71d4 | 944 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 945 | * @param limit_check_id Limit Check ID |
pablo_bmxrp | 0:44429c0a71d4 | 946 | * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ). |
pablo_bmxrp | 0:44429c0a71d4 | 947 | * @param p_limit_check_enable Pointer to the check limit enable |
pablo_bmxrp | 0:44429c0a71d4 | 948 | * value. |
pablo_bmxrp | 0:44429c0a71d4 | 949 | * if 1 the check limit |
pablo_bmxrp | 0:44429c0a71d4 | 950 | * corresponding to LimitCheckId is Enabled |
pablo_bmxrp | 0:44429c0a71d4 | 951 | * if 0 the check limit |
pablo_bmxrp | 0:44429c0a71d4 | 952 | * corresponding to LimitCheckId is disabled |
pablo_bmxrp | 0:44429c0a71d4 | 953 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 954 | * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned |
pablo_bmxrp | 0:44429c0a71d4 | 955 | * when LimitCheckId value is out of range. |
pablo_bmxrp | 0:44429c0a71d4 | 956 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 957 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 958 | VL53L0X_Error VL53L0X_get_limit_check_enable(VL53L0X_DEV dev, uint16_t limit_check_id, |
pablo_bmxrp | 0:44429c0a71d4 | 959 | uint8_t *p_limit_check_enable); |
pablo_bmxrp | 0:44429c0a71d4 | 960 | |
pablo_bmxrp | 0:44429c0a71d4 | 961 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 962 | * @brief Enable/Disable a specific limit check |
pablo_bmxrp | 0:44429c0a71d4 | 963 | * |
pablo_bmxrp | 0:44429c0a71d4 | 964 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 965 | * This function Enable/Disable a specific limit check. |
pablo_bmxrp | 0:44429c0a71d4 | 966 | * The limit check is identified with the LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 967 | * |
pablo_bmxrp | 0:44429c0a71d4 | 968 | * @note This function doesn't Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 969 | * |
pablo_bmxrp | 0:44429c0a71d4 | 970 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 971 | * @param limit_check_id Limit Check ID |
pablo_bmxrp | 0:44429c0a71d4 | 972 | * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ). |
pablo_bmxrp | 0:44429c0a71d4 | 973 | * @param limit_check_enable if 1 the check limit |
pablo_bmxrp | 0:44429c0a71d4 | 974 | * corresponding to LimitCheckId is Enabled |
pablo_bmxrp | 0:44429c0a71d4 | 975 | * if 0 the check limit |
pablo_bmxrp | 0:44429c0a71d4 | 976 | * corresponding to LimitCheckId is disabled |
pablo_bmxrp | 0:44429c0a71d4 | 977 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 978 | * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned |
pablo_bmxrp | 0:44429c0a71d4 | 979 | * when LimitCheckId value is out of range. |
pablo_bmxrp | 0:44429c0a71d4 | 980 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 981 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 982 | VL53L0X_Error VL53L0X_set_limit_check_enable(VL53L0X_DEV dev, uint16_t limit_check_id, |
pablo_bmxrp | 0:44429c0a71d4 | 983 | uint8_t limit_check_enable); |
pablo_bmxrp | 0:44429c0a71d4 | 984 | |
pablo_bmxrp | 0:44429c0a71d4 | 985 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 986 | * @brief Get a specific limit check value |
pablo_bmxrp | 0:44429c0a71d4 | 987 | * |
pablo_bmxrp | 0:44429c0a71d4 | 988 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 989 | * This function get a specific limit check value from device then it updates |
pablo_bmxrp | 0:44429c0a71d4 | 990 | * internal values and check enables. |
pablo_bmxrp | 0:44429c0a71d4 | 991 | * The limit check is identified with the LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 992 | * |
pablo_bmxrp | 0:44429c0a71d4 | 993 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 994 | * |
pablo_bmxrp | 0:44429c0a71d4 | 995 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 996 | * @param limit_check_id Limit Check ID |
pablo_bmxrp | 0:44429c0a71d4 | 997 | * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ). |
pablo_bmxrp | 0:44429c0a71d4 | 998 | * @param p_limit_check_value Pointer to Limit |
pablo_bmxrp | 0:44429c0a71d4 | 999 | * check Value for a given LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 1000 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1001 | * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned |
pablo_bmxrp | 0:44429c0a71d4 | 1002 | * when LimitCheckId value is out of range. |
pablo_bmxrp | 0:44429c0a71d4 | 1003 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1004 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1005 | VL53L0X_Error VL53L0X_get_limit_check_value(VL53L0X_DEV dev, uint16_t limit_check_id, |
pablo_bmxrp | 0:44429c0a71d4 | 1006 | FixPoint1616_t *p_limit_check_value); |
pablo_bmxrp | 0:44429c0a71d4 | 1007 | |
pablo_bmxrp | 0:44429c0a71d4 | 1008 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1009 | * @brief Set a specific limit check value |
pablo_bmxrp | 0:44429c0a71d4 | 1010 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1011 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1012 | * This function set a specific limit check value. |
pablo_bmxrp | 0:44429c0a71d4 | 1013 | * The limit check is identified with the LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 1014 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1015 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1016 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1017 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1018 | * @param limit_check_id Limit Check ID |
pablo_bmxrp | 0:44429c0a71d4 | 1019 | * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ). |
pablo_bmxrp | 0:44429c0a71d4 | 1020 | * @param limit_check_value Limit check Value for a given |
pablo_bmxrp | 0:44429c0a71d4 | 1021 | * LimitCheckId |
pablo_bmxrp | 0:44429c0a71d4 | 1022 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1023 | * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned when either |
pablo_bmxrp | 0:44429c0a71d4 | 1024 | * LimitCheckId or LimitCheckValue value is out of range. |
pablo_bmxrp | 0:44429c0a71d4 | 1025 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1026 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1027 | VL53L0X_Error VL53L0X_set_limit_check_value(VL53L0X_DEV dev, uint16_t limit_check_id, |
pablo_bmxrp | 0:44429c0a71d4 | 1028 | FixPoint1616_t limit_check_value); |
pablo_bmxrp | 0:44429c0a71d4 | 1029 | |
pablo_bmxrp | 0:44429c0a71d4 | 1030 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1031 | * @brief Get the current value of the signal used for the limit check |
pablo_bmxrp | 0:44429c0a71d4 | 1032 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1033 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1034 | * This function get a the current value of the signal used for the limit check. |
pablo_bmxrp | 0:44429c0a71d4 | 1035 | * To obtain the latest value you should run a ranging before. |
pablo_bmxrp | 0:44429c0a71d4 | 1036 | * The value reported is linked to the limit check identified with the |
pablo_bmxrp | 0:44429c0a71d4 | 1037 | * LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 1038 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1039 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1040 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1041 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1042 | * @param limit_check_id Limit Check ID |
pablo_bmxrp | 0:44429c0a71d4 | 1043 | * (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ). |
pablo_bmxrp | 0:44429c0a71d4 | 1044 | * @param p_limit_check_current Pointer to current Value for a |
pablo_bmxrp | 0:44429c0a71d4 | 1045 | * given LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 1046 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1047 | * @return VL53L0X_ERROR_INVALID_PARAMS This error is returned when |
pablo_bmxrp | 0:44429c0a71d4 | 1048 | * LimitCheckId value is out of range. |
pablo_bmxrp | 0:44429c0a71d4 | 1049 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1050 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1051 | VL53L0X_Error VL53L0X_get_limit_check_current(VL53L0X_DEV dev, uint16_t limit_check_id, |
pablo_bmxrp | 0:44429c0a71d4 | 1052 | FixPoint1616_t *p_limit_check_current); |
pablo_bmxrp | 0:44429c0a71d4 | 1053 | |
pablo_bmxrp | 0:44429c0a71d4 | 1054 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1055 | * @brief Return a the Status of the specified check limit |
pablo_bmxrp | 0:44429c0a71d4 | 1056 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1057 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1058 | * This function returns the Status of the specified check limit. |
pablo_bmxrp | 0:44429c0a71d4 | 1059 | * The value indicate if the check is fail or not. |
pablo_bmxrp | 0:44429c0a71d4 | 1060 | * The limit check is identified with the LimitCheckId. |
pablo_bmxrp | 0:44429c0a71d4 | 1061 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1062 | * @note This function doesn't Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1063 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1064 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1065 | * @param limit_check_id Limit Check ID |
pablo_bmxrp | 0:44429c0a71d4 | 1066 | (0<= LimitCheckId < VL53L0X_GetNumberOfLimitCheck() ). |
pablo_bmxrp | 0:44429c0a71d4 | 1067 | * @param p_limit_check_status Pointer to the |
pablo_bmxrp | 0:44429c0a71d4 | 1068 | Limit Check Status of the given check limit. |
pablo_bmxrp | 0:44429c0a71d4 | 1069 | * LimitCheckStatus : |
pablo_bmxrp | 0:44429c0a71d4 | 1070 | * 0 the check is not fail |
pablo_bmxrp | 0:44429c0a71d4 | 1071 | * 1 the check if fail or not enabled |
pablo_bmxrp | 0:44429c0a71d4 | 1072 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1073 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1074 | * @return VL53L0X_ERROR_INVALID_PARAMS This error is |
pablo_bmxrp | 0:44429c0a71d4 | 1075 | returned when LimitCheckId value is out of range. |
pablo_bmxrp | 0:44429c0a71d4 | 1076 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1077 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1078 | VL53L0X_Error VL53L0X_get_limit_check_status(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1079 | uint16_t limit_check_id, uint8_t *p_limit_check_status); |
pablo_bmxrp | 0:44429c0a71d4 | 1080 | |
pablo_bmxrp | 0:44429c0a71d4 | 1081 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1082 | * Get continuous mode Inter-Measurement period in milliseconds |
pablo_bmxrp | 0:44429c0a71d4 | 1083 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1084 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1085 | * When trying to set too short time return INVALID_PARAMS minimal value |
pablo_bmxrp | 0:44429c0a71d4 | 1086 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1087 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1088 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1089 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1090 | * @param p_inter_measurement_period_milli_seconds Pointer to programmed |
pablo_bmxrp | 0:44429c0a71d4 | 1091 | * Inter-Measurement Period in milliseconds. |
pablo_bmxrp | 0:44429c0a71d4 | 1092 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1093 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1094 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1095 | VL53L0X_Error VL53L0X_get_inter_measurement_period_milli_seconds(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1096 | uint32_t *p_inter_measurement_period_milli_seconds); |
pablo_bmxrp | 0:44429c0a71d4 | 1097 | |
pablo_bmxrp | 0:44429c0a71d4 | 1098 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1099 | * Program continuous mode Inter-Measurement period in milliseconds |
pablo_bmxrp | 0:44429c0a71d4 | 1100 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1101 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1102 | * When trying to set too short time return INVALID_PARAMS minimal value |
pablo_bmxrp | 0:44429c0a71d4 | 1103 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1104 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1105 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1106 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1107 | * @param inter_measurement_period_milli_seconds Inter-Measurement Period in ms. |
pablo_bmxrp | 0:44429c0a71d4 | 1108 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1109 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1110 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1111 | VL53L0X_Error VL53L0X_set_inter_measurement_period_milli_seconds( |
pablo_bmxrp | 0:44429c0a71d4 | 1112 | VL53L0X_DEV dev, uint32_t inter_measurement_period_milli_seconds); |
pablo_bmxrp | 0:44429c0a71d4 | 1113 | |
pablo_bmxrp | 0:44429c0a71d4 | 1114 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1115 | * @brief Set new device address |
pablo_bmxrp | 0:44429c0a71d4 | 1116 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1117 | * After completion the device will answer to the new address programmed. |
pablo_bmxrp | 0:44429c0a71d4 | 1118 | * This function should be called when several devices are used in parallel |
pablo_bmxrp | 0:44429c0a71d4 | 1119 | * before start programming the sensor. |
pablo_bmxrp | 0:44429c0a71d4 | 1120 | * When a single device us used, there is no need to call this function. |
pablo_bmxrp | 0:44429c0a71d4 | 1121 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1122 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1123 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1124 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1125 | * @param device_address The new Device address |
pablo_bmxrp | 0:44429c0a71d4 | 1126 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1127 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1128 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1129 | VL53L0X_Error VL53L0X_set_device_address(VL53L0X_DEV dev, uint8_t device_address); |
pablo_bmxrp | 0:44429c0a71d4 | 1130 | |
pablo_bmxrp | 0:44429c0a71d4 | 1131 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1132 | * @brief Do an hard reset or soft reset (depending on implementation) of the |
pablo_bmxrp | 0:44429c0a71d4 | 1133 | * device \nAfter call of this function, device must be in same state as right |
pablo_bmxrp | 0:44429c0a71d4 | 1134 | * after a power-up sequence.This function will change the VL53L0X_State to |
pablo_bmxrp | 0:44429c0a71d4 | 1135 | * VL53L0X_STATE_POWERDOWN. |
pablo_bmxrp | 0:44429c0a71d4 | 1136 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1137 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1138 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1139 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1140 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1141 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1142 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1143 | VL53L0X_Error VL53L0X_reset_device(VL53L0X_DEV dev); |
pablo_bmxrp | 0:44429c0a71d4 | 1144 | |
pablo_bmxrp | 0:44429c0a71d4 | 1145 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1146 | * @brief Get setup of Wrap around Check |
pablo_bmxrp | 0:44429c0a71d4 | 1147 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1148 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1149 | * This function get the wrapAround check enable parameters |
pablo_bmxrp | 0:44429c0a71d4 | 1150 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1151 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1152 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1153 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1154 | * @param p_wrap_around_check_enable Pointer to the Wrap around Check state |
pablo_bmxrp | 0:44429c0a71d4 | 1155 | * 0=disabled or 1 = enabled |
pablo_bmxrp | 0:44429c0a71d4 | 1156 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1157 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1158 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1159 | VL53L0X_Error VL53L0X_get_wrap_around_check_enable(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1160 | uint8_t *p_wrap_around_check_enable); |
pablo_bmxrp | 0:44429c0a71d4 | 1161 | |
pablo_bmxrp | 0:44429c0a71d4 | 1162 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1163 | * @brief Enable (or disable) Wrap around Check |
pablo_bmxrp | 0:44429c0a71d4 | 1164 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1165 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1166 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1167 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1168 | * @param wrap_around_check_enable Wrap around Check to be set |
pablo_bmxrp | 0:44429c0a71d4 | 1169 | * 0=disabled, other = enabled |
pablo_bmxrp | 0:44429c0a71d4 | 1170 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1171 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1172 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1173 | VL53L0X_Error VL53L0X_set_wrap_around_check_enable(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1174 | uint8_t wrap_around_check_enable); |
pablo_bmxrp | 0:44429c0a71d4 | 1175 | |
pablo_bmxrp | 0:44429c0a71d4 | 1176 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1177 | * @brief Gets the VCSEL pulse period. |
pablo_bmxrp | 0:44429c0a71d4 | 1178 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1179 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1180 | * This function retrieves the VCSEL pulse period for the given period type. |
pablo_bmxrp | 0:44429c0a71d4 | 1181 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1182 | * @note This function Accesses the device |
pablo_bmxrp | 0:44429c0a71d4 | 1183 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1184 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1185 | * @param vcsel_period_type VCSEL period identifier (pre-range|final). |
pablo_bmxrp | 0:44429c0a71d4 | 1186 | * @param p_vcsel_pulse_period_pclk Pointer to VCSEL period value. |
pablo_bmxrp | 0:44429c0a71d4 | 1187 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1188 | * @return VL53L0X_ERROR_INVALID_PARAMS Error VcselPeriodType parameter not |
pablo_bmxrp | 0:44429c0a71d4 | 1189 | * supported. |
pablo_bmxrp | 0:44429c0a71d4 | 1190 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1191 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1192 | VL53L0X_Error VL53L0X_get_vcsel_pulse_period(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1193 | VL53L0X_VcselPeriod vcsel_period_type, uint8_t *p_vcsel_pulse_period_pclk); |
pablo_bmxrp | 0:44429c0a71d4 | 1194 | |
pablo_bmxrp | 0:44429c0a71d4 | 1195 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1196 | * @brief Sets the VCSEL pulse period. |
pablo_bmxrp | 0:44429c0a71d4 | 1197 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1198 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1199 | * This function retrieves the VCSEL pulse period for the given period type. |
pablo_bmxrp | 0:44429c0a71d4 | 1200 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1201 | * @note This function Accesses the device |
pablo_bmxrp | 0:44429c0a71d4 | 1202 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1203 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1204 | * @param vcsel_period_type VCSEL period identifier (pre-range|final). |
pablo_bmxrp | 0:44429c0a71d4 | 1205 | * @param vcsel_pulse_period VCSEL period value |
pablo_bmxrp | 0:44429c0a71d4 | 1206 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1207 | * @return VL53L0X_ERROR_INVALID_PARAMS Error VcselPeriodType parameter not |
pablo_bmxrp | 0:44429c0a71d4 | 1208 | * supported. |
pablo_bmxrp | 0:44429c0a71d4 | 1209 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1210 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1211 | VL53L0X_Error VL53L0X_set_vcsel_pulse_period(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1212 | VL53L0X_VcselPeriod vcsel_period_type, uint8_t vcsel_pulse_period); |
pablo_bmxrp | 0:44429c0a71d4 | 1213 | |
pablo_bmxrp | 0:44429c0a71d4 | 1214 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1215 | * @brief Set low and high Interrupt thresholds for a given mode |
pablo_bmxrp | 0:44429c0a71d4 | 1216 | * (ranging, ALS, ...) for a given device |
pablo_bmxrp | 0:44429c0a71d4 | 1217 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1218 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1219 | * Set low and high Interrupt thresholds for a given mode (ranging, ALS, ...) |
pablo_bmxrp | 0:44429c0a71d4 | 1220 | * for a given device |
pablo_bmxrp | 0:44429c0a71d4 | 1221 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1222 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1223 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1224 | * @note DeviceMode is ignored for the current device |
pablo_bmxrp | 0:44429c0a71d4 | 1225 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1226 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1227 | * @param device_mode Device Mode for which change thresholds |
pablo_bmxrp | 0:44429c0a71d4 | 1228 | * @param threshold_low Low threshold (mm, lux ..., depending on the mode) |
pablo_bmxrp | 0:44429c0a71d4 | 1229 | * @param threshold_high High threshold (mm, lux ..., depending on the mode) |
pablo_bmxrp | 0:44429c0a71d4 | 1230 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1231 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1232 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1233 | VL53L0X_Error VL53L0X_set_interrupt_thresholds(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1234 | VL53L0X_DeviceModes device_mode, FixPoint1616_t threshold_low, |
pablo_bmxrp | 0:44429c0a71d4 | 1235 | FixPoint1616_t threshold_high); |
pablo_bmxrp | 0:44429c0a71d4 | 1236 | |
pablo_bmxrp | 0:44429c0a71d4 | 1237 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1238 | * @brief Get high and low Interrupt thresholds for a given mode |
pablo_bmxrp | 0:44429c0a71d4 | 1239 | * (ranging, ALS, ...) for a given device |
pablo_bmxrp | 0:44429c0a71d4 | 1240 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1241 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1242 | * Get high and low Interrupt thresholds for a given mode (ranging, ALS, ...) |
pablo_bmxrp | 0:44429c0a71d4 | 1243 | * for a given device |
pablo_bmxrp | 0:44429c0a71d4 | 1244 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1245 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1246 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1247 | * @note DeviceMode is ignored for the current device |
pablo_bmxrp | 0:44429c0a71d4 | 1248 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1249 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1250 | * @param device_mode Device Mode from which read thresholds |
pablo_bmxrp | 0:44429c0a71d4 | 1251 | * @param p_threshold_low Low threshold (mm, lux ..., depending on the mode) |
pablo_bmxrp | 0:44429c0a71d4 | 1252 | * @param p_threshold_high High threshold (mm, lux ..., depending on the mode) |
pablo_bmxrp | 0:44429c0a71d4 | 1253 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1254 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1255 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1256 | VL53L0X_Error VL53L0X_get_interrupt_thresholds(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1257 | VL53L0X_DeviceModes device_mode, FixPoint1616_t *p_threshold_low, |
pablo_bmxrp | 0:44429c0a71d4 | 1258 | FixPoint1616_t *p_threshold_high); |
pablo_bmxrp | 0:44429c0a71d4 | 1259 | |
pablo_bmxrp | 0:44429c0a71d4 | 1260 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1261 | * @brief Reads the Device information for given Device |
pablo_bmxrp | 0:44429c0a71d4 | 1262 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1263 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1264 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1265 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1266 | * @param p_VL53L0X_device_info Pointer to current device info for a given |
pablo_bmxrp | 0:44429c0a71d4 | 1267 | * Device |
pablo_bmxrp | 0:44429c0a71d4 | 1268 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1269 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1270 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1271 | VL53L0X_Error VL53L0X_get_device_info(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1272 | VL53L0X_DeviceInfo_t *p_VL53L0X_device_info); |
pablo_bmxrp | 0:44429c0a71d4 | 1273 | |
pablo_bmxrp | 0:44429c0a71d4 | 1274 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1275 | * @brief Gets the (on/off) state of all sequence steps. |
pablo_bmxrp | 0:44429c0a71d4 | 1276 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1277 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1278 | * This function retrieves the state of all sequence step in the scheduler. |
pablo_bmxrp | 0:44429c0a71d4 | 1279 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1280 | * @note This function Accesses the device |
pablo_bmxrp | 0:44429c0a71d4 | 1281 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1282 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1283 | * @param p_scheduler_sequence_steps Pointer to struct containing result. |
pablo_bmxrp | 0:44429c0a71d4 | 1284 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1285 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1286 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1287 | VL53L0X_Error VL53L0X_get_sequence_step_enables(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1288 | VL53L0X_SchedulerSequenceSteps_t *p_scheduler_sequence_steps); |
pablo_bmxrp | 0:44429c0a71d4 | 1289 | |
pablo_bmxrp | 0:44429c0a71d4 | 1290 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1291 | * @brief Sets the (on/off) state of a requested sequence step. |
pablo_bmxrp | 0:44429c0a71d4 | 1292 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1293 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1294 | * This function enables/disables a requested sequence step. |
pablo_bmxrp | 0:44429c0a71d4 | 1295 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1296 | * @note This function Accesses the device |
pablo_bmxrp | 0:44429c0a71d4 | 1297 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1298 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1299 | * @param sequence_step_id Sequence step identifier. |
pablo_bmxrp | 0:44429c0a71d4 | 1300 | * @param sequence_step_enabled Demanded state {0=Off,1=On} |
pablo_bmxrp | 0:44429c0a71d4 | 1301 | * is enabled. |
pablo_bmxrp | 0:44429c0a71d4 | 1302 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1303 | * @return VL53L0X_ERROR_INVALID_PARAMS Error SequenceStepId parameter not |
pablo_bmxrp | 0:44429c0a71d4 | 1304 | * supported. |
pablo_bmxrp | 0:44429c0a71d4 | 1305 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1306 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1307 | VL53L0X_Error VL53L0X_set_sequence_step_enable(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1308 | VL53L0X_SequenceStepId sequence_step_id, uint8_t sequence_step_enabled); |
pablo_bmxrp | 0:44429c0a71d4 | 1309 | |
pablo_bmxrp | 0:44429c0a71d4 | 1310 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1311 | * @brief Gets the fraction enable parameter indicating the resolution of |
pablo_bmxrp | 0:44429c0a71d4 | 1312 | * range measurements. |
pablo_bmxrp | 0:44429c0a71d4 | 1313 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1314 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1315 | * Gets the fraction enable state, which translates to the resolution of |
pablo_bmxrp | 0:44429c0a71d4 | 1316 | * range measurements as follows :Enabled:=0.25mm resolution, |
pablo_bmxrp | 0:44429c0a71d4 | 1317 | * Not Enabled:=1mm resolution. |
pablo_bmxrp | 0:44429c0a71d4 | 1318 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1319 | * @note This function Accesses the device |
pablo_bmxrp | 0:44429c0a71d4 | 1320 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1321 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1322 | * @param p_enabled Output Parameter reporting the fraction enable state. |
pablo_bmxrp | 0:44429c0a71d4 | 1323 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1324 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1325 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1326 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1327 | VL53L0X_Error VL53L0X_get_fraction_enable(VL53L0X_DEV dev, uint8_t *p_enabled); |
pablo_bmxrp | 0:44429c0a71d4 | 1328 | |
pablo_bmxrp | 0:44429c0a71d4 | 1329 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1330 | * @brief Sets the resolution of range measurements. |
pablo_bmxrp | 0:44429c0a71d4 | 1331 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1332 | * Set resolution of range measurements to either 0.25mm if |
pablo_bmxrp | 0:44429c0a71d4 | 1333 | * fraction enabled or 1mm if not enabled. |
pablo_bmxrp | 0:44429c0a71d4 | 1334 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1335 | * @note This function Accesses the device |
pablo_bmxrp | 0:44429c0a71d4 | 1336 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1337 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1338 | * @param enable Enable high resolution |
pablo_bmxrp | 0:44429c0a71d4 | 1339 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1340 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1341 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1342 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1343 | VL53L0X_Error VL53L0X_set_range_fraction_enable(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1344 | uint8_t enable); |
pablo_bmxrp | 0:44429c0a71d4 | 1345 | |
pablo_bmxrp | 0:44429c0a71d4 | 1346 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1347 | * @brief Return the VL53L0X PAL Implementation Version |
pablo_bmxrp | 0:44429c0a71d4 | 1348 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1349 | * @note This function doesn't access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1350 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1351 | * @param p_version Pointer to current PAL Implementation Version |
pablo_bmxrp | 0:44429c0a71d4 | 1352 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1353 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1354 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1355 | VL53L0X_Error VL53L0X_get_version(VL53L0X_Version_t *p_version); |
pablo_bmxrp | 0:44429c0a71d4 | 1356 | |
pablo_bmxrp | 0:44429c0a71d4 | 1357 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1358 | * @brief Reads the Product Revision for a for given Device |
pablo_bmxrp | 0:44429c0a71d4 | 1359 | * This function can be used to distinguish cut1.0 from cut1.1. |
pablo_bmxrp | 0:44429c0a71d4 | 1360 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1361 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1362 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1363 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1364 | * @param p_product_revision_major Pointer to Product Revision Major |
pablo_bmxrp | 0:44429c0a71d4 | 1365 | * for a given Device |
pablo_bmxrp | 0:44429c0a71d4 | 1366 | * @param p_product_revision_minor Pointer to Product Revision Minor |
pablo_bmxrp | 0:44429c0a71d4 | 1367 | * for a given Device |
pablo_bmxrp | 0:44429c0a71d4 | 1368 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1369 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1370 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1371 | VL53L0X_Error VL53L0X_get_product_revision(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1372 | uint8_t *p_product_revision_major, uint8_t *p_product_revision_minor); |
pablo_bmxrp | 0:44429c0a71d4 | 1373 | |
pablo_bmxrp | 0:44429c0a71d4 | 1374 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1375 | * @brief Retrieve current device parameters |
pablo_bmxrp | 0:44429c0a71d4 | 1376 | * @par Function Description |
pablo_bmxrp | 0:44429c0a71d4 | 1377 | * Get actual parameters of the device |
pablo_bmxrp | 0:44429c0a71d4 | 1378 | * @li Then start ranging operation. |
pablo_bmxrp | 0:44429c0a71d4 | 1379 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1380 | * @note This function Access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1381 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1382 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1383 | * @param p_device_parameters Pointer to store current device parameters. |
pablo_bmxrp | 0:44429c0a71d4 | 1384 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1385 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1386 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1387 | VL53L0X_Error VL53L0X_get_device_parameters(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1388 | VL53L0X_DeviceParameters_t *p_device_parameters); |
pablo_bmxrp | 0:44429c0a71d4 | 1389 | |
pablo_bmxrp | 0:44429c0a71d4 | 1390 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1391 | * @brief Human readable error string for current PAL error status |
pablo_bmxrp | 0:44429c0a71d4 | 1392 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1393 | * @note This function doesn't access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1394 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1395 | * @param pal_error_code The error code as stored on @a VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1396 | * @param p_pal_error_string The error string corresponding to the |
pablo_bmxrp | 0:44429c0a71d4 | 1397 | * PalErrorCode |
pablo_bmxrp | 0:44429c0a71d4 | 1398 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1399 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1400 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1401 | VL53L0X_Error VL53L0X_get_pal_error_string(VL53L0X_Error pal_error_code, |
pablo_bmxrp | 0:44429c0a71d4 | 1402 | char *p_pal_error_string); |
pablo_bmxrp | 0:44429c0a71d4 | 1403 | |
pablo_bmxrp | 0:44429c0a71d4 | 1404 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1405 | * @brief Return the PAL Specification Version used for the current |
pablo_bmxrp | 0:44429c0a71d4 | 1406 | * implementation. |
pablo_bmxrp | 0:44429c0a71d4 | 1407 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1408 | * @note This function doesn't access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1409 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1410 | * @param p_pal_spec_version Pointer to current PAL Specification Version |
pablo_bmxrp | 0:44429c0a71d4 | 1411 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1412 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1413 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1414 | VL53L0X_Error VL53L0X_get_pal_spec_version( |
pablo_bmxrp | 0:44429c0a71d4 | 1415 | VL53L0X_Version_t *p_pal_spec_version); |
pablo_bmxrp | 0:44429c0a71d4 | 1416 | |
pablo_bmxrp | 0:44429c0a71d4 | 1417 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1418 | * @brief Reads the internal state of the PAL for a given Device |
pablo_bmxrp | 0:44429c0a71d4 | 1419 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1420 | * @note This function doesn't access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1421 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1422 | * @param dev Device Handle |
pablo_bmxrp | 0:44429c0a71d4 | 1423 | * @param p_pal_state Pointer to current state of the PAL for a |
pablo_bmxrp | 0:44429c0a71d4 | 1424 | * given Device |
pablo_bmxrp | 0:44429c0a71d4 | 1425 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1426 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1427 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1428 | VL53L0X_Error VL53L0X_get_pal_state(VL53L0X_DEV dev, |
pablo_bmxrp | 0:44429c0a71d4 | 1429 | VL53L0X_State *p_pal_state); |
pablo_bmxrp | 0:44429c0a71d4 | 1430 | |
pablo_bmxrp | 0:44429c0a71d4 | 1431 | /** |
pablo_bmxrp | 0:44429c0a71d4 | 1432 | * @brief Human readable PAL State string |
pablo_bmxrp | 0:44429c0a71d4 | 1433 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1434 | * @note This function doesn't access to the device |
pablo_bmxrp | 0:44429c0a71d4 | 1435 | * |
pablo_bmxrp | 0:44429c0a71d4 | 1436 | * @param pal_state_code The State code as stored on @a VL53L0X_State |
pablo_bmxrp | 0:44429c0a71d4 | 1437 | * @param p_pal_state_string The State string corresponding to the |
pablo_bmxrp | 0:44429c0a71d4 | 1438 | * PalStateCode |
pablo_bmxrp | 0:44429c0a71d4 | 1439 | * @return VL53L0X_ERROR_NONE Success |
pablo_bmxrp | 0:44429c0a71d4 | 1440 | * @return "Other error code" See ::VL53L0X_Error |
pablo_bmxrp | 0:44429c0a71d4 | 1441 | */ |
pablo_bmxrp | 0:44429c0a71d4 | 1442 | VL53L0X_Error VL53L0X_get_pal_state_string(VL53L0X_State pal_state_code, |
pablo_bmxrp | 0:44429c0a71d4 | 1443 | char *p_pal_state_string); |
pablo_bmxrp | 0:44429c0a71d4 | 1444 | |
pablo_bmxrp | 0:44429c0a71d4 | 1445 | /*** End High level API ***/ |
pablo_bmxrp | 0:44429c0a71d4 | 1446 |