The VL53L1CB proximity sensor, based on ST’s FlightSense™, Time-of-Flight technology.

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   VL53L1CB_noshield_1sensor_polls_auton VL53L1CB_noshield_1sensor_interrupt_auton X_NUCLEO_53L1A2

Based on VL53L1 library, this is a library for the VL53L1CB ToF chip.

Committer:
charlesmn
Date:
Fri Nov 06 10:06:37 2020 +0000
Revision:
0:3ac96e360672
Child:
7:1add29d51e72
Library for ST Vl53L1A1 time of flight sensor.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
charlesmn 0:3ac96e360672 1
charlesmn 0:3ac96e360672 2 /*******************************************************************************
charlesmn 0:3ac96e360672 3 * Copyright (c) 2020, STMicroelectronics - All Rights Reserved
charlesmn 0:3ac96e360672 4
charlesmn 0:3ac96e360672 5 This file is part of VL53L1 Core and is dual licensed,
charlesmn 0:3ac96e360672 6 either 'STMicroelectronics
charlesmn 0:3ac96e360672 7 Proprietary license'
charlesmn 0:3ac96e360672 8 or 'BSD 3-clause "New" or "Revised" License' , at your option.
charlesmn 0:3ac96e360672 9
charlesmn 0:3ac96e360672 10 ********************************************************************************
charlesmn 0:3ac96e360672 11
charlesmn 0:3ac96e360672 12 'STMicroelectronics Proprietary license'
charlesmn 0:3ac96e360672 13
charlesmn 0:3ac96e360672 14 ********************************************************************************
charlesmn 0:3ac96e360672 15
charlesmn 0:3ac96e360672 16 License terms: STMicroelectronics Proprietary in accordance with licensing
charlesmn 0:3ac96e360672 17 terms at www.st.com/sla0081
charlesmn 0:3ac96e360672 18
charlesmn 0:3ac96e360672 19 STMicroelectronics confidential
charlesmn 0:3ac96e360672 20 Reproduction and Communication of this document is strictly prohibited unless
charlesmn 0:3ac96e360672 21 specifically authorized in writing by STMicroelectronics.
charlesmn 0:3ac96e360672 22
charlesmn 0:3ac96e360672 23
charlesmn 0:3ac96e360672 24 ********************************************************************************
charlesmn 0:3ac96e360672 25
charlesmn 0:3ac96e360672 26 Alternatively, VL53L1 Core may be distributed under the terms of
charlesmn 0:3ac96e360672 27 'BSD 3-clause "New" or "Revised" License', in which case the following
charlesmn 0:3ac96e360672 28 provisions apply instead of the ones
charlesmn 0:3ac96e360672 29 mentioned above :
charlesmn 0:3ac96e360672 30
charlesmn 0:3ac96e360672 31 ********************************************************************************
charlesmn 0:3ac96e360672 32
charlesmn 0:3ac96e360672 33 License terms: BSD 3-clause "New" or "Revised" License.
charlesmn 0:3ac96e360672 34
charlesmn 0:3ac96e360672 35 Redistribution and use in source and binary forms, with or without
charlesmn 0:3ac96e360672 36 modification, are permitted provided that the following conditions are met:
charlesmn 0:3ac96e360672 37
charlesmn 0:3ac96e360672 38 1. Redistributions of source code must retain the above copyright notice, this
charlesmn 0:3ac96e360672 39 list of conditions and the following disclaimer.
charlesmn 0:3ac96e360672 40
charlesmn 0:3ac96e360672 41 2. Redistributions in binary form must reproduce the above copyright notice,
charlesmn 0:3ac96e360672 42 this list of conditions and the following disclaimer in the documentation
charlesmn 0:3ac96e360672 43 and/or other materials provided with the distribution.
charlesmn 0:3ac96e360672 44
charlesmn 0:3ac96e360672 45 3. Neither the name of the copyright holder nor the names of its contributors
charlesmn 0:3ac96e360672 46 may be used to endorse or promote products derived from this software
charlesmn 0:3ac96e360672 47 without specific prior written permission.
charlesmn 0:3ac96e360672 48
charlesmn 0:3ac96e360672 49 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
charlesmn 0:3ac96e360672 50 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
charlesmn 0:3ac96e360672 51 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
charlesmn 0:3ac96e360672 52 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
charlesmn 0:3ac96e360672 53 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
charlesmn 0:3ac96e360672 54 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
charlesmn 0:3ac96e360672 55 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
charlesmn 0:3ac96e360672 56 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
charlesmn 0:3ac96e360672 57 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
charlesmn 0:3ac96e360672 58 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
charlesmn 0:3ac96e360672 59
charlesmn 0:3ac96e360672 60
charlesmn 0:3ac96e360672 61 ********************************************************************************
charlesmn 0:3ac96e360672 62
charlesmn 0:3ac96e360672 63 */
charlesmn 0:3ac96e360672 64
charlesmn 0:3ac96e360672 65
charlesmn 0:3ac96e360672 66
charlesmn 0:3ac96e360672 67
charlesmn 0:3ac96e360672 68 #include "vl53l1_ll_def.h"
charlesmn 0:3ac96e360672 69 #include "vl53l1_ll_device.h"
charlesmn 0:3ac96e360672 70 #include "vl53l1_register_structs.h"
charlesmn 0:3ac96e360672 71 #include "vl53l1_hist_structs.h"
charlesmn 0:3ac96e360672 72 #include "vl53l1_nvm_structs.h"
charlesmn 0:3ac96e360672 73 #include "vl53l1_nvm.h"
charlesmn 0:3ac96e360672 74 #include "vl53l1_core.h"
charlesmn 0:3ac96e360672 75 #include "vl53l1_api_debug.h"
charlesmn 0:3ac96e360672 76
charlesmn 0:3ac96e360672 77 #ifdef VL53L1_LOG_ENABLE
charlesmn 0:3ac96e360672 78 #include "vl53l1_nvm_debug.h"
charlesmn 0:3ac96e360672 79 #endif
charlesmn 0:3ac96e360672 80
charlesmn 0:3ac96e360672 81 #define LOG_FUNCTION_START(fmt, ...) \
charlesmn 0:3ac96e360672 82 _LOG_FUNCTION_START(VL53L1_TRACE_MODULE_CORE, fmt, ##__VA_ARGS__)
charlesmn 0:3ac96e360672 83 #define LOG_FUNCTION_END(status, ...) \
charlesmn 0:3ac96e360672 84 _LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__)
charlesmn 0:3ac96e360672 85 #define LOG_FUNCTION_END_FMT(status, fmt, ...) \
charlesmn 0:3ac96e360672 86 _LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE, status, \
charlesmn 0:3ac96e360672 87 fmt, ##__VA_ARGS__)
charlesmn 0:3ac96e360672 88
charlesmn 0:3ac96e360672 89 #define trace_print(level, ...) \
charlesmn 0:3ac96e360672 90 _LOG_TRACE_PRINT(trace_flags, \
charlesmn 0:3ac96e360672 91 level, VL53L1_TRACE_FUNCTION_NONE, ##__VA_ARGS__)
charlesmn 0:3ac96e360672 92
charlesmn 0:3ac96e360672 93
charlesmn 0:3ac96e360672 94 VL53L1_Error VL53L1_decode_calibration_data_buffer(
charlesmn 0:3ac96e360672 95 uint16_t buf_size,
charlesmn 0:3ac96e360672 96 uint8_t *pbuffer,
charlesmn 0:3ac96e360672 97 VL53L1_calibration_data_t *pdata)
charlesmn 0:3ac96e360672 98 {
charlesmn 0:3ac96e360672 99 VL53L1_Error status = VL53L1_ERROR_NONE;
charlesmn 0:3ac96e360672 100
charlesmn 0:3ac96e360672 101 LOG_FUNCTION_START("");
charlesmn 0:3ac96e360672 102
charlesmn 0:3ac96e360672 103 if (sizeof(VL53L1_calibration_data_t) > buf_size)
charlesmn 0:3ac96e360672 104 return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
charlesmn 0:3ac96e360672 105
charlesmn 0:3ac96e360672 106 memcpy(pdata, pbuffer, sizeof(VL53L1_calibration_data_t));
charlesmn 0:3ac96e360672 107
charlesmn 0:3ac96e360672 108 LOG_FUNCTION_END(status);
charlesmn 0:3ac96e360672 109
charlesmn 0:3ac96e360672 110 return status;
charlesmn 0:3ac96e360672 111 }
charlesmn 0:3ac96e360672 112
charlesmn 0:3ac96e360672 113
charlesmn 0:3ac96e360672 114 VL53L1_Error VL53L1_get_nvm_debug_data(
charlesmn 0:3ac96e360672 115 VL53L1_DEV Dev,
charlesmn 0:3ac96e360672 116 VL53L1_decoded_nvm_data_t *pdata)
charlesmn 0:3ac96e360672 117 {
charlesmn 0:3ac96e360672 118
charlesmn 0:3ac96e360672 119
charlesmn 0:3ac96e360672 120 VL53L1_Error status = VL53L1_ERROR_NONE;
charlesmn 0:3ac96e360672 121
charlesmn 0:3ac96e360672 122 LOG_FUNCTION_START("");
charlesmn 0:3ac96e360672 123
charlesmn 0:3ac96e360672 124 status = VL53L1_read_nvm(Dev, 0, pdata);
charlesmn 0:3ac96e360672 125
charlesmn 0:3ac96e360672 126 #ifdef VL53L1_LOG_ENABLE
charlesmn 0:3ac96e360672 127 if (status == VL53L1_ERROR_NONE)
charlesmn 0:3ac96e360672 128 VL53L1_print_decoded_nvm_data(
charlesmn 0:3ac96e360672 129 pdata,
charlesmn 0:3ac96e360672 130 "get_nvm_debug_data():pnvm_info.",
charlesmn 0:3ac96e360672 131 VL53L1_TRACE_MODULE_NVM_DATA);
charlesmn 0:3ac96e360672 132 #endif
charlesmn 0:3ac96e360672 133
charlesmn 0:3ac96e360672 134 LOG_FUNCTION_END(status);
charlesmn 0:3ac96e360672 135
charlesmn 0:3ac96e360672 136 return status;
charlesmn 0:3ac96e360672 137 }
charlesmn 0:3ac96e360672 138
charlesmn 0:3ac96e360672 139
charlesmn 0:3ac96e360672 140 VL53L1_Error VL53L1_get_histogram_debug_data(
charlesmn 0:3ac96e360672 141 VL53L1_DEV Dev,
charlesmn 0:3ac96e360672 142 VL53L1_histogram_bin_data_t *pdata)
charlesmn 0:3ac96e360672 143 {
charlesmn 0:3ac96e360672 144
charlesmn 0:3ac96e360672 145
charlesmn 0:3ac96e360672 146 VL53L1_Error status = VL53L1_ERROR_NONE;
charlesmn 0:3ac96e360672 147
charlesmn 0:3ac96e360672 148 VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
charlesmn 0:3ac96e360672 149
charlesmn 0:3ac96e360672 150 LOG_FUNCTION_START("");
charlesmn 0:3ac96e360672 151
charlesmn 0:3ac96e360672 152
charlesmn 0:3ac96e360672 153 memcpy(
charlesmn 0:3ac96e360672 154 pdata,
charlesmn 0:3ac96e360672 155 &(pdev->hist_data),
charlesmn 0:3ac96e360672 156 sizeof(VL53L1_histogram_bin_data_t));
charlesmn 0:3ac96e360672 157
charlesmn 0:3ac96e360672 158 LOG_FUNCTION_END(status);
charlesmn 0:3ac96e360672 159
charlesmn 0:3ac96e360672 160 return status;
charlesmn 0:3ac96e360672 161 }
charlesmn 0:3ac96e360672 162
charlesmn 0:3ac96e360672 163
charlesmn 0:3ac96e360672 164
charlesmn 0:3ac96e360672 165
charlesmn 0:3ac96e360672 166 VL53L1_Error VL53L1_get_additional_data(
charlesmn 0:3ac96e360672 167 VL53L1_DEV Dev,
charlesmn 0:3ac96e360672 168 VL53L1_additional_data_t *pdata)
charlesmn 0:3ac96e360672 169 {
charlesmn 0:3ac96e360672 170
charlesmn 0:3ac96e360672 171
charlesmn 0:3ac96e360672 172 VL53L1_Error status = VL53L1_ERROR_NONE;
charlesmn 0:3ac96e360672 173
charlesmn 0:3ac96e360672 174 VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
charlesmn 0:3ac96e360672 175
charlesmn 0:3ac96e360672 176 LOG_FUNCTION_START("");
charlesmn 0:3ac96e360672 177
charlesmn 0:3ac96e360672 178
charlesmn 0:3ac96e360672 179
charlesmn 0:3ac96e360672 180 pdata->preset_mode = pdev->preset_mode;
charlesmn 0:3ac96e360672 181 pdata->zone_preset = pdev->zone_preset;
charlesmn 0:3ac96e360672 182 pdata->measurement_mode = pdev->measurement_mode;
charlesmn 0:3ac96e360672 183 pdata->offset_calibration_mode = pdev->offset_calibration_mode;
charlesmn 0:3ac96e360672 184 pdata->offset_correction_mode = pdev->offset_correction_mode;
charlesmn 0:3ac96e360672 185 pdata->dmax_mode = pdev->dmax_mode;
charlesmn 0:3ac96e360672 186
charlesmn 0:3ac96e360672 187 pdata->phasecal_config_timeout_us = pdev->phasecal_config_timeout_us;
charlesmn 0:3ac96e360672 188 pdata->mm_config_timeout_us = pdev->mm_config_timeout_us;
charlesmn 0:3ac96e360672 189 pdata->range_config_timeout_us = pdev->range_config_timeout_us;
charlesmn 0:3ac96e360672 190 pdata->inter_measurement_period_ms = pdev->inter_measurement_period_ms;
charlesmn 0:3ac96e360672 191 pdata->dss_config__target_total_rate_mcps =
charlesmn 0:3ac96e360672 192 pdev->dss_config__target_total_rate_mcps;
charlesmn 0:3ac96e360672 193
charlesmn 0:3ac96e360672 194
charlesmn 0:3ac96e360672 195
charlesmn 0:3ac96e360672 196 status =
charlesmn 0:3ac96e360672 197 VL53L1_get_histogram_debug_data(
charlesmn 0:3ac96e360672 198 Dev,
charlesmn 0:3ac96e360672 199 &(pdata->VL53L1_p_010));
charlesmn 0:3ac96e360672 200
charlesmn 0:3ac96e360672 201 LOG_FUNCTION_END(status);
charlesmn 0:3ac96e360672 202
charlesmn 0:3ac96e360672 203 return status;
charlesmn 0:3ac96e360672 204 }
charlesmn 0:3ac96e360672 205
charlesmn 0:3ac96e360672 206
charlesmn 0:3ac96e360672 207
charlesmn 0:3ac96e360672 208
charlesmn 0:3ac96e360672 209 VL53L1_Error VL53L1_get_xtalk_debug_data(
charlesmn 0:3ac96e360672 210 VL53L1_DEV Dev,
charlesmn 0:3ac96e360672 211 VL53L1_xtalk_debug_data_t *pdata)
charlesmn 0:3ac96e360672 212 {
charlesmn 0:3ac96e360672 213
charlesmn 0:3ac96e360672 214
charlesmn 0:3ac96e360672 215 VL53L1_Error status = VL53L1_ERROR_NONE;
charlesmn 0:3ac96e360672 216
charlesmn 0:3ac96e360672 217 VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
charlesmn 0:3ac96e360672 218
charlesmn 0:3ac96e360672 219 LOG_FUNCTION_START("");
charlesmn 0:3ac96e360672 220
charlesmn 0:3ac96e360672 221
charlesmn 0:3ac96e360672 222 memcpy(
charlesmn 0:3ac96e360672 223 &(pdata->customer),
charlesmn 0:3ac96e360672 224 &(pdev->customer),
charlesmn 0:3ac96e360672 225 sizeof(VL53L1_customer_nvm_managed_t));
charlesmn 0:3ac96e360672 226
charlesmn 0:3ac96e360672 227 memcpy(
charlesmn 0:3ac96e360672 228 &(pdata->xtalk_cfg),
charlesmn 0:3ac96e360672 229 &(pdev->xtalk_cfg),
charlesmn 0:3ac96e360672 230 sizeof(VL53L1_xtalk_config_t));
charlesmn 0:3ac96e360672 231
charlesmn 0:3ac96e360672 232 memcpy(
charlesmn 0:3ac96e360672 233 &(pdata->hist_data),
charlesmn 0:3ac96e360672 234 &(pdev->hist_data),
charlesmn 0:3ac96e360672 235 sizeof(VL53L1_histogram_bin_data_t));
charlesmn 0:3ac96e360672 236
charlesmn 0:3ac96e360672 237 memcpy(
charlesmn 0:3ac96e360672 238 &(pdata->xtalk_shapes),
charlesmn 0:3ac96e360672 239 &(pdev->xtalk_shapes),
charlesmn 0:3ac96e360672 240 sizeof(VL53L1_xtalk_histogram_data_t));
charlesmn 0:3ac96e360672 241
charlesmn 0:3ac96e360672 242 memcpy(
charlesmn 0:3ac96e360672 243 &(pdata->xtalk_results),
charlesmn 0:3ac96e360672 244 &(pdev->xtalk_results),
charlesmn 0:3ac96e360672 245 sizeof(VL53L1_xtalk_range_results_t));
charlesmn 0:3ac96e360672 246
charlesmn 0:3ac96e360672 247 LOG_FUNCTION_END(status);
charlesmn 0:3ac96e360672 248
charlesmn 0:3ac96e360672 249 return status;
charlesmn 0:3ac96e360672 250 }
charlesmn 0:3ac96e360672 251
charlesmn 0:3ac96e360672 252
charlesmn 0:3ac96e360672 253 VL53L1_Error VL53L1_get_offset_debug_data(
charlesmn 0:3ac96e360672 254 VL53L1_DEV Dev,
charlesmn 0:3ac96e360672 255 VL53L1_offset_debug_data_t *pdata)
charlesmn 0:3ac96e360672 256 {
charlesmn 0:3ac96e360672 257
charlesmn 0:3ac96e360672 258
charlesmn 0:3ac96e360672 259 VL53L1_Error status = VL53L1_ERROR_NONE;
charlesmn 0:3ac96e360672 260
charlesmn 0:3ac96e360672 261 VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
charlesmn 0:3ac96e360672 262
charlesmn 0:3ac96e360672 263 LOG_FUNCTION_START("");
charlesmn 0:3ac96e360672 264
charlesmn 0:3ac96e360672 265
charlesmn 0:3ac96e360672 266 memcpy(
charlesmn 0:3ac96e360672 267 &(pdata->customer),
charlesmn 0:3ac96e360672 268 &(pdev->customer),
charlesmn 0:3ac96e360672 269 sizeof(VL53L1_customer_nvm_managed_t));
charlesmn 0:3ac96e360672 270
charlesmn 0:3ac96e360672 271 memcpy(
charlesmn 0:3ac96e360672 272 &(pdata->fmt_dmax_cal),
charlesmn 0:3ac96e360672 273 &(pdev->fmt_dmax_cal),
charlesmn 0:3ac96e360672 274 sizeof(VL53L1_dmax_calibration_data_t));
charlesmn 0:3ac96e360672 275
charlesmn 0:3ac96e360672 276 memcpy(
charlesmn 0:3ac96e360672 277 &(pdata->cust_dmax_cal),
charlesmn 0:3ac96e360672 278 &(pdev->cust_dmax_cal),
charlesmn 0:3ac96e360672 279 sizeof(VL53L1_dmax_calibration_data_t));
charlesmn 0:3ac96e360672 280
charlesmn 0:3ac96e360672 281 memcpy(
charlesmn 0:3ac96e360672 282 &(pdata->add_off_cal_data),
charlesmn 0:3ac96e360672 283 &(pdev->add_off_cal_data),
charlesmn 0:3ac96e360672 284 sizeof(VL53L1_additional_offset_cal_data_t));
charlesmn 0:3ac96e360672 285
charlesmn 0:3ac96e360672 286 memcpy(
charlesmn 0:3ac96e360672 287 &(pdata->offset_results),
charlesmn 0:3ac96e360672 288 &(pdev->offset_results),
charlesmn 0:3ac96e360672 289 sizeof(VL53L1_offset_range_results_t));
charlesmn 0:3ac96e360672 290
charlesmn 0:3ac96e360672 291 LOG_FUNCTION_END(status);
charlesmn 0:3ac96e360672 292
charlesmn 0:3ac96e360672 293 return status;
charlesmn 0:3ac96e360672 294 }
charlesmn 0:3ac96e360672 295
charlesmn 0:3ac96e360672 296 #ifdef VL53L1_LOG_ENABLE
charlesmn 0:3ac96e360672 297
charlesmn 0:3ac96e360672 298 void VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 299 int32_t signed_fp_value,
charlesmn 0:3ac96e360672 300 uint8_t frac_bits,
charlesmn 0:3ac96e360672 301 uint16_t buf_size,
charlesmn 0:3ac96e360672 302 char *pbuffer)
charlesmn 0:3ac96e360672 303 {
charlesmn 0:3ac96e360672 304
charlesmn 0:3ac96e360672 305
charlesmn 0:3ac96e360672 306 uint32_t fp_value = 0;
charlesmn 0:3ac96e360672 307 uint32_t unity_fp_value = 0;
charlesmn 0:3ac96e360672 308 uint32_t sign_bit = 0;
charlesmn 0:3ac96e360672 309 uint32_t int_part = 0;
charlesmn 0:3ac96e360672 310 uint32_t frac_part = 0;
charlesmn 0:3ac96e360672 311 uint32_t dec_points = 0;
charlesmn 0:3ac96e360672 312 uint32_t dec_scaler = 0;
charlesmn 0:3ac96e360672 313 uint32_t dec_part = 0;
charlesmn 0:3ac96e360672 314
charlesmn 0:3ac96e360672 315 uint64_t tmp_long_int = 0;
charlesmn 0:3ac96e360672 316
charlesmn 0:3ac96e360672 317 char fmt[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 318
charlesmn 0:3ac96e360672 319 SUPPRESS_UNUSED_WARNING(buf_size);
charlesmn 0:3ac96e360672 320
charlesmn 0:3ac96e360672 321
charlesmn 0:3ac96e360672 322
charlesmn 0:3ac96e360672 323 sign_bit = signed_fp_value >> 31;
charlesmn 0:3ac96e360672 324
charlesmn 0:3ac96e360672 325 if (sign_bit > 0) {
charlesmn 0:3ac96e360672 326 fp_value = 0x80000000 -
charlesmn 0:3ac96e360672 327 (0x7FFFFFFF & (uint32_t)signed_fp_value);
charlesmn 0:3ac96e360672 328 } else
charlesmn 0:3ac96e360672 329 fp_value = (uint32_t)signed_fp_value;
charlesmn 0:3ac96e360672 330
charlesmn 0:3ac96e360672 331 int_part = fp_value >> frac_bits;
charlesmn 0:3ac96e360672 332 unity_fp_value = 0x01 << frac_bits;
charlesmn 0:3ac96e360672 333 frac_part = fp_value & (unity_fp_value-1);
charlesmn 0:3ac96e360672 334
charlesmn 0:3ac96e360672 335
charlesmn 0:3ac96e360672 336 dec_points = 2;
charlesmn 0:3ac96e360672 337 dec_scaler = 100;
charlesmn 0:3ac96e360672 338
charlesmn 0:3ac96e360672 339 while (dec_scaler < unity_fp_value) {
charlesmn 0:3ac96e360672 340 dec_points++;
charlesmn 0:3ac96e360672 341 dec_scaler *= 10;
charlesmn 0:3ac96e360672 342 }
charlesmn 0:3ac96e360672 343
charlesmn 0:3ac96e360672 344
charlesmn 0:3ac96e360672 345 if (sign_bit > 0)
charlesmn 0:3ac96e360672 346 sprintf(fmt, "-%%u.%%0%uu", dec_points);
charlesmn 0:3ac96e360672 347 else
charlesmn 0:3ac96e360672 348 sprintf(fmt, "%%u.%%0%uu", dec_points);
charlesmn 0:3ac96e360672 349
charlesmn 0:3ac96e360672 350
charlesmn 0:3ac96e360672 351 tmp_long_int = (uint64_t)frac_part * (uint64_t)dec_scaler;
charlesmn 0:3ac96e360672 352 tmp_long_int += (uint64_t)unity_fp_value/2;
charlesmn 0:3ac96e360672 353
charlesmn 0:3ac96e360672 354 tmp_long_int = do_division_u(tmp_long_int, (uint64_t)unity_fp_value);
charlesmn 0:3ac96e360672 355
charlesmn 0:3ac96e360672 356 dec_part = (uint32_t)tmp_long_int;
charlesmn 0:3ac96e360672 357
charlesmn 0:3ac96e360672 358
charlesmn 0:3ac96e360672 359 sprintf(
charlesmn 0:3ac96e360672 360 pbuffer,
charlesmn 0:3ac96e360672 361 fmt,
charlesmn 0:3ac96e360672 362 int_part,
charlesmn 0:3ac96e360672 363 dec_part);
charlesmn 0:3ac96e360672 364 }
charlesmn 0:3ac96e360672 365
charlesmn 0:3ac96e360672 366
charlesmn 0:3ac96e360672 367 void VL53L1_print_static_nvm_managed(
charlesmn 0:3ac96e360672 368 VL53L1_static_nvm_managed_t *pdata,
charlesmn 0:3ac96e360672 369 char *pprefix,
charlesmn 0:3ac96e360672 370 uint32_t trace_flags)
charlesmn 0:3ac96e360672 371 {
charlesmn 0:3ac96e360672 372
charlesmn 0:3ac96e360672 373
charlesmn 0:3ac96e360672 374 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 375
charlesmn 0:3ac96e360672 376 trace_print(
charlesmn 0:3ac96e360672 377 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 378 "%s%s = 0x%02X\n",
charlesmn 0:3ac96e360672 379 pprefix,
charlesmn 0:3ac96e360672 380 "i2c_slave__device_address",
charlesmn 0:3ac96e360672 381 pdata->i2c_slave__device_address);
charlesmn 0:3ac96e360672 382
charlesmn 0:3ac96e360672 383 trace_print(
charlesmn 0:3ac96e360672 384 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 385 "%s%s = %u\n",
charlesmn 0:3ac96e360672 386 pprefix,
charlesmn 0:3ac96e360672 387 "ana_config__vhv_ref_sel_vddpix",
charlesmn 0:3ac96e360672 388 pdata->ana_config__vhv_ref_sel_vddpix);
charlesmn 0:3ac96e360672 389
charlesmn 0:3ac96e360672 390 trace_print(
charlesmn 0:3ac96e360672 391 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 392 "%s%s = %u\n",
charlesmn 0:3ac96e360672 393 pprefix,
charlesmn 0:3ac96e360672 394 "ana_config__vhv_ref_sel_vquench",
charlesmn 0:3ac96e360672 395 pdata->ana_config__vhv_ref_sel_vquench);
charlesmn 0:3ac96e360672 396
charlesmn 0:3ac96e360672 397 trace_print(
charlesmn 0:3ac96e360672 398 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 399 "%s%s = %u\n",
charlesmn 0:3ac96e360672 400 pprefix,
charlesmn 0:3ac96e360672 401 "ana_config__reg_avdd1v2_sel",
charlesmn 0:3ac96e360672 402 pdata->ana_config__reg_avdd1v2_sel);
charlesmn 0:3ac96e360672 403
charlesmn 0:3ac96e360672 404 trace_print(
charlesmn 0:3ac96e360672 405 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 406 "%s%s = %u\n",
charlesmn 0:3ac96e360672 407 pprefix,
charlesmn 0:3ac96e360672 408 "ana_config__fast_osc__trim",
charlesmn 0:3ac96e360672 409 pdata->ana_config__fast_osc__trim);
charlesmn 0:3ac96e360672 410
charlesmn 0:3ac96e360672 411 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 412 (int32_t)pdata->osc_measured__fast_osc__frequency,
charlesmn 0:3ac96e360672 413 12,
charlesmn 0:3ac96e360672 414 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 415 fp_text);
charlesmn 0:3ac96e360672 416
charlesmn 0:3ac96e360672 417 trace_print(
charlesmn 0:3ac96e360672 418 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 419 "%s%s = %s\n",
charlesmn 0:3ac96e360672 420 pprefix,
charlesmn 0:3ac96e360672 421 "osc_measured__fast_osc__frequency",
charlesmn 0:3ac96e360672 422 fp_text);
charlesmn 0:3ac96e360672 423
charlesmn 0:3ac96e360672 424 trace_print(
charlesmn 0:3ac96e360672 425 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 426 "%s%s = %u\n",
charlesmn 0:3ac96e360672 427 pprefix,
charlesmn 0:3ac96e360672 428 "vhv_config__timeout_macrop_loop_bound",
charlesmn 0:3ac96e360672 429 pdata->vhv_config__timeout_macrop_loop_bound);
charlesmn 0:3ac96e360672 430
charlesmn 0:3ac96e360672 431 trace_print(
charlesmn 0:3ac96e360672 432 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 433 "%s%s = %u\n",
charlesmn 0:3ac96e360672 434 pprefix,
charlesmn 0:3ac96e360672 435 "vhv_config__count_thresh",
charlesmn 0:3ac96e360672 436 pdata->vhv_config__count_thresh);
charlesmn 0:3ac96e360672 437
charlesmn 0:3ac96e360672 438 trace_print(
charlesmn 0:3ac96e360672 439 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 440 "%s%s = %u\n",
charlesmn 0:3ac96e360672 441 pprefix,
charlesmn 0:3ac96e360672 442 "vhv_config__offset",
charlesmn 0:3ac96e360672 443 pdata->vhv_config__offset);
charlesmn 0:3ac96e360672 444
charlesmn 0:3ac96e360672 445 trace_print(
charlesmn 0:3ac96e360672 446 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 447 "%s%s = %u\n",
charlesmn 0:3ac96e360672 448 pprefix,
charlesmn 0:3ac96e360672 449 "vhv_config__init",
charlesmn 0:3ac96e360672 450 pdata->vhv_config__init);
charlesmn 0:3ac96e360672 451 }
charlesmn 0:3ac96e360672 452
charlesmn 0:3ac96e360672 453
charlesmn 0:3ac96e360672 454 void VL53L1_print_customer_nvm_managed(
charlesmn 0:3ac96e360672 455 VL53L1_customer_nvm_managed_t *pdata,
charlesmn 0:3ac96e360672 456 char *pprefix,
charlesmn 0:3ac96e360672 457 uint32_t trace_flags)
charlesmn 0:3ac96e360672 458 {
charlesmn 0:3ac96e360672 459
charlesmn 0:3ac96e360672 460
charlesmn 0:3ac96e360672 461 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 462 int16_t tmpi16;
charlesmn 0:3ac96e360672 463
charlesmn 0:3ac96e360672 464 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 465 "%s%s = %u\n",
charlesmn 0:3ac96e360672 466 pprefix,
charlesmn 0:3ac96e360672 467 "global_config__spad_enables_ref_0",
charlesmn 0:3ac96e360672 468 pdata->global_config__spad_enables_ref_0);
charlesmn 0:3ac96e360672 469
charlesmn 0:3ac96e360672 470 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 471 "%s%s = %u\n",
charlesmn 0:3ac96e360672 472 pprefix,
charlesmn 0:3ac96e360672 473 "global_config__spad_enables_ref_1",
charlesmn 0:3ac96e360672 474 pdata->global_config__spad_enables_ref_1);
charlesmn 0:3ac96e360672 475
charlesmn 0:3ac96e360672 476 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 477 "%s%s = %u\n",
charlesmn 0:3ac96e360672 478 pprefix,
charlesmn 0:3ac96e360672 479 "global_config__spad_enables_ref_2",
charlesmn 0:3ac96e360672 480 pdata->global_config__spad_enables_ref_2);
charlesmn 0:3ac96e360672 481
charlesmn 0:3ac96e360672 482 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 483 "%s%s = %u\n",
charlesmn 0:3ac96e360672 484 pprefix,
charlesmn 0:3ac96e360672 485 "global_config__spad_enables_ref_3",
charlesmn 0:3ac96e360672 486 pdata->global_config__spad_enables_ref_3);
charlesmn 0:3ac96e360672 487
charlesmn 0:3ac96e360672 488 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 489 "%s%s = %u\n",
charlesmn 0:3ac96e360672 490 pprefix,
charlesmn 0:3ac96e360672 491 "global_config__spad_enables_ref_4",
charlesmn 0:3ac96e360672 492 pdata->global_config__spad_enables_ref_4);
charlesmn 0:3ac96e360672 493
charlesmn 0:3ac96e360672 494 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 495 "%s%s = %u\n",
charlesmn 0:3ac96e360672 496 pprefix,
charlesmn 0:3ac96e360672 497 "global_config__spad_enables_ref_5",
charlesmn 0:3ac96e360672 498 pdata->global_config__spad_enables_ref_5);
charlesmn 0:3ac96e360672 499
charlesmn 0:3ac96e360672 500 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 501 "%s%s = %u\n",
charlesmn 0:3ac96e360672 502 pprefix,
charlesmn 0:3ac96e360672 503 "global_config__ref_en_start_select",
charlesmn 0:3ac96e360672 504 pdata->global_config__ref_en_start_select);
charlesmn 0:3ac96e360672 505
charlesmn 0:3ac96e360672 506 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 507 "%s%s = %u\n",
charlesmn 0:3ac96e360672 508 pprefix,
charlesmn 0:3ac96e360672 509 "ref_spad_man__num_requested_ref_spads",
charlesmn 0:3ac96e360672 510 pdata->ref_spad_man__num_requested_ref_spads);
charlesmn 0:3ac96e360672 511
charlesmn 0:3ac96e360672 512 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 513 "%s%s = %u\n",
charlesmn 0:3ac96e360672 514 pprefix,
charlesmn 0:3ac96e360672 515 "ref_spad_man__ref_location",
charlesmn 0:3ac96e360672 516 pdata->ref_spad_man__ref_location);
charlesmn 0:3ac96e360672 517
charlesmn 0:3ac96e360672 518 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 519 (int32_t)pdata->algo__crosstalk_compensation_plane_offset_kcps,
charlesmn 0:3ac96e360672 520 9,
charlesmn 0:3ac96e360672 521 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 522 fp_text);
charlesmn 0:3ac96e360672 523
charlesmn 0:3ac96e360672 524 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 525 "%s%s = %s\n",
charlesmn 0:3ac96e360672 526 pprefix,
charlesmn 0:3ac96e360672 527 "algo__crosstalk_compensation_plane_offset_kcps",
charlesmn 0:3ac96e360672 528 fp_text);
charlesmn 0:3ac96e360672 529
charlesmn 0:3ac96e360672 530 tmpi16 = pdata->algo__crosstalk_compensation_x_plane_gradient_kcps;
charlesmn 0:3ac96e360672 531 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 532 (int32_t)tmpi16,
charlesmn 0:3ac96e360672 533 11,
charlesmn 0:3ac96e360672 534 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 535 fp_text);
charlesmn 0:3ac96e360672 536
charlesmn 0:3ac96e360672 537 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 538 "%s%s = %s\n",
charlesmn 0:3ac96e360672 539 pprefix,
charlesmn 0:3ac96e360672 540 "algo__crosstalk_compensation_x_plane_gradient_kcps",
charlesmn 0:3ac96e360672 541 fp_text);
charlesmn 0:3ac96e360672 542
charlesmn 0:3ac96e360672 543 tmpi16 = pdata->algo__crosstalk_compensation_y_plane_gradient_kcps;
charlesmn 0:3ac96e360672 544 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 545 (int32_t)tmpi16,
charlesmn 0:3ac96e360672 546 11,
charlesmn 0:3ac96e360672 547 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 548 fp_text);
charlesmn 0:3ac96e360672 549
charlesmn 0:3ac96e360672 550 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 551 "%s%s = %s\n",
charlesmn 0:3ac96e360672 552 pprefix,
charlesmn 0:3ac96e360672 553 "algo__crosstalk_compensation_y_plane_gradient_kcps",
charlesmn 0:3ac96e360672 554 fp_text);
charlesmn 0:3ac96e360672 555
charlesmn 0:3ac96e360672 556 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 557 (int32_t)pdata->ref_spad_char__total_rate_target_mcps,
charlesmn 0:3ac96e360672 558 7,
charlesmn 0:3ac96e360672 559 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 560 fp_text);
charlesmn 0:3ac96e360672 561
charlesmn 0:3ac96e360672 562 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 563 "%s%s = %s\n",
charlesmn 0:3ac96e360672 564 pprefix,
charlesmn 0:3ac96e360672 565 "ref_spad_char__total_rate_target_mcps",
charlesmn 0:3ac96e360672 566 fp_text);
charlesmn 0:3ac96e360672 567
charlesmn 0:3ac96e360672 568 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 569 (int32_t)pdata->algo__part_to_part_range_offset_mm,
charlesmn 0:3ac96e360672 570 2,
charlesmn 0:3ac96e360672 571 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 572 fp_text);
charlesmn 0:3ac96e360672 573
charlesmn 0:3ac96e360672 574 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 575 "%s%s = %s\n",
charlesmn 0:3ac96e360672 576 pprefix,
charlesmn 0:3ac96e360672 577 "algo__part_to_part_range_offset_mm",
charlesmn 0:3ac96e360672 578 fp_text);
charlesmn 0:3ac96e360672 579
charlesmn 0:3ac96e360672 580 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 581 "%s%s = %d\n",
charlesmn 0:3ac96e360672 582 pprefix,
charlesmn 0:3ac96e360672 583 "mm_config__inner_offset_mm",
charlesmn 0:3ac96e360672 584 pdata->mm_config__inner_offset_mm);
charlesmn 0:3ac96e360672 585
charlesmn 0:3ac96e360672 586 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 587 "%s%s = %d\n",
charlesmn 0:3ac96e360672 588 pprefix,
charlesmn 0:3ac96e360672 589 "mm_config__outer_offset_mm",
charlesmn 0:3ac96e360672 590 pdata->mm_config__outer_offset_mm);
charlesmn 0:3ac96e360672 591 }
charlesmn 0:3ac96e360672 592
charlesmn 0:3ac96e360672 593
charlesmn 0:3ac96e360672 594 void VL53L1_print_nvm_copy_data(
charlesmn 0:3ac96e360672 595 VL53L1_nvm_copy_data_t *pdata,
charlesmn 0:3ac96e360672 596 char *pprefix,
charlesmn 0:3ac96e360672 597 uint32_t trace_flags)
charlesmn 0:3ac96e360672 598 {
charlesmn 0:3ac96e360672 599
charlesmn 0:3ac96e360672 600
charlesmn 0:3ac96e360672 601 trace_print(
charlesmn 0:3ac96e360672 602 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 603 "%s%s = %u\n",
charlesmn 0:3ac96e360672 604 pprefix,
charlesmn 0:3ac96e360672 605 "identification__model_id",
charlesmn 0:3ac96e360672 606 pdata->identification__model_id);
charlesmn 0:3ac96e360672 607
charlesmn 0:3ac96e360672 608 trace_print(
charlesmn 0:3ac96e360672 609 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 610 "%s%s = %u\n",
charlesmn 0:3ac96e360672 611 pprefix,
charlesmn 0:3ac96e360672 612 "identification__module_type",
charlesmn 0:3ac96e360672 613 pdata->identification__module_type);
charlesmn 0:3ac96e360672 614
charlesmn 0:3ac96e360672 615 trace_print(
charlesmn 0:3ac96e360672 616 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 617 "%s%s = %u\n",
charlesmn 0:3ac96e360672 618 pprefix,
charlesmn 0:3ac96e360672 619 "identification__revision_id",
charlesmn 0:3ac96e360672 620 pdata->identification__revision_id);
charlesmn 0:3ac96e360672 621
charlesmn 0:3ac96e360672 622 trace_print(
charlesmn 0:3ac96e360672 623 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 624 "%s%s = %u\n",
charlesmn 0:3ac96e360672 625 pprefix,
charlesmn 0:3ac96e360672 626 "identification__module_id",
charlesmn 0:3ac96e360672 627 pdata->identification__module_id);
charlesmn 0:3ac96e360672 628
charlesmn 0:3ac96e360672 629 trace_print(
charlesmn 0:3ac96e360672 630 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 631 "%s%s = %u\n",
charlesmn 0:3ac96e360672 632 pprefix,
charlesmn 0:3ac96e360672 633 "ana_config__fast_osc__trim_max",
charlesmn 0:3ac96e360672 634 pdata->ana_config__fast_osc__trim_max);
charlesmn 0:3ac96e360672 635
charlesmn 0:3ac96e360672 636 trace_print(
charlesmn 0:3ac96e360672 637 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 638 "%s%s = %u\n",
charlesmn 0:3ac96e360672 639 pprefix,
charlesmn 0:3ac96e360672 640 "ana_config__fast_osc__freq_set",
charlesmn 0:3ac96e360672 641 pdata->ana_config__fast_osc__freq_set);
charlesmn 0:3ac96e360672 642
charlesmn 0:3ac96e360672 643 trace_print(
charlesmn 0:3ac96e360672 644 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 645 "%s%s = %u\n",
charlesmn 0:3ac96e360672 646 pprefix,
charlesmn 0:3ac96e360672 647 "ana_config__vcsel_trim",
charlesmn 0:3ac96e360672 648 pdata->ana_config__vcsel_trim);
charlesmn 0:3ac96e360672 649
charlesmn 0:3ac96e360672 650 trace_print(
charlesmn 0:3ac96e360672 651 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 652 "%s%s = %u\n",
charlesmn 0:3ac96e360672 653 pprefix,
charlesmn 0:3ac96e360672 654 "ana_config__vcsel_selion",
charlesmn 0:3ac96e360672 655 pdata->ana_config__vcsel_selion);
charlesmn 0:3ac96e360672 656
charlesmn 0:3ac96e360672 657 trace_print(
charlesmn 0:3ac96e360672 658 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 659 "%s%s = %u\n",
charlesmn 0:3ac96e360672 660 pprefix,
charlesmn 0:3ac96e360672 661 "ana_config__vcsel_selion_max",
charlesmn 0:3ac96e360672 662 pdata->ana_config__vcsel_selion_max);
charlesmn 0:3ac96e360672 663
charlesmn 0:3ac96e360672 664 trace_print(
charlesmn 0:3ac96e360672 665 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 666 "%s%s = %u\n",
charlesmn 0:3ac96e360672 667 pprefix,
charlesmn 0:3ac96e360672 668 "protected_laser_safety__lock_bit",
charlesmn 0:3ac96e360672 669 pdata->protected_laser_safety__lock_bit);
charlesmn 0:3ac96e360672 670
charlesmn 0:3ac96e360672 671 trace_print(
charlesmn 0:3ac96e360672 672 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 673 "%s%s = %u\n",
charlesmn 0:3ac96e360672 674 pprefix,
charlesmn 0:3ac96e360672 675 "laser_safety__key",
charlesmn 0:3ac96e360672 676 pdata->laser_safety__key);
charlesmn 0:3ac96e360672 677
charlesmn 0:3ac96e360672 678 trace_print(
charlesmn 0:3ac96e360672 679 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 680 "%s%s = %u\n",
charlesmn 0:3ac96e360672 681 pprefix,
charlesmn 0:3ac96e360672 682 "laser_safety__key_ro",
charlesmn 0:3ac96e360672 683 pdata->laser_safety__key_ro);
charlesmn 0:3ac96e360672 684
charlesmn 0:3ac96e360672 685 trace_print(
charlesmn 0:3ac96e360672 686 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 687 "%s%s = %u\n",
charlesmn 0:3ac96e360672 688 pprefix,
charlesmn 0:3ac96e360672 689 "laser_safety__clip",
charlesmn 0:3ac96e360672 690 pdata->laser_safety__clip);
charlesmn 0:3ac96e360672 691
charlesmn 0:3ac96e360672 692 trace_print(
charlesmn 0:3ac96e360672 693 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 694 "%s%s = %u\n",
charlesmn 0:3ac96e360672 695 pprefix,
charlesmn 0:3ac96e360672 696 "laser_safety__mult",
charlesmn 0:3ac96e360672 697 pdata->laser_safety__mult);
charlesmn 0:3ac96e360672 698
charlesmn 0:3ac96e360672 699 trace_print(
charlesmn 0:3ac96e360672 700 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 701 "%s%s = %u\n",
charlesmn 0:3ac96e360672 702 pprefix,
charlesmn 0:3ac96e360672 703 "global_config__spad_enables_rtn_0",
charlesmn 0:3ac96e360672 704 pdata->global_config__spad_enables_rtn_0);
charlesmn 0:3ac96e360672 705
charlesmn 0:3ac96e360672 706 trace_print(
charlesmn 0:3ac96e360672 707 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 708 "%s%s = %u\n",
charlesmn 0:3ac96e360672 709 pprefix,
charlesmn 0:3ac96e360672 710 "global_config__spad_enables_rtn_1",
charlesmn 0:3ac96e360672 711 pdata->global_config__spad_enables_rtn_1);
charlesmn 0:3ac96e360672 712
charlesmn 0:3ac96e360672 713 trace_print(
charlesmn 0:3ac96e360672 714 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 715 "%s%s = %u\n",
charlesmn 0:3ac96e360672 716 pprefix,
charlesmn 0:3ac96e360672 717 "global_config__spad_enables_rtn_2",
charlesmn 0:3ac96e360672 718 pdata->global_config__spad_enables_rtn_2);
charlesmn 0:3ac96e360672 719
charlesmn 0:3ac96e360672 720 trace_print(
charlesmn 0:3ac96e360672 721 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 722 "%s%s = %u\n",
charlesmn 0:3ac96e360672 723 pprefix,
charlesmn 0:3ac96e360672 724 "global_config__spad_enables_rtn_3",
charlesmn 0:3ac96e360672 725 pdata->global_config__spad_enables_rtn_3);
charlesmn 0:3ac96e360672 726
charlesmn 0:3ac96e360672 727 trace_print(
charlesmn 0:3ac96e360672 728 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 729 "%s%s = %u\n",
charlesmn 0:3ac96e360672 730 pprefix,
charlesmn 0:3ac96e360672 731 "global_config__spad_enables_rtn_4",
charlesmn 0:3ac96e360672 732 pdata->global_config__spad_enables_rtn_4);
charlesmn 0:3ac96e360672 733
charlesmn 0:3ac96e360672 734 trace_print(
charlesmn 0:3ac96e360672 735 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 736 "%s%s = %u\n",
charlesmn 0:3ac96e360672 737 pprefix,
charlesmn 0:3ac96e360672 738 "global_config__spad_enables_rtn_5",
charlesmn 0:3ac96e360672 739 pdata->global_config__spad_enables_rtn_5);
charlesmn 0:3ac96e360672 740
charlesmn 0:3ac96e360672 741 trace_print(
charlesmn 0:3ac96e360672 742 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 743 "%s%s = %u\n",
charlesmn 0:3ac96e360672 744 pprefix,
charlesmn 0:3ac96e360672 745 "global_config__spad_enables_rtn_6",
charlesmn 0:3ac96e360672 746 pdata->global_config__spad_enables_rtn_6);
charlesmn 0:3ac96e360672 747
charlesmn 0:3ac96e360672 748 trace_print(
charlesmn 0:3ac96e360672 749 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 750 "%s%s = %u\n",
charlesmn 0:3ac96e360672 751 pprefix,
charlesmn 0:3ac96e360672 752 "global_config__spad_enables_rtn_7",
charlesmn 0:3ac96e360672 753 pdata->global_config__spad_enables_rtn_7);
charlesmn 0:3ac96e360672 754
charlesmn 0:3ac96e360672 755 trace_print(
charlesmn 0:3ac96e360672 756 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 757 "%s%s = %u\n",
charlesmn 0:3ac96e360672 758 pprefix,
charlesmn 0:3ac96e360672 759 "global_config__spad_enables_rtn_8",
charlesmn 0:3ac96e360672 760 pdata->global_config__spad_enables_rtn_8);
charlesmn 0:3ac96e360672 761
charlesmn 0:3ac96e360672 762 trace_print(
charlesmn 0:3ac96e360672 763 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 764 "%s%s = %u\n",
charlesmn 0:3ac96e360672 765 pprefix,
charlesmn 0:3ac96e360672 766 "global_config__spad_enables_rtn_9",
charlesmn 0:3ac96e360672 767 pdata->global_config__spad_enables_rtn_9);
charlesmn 0:3ac96e360672 768
charlesmn 0:3ac96e360672 769 trace_print(
charlesmn 0:3ac96e360672 770 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 771 "%s%s = %u\n",
charlesmn 0:3ac96e360672 772 pprefix,
charlesmn 0:3ac96e360672 773 "global_config__spad_enables_rtn_10",
charlesmn 0:3ac96e360672 774 pdata->global_config__spad_enables_rtn_10);
charlesmn 0:3ac96e360672 775
charlesmn 0:3ac96e360672 776 trace_print(
charlesmn 0:3ac96e360672 777 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 778 "%s%s = %u\n",
charlesmn 0:3ac96e360672 779 pprefix,
charlesmn 0:3ac96e360672 780 "global_config__spad_enables_rtn_11",
charlesmn 0:3ac96e360672 781 pdata->global_config__spad_enables_rtn_11);
charlesmn 0:3ac96e360672 782
charlesmn 0:3ac96e360672 783 trace_print(
charlesmn 0:3ac96e360672 784 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 785 "%s%s = %u\n",
charlesmn 0:3ac96e360672 786 pprefix,
charlesmn 0:3ac96e360672 787 "global_config__spad_enables_rtn_12",
charlesmn 0:3ac96e360672 788 pdata->global_config__spad_enables_rtn_12);
charlesmn 0:3ac96e360672 789
charlesmn 0:3ac96e360672 790 trace_print(
charlesmn 0:3ac96e360672 791 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 792 "%s%s = %u\n",
charlesmn 0:3ac96e360672 793 pprefix,
charlesmn 0:3ac96e360672 794 "global_config__spad_enables_rtn_13",
charlesmn 0:3ac96e360672 795 pdata->global_config__spad_enables_rtn_13);
charlesmn 0:3ac96e360672 796
charlesmn 0:3ac96e360672 797 trace_print(
charlesmn 0:3ac96e360672 798 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 799 "%s%s = %u\n",
charlesmn 0:3ac96e360672 800 pprefix,
charlesmn 0:3ac96e360672 801 "global_config__spad_enables_rtn_14",
charlesmn 0:3ac96e360672 802 pdata->global_config__spad_enables_rtn_14);
charlesmn 0:3ac96e360672 803
charlesmn 0:3ac96e360672 804 trace_print(
charlesmn 0:3ac96e360672 805 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 806 "%s%s = %u\n",
charlesmn 0:3ac96e360672 807 pprefix,
charlesmn 0:3ac96e360672 808 "global_config__spad_enables_rtn_15",
charlesmn 0:3ac96e360672 809 pdata->global_config__spad_enables_rtn_15);
charlesmn 0:3ac96e360672 810
charlesmn 0:3ac96e360672 811 trace_print(
charlesmn 0:3ac96e360672 812 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 813 "%s%s = %u\n",
charlesmn 0:3ac96e360672 814 pprefix,
charlesmn 0:3ac96e360672 815 "global_config__spad_enables_rtn_16",
charlesmn 0:3ac96e360672 816 pdata->global_config__spad_enables_rtn_16);
charlesmn 0:3ac96e360672 817
charlesmn 0:3ac96e360672 818 trace_print(
charlesmn 0:3ac96e360672 819 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 820 "%s%s = %u\n",
charlesmn 0:3ac96e360672 821 pprefix,
charlesmn 0:3ac96e360672 822 "global_config__spad_enables_rtn_17",
charlesmn 0:3ac96e360672 823 pdata->global_config__spad_enables_rtn_17);
charlesmn 0:3ac96e360672 824
charlesmn 0:3ac96e360672 825 trace_print(
charlesmn 0:3ac96e360672 826 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 827 "%s%s = %u\n",
charlesmn 0:3ac96e360672 828 pprefix,
charlesmn 0:3ac96e360672 829 "global_config__spad_enables_rtn_18",
charlesmn 0:3ac96e360672 830 pdata->global_config__spad_enables_rtn_18);
charlesmn 0:3ac96e360672 831
charlesmn 0:3ac96e360672 832 trace_print(
charlesmn 0:3ac96e360672 833 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 834 "%s%s = %u\n",
charlesmn 0:3ac96e360672 835 pprefix,
charlesmn 0:3ac96e360672 836 "global_config__spad_enables_rtn_19",
charlesmn 0:3ac96e360672 837 pdata->global_config__spad_enables_rtn_19);
charlesmn 0:3ac96e360672 838
charlesmn 0:3ac96e360672 839 trace_print(
charlesmn 0:3ac96e360672 840 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 841 "%s%s = %u\n",
charlesmn 0:3ac96e360672 842 pprefix,
charlesmn 0:3ac96e360672 843 "global_config__spad_enables_rtn_20",
charlesmn 0:3ac96e360672 844 pdata->global_config__spad_enables_rtn_20);
charlesmn 0:3ac96e360672 845
charlesmn 0:3ac96e360672 846 trace_print(
charlesmn 0:3ac96e360672 847 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 848 "%s%s = %u\n",
charlesmn 0:3ac96e360672 849 pprefix,
charlesmn 0:3ac96e360672 850 "global_config__spad_enables_rtn_21",
charlesmn 0:3ac96e360672 851 pdata->global_config__spad_enables_rtn_21);
charlesmn 0:3ac96e360672 852
charlesmn 0:3ac96e360672 853 trace_print(
charlesmn 0:3ac96e360672 854 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 855 "%s%s = %u\n",
charlesmn 0:3ac96e360672 856 pprefix,
charlesmn 0:3ac96e360672 857 "global_config__spad_enables_rtn_22",
charlesmn 0:3ac96e360672 858 pdata->global_config__spad_enables_rtn_22);
charlesmn 0:3ac96e360672 859
charlesmn 0:3ac96e360672 860 trace_print(
charlesmn 0:3ac96e360672 861 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 862 "%s%s = %u\n",
charlesmn 0:3ac96e360672 863 pprefix,
charlesmn 0:3ac96e360672 864 "global_config__spad_enables_rtn_23",
charlesmn 0:3ac96e360672 865 pdata->global_config__spad_enables_rtn_23);
charlesmn 0:3ac96e360672 866
charlesmn 0:3ac96e360672 867 trace_print(
charlesmn 0:3ac96e360672 868 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 869 "%s%s = %u\n",
charlesmn 0:3ac96e360672 870 pprefix,
charlesmn 0:3ac96e360672 871 "global_config__spad_enables_rtn_24",
charlesmn 0:3ac96e360672 872 pdata->global_config__spad_enables_rtn_24);
charlesmn 0:3ac96e360672 873
charlesmn 0:3ac96e360672 874 trace_print(
charlesmn 0:3ac96e360672 875 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 876 "%s%s = %u\n",
charlesmn 0:3ac96e360672 877 pprefix,
charlesmn 0:3ac96e360672 878 "global_config__spad_enables_rtn_25",
charlesmn 0:3ac96e360672 879 pdata->global_config__spad_enables_rtn_25);
charlesmn 0:3ac96e360672 880
charlesmn 0:3ac96e360672 881 trace_print(
charlesmn 0:3ac96e360672 882 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 883 "%s%s = %u\n",
charlesmn 0:3ac96e360672 884 pprefix,
charlesmn 0:3ac96e360672 885 "global_config__spad_enables_rtn_26",
charlesmn 0:3ac96e360672 886 pdata->global_config__spad_enables_rtn_26);
charlesmn 0:3ac96e360672 887
charlesmn 0:3ac96e360672 888 trace_print(
charlesmn 0:3ac96e360672 889 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 890 "%s%s = %u\n",
charlesmn 0:3ac96e360672 891 pprefix,
charlesmn 0:3ac96e360672 892 "global_config__spad_enables_rtn_27",
charlesmn 0:3ac96e360672 893 pdata->global_config__spad_enables_rtn_27);
charlesmn 0:3ac96e360672 894
charlesmn 0:3ac96e360672 895 trace_print(
charlesmn 0:3ac96e360672 896 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 897 "%s%s = %u\n",
charlesmn 0:3ac96e360672 898 pprefix,
charlesmn 0:3ac96e360672 899 "global_config__spad_enables_rtn_28",
charlesmn 0:3ac96e360672 900 pdata->global_config__spad_enables_rtn_28);
charlesmn 0:3ac96e360672 901
charlesmn 0:3ac96e360672 902 trace_print(
charlesmn 0:3ac96e360672 903 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 904 "%s%s = %u\n",
charlesmn 0:3ac96e360672 905 pprefix,
charlesmn 0:3ac96e360672 906 "global_config__spad_enables_rtn_29",
charlesmn 0:3ac96e360672 907 pdata->global_config__spad_enables_rtn_29);
charlesmn 0:3ac96e360672 908
charlesmn 0:3ac96e360672 909 trace_print(
charlesmn 0:3ac96e360672 910 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 911 "%s%s = %u\n",
charlesmn 0:3ac96e360672 912 pprefix,
charlesmn 0:3ac96e360672 913 "global_config__spad_enables_rtn_30",
charlesmn 0:3ac96e360672 914 pdata->global_config__spad_enables_rtn_30);
charlesmn 0:3ac96e360672 915
charlesmn 0:3ac96e360672 916 trace_print(
charlesmn 0:3ac96e360672 917 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 918 "%s%s = %u\n",
charlesmn 0:3ac96e360672 919 pprefix,
charlesmn 0:3ac96e360672 920 "global_config__spad_enables_rtn_31",
charlesmn 0:3ac96e360672 921 pdata->global_config__spad_enables_rtn_31);
charlesmn 0:3ac96e360672 922
charlesmn 0:3ac96e360672 923 trace_print(
charlesmn 0:3ac96e360672 924 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 925 "%s%s = %u\n",
charlesmn 0:3ac96e360672 926 pprefix,
charlesmn 0:3ac96e360672 927 "roi_config__mode_roi_centre_spad",
charlesmn 0:3ac96e360672 928 pdata->roi_config__mode_roi_centre_spad);
charlesmn 0:3ac96e360672 929
charlesmn 0:3ac96e360672 930 trace_print(
charlesmn 0:3ac96e360672 931 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 932 "%s%s = 0x%02X\n",
charlesmn 0:3ac96e360672 933 pprefix,
charlesmn 0:3ac96e360672 934 "roi_config__mode_roi_xy_size",
charlesmn 0:3ac96e360672 935 pdata->roi_config__mode_roi_xy_size);
charlesmn 0:3ac96e360672 936 }
charlesmn 0:3ac96e360672 937
charlesmn 0:3ac96e360672 938
charlesmn 0:3ac96e360672 939 void VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 940 VL53L1_histogram_bin_data_t *pdata,
charlesmn 0:3ac96e360672 941 char *pprefix,
charlesmn 0:3ac96e360672 942 uint32_t trace_flags)
charlesmn 0:3ac96e360672 943 {
charlesmn 0:3ac96e360672 944
charlesmn 0:3ac96e360672 945
charlesmn 0:3ac96e360672 946 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 947 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 948 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 949
charlesmn 0:3ac96e360672 950 uint8_t i = 0;
charlesmn 0:3ac96e360672 951
charlesmn 0:3ac96e360672 952 trace_print(
charlesmn 0:3ac96e360672 953 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 954 "%s%s = %u\n",
charlesmn 0:3ac96e360672 955 pprefix,
charlesmn 0:3ac96e360672 956 "cfg_device_state",
charlesmn 0:3ac96e360672 957 pdata->cfg_device_state);
charlesmn 0:3ac96e360672 958
charlesmn 0:3ac96e360672 959 trace_print(
charlesmn 0:3ac96e360672 960 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 961 "%s%s = %u\n",
charlesmn 0:3ac96e360672 962 pprefix,
charlesmn 0:3ac96e360672 963 "rd_device_state",
charlesmn 0:3ac96e360672 964 pdata->rd_device_state);
charlesmn 0:3ac96e360672 965
charlesmn 0:3ac96e360672 966 trace_print(
charlesmn 0:3ac96e360672 967 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 968 "%s%s = %u\n",
charlesmn 0:3ac96e360672 969 pprefix,
charlesmn 0:3ac96e360672 970 "VL53L1_p_022",
charlesmn 0:3ac96e360672 971 pdata->VL53L1_p_022);
charlesmn 0:3ac96e360672 972
charlesmn 0:3ac96e360672 973 trace_print(
charlesmn 0:3ac96e360672 974 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 975 "%s%s = %u\n",
charlesmn 0:3ac96e360672 976 pprefix,
charlesmn 0:3ac96e360672 977 "VL53L1_p_023",
charlesmn 0:3ac96e360672 978 pdata->VL53L1_p_023);
charlesmn 0:3ac96e360672 979
charlesmn 0:3ac96e360672 980 trace_print(
charlesmn 0:3ac96e360672 981 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 982 "%s%s = %u\n",
charlesmn 0:3ac96e360672 983 pprefix,
charlesmn 0:3ac96e360672 984 "VL53L1_p_024",
charlesmn 0:3ac96e360672 985 pdata->VL53L1_p_024);
charlesmn 0:3ac96e360672 986
charlesmn 0:3ac96e360672 987 trace_print(
charlesmn 0:3ac96e360672 988 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 989 "%s%s = %u\n",
charlesmn 0:3ac96e360672 990 pprefix,
charlesmn 0:3ac96e360672 991 "number_of_ambient_bins",
charlesmn 0:3ac96e360672 992 pdata->number_of_ambient_bins);
charlesmn 0:3ac96e360672 993
charlesmn 0:3ac96e360672 994 for (i = 0; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH; i++) {
charlesmn 0:3ac96e360672 995 sprintf(ppre_text, "%sbin_seq[%u]", pprefix, i);
charlesmn 0:3ac96e360672 996 trace_print(
charlesmn 0:3ac96e360672 997 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 998 "%s = %u\n",
charlesmn 0:3ac96e360672 999 ppre_text,
charlesmn 0:3ac96e360672 1000 pdata->bin_seq[i]);
charlesmn 0:3ac96e360672 1001 }
charlesmn 0:3ac96e360672 1002
charlesmn 0:3ac96e360672 1003 for (i = 0; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH; i++) {
charlesmn 0:3ac96e360672 1004 sprintf(ppre_text, "%sbin_rep[%u]", pprefix, i);
charlesmn 0:3ac96e360672 1005 trace_print(
charlesmn 0:3ac96e360672 1006 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1007 "%s = %u\n",
charlesmn 0:3ac96e360672 1008 ppre_text,
charlesmn 0:3ac96e360672 1009 pdata->bin_rep[i]);
charlesmn 0:3ac96e360672 1010 }
charlesmn 0:3ac96e360672 1011
charlesmn 0:3ac96e360672 1012 for (i = 0; i < pdata->VL53L1_p_024; i++) {
charlesmn 0:3ac96e360672 1013 sprintf(ppre_text, "%sbin_data[%u]", pprefix, i);
charlesmn 0:3ac96e360672 1014 trace_print(
charlesmn 0:3ac96e360672 1015 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1016 "%s = %d\n",
charlesmn 0:3ac96e360672 1017 ppre_text,
charlesmn 0:3ac96e360672 1018 pdata->bin_data[i]);
charlesmn 0:3ac96e360672 1019 }
charlesmn 0:3ac96e360672 1020
charlesmn 0:3ac96e360672 1021 trace_print(
charlesmn 0:3ac96e360672 1022 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1023 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1024 pprefix,
charlesmn 0:3ac96e360672 1025 "result__interrupt_status",
charlesmn 0:3ac96e360672 1026 pdata->result__interrupt_status);
charlesmn 0:3ac96e360672 1027
charlesmn 0:3ac96e360672 1028 trace_print(
charlesmn 0:3ac96e360672 1029 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1030 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1031 pprefix,
charlesmn 0:3ac96e360672 1032 "result__range_status",
charlesmn 0:3ac96e360672 1033 pdata->result__range_status);
charlesmn 0:3ac96e360672 1034
charlesmn 0:3ac96e360672 1035 trace_print(
charlesmn 0:3ac96e360672 1036 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1037 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1038 pprefix,
charlesmn 0:3ac96e360672 1039 "result__report_status",
charlesmn 0:3ac96e360672 1040 pdata->result__report_status);
charlesmn 0:3ac96e360672 1041
charlesmn 0:3ac96e360672 1042 trace_print(
charlesmn 0:3ac96e360672 1043 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1044 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1045 pprefix,
charlesmn 0:3ac96e360672 1046 "result__stream_count",
charlesmn 0:3ac96e360672 1047 pdata->result__stream_count);
charlesmn 0:3ac96e360672 1048
charlesmn 0:3ac96e360672 1049 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1050 (int32_t)pdata->result__dss_actual_effective_spads,
charlesmn 0:3ac96e360672 1051 8,
charlesmn 0:3ac96e360672 1052 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1053 fp_text);
charlesmn 0:3ac96e360672 1054
charlesmn 0:3ac96e360672 1055 trace_print(
charlesmn 0:3ac96e360672 1056 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1057 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1058 pprefix,
charlesmn 0:3ac96e360672 1059 "result__dss_actual_effective_spads",
charlesmn 0:3ac96e360672 1060 fp_text);
charlesmn 0:3ac96e360672 1061
charlesmn 0:3ac96e360672 1062 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1063 (int32_t)pdata->phasecal_result__reference_phase,
charlesmn 0:3ac96e360672 1064 11,
charlesmn 0:3ac96e360672 1065 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1066 fp_text);
charlesmn 0:3ac96e360672 1067
charlesmn 0:3ac96e360672 1068 trace_print(
charlesmn 0:3ac96e360672 1069 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1070 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1071 pprefix,
charlesmn 0:3ac96e360672 1072 "phasecal_result__reference_phase",
charlesmn 0:3ac96e360672 1073 fp_text);
charlesmn 0:3ac96e360672 1074
charlesmn 0:3ac96e360672 1075 trace_print(
charlesmn 0:3ac96e360672 1076 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1077 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1078 pprefix,
charlesmn 0:3ac96e360672 1079 "phasecal_result__vcsel_start",
charlesmn 0:3ac96e360672 1080 pdata->phasecal_result__vcsel_start);
charlesmn 0:3ac96e360672 1081
charlesmn 0:3ac96e360672 1082 trace_print(
charlesmn 0:3ac96e360672 1083 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1084 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1085 pprefix,
charlesmn 0:3ac96e360672 1086 "cal_config__vcsel_start",
charlesmn 0:3ac96e360672 1087 pdata->cal_config__vcsel_start);
charlesmn 0:3ac96e360672 1088
charlesmn 0:3ac96e360672 1089 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1090 (uint32_t)pdata->vcsel_width,
charlesmn 0:3ac96e360672 1091 4,
charlesmn 0:3ac96e360672 1092 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1093 fp_text);
charlesmn 0:3ac96e360672 1094
charlesmn 0:3ac96e360672 1095 trace_print(
charlesmn 0:3ac96e360672 1096 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1097 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1098 pprefix,
charlesmn 0:3ac96e360672 1099 "vcsel_width",
charlesmn 0:3ac96e360672 1100 fp_text);
charlesmn 0:3ac96e360672 1101
charlesmn 0:3ac96e360672 1102 trace_print(
charlesmn 0:3ac96e360672 1103 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1104 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1105 pprefix,
charlesmn 0:3ac96e360672 1106 "VL53L1_p_009",
charlesmn 0:3ac96e360672 1107 pdata->VL53L1_p_009);
charlesmn 0:3ac96e360672 1108
charlesmn 0:3ac96e360672 1109 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1110 (int32_t)pdata->VL53L1_p_019,
charlesmn 0:3ac96e360672 1111 12,
charlesmn 0:3ac96e360672 1112 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1113 fp_text);
charlesmn 0:3ac96e360672 1114
charlesmn 0:3ac96e360672 1115 trace_print(
charlesmn 0:3ac96e360672 1116 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1117 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1118 pprefix,
charlesmn 0:3ac96e360672 1119 "VL53L1_p_019",
charlesmn 0:3ac96e360672 1120 fp_text);
charlesmn 0:3ac96e360672 1121
charlesmn 0:3ac96e360672 1122 trace_print(
charlesmn 0:3ac96e360672 1123 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1124 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1125 pprefix,
charlesmn 0:3ac96e360672 1126 "total_periods_elapsed",
charlesmn 0:3ac96e360672 1127 pdata->total_periods_elapsed);
charlesmn 0:3ac96e360672 1128
charlesmn 0:3ac96e360672 1129 trace_print(
charlesmn 0:3ac96e360672 1130 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1131 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1132 pprefix,
charlesmn 0:3ac96e360672 1133 "peak_duration_us",
charlesmn 0:3ac96e360672 1134 pdata->peak_duration_us);
charlesmn 0:3ac96e360672 1135
charlesmn 0:3ac96e360672 1136 trace_print(
charlesmn 0:3ac96e360672 1137 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1138 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1139 pprefix,
charlesmn 0:3ac96e360672 1140 "woi_duration_us",
charlesmn 0:3ac96e360672 1141 pdata->woi_duration_us);
charlesmn 0:3ac96e360672 1142
charlesmn 0:3ac96e360672 1143 trace_print(
charlesmn 0:3ac96e360672 1144 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1145 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1146 pprefix,
charlesmn 0:3ac96e360672 1147 "min_bin_value",
charlesmn 0:3ac96e360672 1148 pdata->min_bin_value);
charlesmn 0:3ac96e360672 1149
charlesmn 0:3ac96e360672 1150 trace_print(
charlesmn 0:3ac96e360672 1151 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1152 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1153 pprefix,
charlesmn 0:3ac96e360672 1154 "max_bin_value",
charlesmn 0:3ac96e360672 1155 pdata->max_bin_value);
charlesmn 0:3ac96e360672 1156
charlesmn 0:3ac96e360672 1157 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1158 (int32_t)pdata->zero_distance_phase,
charlesmn 0:3ac96e360672 1159 11,
charlesmn 0:3ac96e360672 1160 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1161 fp_text);
charlesmn 0:3ac96e360672 1162
charlesmn 0:3ac96e360672 1163 trace_print(
charlesmn 0:3ac96e360672 1164 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1165 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1166 pprefix,
charlesmn 0:3ac96e360672 1167 "zero_distance_phase",
charlesmn 0:3ac96e360672 1168 fp_text);
charlesmn 0:3ac96e360672 1169
charlesmn 0:3ac96e360672 1170 trace_print(
charlesmn 0:3ac96e360672 1171 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1172 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1173 pprefix,
charlesmn 0:3ac96e360672 1174 "number_of_ambient_samples",
charlesmn 0:3ac96e360672 1175 pdata->number_of_ambient_samples);
charlesmn 0:3ac96e360672 1176
charlesmn 0:3ac96e360672 1177 trace_print(
charlesmn 0:3ac96e360672 1178 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1179 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1180 pprefix,
charlesmn 0:3ac96e360672 1181 "ambient_events_sum",
charlesmn 0:3ac96e360672 1182 pdata->ambient_events_sum);
charlesmn 0:3ac96e360672 1183
charlesmn 0:3ac96e360672 1184 trace_print(
charlesmn 0:3ac96e360672 1185 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1186 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1187 pprefix,
charlesmn 0:3ac96e360672 1188 "VL53L1_p_004",
charlesmn 0:3ac96e360672 1189 pdata->VL53L1_p_004);
charlesmn 0:3ac96e360672 1190
charlesmn 0:3ac96e360672 1191 trace_print(
charlesmn 0:3ac96e360672 1192 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1193 "%s%s = 0x%02X\n",
charlesmn 0:3ac96e360672 1194 pprefix,
charlesmn 0:3ac96e360672 1195 "roi_config__user_roi_centre_spad",
charlesmn 0:3ac96e360672 1196 pdata->roi_config__user_roi_centre_spad);
charlesmn 0:3ac96e360672 1197
charlesmn 0:3ac96e360672 1198 trace_print(
charlesmn 0:3ac96e360672 1199 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1200 "%s%s = 0x%02X\n",
charlesmn 0:3ac96e360672 1201 pprefix,
charlesmn 0:3ac96e360672 1202 "roi_config__user_roi_requested_global_xy_size",
charlesmn 0:3ac96e360672 1203 pdata->roi_config__user_roi_requested_global_xy_size);
charlesmn 0:3ac96e360672 1204 }
charlesmn 0:3ac96e360672 1205
charlesmn 0:3ac96e360672 1206
charlesmn 0:3ac96e360672 1207 void VL53L1_print_xtalk_histogram_shape_data(
charlesmn 0:3ac96e360672 1208 VL53L1_xtalk_histogram_shape_t *pdata,
charlesmn 0:3ac96e360672 1209 char *pprefix,
charlesmn 0:3ac96e360672 1210 uint32_t trace_flags)
charlesmn 0:3ac96e360672 1211 {
charlesmn 0:3ac96e360672 1212
charlesmn 0:3ac96e360672 1213
charlesmn 0:3ac96e360672 1214 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1215 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1216 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 1217
charlesmn 0:3ac96e360672 1218 uint8_t i = 0;
charlesmn 0:3ac96e360672 1219
charlesmn 0:3ac96e360672 1220 trace_print(
charlesmn 0:3ac96e360672 1221 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1222 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1223 pprefix,
charlesmn 0:3ac96e360672 1224 "VL53L1_p_022",
charlesmn 0:3ac96e360672 1225 pdata->VL53L1_p_022);
charlesmn 0:3ac96e360672 1226
charlesmn 0:3ac96e360672 1227 trace_print(
charlesmn 0:3ac96e360672 1228 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1229 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1230 pprefix,
charlesmn 0:3ac96e360672 1231 "VL53L1_p_023",
charlesmn 0:3ac96e360672 1232 pdata->VL53L1_p_023);
charlesmn 0:3ac96e360672 1233
charlesmn 0:3ac96e360672 1234 trace_print(
charlesmn 0:3ac96e360672 1235 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1236 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1237 pprefix,
charlesmn 0:3ac96e360672 1238 "VL53L1_p_024",
charlesmn 0:3ac96e360672 1239 pdata->VL53L1_p_024);
charlesmn 0:3ac96e360672 1240
charlesmn 0:3ac96e360672 1241 for (i = 0; i < pdata->VL53L1_p_024; i++) {
charlesmn 0:3ac96e360672 1242
charlesmn 0:3ac96e360672 1243 sprintf(ppre_text, "%sbin_data[%u]", pprefix, i);
charlesmn 0:3ac96e360672 1244
charlesmn 0:3ac96e360672 1245 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1246 (int32_t)pdata->bin_data[i],
charlesmn 0:3ac96e360672 1247 10,
charlesmn 0:3ac96e360672 1248 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1249 fp_text);
charlesmn 0:3ac96e360672 1250
charlesmn 0:3ac96e360672 1251 trace_print(
charlesmn 0:3ac96e360672 1252 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1253 "%s = %s\n",
charlesmn 0:3ac96e360672 1254 ppre_text,
charlesmn 0:3ac96e360672 1255 fp_text);
charlesmn 0:3ac96e360672 1256 }
charlesmn 0:3ac96e360672 1257
charlesmn 0:3ac96e360672 1258 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1259 (int32_t)pdata->phasecal_result__reference_phase,
charlesmn 0:3ac96e360672 1260 11,
charlesmn 0:3ac96e360672 1261 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1262 fp_text);
charlesmn 0:3ac96e360672 1263
charlesmn 0:3ac96e360672 1264 trace_print(
charlesmn 0:3ac96e360672 1265 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1266 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1267 pprefix,
charlesmn 0:3ac96e360672 1268 "phasecal_result__reference_phase",
charlesmn 0:3ac96e360672 1269 fp_text);
charlesmn 0:3ac96e360672 1270
charlesmn 0:3ac96e360672 1271 trace_print(
charlesmn 0:3ac96e360672 1272 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1273 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1274 pprefix,
charlesmn 0:3ac96e360672 1275 "phasecal_result__vcsel_start",
charlesmn 0:3ac96e360672 1276 pdata->phasecal_result__vcsel_start);
charlesmn 0:3ac96e360672 1277
charlesmn 0:3ac96e360672 1278 trace_print(
charlesmn 0:3ac96e360672 1279 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1280 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1281 pprefix,
charlesmn 0:3ac96e360672 1282 "cal_config__vcsel_start",
charlesmn 0:3ac96e360672 1283 pdata->cal_config__vcsel_start);
charlesmn 0:3ac96e360672 1284
charlesmn 0:3ac96e360672 1285 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1286 (int32_t)pdata->vcsel_width,
charlesmn 0:3ac96e360672 1287 4,
charlesmn 0:3ac96e360672 1288 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1289 fp_text);
charlesmn 0:3ac96e360672 1290
charlesmn 0:3ac96e360672 1291 trace_print(
charlesmn 0:3ac96e360672 1292 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1293 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1294 pprefix,
charlesmn 0:3ac96e360672 1295 "vcsel_width",
charlesmn 0:3ac96e360672 1296 fp_text);
charlesmn 0:3ac96e360672 1297
charlesmn 0:3ac96e360672 1298 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1299 (int32_t)pdata->VL53L1_p_019,
charlesmn 0:3ac96e360672 1300 12,
charlesmn 0:3ac96e360672 1301 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1302 fp_text);
charlesmn 0:3ac96e360672 1303
charlesmn 0:3ac96e360672 1304 trace_print(
charlesmn 0:3ac96e360672 1305 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1306 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1307 pprefix,
charlesmn 0:3ac96e360672 1308 "VL53L1_p_019",
charlesmn 0:3ac96e360672 1309 fp_text);
charlesmn 0:3ac96e360672 1310
charlesmn 0:3ac96e360672 1311 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1312 (int32_t)pdata->zero_distance_phase,
charlesmn 0:3ac96e360672 1313 11,
charlesmn 0:3ac96e360672 1314 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1315 fp_text);
charlesmn 0:3ac96e360672 1316
charlesmn 0:3ac96e360672 1317 trace_print(
charlesmn 0:3ac96e360672 1318 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1319 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1320 pprefix,
charlesmn 0:3ac96e360672 1321 "zero_distance_phase",
charlesmn 0:3ac96e360672 1322 fp_text);
charlesmn 0:3ac96e360672 1323 }
charlesmn 0:3ac96e360672 1324
charlesmn 0:3ac96e360672 1325
charlesmn 0:3ac96e360672 1326 void VL53L1_print_xtalk_histogram_data(
charlesmn 0:3ac96e360672 1327 VL53L1_xtalk_histogram_data_t *pdata,
charlesmn 0:3ac96e360672 1328 char *pprefix,
charlesmn 0:3ac96e360672 1329 uint32_t trace_flags)
charlesmn 0:3ac96e360672 1330 {
charlesmn 0:3ac96e360672 1331
charlesmn 0:3ac96e360672 1332
charlesmn 0:3ac96e360672 1333 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1334 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 1335
charlesmn 0:3ac96e360672 1336
charlesmn 0:3ac96e360672 1337 sprintf(ppre_text, "%sxtalk_shape.", pprefix);
charlesmn 0:3ac96e360672 1338 VL53L1_print_xtalk_histogram_shape_data(
charlesmn 0:3ac96e360672 1339 &(pdata->xtalk_shape),
charlesmn 0:3ac96e360672 1340 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 1341
charlesmn 0:3ac96e360672 1342
charlesmn 0:3ac96e360672 1343 sprintf(ppre_text, "%sxtalk_hist_removed.", pprefix);
charlesmn 0:3ac96e360672 1344 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 1345 &(pdata->xtalk_hist_removed),
charlesmn 0:3ac96e360672 1346 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 1347 }
charlesmn 0:3ac96e360672 1348
charlesmn 0:3ac96e360672 1349
charlesmn 0:3ac96e360672 1350 void VL53L1_print_range_data(
charlesmn 0:3ac96e360672 1351 VL53L1_range_data_t *pdata,
charlesmn 0:3ac96e360672 1352 char *pprefix,
charlesmn 0:3ac96e360672 1353 uint32_t trace_flags)
charlesmn 0:3ac96e360672 1354 {
charlesmn 0:3ac96e360672 1355
charlesmn 0:3ac96e360672 1356
charlesmn 0:3ac96e360672 1357 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1358
charlesmn 0:3ac96e360672 1359 trace_print(
charlesmn 0:3ac96e360672 1360 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1361 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1362 pprefix,
charlesmn 0:3ac96e360672 1363 "range_id",
charlesmn 0:3ac96e360672 1364 pdata->range_id);
charlesmn 0:3ac96e360672 1365
charlesmn 0:3ac96e360672 1366 trace_print(
charlesmn 0:3ac96e360672 1367 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1368 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1369 pprefix,
charlesmn 0:3ac96e360672 1370 "time_stamp",
charlesmn 0:3ac96e360672 1371 pdata->time_stamp);
charlesmn 0:3ac96e360672 1372
charlesmn 0:3ac96e360672 1373 trace_print(
charlesmn 0:3ac96e360672 1374 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1375 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1376 pprefix,
charlesmn 0:3ac96e360672 1377 "VL53L1_p_015",
charlesmn 0:3ac96e360672 1378 pdata->VL53L1_p_015);
charlesmn 0:3ac96e360672 1379
charlesmn 0:3ac96e360672 1380 trace_print(
charlesmn 0:3ac96e360672 1381 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1382 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1383 pprefix,
charlesmn 0:3ac96e360672 1384 "VL53L1_p_022",
charlesmn 0:3ac96e360672 1385 pdata->VL53L1_p_022);
charlesmn 0:3ac96e360672 1386
charlesmn 0:3ac96e360672 1387 trace_print(
charlesmn 0:3ac96e360672 1388 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1389 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1390 pprefix,
charlesmn 0:3ac96e360672 1391 "VL53L1_p_025",
charlesmn 0:3ac96e360672 1392 pdata->VL53L1_p_025);
charlesmn 0:3ac96e360672 1393
charlesmn 0:3ac96e360672 1394 trace_print(
charlesmn 0:3ac96e360672 1395 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1396 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1397 pprefix,
charlesmn 0:3ac96e360672 1398 "VL53L1_p_026",
charlesmn 0:3ac96e360672 1399 pdata->VL53L1_p_026);
charlesmn 0:3ac96e360672 1400
charlesmn 0:3ac96e360672 1401 trace_print(
charlesmn 0:3ac96e360672 1402 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1403 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1404 pprefix,
charlesmn 0:3ac96e360672 1405 "VL53L1_p_016",
charlesmn 0:3ac96e360672 1406 pdata->VL53L1_p_016);
charlesmn 0:3ac96e360672 1407
charlesmn 0:3ac96e360672 1408 trace_print(
charlesmn 0:3ac96e360672 1409 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1410 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1411 pprefix,
charlesmn 0:3ac96e360672 1412 "VL53L1_p_027",
charlesmn 0:3ac96e360672 1413 pdata->VL53L1_p_027);
charlesmn 0:3ac96e360672 1414
charlesmn 0:3ac96e360672 1415 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1416 (int32_t)pdata->width,
charlesmn 0:3ac96e360672 1417 4, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1418
charlesmn 0:3ac96e360672 1419 trace_print(
charlesmn 0:3ac96e360672 1420 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1421 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1422 pprefix,
charlesmn 0:3ac96e360672 1423 "width",
charlesmn 0:3ac96e360672 1424 fp_text);
charlesmn 0:3ac96e360672 1425
charlesmn 0:3ac96e360672 1426 trace_print(
charlesmn 0:3ac96e360672 1427 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1428 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1429 pprefix,
charlesmn 0:3ac96e360672 1430 "VL53L1_p_030",
charlesmn 0:3ac96e360672 1431 pdata->VL53L1_p_030);
charlesmn 0:3ac96e360672 1432
charlesmn 0:3ac96e360672 1433
charlesmn 0:3ac96e360672 1434
charlesmn 0:3ac96e360672 1435 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1436 (int32_t)pdata->fast_osc_frequency,
charlesmn 0:3ac96e360672 1437 12, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1438
charlesmn 0:3ac96e360672 1439 trace_print(
charlesmn 0:3ac96e360672 1440 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1441 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1442 pprefix,
charlesmn 0:3ac96e360672 1443 "fast_osc_frequency",
charlesmn 0:3ac96e360672 1444 fp_text);
charlesmn 0:3ac96e360672 1445
charlesmn 0:3ac96e360672 1446
charlesmn 0:3ac96e360672 1447
charlesmn 0:3ac96e360672 1448 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1449 (int32_t)pdata->zero_distance_phase,
charlesmn 0:3ac96e360672 1450 11, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1451
charlesmn 0:3ac96e360672 1452 trace_print(
charlesmn 0:3ac96e360672 1453 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1454 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1455 pprefix,
charlesmn 0:3ac96e360672 1456 "zero_distance_phase",
charlesmn 0:3ac96e360672 1457 fp_text);
charlesmn 0:3ac96e360672 1458
charlesmn 0:3ac96e360672 1459
charlesmn 0:3ac96e360672 1460
charlesmn 0:3ac96e360672 1461 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1462 (int32_t)pdata->VL53L1_p_006,
charlesmn 0:3ac96e360672 1463 8, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1464
charlesmn 0:3ac96e360672 1465 trace_print(
charlesmn 0:3ac96e360672 1466 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1467 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1468 pprefix,
charlesmn 0:3ac96e360672 1469 "actual_effective_spad",
charlesmn 0:3ac96e360672 1470 fp_text);
charlesmn 0:3ac96e360672 1471
charlesmn 0:3ac96e360672 1472
charlesmn 0:3ac96e360672 1473 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1474 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1475 pprefix,
charlesmn 0:3ac96e360672 1476 "total_periods_elapsed",
charlesmn 0:3ac96e360672 1477 pdata->total_periods_elapsed);
charlesmn 0:3ac96e360672 1478
charlesmn 0:3ac96e360672 1479 trace_print(
charlesmn 0:3ac96e360672 1480 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1481 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1482 pprefix,
charlesmn 0:3ac96e360672 1483 "peak_duration_us",
charlesmn 0:3ac96e360672 1484 pdata->peak_duration_us);
charlesmn 0:3ac96e360672 1485
charlesmn 0:3ac96e360672 1486 trace_print(
charlesmn 0:3ac96e360672 1487 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1488 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1489 pprefix,
charlesmn 0:3ac96e360672 1490 "woi_duration_us",
charlesmn 0:3ac96e360672 1491 pdata->woi_duration_us);
charlesmn 0:3ac96e360672 1492
charlesmn 0:3ac96e360672 1493 trace_print(
charlesmn 0:3ac96e360672 1494 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1495 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1496 pprefix,
charlesmn 0:3ac96e360672 1497 "VL53L1_p_020",
charlesmn 0:3ac96e360672 1498 pdata->VL53L1_p_020);
charlesmn 0:3ac96e360672 1499
charlesmn 0:3ac96e360672 1500 trace_print(
charlesmn 0:3ac96e360672 1501 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1502 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1503 pprefix,
charlesmn 0:3ac96e360672 1504 "VL53L1_p_021",
charlesmn 0:3ac96e360672 1505 pdata->VL53L1_p_021);
charlesmn 0:3ac96e360672 1506
charlesmn 0:3ac96e360672 1507 trace_print(
charlesmn 0:3ac96e360672 1508 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1509 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1510 pprefix,
charlesmn 0:3ac96e360672 1511 "VL53L1_p_013",
charlesmn 0:3ac96e360672 1512 pdata->VL53L1_p_013);
charlesmn 0:3ac96e360672 1513
charlesmn 0:3ac96e360672 1514
charlesmn 0:3ac96e360672 1515
charlesmn 0:3ac96e360672 1516 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1517 (int32_t)pdata->peak_signal_count_rate_mcps,
charlesmn 0:3ac96e360672 1518 7, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1519
charlesmn 0:3ac96e360672 1520 trace_print(
charlesmn 0:3ac96e360672 1521 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1522 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1523 pprefix,
charlesmn 0:3ac96e360672 1524 "peak_signal_count_rate_mcps",
charlesmn 0:3ac96e360672 1525 fp_text);
charlesmn 0:3ac96e360672 1526
charlesmn 0:3ac96e360672 1527 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1528 (int32_t)pdata->avg_signal_count_rate_mcps,
charlesmn 0:3ac96e360672 1529 7, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1530
charlesmn 0:3ac96e360672 1531 trace_print(
charlesmn 0:3ac96e360672 1532 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1533 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1534 pprefix,
charlesmn 0:3ac96e360672 1535 "avg_signal_count_rate_mcps",
charlesmn 0:3ac96e360672 1536 fp_text);
charlesmn 0:3ac96e360672 1537
charlesmn 0:3ac96e360672 1538 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1539 (int32_t)pdata->ambient_count_rate_mcps,
charlesmn 0:3ac96e360672 1540 7, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1541
charlesmn 0:3ac96e360672 1542 trace_print(
charlesmn 0:3ac96e360672 1543 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1544 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1545 pprefix,
charlesmn 0:3ac96e360672 1546 "ambient_count_rate_mcps",
charlesmn 0:3ac96e360672 1547 fp_text);
charlesmn 0:3ac96e360672 1548
charlesmn 0:3ac96e360672 1549 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1550 (int32_t)pdata->total_rate_per_spad_mcps,
charlesmn 0:3ac96e360672 1551 13, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1552
charlesmn 0:3ac96e360672 1553 trace_print(
charlesmn 0:3ac96e360672 1554 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1555 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1556 pprefix,
charlesmn 0:3ac96e360672 1557 "total_rate_per_spad_mcps",
charlesmn 0:3ac96e360672 1558 fp_text);
charlesmn 0:3ac96e360672 1559
charlesmn 0:3ac96e360672 1560 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1561 (int32_t)pdata->VL53L1_p_012,
charlesmn 0:3ac96e360672 1562 11, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1563
charlesmn 0:3ac96e360672 1564 trace_print(
charlesmn 0:3ac96e360672 1565 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1566 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1567 pprefix,
charlesmn 0:3ac96e360672 1568 "VL53L1_p_012",
charlesmn 0:3ac96e360672 1569 fp_text);
charlesmn 0:3ac96e360672 1570
charlesmn 0:3ac96e360672 1571
charlesmn 0:3ac96e360672 1572
charlesmn 0:3ac96e360672 1573 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1574 (int32_t)pdata->VL53L1_p_005,
charlesmn 0:3ac96e360672 1575 2, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1576
charlesmn 0:3ac96e360672 1577 trace_print(
charlesmn 0:3ac96e360672 1578 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1579 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1580 pprefix,
charlesmn 0:3ac96e360672 1581 "VL53L1_p_005",
charlesmn 0:3ac96e360672 1582 fp_text);
charlesmn 0:3ac96e360672 1583
charlesmn 0:3ac96e360672 1584
charlesmn 0:3ac96e360672 1585
charlesmn 0:3ac96e360672 1586 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1587 (int32_t)pdata->VL53L1_p_028,
charlesmn 0:3ac96e360672 1588 11, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1589
charlesmn 0:3ac96e360672 1590 trace_print(
charlesmn 0:3ac96e360672 1591 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1592 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1593 pprefix,
charlesmn 0:3ac96e360672 1594 "VL53L1_p_028",
charlesmn 0:3ac96e360672 1595 fp_text);
charlesmn 0:3ac96e360672 1596
charlesmn 0:3ac96e360672 1597 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1598 (int32_t)pdata->VL53L1_p_014,
charlesmn 0:3ac96e360672 1599 11, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1600
charlesmn 0:3ac96e360672 1601 trace_print(
charlesmn 0:3ac96e360672 1602 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1603 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1604 pprefix,
charlesmn 0:3ac96e360672 1605 "VL53L1_p_014",
charlesmn 0:3ac96e360672 1606 fp_text);
charlesmn 0:3ac96e360672 1607
charlesmn 0:3ac96e360672 1608 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1609 (int32_t)pdata->VL53L1_p_029,
charlesmn 0:3ac96e360672 1610 11, VL53L1_MAX_STRING_LENGTH, fp_text);
charlesmn 0:3ac96e360672 1611
charlesmn 0:3ac96e360672 1612 trace_print(
charlesmn 0:3ac96e360672 1613 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1614 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1615 pprefix,
charlesmn 0:3ac96e360672 1616 "VL53L1_p_029",
charlesmn 0:3ac96e360672 1617 fp_text);
charlesmn 0:3ac96e360672 1618
charlesmn 0:3ac96e360672 1619
charlesmn 0:3ac96e360672 1620
charlesmn 0:3ac96e360672 1621 trace_print(
charlesmn 0:3ac96e360672 1622 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1623 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1624 pprefix,
charlesmn 0:3ac96e360672 1625 "min_range_mm",
charlesmn 0:3ac96e360672 1626 pdata->min_range_mm);
charlesmn 0:3ac96e360672 1627
charlesmn 0:3ac96e360672 1628 trace_print(
charlesmn 0:3ac96e360672 1629 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1630 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1631 pprefix,
charlesmn 0:3ac96e360672 1632 "median_range_mm",
charlesmn 0:3ac96e360672 1633 pdata->median_range_mm);
charlesmn 0:3ac96e360672 1634
charlesmn 0:3ac96e360672 1635 trace_print(
charlesmn 0:3ac96e360672 1636 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1637 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1638 pprefix,
charlesmn 0:3ac96e360672 1639 "max_range_mm",
charlesmn 0:3ac96e360672 1640 pdata->max_range_mm);
charlesmn 0:3ac96e360672 1641
charlesmn 0:3ac96e360672 1642 trace_print(
charlesmn 0:3ac96e360672 1643 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1644 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1645 pprefix,
charlesmn 0:3ac96e360672 1646 "range_status",
charlesmn 0:3ac96e360672 1647 pdata->range_status);
charlesmn 0:3ac96e360672 1648 }
charlesmn 0:3ac96e360672 1649
charlesmn 0:3ac96e360672 1650
charlesmn 0:3ac96e360672 1651 void VL53L1_print_range_results(
charlesmn 0:3ac96e360672 1652 VL53L1_range_results_t *pdata,
charlesmn 0:3ac96e360672 1653 char *pprefix,
charlesmn 0:3ac96e360672 1654 uint32_t trace_flags)
charlesmn 0:3ac96e360672 1655 {
charlesmn 0:3ac96e360672 1656
charlesmn 0:3ac96e360672 1657
charlesmn 0:3ac96e360672 1658 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1659 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 1660
charlesmn 0:3ac96e360672 1661 uint8_t i = 0;
charlesmn 0:3ac96e360672 1662
charlesmn 0:3ac96e360672 1663 trace_print(
charlesmn 0:3ac96e360672 1664 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1665 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1666 pprefix,
charlesmn 0:3ac96e360672 1667 "cfg_device_state",
charlesmn 0:3ac96e360672 1668 pdata->cfg_device_state);
charlesmn 0:3ac96e360672 1669
charlesmn 0:3ac96e360672 1670 trace_print(
charlesmn 0:3ac96e360672 1671 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1672 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1673 pprefix,
charlesmn 0:3ac96e360672 1674 "rd_device_state",
charlesmn 0:3ac96e360672 1675 pdata->rd_device_state);
charlesmn 0:3ac96e360672 1676
charlesmn 0:3ac96e360672 1677 trace_print(
charlesmn 0:3ac96e360672 1678 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1679 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1680 pprefix,
charlesmn 0:3ac96e360672 1681 "zone_id",
charlesmn 0:3ac96e360672 1682 pdata->zone_id);
charlesmn 0:3ac96e360672 1683
charlesmn 0:3ac96e360672 1684 trace_print(
charlesmn 0:3ac96e360672 1685 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1686 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1687 pprefix,
charlesmn 0:3ac96e360672 1688 "stream_count",
charlesmn 0:3ac96e360672 1689 pdata->stream_count);
charlesmn 0:3ac96e360672 1690
charlesmn 0:3ac96e360672 1691 for (i = 0; i < VL53L1_MAX_AMBIENT_DMAX_VALUES; i++) {
charlesmn 0:3ac96e360672 1692 sprintf(
charlesmn 0:3ac96e360672 1693 ppre_text,
charlesmn 0:3ac96e360672 1694 "%sambient_dmax_mm[%u]",
charlesmn 0:3ac96e360672 1695 pprefix, i);
charlesmn 0:3ac96e360672 1696
charlesmn 0:3ac96e360672 1697 trace_print(
charlesmn 0:3ac96e360672 1698 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1699 "%s = %u\n",
charlesmn 0:3ac96e360672 1700 ppre_text,
charlesmn 0:3ac96e360672 1701 pdata->VL53L1_p_007[i]);
charlesmn 0:3ac96e360672 1702 }
charlesmn 0:3ac96e360672 1703
charlesmn 0:3ac96e360672 1704 trace_print(
charlesmn 0:3ac96e360672 1705 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1706 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1707 pprefix,
charlesmn 0:3ac96e360672 1708 "device_status",
charlesmn 0:3ac96e360672 1709 pdata->device_status);
charlesmn 0:3ac96e360672 1710
charlesmn 0:3ac96e360672 1711 trace_print(
charlesmn 0:3ac96e360672 1712 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1713 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1714 pprefix,
charlesmn 0:3ac96e360672 1715 "wrap_dmax_mm",
charlesmn 0:3ac96e360672 1716 pdata->wrap_dmax_mm);
charlesmn 0:3ac96e360672 1717
charlesmn 0:3ac96e360672 1718 trace_print(
charlesmn 0:3ac96e360672 1719 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1720 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1721 pprefix,
charlesmn 0:3ac96e360672 1722 "max_results",
charlesmn 0:3ac96e360672 1723 pdata->max_results);
charlesmn 0:3ac96e360672 1724
charlesmn 0:3ac96e360672 1725 trace_print(
charlesmn 0:3ac96e360672 1726 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1727 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1728 pprefix,
charlesmn 0:3ac96e360672 1729 "active_results",
charlesmn 0:3ac96e360672 1730 pdata->active_results);
charlesmn 0:3ac96e360672 1731
charlesmn 0:3ac96e360672 1732 for (i = 0; i < pdata->active_results; i++) {
charlesmn 0:3ac96e360672 1733 sprintf(ppre_text, "%sdata[%u].", pprefix, i);
charlesmn 0:3ac96e360672 1734 VL53L1_print_range_data(
charlesmn 0:3ac96e360672 1735 &pdata->VL53L1_p_002[i],
charlesmn 0:3ac96e360672 1736 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 1737 }
charlesmn 0:3ac96e360672 1738
charlesmn 0:3ac96e360672 1739 sprintf(ppre_text, "%sxmonitor.", pprefix);
charlesmn 0:3ac96e360672 1740 VL53L1_print_range_data(
charlesmn 0:3ac96e360672 1741 &pdata->xmonitor,
charlesmn 0:3ac96e360672 1742 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 1743 }
charlesmn 0:3ac96e360672 1744
charlesmn 0:3ac96e360672 1745
charlesmn 0:3ac96e360672 1746 void VL53L1_print_offset_range_results(
charlesmn 0:3ac96e360672 1747 VL53L1_offset_range_results_t *pdata,
charlesmn 0:3ac96e360672 1748 char *pprefix,
charlesmn 0:3ac96e360672 1749 uint32_t trace_flags)
charlesmn 0:3ac96e360672 1750 {
charlesmn 0:3ac96e360672 1751
charlesmn 0:3ac96e360672 1752
charlesmn 0:3ac96e360672 1753 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1754 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1755 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 1756
charlesmn 0:3ac96e360672 1757 uint8_t i = 0;
charlesmn 0:3ac96e360672 1758
charlesmn 0:3ac96e360672 1759 trace_print(
charlesmn 0:3ac96e360672 1760 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1761 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1762 pprefix,
charlesmn 0:3ac96e360672 1763 "cal_distance_mm",
charlesmn 0:3ac96e360672 1764 pdata->cal_distance_mm);
charlesmn 0:3ac96e360672 1765
charlesmn 0:3ac96e360672 1766 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1767 (int32_t)pdata->cal_reflectance_pc,
charlesmn 0:3ac96e360672 1768 2,
charlesmn 0:3ac96e360672 1769 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1770 fp_text);
charlesmn 0:3ac96e360672 1771
charlesmn 0:3ac96e360672 1772 trace_print(
charlesmn 0:3ac96e360672 1773 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1774 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1775 pprefix,
charlesmn 0:3ac96e360672 1776 "cal_reflectance_pc",
charlesmn 0:3ac96e360672 1777 fp_text);
charlesmn 0:3ac96e360672 1778
charlesmn 0:3ac96e360672 1779 trace_print(
charlesmn 0:3ac96e360672 1780 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1781 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1782 pprefix,
charlesmn 0:3ac96e360672 1783 "cal_status",
charlesmn 0:3ac96e360672 1784 pdata->cal_status);
charlesmn 0:3ac96e360672 1785
charlesmn 0:3ac96e360672 1786 trace_print(
charlesmn 0:3ac96e360672 1787 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1788 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1789 pprefix,
charlesmn 0:3ac96e360672 1790 "cal_report",
charlesmn 0:3ac96e360672 1791 pdata->cal_report);
charlesmn 0:3ac96e360672 1792
charlesmn 0:3ac96e360672 1793 trace_print(
charlesmn 0:3ac96e360672 1794 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1795 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1796 pprefix,
charlesmn 0:3ac96e360672 1797 "max_results",
charlesmn 0:3ac96e360672 1798 pdata->max_results);
charlesmn 0:3ac96e360672 1799
charlesmn 0:3ac96e360672 1800 trace_print(
charlesmn 0:3ac96e360672 1801 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1802 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1803 pprefix,
charlesmn 0:3ac96e360672 1804 "active_results",
charlesmn 0:3ac96e360672 1805 pdata->active_results);
charlesmn 0:3ac96e360672 1806
charlesmn 0:3ac96e360672 1807 for (i = 0; i < pdata->active_results; i++) {
charlesmn 0:3ac96e360672 1808 sprintf(ppre_text, "%sdata[%u].", pprefix, i);
charlesmn 0:3ac96e360672 1809 VL53L1_print_offset_range_data(
charlesmn 0:3ac96e360672 1810 &(pdata->VL53L1_p_002[i]),
charlesmn 0:3ac96e360672 1811 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 1812 }
charlesmn 0:3ac96e360672 1813 }
charlesmn 0:3ac96e360672 1814
charlesmn 0:3ac96e360672 1815
charlesmn 0:3ac96e360672 1816 void VL53L1_print_offset_range_data(
charlesmn 0:3ac96e360672 1817 VL53L1_offset_range_data_t *pdata,
charlesmn 0:3ac96e360672 1818 char *pprefix,
charlesmn 0:3ac96e360672 1819 uint32_t trace_flags)
charlesmn 0:3ac96e360672 1820 {
charlesmn 0:3ac96e360672 1821
charlesmn 0:3ac96e360672 1822
charlesmn 0:3ac96e360672 1823 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1824
charlesmn 0:3ac96e360672 1825 trace_print(
charlesmn 0:3ac96e360672 1826 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1827 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1828 pprefix,
charlesmn 0:3ac96e360672 1829 "preset_mode",
charlesmn 0:3ac96e360672 1830 pdata->preset_mode);
charlesmn 0:3ac96e360672 1831
charlesmn 0:3ac96e360672 1832 trace_print(
charlesmn 0:3ac96e360672 1833 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1834 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1835 pprefix,
charlesmn 0:3ac96e360672 1836 "dss_config__roi_mode_control",
charlesmn 0:3ac96e360672 1837 pdata->dss_config__roi_mode_control);
charlesmn 0:3ac96e360672 1838
charlesmn 0:3ac96e360672 1839 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1840 (int32_t)pdata->dss_config__manual_effective_spads_select,
charlesmn 0:3ac96e360672 1841 8,
charlesmn 0:3ac96e360672 1842 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1843 fp_text);
charlesmn 0:3ac96e360672 1844
charlesmn 0:3ac96e360672 1845 trace_print(
charlesmn 0:3ac96e360672 1846 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1847 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1848 pprefix,
charlesmn 0:3ac96e360672 1849 "dss_config__manual_effective_spads_select",
charlesmn 0:3ac96e360672 1850 fp_text);
charlesmn 0:3ac96e360672 1851
charlesmn 0:3ac96e360672 1852 trace_print(
charlesmn 0:3ac96e360672 1853 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1854 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1855 pprefix,
charlesmn 0:3ac96e360672 1856 "no_of_samples",
charlesmn 0:3ac96e360672 1857 pdata->no_of_samples);
charlesmn 0:3ac96e360672 1858
charlesmn 0:3ac96e360672 1859
charlesmn 0:3ac96e360672 1860 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1861 (int32_t)pdata->effective_spads,
charlesmn 0:3ac96e360672 1862 8,
charlesmn 0:3ac96e360672 1863 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1864 fp_text);
charlesmn 0:3ac96e360672 1865
charlesmn 0:3ac96e360672 1866 trace_print(
charlesmn 0:3ac96e360672 1867 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1868 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1869 pprefix,
charlesmn 0:3ac96e360672 1870 "effective_spads",
charlesmn 0:3ac96e360672 1871 fp_text);
charlesmn 0:3ac96e360672 1872
charlesmn 0:3ac96e360672 1873 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1874 (int32_t)pdata->peak_rate_mcps,
charlesmn 0:3ac96e360672 1875 7,
charlesmn 0:3ac96e360672 1876 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1877 fp_text);
charlesmn 0:3ac96e360672 1878
charlesmn 0:3ac96e360672 1879 trace_print(
charlesmn 0:3ac96e360672 1880 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1881 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1882 pprefix,
charlesmn 0:3ac96e360672 1883 "peak_rate_mcps",
charlesmn 0:3ac96e360672 1884 fp_text);
charlesmn 0:3ac96e360672 1885
charlesmn 0:3ac96e360672 1886 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1887 (int32_t)pdata->VL53L1_p_005,
charlesmn 0:3ac96e360672 1888 2,
charlesmn 0:3ac96e360672 1889 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1890 fp_text);
charlesmn 0:3ac96e360672 1891
charlesmn 0:3ac96e360672 1892 trace_print(
charlesmn 0:3ac96e360672 1893 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1894 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1895 pprefix,
charlesmn 0:3ac96e360672 1896 "VL53L1_p_005",
charlesmn 0:3ac96e360672 1897 fp_text);
charlesmn 0:3ac96e360672 1898
charlesmn 0:3ac96e360672 1899 trace_print(
charlesmn 0:3ac96e360672 1900 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1901 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1902 pprefix,
charlesmn 0:3ac96e360672 1903 "median_range_mm",
charlesmn 0:3ac96e360672 1904 pdata->median_range_mm);
charlesmn 0:3ac96e360672 1905
charlesmn 0:3ac96e360672 1906 trace_print(
charlesmn 0:3ac96e360672 1907 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1908 "%s%s = %d\n",
charlesmn 0:3ac96e360672 1909 pprefix,
charlesmn 0:3ac96e360672 1910 "range_mm_offset",
charlesmn 0:3ac96e360672 1911 pdata->range_mm_offset);
charlesmn 0:3ac96e360672 1912 }
charlesmn 0:3ac96e360672 1913
charlesmn 0:3ac96e360672 1914
charlesmn 0:3ac96e360672 1915 void VL53L1_print_cal_peak_rate_map(
charlesmn 0:3ac96e360672 1916 VL53L1_cal_peak_rate_map_t *pdata,
charlesmn 0:3ac96e360672 1917 char *pprefix,
charlesmn 0:3ac96e360672 1918 uint32_t trace_flags)
charlesmn 0:3ac96e360672 1919 {
charlesmn 0:3ac96e360672 1920
charlesmn 0:3ac96e360672 1921
charlesmn 0:3ac96e360672 1922 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1923 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 1924 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 1925
charlesmn 0:3ac96e360672 1926 uint8_t i = 0;
charlesmn 0:3ac96e360672 1927 uint8_t x = 0;
charlesmn 0:3ac96e360672 1928 uint8_t y = 0;
charlesmn 0:3ac96e360672 1929
charlesmn 0:3ac96e360672 1930 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1931 (int32_t)pdata->cal_distance_mm,
charlesmn 0:3ac96e360672 1932 2,
charlesmn 0:3ac96e360672 1933 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1934 fp_text);
charlesmn 0:3ac96e360672 1935
charlesmn 0:3ac96e360672 1936 trace_print(
charlesmn 0:3ac96e360672 1937 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1938 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1939 pprefix,
charlesmn 0:3ac96e360672 1940 "cal_distance_mm",
charlesmn 0:3ac96e360672 1941 fp_text);
charlesmn 0:3ac96e360672 1942
charlesmn 0:3ac96e360672 1943 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1944 (int32_t)pdata->cal_reflectance_pc,
charlesmn 0:3ac96e360672 1945 2,
charlesmn 0:3ac96e360672 1946 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1947 fp_text);
charlesmn 0:3ac96e360672 1948
charlesmn 0:3ac96e360672 1949 trace_print(
charlesmn 0:3ac96e360672 1950 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1951 "%s%s = %s\n",
charlesmn 0:3ac96e360672 1952 pprefix,
charlesmn 0:3ac96e360672 1953 "cal_reflectance_pc",
charlesmn 0:3ac96e360672 1954 fp_text);
charlesmn 0:3ac96e360672 1955
charlesmn 0:3ac96e360672 1956 trace_print(
charlesmn 0:3ac96e360672 1957 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1958 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1959 pprefix,
charlesmn 0:3ac96e360672 1960 "max_samples",
charlesmn 0:3ac96e360672 1961 pdata->max_samples);
charlesmn 0:3ac96e360672 1962
charlesmn 0:3ac96e360672 1963 trace_print(
charlesmn 0:3ac96e360672 1964 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1965 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1966 pprefix,
charlesmn 0:3ac96e360672 1967 "width",
charlesmn 0:3ac96e360672 1968 pdata->width);
charlesmn 0:3ac96e360672 1969
charlesmn 0:3ac96e360672 1970 trace_print(
charlesmn 0:3ac96e360672 1971 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1972 "%s%s = %u\n",
charlesmn 0:3ac96e360672 1973 pprefix,
charlesmn 0:3ac96e360672 1974 "height",
charlesmn 0:3ac96e360672 1975 pdata->height);
charlesmn 0:3ac96e360672 1976
charlesmn 0:3ac96e360672 1977 i = 0;
charlesmn 0:3ac96e360672 1978 for (y = 0; y < pdata->height; y++) {
charlesmn 0:3ac96e360672 1979 for (x = 0; x < pdata->width; x++) {
charlesmn 0:3ac96e360672 1980
charlesmn 0:3ac96e360672 1981 sprintf(ppre_text, "%speak_rate_mcps[%u]", pprefix, i);
charlesmn 0:3ac96e360672 1982
charlesmn 0:3ac96e360672 1983 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 1984 (int32_t)pdata->peak_rate_mcps[i],
charlesmn 0:3ac96e360672 1985 7,
charlesmn 0:3ac96e360672 1986 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 1987 fp_text);
charlesmn 0:3ac96e360672 1988
charlesmn 0:3ac96e360672 1989 trace_print(
charlesmn 0:3ac96e360672 1990 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 1991 "%s = %s\n",
charlesmn 0:3ac96e360672 1992 ppre_text,
charlesmn 0:3ac96e360672 1993 fp_text);
charlesmn 0:3ac96e360672 1994
charlesmn 0:3ac96e360672 1995 i++;
charlesmn 0:3ac96e360672 1996 }
charlesmn 0:3ac96e360672 1997 }
charlesmn 0:3ac96e360672 1998 }
charlesmn 0:3ac96e360672 1999
charlesmn 0:3ac96e360672 2000 void VL53L1_print_additional_data(
charlesmn 0:3ac96e360672 2001 VL53L1_additional_data_t *pdata,
charlesmn 0:3ac96e360672 2002 char *pprefix,
charlesmn 0:3ac96e360672 2003 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2004 {
charlesmn 0:3ac96e360672 2005
charlesmn 0:3ac96e360672 2006
charlesmn 0:3ac96e360672 2007
charlesmn 0:3ac96e360672 2008 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2009 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2010 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 2011
charlesmn 0:3ac96e360672 2012 trace_print(
charlesmn 0:3ac96e360672 2013 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2014 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2015 pprefix,
charlesmn 0:3ac96e360672 2016 "preset_mode",
charlesmn 0:3ac96e360672 2017 pdata->preset_mode);
charlesmn 0:3ac96e360672 2018
charlesmn 0:3ac96e360672 2019 trace_print(
charlesmn 0:3ac96e360672 2020 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2021 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2022 pprefix,
charlesmn 0:3ac96e360672 2023 "zone_preset",
charlesmn 0:3ac96e360672 2024 pdata->zone_preset);
charlesmn 0:3ac96e360672 2025
charlesmn 0:3ac96e360672 2026 trace_print(
charlesmn 0:3ac96e360672 2027 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2028 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2029 pprefix,
charlesmn 0:3ac96e360672 2030 "measurement_mode",
charlesmn 0:3ac96e360672 2031 pdata->measurement_mode);
charlesmn 0:3ac96e360672 2032
charlesmn 0:3ac96e360672 2033 trace_print(
charlesmn 0:3ac96e360672 2034 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2035 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2036 pprefix,
charlesmn 0:3ac96e360672 2037 "offset_calibration_mode",
charlesmn 0:3ac96e360672 2038 pdata->offset_calibration_mode);
charlesmn 0:3ac96e360672 2039
charlesmn 0:3ac96e360672 2040 trace_print(
charlesmn 0:3ac96e360672 2041 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2042 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2043 pprefix,
charlesmn 0:3ac96e360672 2044 "offset_correction_mode",
charlesmn 0:3ac96e360672 2045 pdata->offset_correction_mode);
charlesmn 0:3ac96e360672 2046
charlesmn 0:3ac96e360672 2047 trace_print(
charlesmn 0:3ac96e360672 2048 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2049 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2050 pprefix,
charlesmn 0:3ac96e360672 2051 "dmax_mode",
charlesmn 0:3ac96e360672 2052 pdata->dmax_mode);
charlesmn 0:3ac96e360672 2053
charlesmn 0:3ac96e360672 2054 trace_print(
charlesmn 0:3ac96e360672 2055 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2056 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2057 pprefix,
charlesmn 0:3ac96e360672 2058 "phasecal_config_timeout_us",
charlesmn 0:3ac96e360672 2059 pdata->phasecal_config_timeout_us);
charlesmn 0:3ac96e360672 2060
charlesmn 0:3ac96e360672 2061 trace_print(
charlesmn 0:3ac96e360672 2062 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2063 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2064 pprefix,
charlesmn 0:3ac96e360672 2065 "mm_config_timeout_us",
charlesmn 0:3ac96e360672 2066 pdata->mm_config_timeout_us);
charlesmn 0:3ac96e360672 2067
charlesmn 0:3ac96e360672 2068 trace_print(
charlesmn 0:3ac96e360672 2069 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2070 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2071 pprefix,
charlesmn 0:3ac96e360672 2072 "range_config_timeout_us",
charlesmn 0:3ac96e360672 2073 pdata->range_config_timeout_us);
charlesmn 0:3ac96e360672 2074
charlesmn 0:3ac96e360672 2075 trace_print(
charlesmn 0:3ac96e360672 2076 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2077 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2078 pprefix,
charlesmn 0:3ac96e360672 2079 "inter_measurement_period_ms",
charlesmn 0:3ac96e360672 2080 pdata->inter_measurement_period_ms);
charlesmn 0:3ac96e360672 2081
charlesmn 0:3ac96e360672 2082
charlesmn 0:3ac96e360672 2083 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2084 (int32_t)pdata->dss_config__target_total_rate_mcps,
charlesmn 0:3ac96e360672 2085 7,
charlesmn 0:3ac96e360672 2086 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2087 fp_text);
charlesmn 0:3ac96e360672 2088
charlesmn 0:3ac96e360672 2089 trace_print(
charlesmn 0:3ac96e360672 2090 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2091 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2092 pprefix,
charlesmn 0:3ac96e360672 2093 "dss_config__target_total_rate_mcps",
charlesmn 0:3ac96e360672 2094 fp_text);
charlesmn 0:3ac96e360672 2095
charlesmn 0:3ac96e360672 2096 sprintf(ppre_text, "%s VL53L1_p_010.", pprefix);
charlesmn 0:3ac96e360672 2097 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 2098 &pdata->VL53L1_p_010,
charlesmn 0:3ac96e360672 2099 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2100
charlesmn 0:3ac96e360672 2101
charlesmn 0:3ac96e360672 2102 }
charlesmn 0:3ac96e360672 2103
charlesmn 0:3ac96e360672 2104
charlesmn 0:3ac96e360672 2105 void VL53L1_print_additional_offset_cal_data(
charlesmn 0:3ac96e360672 2106 VL53L1_additional_offset_cal_data_t *pdata,
charlesmn 0:3ac96e360672 2107 char *pprefix,
charlesmn 0:3ac96e360672 2108 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2109 {
charlesmn 0:3ac96e360672 2110
charlesmn 0:3ac96e360672 2111
charlesmn 0:3ac96e360672 2112 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2113
charlesmn 0:3ac96e360672 2114 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2115 (int32_t)pdata->result__mm_inner_actual_effective_spads,
charlesmn 0:3ac96e360672 2116 8,
charlesmn 0:3ac96e360672 2117 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2118 fp_text);
charlesmn 0:3ac96e360672 2119
charlesmn 0:3ac96e360672 2120 trace_print(
charlesmn 0:3ac96e360672 2121 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2122 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2123 pprefix,
charlesmn 0:3ac96e360672 2124 "result__mm_inner_actual_effective_spads",
charlesmn 0:3ac96e360672 2125 fp_text);
charlesmn 0:3ac96e360672 2126
charlesmn 0:3ac96e360672 2127 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2128 (int32_t)pdata->result__mm_outer_actual_effective_spads,
charlesmn 0:3ac96e360672 2129 8,
charlesmn 0:3ac96e360672 2130 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2131 fp_text);
charlesmn 0:3ac96e360672 2132
charlesmn 0:3ac96e360672 2133 trace_print(
charlesmn 0:3ac96e360672 2134 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2135 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2136 pprefix,
charlesmn 0:3ac96e360672 2137 "result__mm_outer_actual_effective_spads",
charlesmn 0:3ac96e360672 2138 fp_text);
charlesmn 0:3ac96e360672 2139
charlesmn 0:3ac96e360672 2140 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2141 (int32_t)pdata->result__mm_inner_peak_signal_count_rtn_mcps,
charlesmn 0:3ac96e360672 2142 7,
charlesmn 0:3ac96e360672 2143 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2144 fp_text);
charlesmn 0:3ac96e360672 2145
charlesmn 0:3ac96e360672 2146 trace_print(
charlesmn 0:3ac96e360672 2147 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2148 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2149 pprefix,
charlesmn 0:3ac96e360672 2150 "result__mm_inner_peak_signal_count_rtn_mcps",
charlesmn 0:3ac96e360672 2151 fp_text);
charlesmn 0:3ac96e360672 2152
charlesmn 0:3ac96e360672 2153 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2154 (int32_t)pdata->result__mm_outer_peak_signal_count_rtn_mcps,
charlesmn 0:3ac96e360672 2155 7,
charlesmn 0:3ac96e360672 2156 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2157 fp_text);
charlesmn 0:3ac96e360672 2158
charlesmn 0:3ac96e360672 2159 trace_print(
charlesmn 0:3ac96e360672 2160 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2161 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2162 pprefix,
charlesmn 0:3ac96e360672 2163 "result__mm_outer_peak_signal_count_rtn_mcps",
charlesmn 0:3ac96e360672 2164 fp_text);
charlesmn 0:3ac96e360672 2165 }
charlesmn 0:3ac96e360672 2166
charlesmn 0:3ac96e360672 2167
charlesmn 0:3ac96e360672 2168 void VL53L1_print_gain_calibration_data(
charlesmn 0:3ac96e360672 2169 VL53L1_gain_calibration_data_t *pdata,
charlesmn 0:3ac96e360672 2170 char *pprefix,
charlesmn 0:3ac96e360672 2171 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2172 {
charlesmn 0:3ac96e360672 2173
charlesmn 0:3ac96e360672 2174
charlesmn 0:3ac96e360672 2175 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2176
charlesmn 0:3ac96e360672 2177 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2178 (int32_t)pdata->standard_ranging_gain_factor,
charlesmn 0:3ac96e360672 2179 11,
charlesmn 0:3ac96e360672 2180 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2181 fp_text);
charlesmn 0:3ac96e360672 2182
charlesmn 0:3ac96e360672 2183 trace_print(
charlesmn 0:3ac96e360672 2184 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2185 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2186 pprefix,
charlesmn 0:3ac96e360672 2187 "standard_ranging_gain_factor",
charlesmn 0:3ac96e360672 2188 fp_text);
charlesmn 0:3ac96e360672 2189
charlesmn 0:3ac96e360672 2190 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2191 (int32_t)pdata->histogram_ranging_gain_factor,
charlesmn 0:3ac96e360672 2192 11,
charlesmn 0:3ac96e360672 2193 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2194 fp_text);
charlesmn 0:3ac96e360672 2195
charlesmn 0:3ac96e360672 2196 trace_print(
charlesmn 0:3ac96e360672 2197 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2198 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2199 pprefix,
charlesmn 0:3ac96e360672 2200 "histogram_ranging_gain_factor",
charlesmn 0:3ac96e360672 2201 fp_text);
charlesmn 0:3ac96e360672 2202 }
charlesmn 0:3ac96e360672 2203
charlesmn 0:3ac96e360672 2204
charlesmn 0:3ac96e360672 2205 void VL53L1_print_zone_calibration_data(
charlesmn 0:3ac96e360672 2206 VL53L1_zone_calibration_data_t *pdata,
charlesmn 0:3ac96e360672 2207 char *pprefix,
charlesmn 0:3ac96e360672 2208 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2209 {
charlesmn 0:3ac96e360672 2210
charlesmn 0:3ac96e360672 2211
charlesmn 0:3ac96e360672 2212 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2213
charlesmn 0:3ac96e360672 2214 trace_print(
charlesmn 0:3ac96e360672 2215 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2216 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2217 pprefix,
charlesmn 0:3ac96e360672 2218 "no_of_samples",
charlesmn 0:3ac96e360672 2219 pdata->no_of_samples);
charlesmn 0:3ac96e360672 2220
charlesmn 0:3ac96e360672 2221 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2222 (int32_t)pdata->effective_spads,
charlesmn 0:3ac96e360672 2223 8,
charlesmn 0:3ac96e360672 2224 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2225 fp_text);
charlesmn 0:3ac96e360672 2226
charlesmn 0:3ac96e360672 2227 trace_print(
charlesmn 0:3ac96e360672 2228 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2229 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2230 pprefix,
charlesmn 0:3ac96e360672 2231 "effective_spads",
charlesmn 0:3ac96e360672 2232 fp_text);
charlesmn 0:3ac96e360672 2233
charlesmn 0:3ac96e360672 2234 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2235 (int32_t)pdata->peak_rate_mcps,
charlesmn 0:3ac96e360672 2236 7,
charlesmn 0:3ac96e360672 2237 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2238 fp_text);
charlesmn 0:3ac96e360672 2239
charlesmn 0:3ac96e360672 2240 trace_print(
charlesmn 0:3ac96e360672 2241 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2242 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2243 pprefix,
charlesmn 0:3ac96e360672 2244 "peak_rate_mcps",
charlesmn 0:3ac96e360672 2245 fp_text);
charlesmn 0:3ac96e360672 2246
charlesmn 0:3ac96e360672 2247 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2248 (int32_t)pdata->VL53L1_p_014,
charlesmn 0:3ac96e360672 2249 11,
charlesmn 0:3ac96e360672 2250 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2251 fp_text);
charlesmn 0:3ac96e360672 2252
charlesmn 0:3ac96e360672 2253 trace_print(
charlesmn 0:3ac96e360672 2254 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2255 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2256 pprefix,
charlesmn 0:3ac96e360672 2257 "VL53L1_p_014",
charlesmn 0:3ac96e360672 2258 fp_text);
charlesmn 0:3ac96e360672 2259
charlesmn 0:3ac96e360672 2260 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2261 (int32_t)pdata->VL53L1_p_005,
charlesmn 0:3ac96e360672 2262 2,
charlesmn 0:3ac96e360672 2263 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2264 fp_text);
charlesmn 0:3ac96e360672 2265
charlesmn 0:3ac96e360672 2266 trace_print(
charlesmn 0:3ac96e360672 2267 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2268 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2269 pprefix,
charlesmn 0:3ac96e360672 2270 "VL53L1_p_005",
charlesmn 0:3ac96e360672 2271 fp_text);
charlesmn 0:3ac96e360672 2272
charlesmn 0:3ac96e360672 2273 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2274 (int32_t)pdata->median_range_mm,
charlesmn 0:3ac96e360672 2275 2,
charlesmn 0:3ac96e360672 2276 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2277 fp_text);
charlesmn 0:3ac96e360672 2278
charlesmn 0:3ac96e360672 2279 trace_print(
charlesmn 0:3ac96e360672 2280 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2281 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2282 pprefix,
charlesmn 0:3ac96e360672 2283 "median_range_mm",
charlesmn 0:3ac96e360672 2284 fp_text);
charlesmn 0:3ac96e360672 2285
charlesmn 0:3ac96e360672 2286 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2287 (int32_t)pdata->range_mm_offset,
charlesmn 0:3ac96e360672 2288 2,
charlesmn 0:3ac96e360672 2289 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2290 fp_text);
charlesmn 0:3ac96e360672 2291
charlesmn 0:3ac96e360672 2292 trace_print(
charlesmn 0:3ac96e360672 2293 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2294 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2295 pprefix,
charlesmn 0:3ac96e360672 2296 "range_mm_offset",
charlesmn 0:3ac96e360672 2297 fp_text);
charlesmn 0:3ac96e360672 2298 }
charlesmn 0:3ac96e360672 2299
charlesmn 0:3ac96e360672 2300
charlesmn 0:3ac96e360672 2301 void VL53L1_print_zone_calibration_results(
charlesmn 0:3ac96e360672 2302 VL53L1_zone_calibration_results_t *pdata,
charlesmn 0:3ac96e360672 2303 char *pprefix,
charlesmn 0:3ac96e360672 2304 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2305 {
charlesmn 0:3ac96e360672 2306
charlesmn 0:3ac96e360672 2307
charlesmn 0:3ac96e360672 2308 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2309 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2310 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 2311
charlesmn 0:3ac96e360672 2312 uint8_t i = 0;
charlesmn 0:3ac96e360672 2313
charlesmn 0:3ac96e360672 2314 trace_print(
charlesmn 0:3ac96e360672 2315 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2316 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2317 pprefix,
charlesmn 0:3ac96e360672 2318 "preset_mode",
charlesmn 0:3ac96e360672 2319 pdata->preset_mode);
charlesmn 0:3ac96e360672 2320
charlesmn 0:3ac96e360672 2321 trace_print(
charlesmn 0:3ac96e360672 2322 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2323 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2324 pprefix,
charlesmn 0:3ac96e360672 2325 "zone_preset",
charlesmn 0:3ac96e360672 2326 pdata->zone_preset);
charlesmn 0:3ac96e360672 2327
charlesmn 0:3ac96e360672 2328 trace_print(
charlesmn 0:3ac96e360672 2329 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2330 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2331 pprefix,
charlesmn 0:3ac96e360672 2332 "cal_distance_mm",
charlesmn 0:3ac96e360672 2333 pdata->cal_distance_mm);
charlesmn 0:3ac96e360672 2334
charlesmn 0:3ac96e360672 2335 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2336 (int32_t)pdata->cal_reflectance_pc,
charlesmn 0:3ac96e360672 2337 2,
charlesmn 0:3ac96e360672 2338 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2339 fp_text);
charlesmn 0:3ac96e360672 2340
charlesmn 0:3ac96e360672 2341 trace_print(
charlesmn 0:3ac96e360672 2342 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2343 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2344 pprefix,
charlesmn 0:3ac96e360672 2345 "cal_reflectance_pc",
charlesmn 0:3ac96e360672 2346 fp_text);
charlesmn 0:3ac96e360672 2347
charlesmn 0:3ac96e360672 2348 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2349 (int32_t)pdata->phasecal_result__reference_phase,
charlesmn 0:3ac96e360672 2350 11,
charlesmn 0:3ac96e360672 2351 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2352 fp_text);
charlesmn 0:3ac96e360672 2353
charlesmn 0:3ac96e360672 2354 trace_print(
charlesmn 0:3ac96e360672 2355 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2356 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2357 pprefix,
charlesmn 0:3ac96e360672 2358 "phasecal_result__reference_phase",
charlesmn 0:3ac96e360672 2359 fp_text);
charlesmn 0:3ac96e360672 2360
charlesmn 0:3ac96e360672 2361 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2362 (int32_t)pdata->zero_distance_phase,
charlesmn 0:3ac96e360672 2363 11,
charlesmn 0:3ac96e360672 2364 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2365 fp_text);
charlesmn 0:3ac96e360672 2366
charlesmn 0:3ac96e360672 2367 trace_print(
charlesmn 0:3ac96e360672 2368 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2369 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2370 pprefix,
charlesmn 0:3ac96e360672 2371 "zero_distance_phase",
charlesmn 0:3ac96e360672 2372 fp_text);
charlesmn 0:3ac96e360672 2373
charlesmn 0:3ac96e360672 2374 trace_print(
charlesmn 0:3ac96e360672 2375 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2376 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2377 pprefix,
charlesmn 0:3ac96e360672 2378 "cal_status",
charlesmn 0:3ac96e360672 2379 pdata->cal_status);
charlesmn 0:3ac96e360672 2380
charlesmn 0:3ac96e360672 2381 trace_print(
charlesmn 0:3ac96e360672 2382 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2383 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2384 pprefix,
charlesmn 0:3ac96e360672 2385 "max_zones",
charlesmn 0:3ac96e360672 2386 pdata->max_zones);
charlesmn 0:3ac96e360672 2387
charlesmn 0:3ac96e360672 2388 trace_print(
charlesmn 0:3ac96e360672 2389 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2390 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2391 pprefix,
charlesmn 0:3ac96e360672 2392 "active_zones",
charlesmn 0:3ac96e360672 2393 pdata->active_zones);
charlesmn 0:3ac96e360672 2394
charlesmn 0:3ac96e360672 2395 for (i = 0; i < pdata->active_zones; i++) {
charlesmn 0:3ac96e360672 2396 sprintf(ppre_text, "%sdata[%u].", pprefix, i);
charlesmn 0:3ac96e360672 2397 VL53L1_print_zone_calibration_data(
charlesmn 0:3ac96e360672 2398 &(pdata->VL53L1_p_002[i]),
charlesmn 0:3ac96e360672 2399 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2400 }
charlesmn 0:3ac96e360672 2401 }
charlesmn 0:3ac96e360672 2402
charlesmn 0:3ac96e360672 2403 void VL53L1_print_xtalk_range_results(
charlesmn 0:3ac96e360672 2404 VL53L1_xtalk_range_results_t *pdata,
charlesmn 0:3ac96e360672 2405 char *pprefix,
charlesmn 0:3ac96e360672 2406 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2407 {
charlesmn 0:3ac96e360672 2408
charlesmn 0:3ac96e360672 2409
charlesmn 0:3ac96e360672 2410 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2411 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 2412 uint8_t i = 0;
charlesmn 0:3ac96e360672 2413
charlesmn 0:3ac96e360672 2414 VL53L1_histogram_bin_data_t *pbin_data;
charlesmn 0:3ac96e360672 2415
charlesmn 0:3ac96e360672 2416 trace_print(
charlesmn 0:3ac96e360672 2417 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2418 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2419 pprefix,
charlesmn 0:3ac96e360672 2420 "cal_status",
charlesmn 0:3ac96e360672 2421 pdata->cal_status);
charlesmn 0:3ac96e360672 2422
charlesmn 0:3ac96e360672 2423 trace_print(
charlesmn 0:3ac96e360672 2424 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2425 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2426 pprefix,
charlesmn 0:3ac96e360672 2427 "num_of_samples_status",
charlesmn 0:3ac96e360672 2428 pdata->num_of_samples_status);
charlesmn 0:3ac96e360672 2429
charlesmn 0:3ac96e360672 2430 trace_print(
charlesmn 0:3ac96e360672 2431 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2432 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2433 pprefix,
charlesmn 0:3ac96e360672 2434 "zero_samples_status",
charlesmn 0:3ac96e360672 2435 pdata->zero_samples_status);
charlesmn 0:3ac96e360672 2436
charlesmn 0:3ac96e360672 2437 trace_print(
charlesmn 0:3ac96e360672 2438 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2439 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2440 pprefix,
charlesmn 0:3ac96e360672 2441 "max_sigma_status",
charlesmn 0:3ac96e360672 2442 pdata->max_sigma_status);
charlesmn 0:3ac96e360672 2443
charlesmn 0:3ac96e360672 2444 trace_print(
charlesmn 0:3ac96e360672 2445 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2446 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2447 pprefix,
charlesmn 0:3ac96e360672 2448 "max_results",
charlesmn 0:3ac96e360672 2449 pdata->max_results);
charlesmn 0:3ac96e360672 2450
charlesmn 0:3ac96e360672 2451 trace_print(
charlesmn 0:3ac96e360672 2452 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2453 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2454 pprefix,
charlesmn 0:3ac96e360672 2455 "active_results",
charlesmn 0:3ac96e360672 2456 pdata->active_results);
charlesmn 0:3ac96e360672 2457
charlesmn 0:3ac96e360672 2458 for (i = 0; i < pdata->active_results; i++) {
charlesmn 0:3ac96e360672 2459 sprintf(ppre_text, "%sdata[%u].", pprefix, i);
charlesmn 0:3ac96e360672 2460 VL53L1_print_xtalk_range_data(
charlesmn 0:3ac96e360672 2461 &(pdata->VL53L1_p_002[i]),
charlesmn 0:3ac96e360672 2462 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2463 }
charlesmn 0:3ac96e360672 2464
charlesmn 0:3ac96e360672 2465 sprintf(ppre_text, "%scentral_histogram_sum.", pprefix);
charlesmn 0:3ac96e360672 2466 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 2467 &pdata->central_histogram_sum,
charlesmn 0:3ac96e360672 2468 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2469
charlesmn 0:3ac96e360672 2470 sprintf(ppre_text, "%scentral_histogram_avg.", pprefix);
charlesmn 0:3ac96e360672 2471 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 2472 &pdata->central_histogram_avg,
charlesmn 0:3ac96e360672 2473 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2474
charlesmn 0:3ac96e360672 2475 trace_print(
charlesmn 0:3ac96e360672 2476 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2477 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2478 pprefix,
charlesmn 0:3ac96e360672 2479 "VL53L1_p_015",
charlesmn 0:3ac96e360672 2480 pdata->central_histogram__window_start);
charlesmn 0:3ac96e360672 2481
charlesmn 0:3ac96e360672 2482 trace_print(
charlesmn 0:3ac96e360672 2483 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2484 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2485 pprefix,
charlesmn 0:3ac96e360672 2486 "VL53L1_p_016",
charlesmn 0:3ac96e360672 2487 pdata->central_histogram__window_end);
charlesmn 0:3ac96e360672 2488
charlesmn 0:3ac96e360672 2489 pbin_data = &(pdata->histogram_avg_1[0]);
charlesmn 0:3ac96e360672 2490
charlesmn 0:3ac96e360672 2491 for (i = 0; i < 5; i++) {
charlesmn 0:3ac96e360672 2492 sprintf(ppre_text, "%shistogram_avg_1[%u].", pprefix, i);
charlesmn 0:3ac96e360672 2493 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 2494 pbin_data,
charlesmn 0:3ac96e360672 2495 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2496 pbin_data++;
charlesmn 0:3ac96e360672 2497 }
charlesmn 0:3ac96e360672 2498
charlesmn 0:3ac96e360672 2499 pbin_data = &(pdata->histogram_avg_2[0]);
charlesmn 0:3ac96e360672 2500
charlesmn 0:3ac96e360672 2501 for (i = 0; i < 5; i++) {
charlesmn 0:3ac96e360672 2502 sprintf(ppre_text, "%shistogram_avg_2[%u].", pprefix, i);
charlesmn 0:3ac96e360672 2503 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 2504 pbin_data,
charlesmn 0:3ac96e360672 2505 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2506 pbin_data++;
charlesmn 0:3ac96e360672 2507 }
charlesmn 0:3ac96e360672 2508
charlesmn 0:3ac96e360672 2509 pbin_data = &(pdata->xtalk_avg[0]);
charlesmn 0:3ac96e360672 2510
charlesmn 0:3ac96e360672 2511 for (i = 0; i < 5; i++) {
charlesmn 0:3ac96e360672 2512 sprintf(ppre_text, "%sxtalk_avg[%u].", pprefix, i);
charlesmn 0:3ac96e360672 2513 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 2514 pbin_data,
charlesmn 0:3ac96e360672 2515 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 2516 pbin_data++;
charlesmn 0:3ac96e360672 2517 }
charlesmn 0:3ac96e360672 2518 }
charlesmn 0:3ac96e360672 2519
charlesmn 0:3ac96e360672 2520
charlesmn 0:3ac96e360672 2521 void VL53L1_print_xtalk_range_data(
charlesmn 0:3ac96e360672 2522 VL53L1_xtalk_range_data_t *pdata,
charlesmn 0:3ac96e360672 2523 char *pprefix,
charlesmn 0:3ac96e360672 2524 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2525 {
charlesmn 0:3ac96e360672 2526
charlesmn 0:3ac96e360672 2527
charlesmn 0:3ac96e360672 2528 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2529
charlesmn 0:3ac96e360672 2530 trace_print(
charlesmn 0:3ac96e360672 2531 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2532 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2533 pprefix,
charlesmn 0:3ac96e360672 2534 "no_of_samples",
charlesmn 0:3ac96e360672 2535 pdata->no_of_samples);
charlesmn 0:3ac96e360672 2536
charlesmn 0:3ac96e360672 2537 trace_print(
charlesmn 0:3ac96e360672 2538 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2539 "%s%s = %d\n",
charlesmn 0:3ac96e360672 2540 pprefix,
charlesmn 0:3ac96e360672 2541 "signal_total_events_sum",
charlesmn 0:3ac96e360672 2542 pdata->signal_total_events_sum);
charlesmn 0:3ac96e360672 2543
charlesmn 0:3ac96e360672 2544 trace_print(
charlesmn 0:3ac96e360672 2545 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2546 "%s%s = %d\n",
charlesmn 0:3ac96e360672 2547 pprefix,
charlesmn 0:3ac96e360672 2548 "signal_total_events_avg",
charlesmn 0:3ac96e360672 2549 pdata->signal_total_events_avg);
charlesmn 0:3ac96e360672 2550
charlesmn 0:3ac96e360672 2551 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2552 (int32_t)pdata->rate_per_spad_kcps_sum,
charlesmn 0:3ac96e360672 2553 11,
charlesmn 0:3ac96e360672 2554 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2555 fp_text);
charlesmn 0:3ac96e360672 2556
charlesmn 0:3ac96e360672 2557 trace_print(
charlesmn 0:3ac96e360672 2558 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2559 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2560 pprefix,
charlesmn 0:3ac96e360672 2561 "rate_per_spad_kcps_sum",
charlesmn 0:3ac96e360672 2562 fp_text);
charlesmn 0:3ac96e360672 2563
charlesmn 0:3ac96e360672 2564
charlesmn 0:3ac96e360672 2565 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2566 (int32_t)pdata->rate_per_spad_kcps_avg,
charlesmn 0:3ac96e360672 2567 11,
charlesmn 0:3ac96e360672 2568 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2569 fp_text);
charlesmn 0:3ac96e360672 2570
charlesmn 0:3ac96e360672 2571 trace_print(
charlesmn 0:3ac96e360672 2572 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2573 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2574 pprefix,
charlesmn 0:3ac96e360672 2575 "rate_per_spad_kcps_avg",
charlesmn 0:3ac96e360672 2576 fp_text);
charlesmn 0:3ac96e360672 2577 }
charlesmn 0:3ac96e360672 2578
charlesmn 0:3ac96e360672 2579
charlesmn 0:3ac96e360672 2580 void VL53L1_print_xtalk_calibration_results(
charlesmn 0:3ac96e360672 2581 VL53L1_xtalk_calibration_results_t *pdata,
charlesmn 0:3ac96e360672 2582 char *pprefix,
charlesmn 0:3ac96e360672 2583 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2584 {
charlesmn 0:3ac96e360672 2585
charlesmn 0:3ac96e360672 2586
charlesmn 0:3ac96e360672 2587 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2588 int16_t tmpi16;
charlesmn 0:3ac96e360672 2589
charlesmn 0:3ac96e360672 2590 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2591 (int32_t)pdata->algo__crosstalk_compensation_plane_offset_kcps,
charlesmn 0:3ac96e360672 2592 9,
charlesmn 0:3ac96e360672 2593 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2594 fp_text);
charlesmn 0:3ac96e360672 2595
charlesmn 0:3ac96e360672 2596 trace_print(
charlesmn 0:3ac96e360672 2597 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2598 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2599 pprefix,
charlesmn 0:3ac96e360672 2600 "algo__crosstalk_compensation_plane_offset_kcps",
charlesmn 0:3ac96e360672 2601 fp_text);
charlesmn 0:3ac96e360672 2602
charlesmn 0:3ac96e360672 2603 tmpi16 = pdata->algo__crosstalk_compensation_x_plane_gradient_kcps;
charlesmn 0:3ac96e360672 2604 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2605 (int32_t)tmpi16,
charlesmn 0:3ac96e360672 2606 11,
charlesmn 0:3ac96e360672 2607 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2608 fp_text);
charlesmn 0:3ac96e360672 2609
charlesmn 0:3ac96e360672 2610 trace_print(
charlesmn 0:3ac96e360672 2611 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2612 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2613 pprefix,
charlesmn 0:3ac96e360672 2614 "algo__crosstalk_compensation_x_plane_gradient_kcps",
charlesmn 0:3ac96e360672 2615 fp_text);
charlesmn 0:3ac96e360672 2616
charlesmn 0:3ac96e360672 2617 tmpi16 = pdata->algo__crosstalk_compensation_y_plane_gradient_kcps;
charlesmn 0:3ac96e360672 2618 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2619 (int32_t)tmpi16,
charlesmn 0:3ac96e360672 2620 11,
charlesmn 0:3ac96e360672 2621 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2622 fp_text);
charlesmn 0:3ac96e360672 2623
charlesmn 0:3ac96e360672 2624 trace_print(
charlesmn 0:3ac96e360672 2625 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2626 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2627 pprefix,
charlesmn 0:3ac96e360672 2628 "algo__crosstalk_compensation_y_plane_gradient_kcps",
charlesmn 0:3ac96e360672 2629 fp_text);
charlesmn 0:3ac96e360672 2630 }
charlesmn 0:3ac96e360672 2631
charlesmn 0:3ac96e360672 2632
charlesmn 0:3ac96e360672 2633 void VL53L1_print_xtalk_config(
charlesmn 0:3ac96e360672 2634 VL53L1_xtalk_config_t *pdata,
charlesmn 0:3ac96e360672 2635 char *pprefix,
charlesmn 0:3ac96e360672 2636 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2637 {
charlesmn 0:3ac96e360672 2638
charlesmn 0:3ac96e360672 2639
charlesmn 0:3ac96e360672 2640 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2641 int16_t tmpi16;
charlesmn 0:3ac96e360672 2642
charlesmn 0:3ac96e360672 2643 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2644 (int32_t)pdata->algo__crosstalk_compensation_plane_offset_kcps,
charlesmn 0:3ac96e360672 2645 9,
charlesmn 0:3ac96e360672 2646 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2647 fp_text);
charlesmn 0:3ac96e360672 2648
charlesmn 0:3ac96e360672 2649 trace_print(
charlesmn 0:3ac96e360672 2650 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2651 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2652 pprefix,
charlesmn 0:3ac96e360672 2653 "algo__crosstalk_compensation_plane_offset_kcps",
charlesmn 0:3ac96e360672 2654 fp_text);
charlesmn 0:3ac96e360672 2655
charlesmn 0:3ac96e360672 2656 tmpi16 = pdata->algo__crosstalk_compensation_x_plane_gradient_kcps;
charlesmn 0:3ac96e360672 2657 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2658 (int32_t)tmpi16,
charlesmn 0:3ac96e360672 2659 11,
charlesmn 0:3ac96e360672 2660 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2661 fp_text);
charlesmn 0:3ac96e360672 2662
charlesmn 0:3ac96e360672 2663 trace_print(
charlesmn 0:3ac96e360672 2664 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2665 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2666 pprefix,
charlesmn 0:3ac96e360672 2667 "algo__crosstalk_compensation_x_plane_gradient_kcps",
charlesmn 0:3ac96e360672 2668 fp_text);
charlesmn 0:3ac96e360672 2669
charlesmn 0:3ac96e360672 2670 tmpi16 = pdata->algo__crosstalk_compensation_y_plane_gradient_kcps;
charlesmn 0:3ac96e360672 2671 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2672 (int32_t)tmpi16,
charlesmn 0:3ac96e360672 2673 11,
charlesmn 0:3ac96e360672 2674 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2675 fp_text);
charlesmn 0:3ac96e360672 2676
charlesmn 0:3ac96e360672 2677 trace_print(
charlesmn 0:3ac96e360672 2678 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2679 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2680 pprefix,
charlesmn 0:3ac96e360672 2681 "algo__crosstalk_compensation_y_plane_gradient_kcps",
charlesmn 0:3ac96e360672 2682 fp_text);
charlesmn 0:3ac96e360672 2683
charlesmn 0:3ac96e360672 2684 trace_print(
charlesmn 0:3ac96e360672 2685 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2686 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2687 pprefix,
charlesmn 0:3ac96e360672 2688 "global_crosstalk_compensation_enable",
charlesmn 0:3ac96e360672 2689 pdata->global_crosstalk_compensation_enable);
charlesmn 0:3ac96e360672 2690
charlesmn 0:3ac96e360672 2691 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2692 (int32_t)pdata->histogram_mode_crosstalk_margin_kcps,
charlesmn 0:3ac96e360672 2693 9,
charlesmn 0:3ac96e360672 2694 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2695 fp_text);
charlesmn 0:3ac96e360672 2696
charlesmn 0:3ac96e360672 2697 trace_print(
charlesmn 0:3ac96e360672 2698 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2699 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2700 pprefix,
charlesmn 0:3ac96e360672 2701 "histogram_mode_crosstalk_margin_kcps",
charlesmn 0:3ac96e360672 2702 fp_text);
charlesmn 0:3ac96e360672 2703
charlesmn 0:3ac96e360672 2704 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2705 (int32_t)pdata->lite_mode_crosstalk_margin_kcps,
charlesmn 0:3ac96e360672 2706 9,
charlesmn 0:3ac96e360672 2707 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2708 fp_text);
charlesmn 0:3ac96e360672 2709
charlesmn 0:3ac96e360672 2710 trace_print(
charlesmn 0:3ac96e360672 2711 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2712 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2713 pprefix,
charlesmn 0:3ac96e360672 2714 "lite_mode_crosstalk_margin_kcps",
charlesmn 0:3ac96e360672 2715 fp_text);
charlesmn 0:3ac96e360672 2716
charlesmn 0:3ac96e360672 2717 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2718 (int32_t)pdata->crosstalk_range_ignore_threshold_mult,
charlesmn 0:3ac96e360672 2719 5,
charlesmn 0:3ac96e360672 2720 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2721 fp_text);
charlesmn 0:3ac96e360672 2722
charlesmn 0:3ac96e360672 2723 trace_print(
charlesmn 0:3ac96e360672 2724 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2725 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2726 pprefix,
charlesmn 0:3ac96e360672 2727 "crosstalk_range_ignore_threshold_mult",
charlesmn 0:3ac96e360672 2728 fp_text);
charlesmn 0:3ac96e360672 2729
charlesmn 0:3ac96e360672 2730
charlesmn 0:3ac96e360672 2731 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2732 (int32_t)pdata->crosstalk_range_ignore_threshold_rate_mcps,
charlesmn 0:3ac96e360672 2733 13,
charlesmn 0:3ac96e360672 2734 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2735 fp_text);
charlesmn 0:3ac96e360672 2736
charlesmn 0:3ac96e360672 2737 trace_print(
charlesmn 0:3ac96e360672 2738 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2739 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2740 pprefix,
charlesmn 0:3ac96e360672 2741 "crosstalk_range_ignore_threshold_rate_mcps",
charlesmn 0:3ac96e360672 2742 fp_text);
charlesmn 0:3ac96e360672 2743
charlesmn 0:3ac96e360672 2744 trace_print(
charlesmn 0:3ac96e360672 2745 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2746 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2747 pprefix,
charlesmn 0:3ac96e360672 2748 "algo__crosstalk_detect_max_valid_range_mm",
charlesmn 0:3ac96e360672 2749 pdata->algo__crosstalk_detect_max_valid_range_mm);
charlesmn 0:3ac96e360672 2750
charlesmn 0:3ac96e360672 2751 trace_print(
charlesmn 0:3ac96e360672 2752 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2753 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2754 pprefix,
charlesmn 0:3ac96e360672 2755 "algo__crosstalk_detect_min_valid_range_mm",
charlesmn 0:3ac96e360672 2756 pdata->algo__crosstalk_detect_min_valid_range_mm);
charlesmn 0:3ac96e360672 2757
charlesmn 0:3ac96e360672 2758 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2759 (int32_t)pdata->algo__crosstalk_detect_max_valid_rate_kcps,
charlesmn 0:3ac96e360672 2760 7,
charlesmn 0:3ac96e360672 2761 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2762 fp_text);
charlesmn 0:3ac96e360672 2763
charlesmn 0:3ac96e360672 2764 trace_print(
charlesmn 0:3ac96e360672 2765 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2766 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2767 pprefix,
charlesmn 0:3ac96e360672 2768 "algo__crosstalk_detect_max_valid_rate_kcps",
charlesmn 0:3ac96e360672 2769 fp_text);
charlesmn 0:3ac96e360672 2770
charlesmn 0:3ac96e360672 2771 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2772 (int32_t)pdata->algo__crosstalk_detect_max_sigma_mm,
charlesmn 0:3ac96e360672 2773 2,
charlesmn 0:3ac96e360672 2774 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2775 fp_text);
charlesmn 0:3ac96e360672 2776
charlesmn 0:3ac96e360672 2777 trace_print(
charlesmn 0:3ac96e360672 2778 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2779 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2780 pprefix,
charlesmn 0:3ac96e360672 2781 "algo__crosstalk_detect_max_sigma_mm",
charlesmn 0:3ac96e360672 2782 fp_text);
charlesmn 0:3ac96e360672 2783
charlesmn 0:3ac96e360672 2784 }
charlesmn 0:3ac96e360672 2785
charlesmn 0:3ac96e360672 2786
charlesmn 0:3ac96e360672 2787 void VL53L1_print_xtalk_extract_config(
charlesmn 0:3ac96e360672 2788 VL53L1_xtalkextract_config_t *pdata,
charlesmn 0:3ac96e360672 2789 char *pprefix,
charlesmn 0:3ac96e360672 2790 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2791 {
charlesmn 0:3ac96e360672 2792
charlesmn 0:3ac96e360672 2793
charlesmn 0:3ac96e360672 2794 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2795
charlesmn 0:3ac96e360672 2796
charlesmn 0:3ac96e360672 2797 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2798 (int32_t)pdata->dss_config__target_total_rate_mcps,
charlesmn 0:3ac96e360672 2799 7,
charlesmn 0:3ac96e360672 2800 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2801 fp_text);
charlesmn 0:3ac96e360672 2802
charlesmn 0:3ac96e360672 2803 trace_print(
charlesmn 0:3ac96e360672 2804 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2805 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2806 pprefix,
charlesmn 0:3ac96e360672 2807 "dss_config__target_total_rate_mcps",
charlesmn 0:3ac96e360672 2808 fp_text);
charlesmn 0:3ac96e360672 2809
charlesmn 0:3ac96e360672 2810 trace_print(
charlesmn 0:3ac96e360672 2811 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2812 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2813 pprefix,
charlesmn 0:3ac96e360672 2814 "mm_config_timeout_us",
charlesmn 0:3ac96e360672 2815 pdata->mm_config_timeout_us);
charlesmn 0:3ac96e360672 2816
charlesmn 0:3ac96e360672 2817 trace_print(
charlesmn 0:3ac96e360672 2818 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2819 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2820 pprefix,
charlesmn 0:3ac96e360672 2821 "range_config_timeout_us",
charlesmn 0:3ac96e360672 2822 pdata->range_config_timeout_us);
charlesmn 0:3ac96e360672 2823
charlesmn 0:3ac96e360672 2824 trace_print(
charlesmn 0:3ac96e360672 2825 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2826 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2827 pprefix,
charlesmn 0:3ac96e360672 2828 "num_of_samples",
charlesmn 0:3ac96e360672 2829 pdata->num_of_samples);
charlesmn 0:3ac96e360672 2830
charlesmn 0:3ac96e360672 2831
charlesmn 0:3ac96e360672 2832 trace_print(
charlesmn 0:3ac96e360672 2833 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2834 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2835 pprefix,
charlesmn 0:3ac96e360672 2836 "algo__crosstalk_extract_max_valid_range_mm",
charlesmn 0:3ac96e360672 2837 pdata->algo__crosstalk_extract_max_valid_range_mm);
charlesmn 0:3ac96e360672 2838
charlesmn 0:3ac96e360672 2839 trace_print(
charlesmn 0:3ac96e360672 2840 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2841 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2842 pprefix,
charlesmn 0:3ac96e360672 2843 "algo__crosstalk_extract_min_valid_range_mm",
charlesmn 0:3ac96e360672 2844 pdata->algo__crosstalk_extract_min_valid_range_mm);
charlesmn 0:3ac96e360672 2845
charlesmn 0:3ac96e360672 2846 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2847 (int32_t)pdata->algo__crosstalk_extract_max_valid_rate_kcps,
charlesmn 0:3ac96e360672 2848 9,
charlesmn 0:3ac96e360672 2849 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2850 fp_text);
charlesmn 0:3ac96e360672 2851
charlesmn 0:3ac96e360672 2852 trace_print(
charlesmn 0:3ac96e360672 2853 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2854 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2855 pprefix,
charlesmn 0:3ac96e360672 2856 "algo__crosstalk_extract_max_valid_rate_kcps",
charlesmn 0:3ac96e360672 2857 fp_text);
charlesmn 0:3ac96e360672 2858
charlesmn 0:3ac96e360672 2859 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2860 (int32_t)pdata->algo__crosstalk_extract_max_sigma_mm,
charlesmn 0:3ac96e360672 2861 2,
charlesmn 0:3ac96e360672 2862 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2863 fp_text);
charlesmn 0:3ac96e360672 2864
charlesmn 0:3ac96e360672 2865 trace_print(
charlesmn 0:3ac96e360672 2866 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2867 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2868 pprefix,
charlesmn 0:3ac96e360672 2869 "algo__crosstalk_extract_max_sigma_mm",
charlesmn 0:3ac96e360672 2870 fp_text);
charlesmn 0:3ac96e360672 2871
charlesmn 0:3ac96e360672 2872 }
charlesmn 0:3ac96e360672 2873
charlesmn 0:3ac96e360672 2874
charlesmn 0:3ac96e360672 2875 void VL53L1_print_zone_cal_config(
charlesmn 0:3ac96e360672 2876 VL53L1_zonecal_config_t *pdata,
charlesmn 0:3ac96e360672 2877 char *pprefix,
charlesmn 0:3ac96e360672 2878 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2879 {
charlesmn 0:3ac96e360672 2880
charlesmn 0:3ac96e360672 2881
charlesmn 0:3ac96e360672 2882 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2883
charlesmn 0:3ac96e360672 2884 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2885 (int32_t)pdata->dss_config__target_total_rate_mcps,
charlesmn 0:3ac96e360672 2886 7,
charlesmn 0:3ac96e360672 2887 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2888 fp_text);
charlesmn 0:3ac96e360672 2889
charlesmn 0:3ac96e360672 2890 trace_print(
charlesmn 0:3ac96e360672 2891 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2892 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2893 pprefix,
charlesmn 0:3ac96e360672 2894 "dss_config__target_total_rate_mcps",
charlesmn 0:3ac96e360672 2895 fp_text);
charlesmn 0:3ac96e360672 2896
charlesmn 0:3ac96e360672 2897
charlesmn 0:3ac96e360672 2898 trace_print(
charlesmn 0:3ac96e360672 2899 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2900 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2901 pprefix,
charlesmn 0:3ac96e360672 2902 "mm_config_timeout_us",
charlesmn 0:3ac96e360672 2903 pdata->mm_config_timeout_us);
charlesmn 0:3ac96e360672 2904
charlesmn 0:3ac96e360672 2905 trace_print(
charlesmn 0:3ac96e360672 2906 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2907 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2908 pprefix,
charlesmn 0:3ac96e360672 2909 "range_config_timeout_us",
charlesmn 0:3ac96e360672 2910 pdata->range_config_timeout_us);
charlesmn 0:3ac96e360672 2911
charlesmn 0:3ac96e360672 2912 trace_print(
charlesmn 0:3ac96e360672 2913 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2914 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2915 pprefix,
charlesmn 0:3ac96e360672 2916 "phasecal_config_timeout_us",
charlesmn 0:3ac96e360672 2917 pdata->phasecal_config_timeout_us);
charlesmn 0:3ac96e360672 2918
charlesmn 0:3ac96e360672 2919
charlesmn 0:3ac96e360672 2920 trace_print(
charlesmn 0:3ac96e360672 2921 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2922 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2923 pprefix,
charlesmn 0:3ac96e360672 2924 "phasecal_num_of_samples",
charlesmn 0:3ac96e360672 2925 pdata->phasecal_num_of_samples);
charlesmn 0:3ac96e360672 2926
charlesmn 0:3ac96e360672 2927
charlesmn 0:3ac96e360672 2928 trace_print(
charlesmn 0:3ac96e360672 2929 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2930 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2931 pprefix,
charlesmn 0:3ac96e360672 2932 "zone_num_of_samples",
charlesmn 0:3ac96e360672 2933 pdata->zone_num_of_samples);
charlesmn 0:3ac96e360672 2934
charlesmn 0:3ac96e360672 2935 }
charlesmn 0:3ac96e360672 2936
charlesmn 0:3ac96e360672 2937 void VL53L1_print_offset_cal_config(
charlesmn 0:3ac96e360672 2938 VL53L1_offsetcal_config_t *pdata,
charlesmn 0:3ac96e360672 2939 char *pprefix,
charlesmn 0:3ac96e360672 2940 uint32_t trace_flags)
charlesmn 0:3ac96e360672 2941 {
charlesmn 0:3ac96e360672 2942
charlesmn 0:3ac96e360672 2943
charlesmn 0:3ac96e360672 2944 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 2945
charlesmn 0:3ac96e360672 2946 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 2947 (int32_t)pdata->dss_config__target_total_rate_mcps,
charlesmn 0:3ac96e360672 2948 7,
charlesmn 0:3ac96e360672 2949 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 2950 fp_text);
charlesmn 0:3ac96e360672 2951
charlesmn 0:3ac96e360672 2952 trace_print(
charlesmn 0:3ac96e360672 2953 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2954 "%s%s = %s\n",
charlesmn 0:3ac96e360672 2955 pprefix,
charlesmn 0:3ac96e360672 2956 "dss_config__target_total_rate_mcps",
charlesmn 0:3ac96e360672 2957 fp_text);
charlesmn 0:3ac96e360672 2958
charlesmn 0:3ac96e360672 2959 trace_print(
charlesmn 0:3ac96e360672 2960 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2961 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2962 pprefix,
charlesmn 0:3ac96e360672 2963 "phasecal_config_timeout_us",
charlesmn 0:3ac96e360672 2964 pdata->phasecal_config_timeout_us);
charlesmn 0:3ac96e360672 2965
charlesmn 0:3ac96e360672 2966 trace_print(
charlesmn 0:3ac96e360672 2967 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2968 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2969 pprefix,
charlesmn 0:3ac96e360672 2970 "range_config_timeout_us",
charlesmn 0:3ac96e360672 2971 pdata->range_config_timeout_us);
charlesmn 0:3ac96e360672 2972
charlesmn 0:3ac96e360672 2973 trace_print(
charlesmn 0:3ac96e360672 2974 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2975 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2976 pprefix,
charlesmn 0:3ac96e360672 2977 "pre_num_of_samples",
charlesmn 0:3ac96e360672 2978 pdata->pre_num_of_samples);
charlesmn 0:3ac96e360672 2979
charlesmn 0:3ac96e360672 2980 trace_print(
charlesmn 0:3ac96e360672 2981 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2982 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2983 pprefix,
charlesmn 0:3ac96e360672 2984 "mm1_num_of_samples",
charlesmn 0:3ac96e360672 2985 pdata->mm1_num_of_samples);
charlesmn 0:3ac96e360672 2986
charlesmn 0:3ac96e360672 2987 trace_print(
charlesmn 0:3ac96e360672 2988 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 2989 "%s%s = %u\n",
charlesmn 0:3ac96e360672 2990 pprefix,
charlesmn 0:3ac96e360672 2991 "mm2_num_of_samples",
charlesmn 0:3ac96e360672 2992 pdata->mm2_num_of_samples);
charlesmn 0:3ac96e360672 2993
charlesmn 0:3ac96e360672 2994
charlesmn 0:3ac96e360672 2995 }
charlesmn 0:3ac96e360672 2996
charlesmn 0:3ac96e360672 2997
charlesmn 0:3ac96e360672 2998 void VL53L1_print_dmax_calibration_data(
charlesmn 0:3ac96e360672 2999 VL53L1_dmax_calibration_data_t *pdata,
charlesmn 0:3ac96e360672 3000 char *pprefix,
charlesmn 0:3ac96e360672 3001 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3002 {
charlesmn 0:3ac96e360672 3003
charlesmn 0:3ac96e360672 3004
charlesmn 0:3ac96e360672 3005 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3006
charlesmn 0:3ac96e360672 3007 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3008 (int32_t)pdata->ref__actual_effective_spads,
charlesmn 0:3ac96e360672 3009 8,
charlesmn 0:3ac96e360672 3010 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3011 fp_text);
charlesmn 0:3ac96e360672 3012
charlesmn 0:3ac96e360672 3013 trace_print(
charlesmn 0:3ac96e360672 3014 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3015 "%s%s = %s\n",
charlesmn 0:3ac96e360672 3016 pprefix,
charlesmn 0:3ac96e360672 3017 "ref__actual_effective_spads",
charlesmn 0:3ac96e360672 3018 fp_text);
charlesmn 0:3ac96e360672 3019
charlesmn 0:3ac96e360672 3020 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3021 (int32_t)pdata->ref__peak_signal_count_rate_mcps,
charlesmn 0:3ac96e360672 3022 7,
charlesmn 0:3ac96e360672 3023 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3024 fp_text);
charlesmn 0:3ac96e360672 3025
charlesmn 0:3ac96e360672 3026 trace_print(
charlesmn 0:3ac96e360672 3027 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3028 "%s%s = %s\n",
charlesmn 0:3ac96e360672 3029 pprefix,
charlesmn 0:3ac96e360672 3030 "ref__peak_signal_count_rate_mcps",
charlesmn 0:3ac96e360672 3031 fp_text);
charlesmn 0:3ac96e360672 3032
charlesmn 0:3ac96e360672 3033 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3034 (int32_t)pdata->ref__distance_mm,
charlesmn 0:3ac96e360672 3035 4,
charlesmn 0:3ac96e360672 3036 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3037 fp_text);
charlesmn 0:3ac96e360672 3038
charlesmn 0:3ac96e360672 3039 trace_print(
charlesmn 0:3ac96e360672 3040 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3041 "%s%s = %s\n",
charlesmn 0:3ac96e360672 3042 pprefix,
charlesmn 0:3ac96e360672 3043 "ref__distance_mm",
charlesmn 0:3ac96e360672 3044 fp_text);
charlesmn 0:3ac96e360672 3045
charlesmn 0:3ac96e360672 3046 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3047 (int32_t)pdata->ref_reflectance_pc,
charlesmn 0:3ac96e360672 3048 2,
charlesmn 0:3ac96e360672 3049 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3050 fp_text);
charlesmn 0:3ac96e360672 3051
charlesmn 0:3ac96e360672 3052 trace_print(
charlesmn 0:3ac96e360672 3053 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3054 "%s%s = %s\n",
charlesmn 0:3ac96e360672 3055 pprefix,
charlesmn 0:3ac96e360672 3056 "ref_reflectance_pc",
charlesmn 0:3ac96e360672 3057 fp_text);
charlesmn 0:3ac96e360672 3058
charlesmn 0:3ac96e360672 3059 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3060 (int32_t)pdata->coverglass_transmission,
charlesmn 0:3ac96e360672 3061 8,
charlesmn 0:3ac96e360672 3062 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3063 fp_text);
charlesmn 0:3ac96e360672 3064
charlesmn 0:3ac96e360672 3065 trace_print(
charlesmn 0:3ac96e360672 3066 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3067 "%s%s = %s\n",
charlesmn 0:3ac96e360672 3068 pprefix,
charlesmn 0:3ac96e360672 3069 "coverglass_transmission",
charlesmn 0:3ac96e360672 3070 fp_text);
charlesmn 0:3ac96e360672 3071 }
charlesmn 0:3ac96e360672 3072
charlesmn 0:3ac96e360672 3073
charlesmn 0:3ac96e360672 3074 void VL53L1_print_calibration_data(
charlesmn 0:3ac96e360672 3075 VL53L1_calibration_data_t *pdata,
charlesmn 0:3ac96e360672 3076 char *pprefix,
charlesmn 0:3ac96e360672 3077 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3078 {
charlesmn 0:3ac96e360672 3079
charlesmn 0:3ac96e360672 3080
charlesmn 0:3ac96e360672 3081 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3082 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 3083
charlesmn 0:3ac96e360672 3084 trace_print(
charlesmn 0:3ac96e360672 3085 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3086 "%s%s = 0x%08X\n",
charlesmn 0:3ac96e360672 3087 pprefix,
charlesmn 0:3ac96e360672 3088 "struct_version",
charlesmn 0:3ac96e360672 3089 pdata->struct_version);
charlesmn 0:3ac96e360672 3090
charlesmn 0:3ac96e360672 3091 sprintf(ppre_text, "%scustomer.", pprefix);
charlesmn 0:3ac96e360672 3092 VL53L1_print_customer_nvm_managed(
charlesmn 0:3ac96e360672 3093 &(pdata->customer),
charlesmn 0:3ac96e360672 3094 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3095
charlesmn 0:3ac96e360672 3096 sprintf(ppre_text, "%sfmt_dmax_cal.", pprefix);
charlesmn 0:3ac96e360672 3097 VL53L1_print_dmax_calibration_data(
charlesmn 0:3ac96e360672 3098 &(pdata->fmt_dmax_cal),
charlesmn 0:3ac96e360672 3099 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3100
charlesmn 0:3ac96e360672 3101 sprintf(ppre_text, "%scust_dmax_cal.", pprefix);
charlesmn 0:3ac96e360672 3102 VL53L1_print_dmax_calibration_data(
charlesmn 0:3ac96e360672 3103 &(pdata->cust_dmax_cal),
charlesmn 0:3ac96e360672 3104 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3105
charlesmn 0:3ac96e360672 3106 sprintf(ppre_text, "%sadd_off_cal_data.", pprefix);
charlesmn 0:3ac96e360672 3107 VL53L1_print_additional_offset_cal_data(
charlesmn 0:3ac96e360672 3108 &(pdata->add_off_cal_data),
charlesmn 0:3ac96e360672 3109 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3110
charlesmn 0:3ac96e360672 3111 sprintf(ppre_text, "%soptical_centre.", pprefix);
charlesmn 0:3ac96e360672 3112 VL53L1_print_optical_centre(
charlesmn 0:3ac96e360672 3113 &(pdata->optical_centre),
charlesmn 0:3ac96e360672 3114 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3115
charlesmn 0:3ac96e360672 3116 sprintf(ppre_text, "%sxtalkhisto.", pprefix);
charlesmn 0:3ac96e360672 3117 VL53L1_print_xtalk_histogram_data(
charlesmn 0:3ac96e360672 3118 &(pdata->xtalkhisto),
charlesmn 0:3ac96e360672 3119 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3120
charlesmn 0:3ac96e360672 3121 sprintf(ppre_text, "%sgain_cal.", pprefix);
charlesmn 0:3ac96e360672 3122 VL53L1_print_gain_calibration_data(
charlesmn 0:3ac96e360672 3123 &(pdata->gain_cal),
charlesmn 0:3ac96e360672 3124 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3125
charlesmn 0:3ac96e360672 3126 sprintf(ppre_text, "%scal_peak_rate_map.", pprefix);
charlesmn 0:3ac96e360672 3127 VL53L1_print_cal_peak_rate_map(
charlesmn 0:3ac96e360672 3128 &(pdata->cal_peak_rate_map),
charlesmn 0:3ac96e360672 3129 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3130 }
charlesmn 0:3ac96e360672 3131
charlesmn 0:3ac96e360672 3132
charlesmn 0:3ac96e360672 3133 void VL53L1_print_xtalk_debug_data(
charlesmn 0:3ac96e360672 3134 VL53L1_xtalk_debug_data_t *pdata,
charlesmn 0:3ac96e360672 3135 char *pprefix,
charlesmn 0:3ac96e360672 3136 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3137 {
charlesmn 0:3ac96e360672 3138
charlesmn 0:3ac96e360672 3139
charlesmn 0:3ac96e360672 3140 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3141 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 3142
charlesmn 0:3ac96e360672 3143 sprintf(ppre_text, "%scustomer.", pprefix);
charlesmn 0:3ac96e360672 3144 VL53L1_print_customer_nvm_managed(
charlesmn 0:3ac96e360672 3145 &(pdata->customer),
charlesmn 0:3ac96e360672 3146 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3147
charlesmn 0:3ac96e360672 3148 sprintf(ppre_text, "%sxtalk_cfg.", pprefix);
charlesmn 0:3ac96e360672 3149 VL53L1_print_xtalk_config(
charlesmn 0:3ac96e360672 3150 &(pdata->xtalk_cfg),
charlesmn 0:3ac96e360672 3151 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3152
charlesmn 0:3ac96e360672 3153 sprintf(ppre_text, "%sxtalk_extract_cfg.", pprefix);
charlesmn 0:3ac96e360672 3154 VL53L1_print_xtalk_extract_config(
charlesmn 0:3ac96e360672 3155 &(pdata->xtalk_extract_cfg),
charlesmn 0:3ac96e360672 3156 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3157
charlesmn 0:3ac96e360672 3158 sprintf(ppre_text, "%shist_data.", pprefix);
charlesmn 0:3ac96e360672 3159 VL53L1_print_histogram_bin_data(
charlesmn 0:3ac96e360672 3160 &(pdata->hist_data),
charlesmn 0:3ac96e360672 3161 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3162
charlesmn 0:3ac96e360672 3163 sprintf(ppre_text, "%sxtalk_shapes.", pprefix);
charlesmn 0:3ac96e360672 3164 VL53L1_print_xtalk_histogram_data(
charlesmn 0:3ac96e360672 3165 &(pdata->xtalk_shapes),
charlesmn 0:3ac96e360672 3166 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3167
charlesmn 0:3ac96e360672 3168 sprintf(ppre_text, "%sgain_cal.", pprefix);
charlesmn 0:3ac96e360672 3169 VL53L1_print_xtalk_range_results(
charlesmn 0:3ac96e360672 3170 &(pdata->xtalk_results),
charlesmn 0:3ac96e360672 3171 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3172 }
charlesmn 0:3ac96e360672 3173
charlesmn 0:3ac96e360672 3174
charlesmn 0:3ac96e360672 3175 void VL53L1_print_offset_debug_data(
charlesmn 0:3ac96e360672 3176 VL53L1_offset_debug_data_t *pdata,
charlesmn 0:3ac96e360672 3177 char *pprefix,
charlesmn 0:3ac96e360672 3178 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3179 {
charlesmn 0:3ac96e360672 3180
charlesmn 0:3ac96e360672 3181
charlesmn 0:3ac96e360672 3182 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3183 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 3184
charlesmn 0:3ac96e360672 3185 sprintf(ppre_text, "%scustomer.", pprefix);
charlesmn 0:3ac96e360672 3186 VL53L1_print_customer_nvm_managed(
charlesmn 0:3ac96e360672 3187 &(pdata->customer),
charlesmn 0:3ac96e360672 3188 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3189
charlesmn 0:3ac96e360672 3190 sprintf(ppre_text, "%sfmt_dmax_cal.", pprefix);
charlesmn 0:3ac96e360672 3191 VL53L1_print_dmax_calibration_data(
charlesmn 0:3ac96e360672 3192 &(pdata->fmt_dmax_cal),
charlesmn 0:3ac96e360672 3193 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3194
charlesmn 0:3ac96e360672 3195 sprintf(ppre_text, "%scust_dmax_cal.", pprefix);
charlesmn 0:3ac96e360672 3196 VL53L1_print_dmax_calibration_data(
charlesmn 0:3ac96e360672 3197 &(pdata->cust_dmax_cal),
charlesmn 0:3ac96e360672 3198 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3199
charlesmn 0:3ac96e360672 3200 sprintf(ppre_text, "%sadd_off_cal_data.", pprefix);
charlesmn 0:3ac96e360672 3201 VL53L1_print_additional_offset_cal_data(
charlesmn 0:3ac96e360672 3202 &(pdata->add_off_cal_data),
charlesmn 0:3ac96e360672 3203 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3204
charlesmn 0:3ac96e360672 3205 sprintf(ppre_text, "%soffset_results.", pprefix);
charlesmn 0:3ac96e360672 3206 VL53L1_print_offset_range_results(
charlesmn 0:3ac96e360672 3207 &(pdata->offset_results),
charlesmn 0:3ac96e360672 3208 ppre_text, trace_flags);
charlesmn 0:3ac96e360672 3209 }
charlesmn 0:3ac96e360672 3210
charlesmn 0:3ac96e360672 3211
charlesmn 0:3ac96e360672 3212 void VL53L1_print_zone_config(
charlesmn 0:3ac96e360672 3213 VL53L1_zone_config_t *pdata,
charlesmn 0:3ac96e360672 3214 char *pprefix,
charlesmn 0:3ac96e360672 3215 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3216 {
charlesmn 0:3ac96e360672 3217
charlesmn 0:3ac96e360672 3218
charlesmn 0:3ac96e360672 3219
charlesmn 0:3ac96e360672 3220 char pre_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3221 char *ppre_text = &(pre_text[0]);
charlesmn 0:3ac96e360672 3222
charlesmn 0:3ac96e360672 3223 uint8_t i = 0;
charlesmn 0:3ac96e360672 3224
charlesmn 0:3ac96e360672 3225 trace_print(
charlesmn 0:3ac96e360672 3226 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3227 "%s%s = %u\n",
charlesmn 0:3ac96e360672 3228 pprefix,
charlesmn 0:3ac96e360672 3229 "max_zones",
charlesmn 0:3ac96e360672 3230 pdata->max_zones);
charlesmn 0:3ac96e360672 3231
charlesmn 0:3ac96e360672 3232 trace_print(
charlesmn 0:3ac96e360672 3233 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3234 "%s%s = %u\n",
charlesmn 0:3ac96e360672 3235 pprefix,
charlesmn 0:3ac96e360672 3236 "active_zones",
charlesmn 0:3ac96e360672 3237 pdata->active_zones);
charlesmn 0:3ac96e360672 3238
charlesmn 0:3ac96e360672 3239 for (i = 0; i < pdata->active_zones; i++) {
charlesmn 0:3ac96e360672 3240 sprintf(ppre_text, "%suser_zones[%u].", pprefix, i);
charlesmn 0:3ac96e360672 3241 VL53L1_print_user_zone(
charlesmn 0:3ac96e360672 3242 &pdata->user_zones[i],
charlesmn 0:3ac96e360672 3243 ppre_text,
charlesmn 0:3ac96e360672 3244 trace_flags);
charlesmn 0:3ac96e360672 3245 }
charlesmn 0:3ac96e360672 3246 }
charlesmn 0:3ac96e360672 3247
charlesmn 0:3ac96e360672 3248
charlesmn 0:3ac96e360672 3249 void VL53L1_print_optical_centre(
charlesmn 0:3ac96e360672 3250 VL53L1_optical_centre_t *pdata,
charlesmn 0:3ac96e360672 3251 char *pprefix,
charlesmn 0:3ac96e360672 3252 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3253 {
charlesmn 0:3ac96e360672 3254
charlesmn 0:3ac96e360672 3255
charlesmn 0:3ac96e360672 3256
charlesmn 0:3ac96e360672 3257 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3258
charlesmn 0:3ac96e360672 3259 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3260 (int32_t)pdata->x_centre,
charlesmn 0:3ac96e360672 3261 4,
charlesmn 0:3ac96e360672 3262 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3263 fp_text);
charlesmn 0:3ac96e360672 3264
charlesmn 0:3ac96e360672 3265 trace_print(
charlesmn 0:3ac96e360672 3266 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3267 "%s%s = %s\n",
charlesmn 0:3ac96e360672 3268 pprefix,
charlesmn 0:3ac96e360672 3269 "x_centre",
charlesmn 0:3ac96e360672 3270 fp_text);
charlesmn 0:3ac96e360672 3271
charlesmn 0:3ac96e360672 3272 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3273 (int32_t)pdata->y_centre,
charlesmn 0:3ac96e360672 3274 4,
charlesmn 0:3ac96e360672 3275 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3276 fp_text);
charlesmn 0:3ac96e360672 3277
charlesmn 0:3ac96e360672 3278 trace_print(
charlesmn 0:3ac96e360672 3279 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3280 "%s%s = %s\n",
charlesmn 0:3ac96e360672 3281 pprefix,
charlesmn 0:3ac96e360672 3282 "y_centre",
charlesmn 0:3ac96e360672 3283 fp_text);
charlesmn 0:3ac96e360672 3284 }
charlesmn 0:3ac96e360672 3285
charlesmn 0:3ac96e360672 3286
charlesmn 0:3ac96e360672 3287 void VL53L1_print_user_zone(
charlesmn 0:3ac96e360672 3288 VL53L1_user_zone_t *pdata,
charlesmn 0:3ac96e360672 3289 char *pprefix,
charlesmn 0:3ac96e360672 3290 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3291 {
charlesmn 0:3ac96e360672 3292
charlesmn 0:3ac96e360672 3293
charlesmn 0:3ac96e360672 3294
charlesmn 0:3ac96e360672 3295 trace_print(
charlesmn 0:3ac96e360672 3296 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3297 "%s%s = %u\n",
charlesmn 0:3ac96e360672 3298 pprefix,
charlesmn 0:3ac96e360672 3299 "x_centre",
charlesmn 0:3ac96e360672 3300 pdata->x_centre);
charlesmn 0:3ac96e360672 3301
charlesmn 0:3ac96e360672 3302 trace_print(
charlesmn 0:3ac96e360672 3303 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3304 "%s%s = %u\n",
charlesmn 0:3ac96e360672 3305 pprefix,
charlesmn 0:3ac96e360672 3306 "y_centre",
charlesmn 0:3ac96e360672 3307 pdata->y_centre);
charlesmn 0:3ac96e360672 3308
charlesmn 0:3ac96e360672 3309 trace_print(
charlesmn 0:3ac96e360672 3310 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3311 "%s%s = %u\n",
charlesmn 0:3ac96e360672 3312 pprefix,
charlesmn 0:3ac96e360672 3313 "width",
charlesmn 0:3ac96e360672 3314 pdata->width);
charlesmn 0:3ac96e360672 3315
charlesmn 0:3ac96e360672 3316 trace_print(VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3317 "%s%s = %u\n",
charlesmn 0:3ac96e360672 3318 pprefix,
charlesmn 0:3ac96e360672 3319 "height",
charlesmn 0:3ac96e360672 3320 pdata->height);
charlesmn 0:3ac96e360672 3321 }
charlesmn 0:3ac96e360672 3322
charlesmn 0:3ac96e360672 3323
charlesmn 0:3ac96e360672 3324 void VL53L1_print_spad_rate_data(
charlesmn 0:3ac96e360672 3325 VL53L1_spad_rate_data_t *pspad_rates,
charlesmn 0:3ac96e360672 3326 char *pprefix,
charlesmn 0:3ac96e360672 3327 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3328 {
charlesmn 0:3ac96e360672 3329
charlesmn 0:3ac96e360672 3330
charlesmn 0:3ac96e360672 3331
charlesmn 0:3ac96e360672 3332 uint16_t spad_no = 0;
charlesmn 0:3ac96e360672 3333 uint8_t row = 0;
charlesmn 0:3ac96e360672 3334 uint8_t col = 0;
charlesmn 0:3ac96e360672 3335
charlesmn 0:3ac96e360672 3336 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3337
charlesmn 0:3ac96e360672 3338 trace_print(
charlesmn 0:3ac96e360672 3339 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3340 "%s%8s,%4s,%4s, %s\n",
charlesmn 0:3ac96e360672 3341 pprefix,
charlesmn 0:3ac96e360672 3342 "spad_no",
charlesmn 0:3ac96e360672 3343 "row",
charlesmn 0:3ac96e360672 3344 "col",
charlesmn 0:3ac96e360672 3345 "peak_rate_mcps");
charlesmn 0:3ac96e360672 3346
charlesmn 0:3ac96e360672 3347 for (spad_no = 0; spad_no < pspad_rates->no_of_values; spad_no++) {
charlesmn 0:3ac96e360672 3348
charlesmn 0:3ac96e360672 3349
charlesmn 0:3ac96e360672 3350 VL53L1_decode_row_col(
charlesmn 0:3ac96e360672 3351 (uint8_t)spad_no,
charlesmn 0:3ac96e360672 3352 &row,
charlesmn 0:3ac96e360672 3353 &col);
charlesmn 0:3ac96e360672 3354
charlesmn 0:3ac96e360672 3355
charlesmn 0:3ac96e360672 3356
charlesmn 0:3ac96e360672 3357 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3358 (int32_t)pspad_rates->rate_data[spad_no],
charlesmn 0:3ac96e360672 3359 pspad_rates->fractional_bits,
charlesmn 0:3ac96e360672 3360 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3361 fp_text);
charlesmn 0:3ac96e360672 3362
charlesmn 0:3ac96e360672 3363
charlesmn 0:3ac96e360672 3364
charlesmn 0:3ac96e360672 3365 trace_print(
charlesmn 0:3ac96e360672 3366 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3367 "%s%8u,%4u,%4u, %s\n",
charlesmn 0:3ac96e360672 3368 pprefix,
charlesmn 0:3ac96e360672 3369 spad_no,
charlesmn 0:3ac96e360672 3370 row,
charlesmn 0:3ac96e360672 3371 col,
charlesmn 0:3ac96e360672 3372 fp_text);
charlesmn 0:3ac96e360672 3373 }
charlesmn 0:3ac96e360672 3374 }
charlesmn 0:3ac96e360672 3375
charlesmn 0:3ac96e360672 3376
charlesmn 0:3ac96e360672 3377 void VL53L1_print_spad_rate_map(
charlesmn 0:3ac96e360672 3378 VL53L1_spad_rate_data_t *pspad_rates,
charlesmn 0:3ac96e360672 3379 char *pprefix,
charlesmn 0:3ac96e360672 3380 uint32_t trace_flags)
charlesmn 0:3ac96e360672 3381 {
charlesmn 0:3ac96e360672 3382
charlesmn 0:3ac96e360672 3383
charlesmn 0:3ac96e360672 3384
charlesmn 0:3ac96e360672 3385 uint8_t spad_no = 0;
charlesmn 0:3ac96e360672 3386 uint8_t row = 0;
charlesmn 0:3ac96e360672 3387 uint8_t col = 0;
charlesmn 0:3ac96e360672 3388
charlesmn 0:3ac96e360672 3389 char fp_text[VL53L1_MAX_STRING_LENGTH];
charlesmn 0:3ac96e360672 3390
charlesmn 0:3ac96e360672 3391
charlesmn 0:3ac96e360672 3392 trace_print(
charlesmn 0:3ac96e360672 3393 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3394 "%s%4s",
charlesmn 0:3ac96e360672 3395 pprefix,
charlesmn 0:3ac96e360672 3396 " ");
charlesmn 0:3ac96e360672 3397
charlesmn 0:3ac96e360672 3398 for (col = 0; col < VL53L1_SPAD_ARRAY_WIDTH; col++)
charlesmn 0:3ac96e360672 3399 trace_print(
charlesmn 0:3ac96e360672 3400 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3401 ",%8u",
charlesmn 0:3ac96e360672 3402 col);
charlesmn 0:3ac96e360672 3403
charlesmn 0:3ac96e360672 3404 trace_print(
charlesmn 0:3ac96e360672 3405 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3406 "\n");
charlesmn 0:3ac96e360672 3407
charlesmn 0:3ac96e360672 3408
charlesmn 0:3ac96e360672 3409
charlesmn 0:3ac96e360672 3410 for (row = 0; row < VL53L1_SPAD_ARRAY_HEIGHT; row++) {
charlesmn 0:3ac96e360672 3411
charlesmn 0:3ac96e360672 3412 trace_print(
charlesmn 0:3ac96e360672 3413 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3414 "%s%4u",
charlesmn 0:3ac96e360672 3415 pprefix,
charlesmn 0:3ac96e360672 3416 row);
charlesmn 0:3ac96e360672 3417
charlesmn 0:3ac96e360672 3418 for (col = 0; col < VL53L1_SPAD_ARRAY_HEIGHT; col++) {
charlesmn 0:3ac96e360672 3419
charlesmn 0:3ac96e360672 3420
charlesmn 0:3ac96e360672 3421
charlesmn 0:3ac96e360672 3422 VL53L1_encode_row_col(
charlesmn 0:3ac96e360672 3423 row,
charlesmn 0:3ac96e360672 3424 col,
charlesmn 0:3ac96e360672 3425 &spad_no);
charlesmn 0:3ac96e360672 3426
charlesmn 0:3ac96e360672 3427
charlesmn 0:3ac96e360672 3428
charlesmn 0:3ac96e360672 3429 VL53L1_signed_fixed_point_sprintf(
charlesmn 0:3ac96e360672 3430 (int32_t)pspad_rates->rate_data[spad_no],
charlesmn 0:3ac96e360672 3431 pspad_rates->fractional_bits,
charlesmn 0:3ac96e360672 3432 VL53L1_MAX_STRING_LENGTH,
charlesmn 0:3ac96e360672 3433 fp_text);
charlesmn 0:3ac96e360672 3434
charlesmn 0:3ac96e360672 3435
charlesmn 0:3ac96e360672 3436
charlesmn 0:3ac96e360672 3437 trace_print(
charlesmn 0:3ac96e360672 3438 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3439 ",%8s",
charlesmn 0:3ac96e360672 3440 fp_text);
charlesmn 0:3ac96e360672 3441 }
charlesmn 0:3ac96e360672 3442
charlesmn 0:3ac96e360672 3443 trace_print(
charlesmn 0:3ac96e360672 3444 VL53L1_TRACE_LEVEL_INFO,
charlesmn 0:3ac96e360672 3445 "\n");
charlesmn 0:3ac96e360672 3446 }
charlesmn 0:3ac96e360672 3447 }
charlesmn 0:3ac96e360672 3448
charlesmn 0:3ac96e360672 3449
charlesmn 0:3ac96e360672 3450 #endif
charlesmn 0:3ac96e360672 3451
charlesmn 0:3ac96e360672 3452
charlesmn 0:3ac96e360672 3453