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