Initial release. Mbed library for VL53L1CB

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers vl53l1_hist_structs.h Source File

vl53l1_hist_structs.h

00001 
00002 /*******************************************************************************
00003  * Copyright (c) 2020, STMicroelectronics - All Rights Reserved
00004 
00005  This file is part of VL53L1 Core and is dual licensed,
00006  either 'STMicroelectronics
00007  Proprietary license'
00008  or 'BSD 3-clause "New" or "Revised" License' , at your option.
00009 
00010 ********************************************************************************
00011 
00012  'STMicroelectronics Proprietary license'
00013 
00014 ********************************************************************************
00015 
00016  License terms: STMicroelectronics Proprietary in accordance with licensing
00017  terms at www.st.com/sla0081
00018 
00019  STMicroelectronics confidential
00020  Reproduction and Communication of this document is strictly prohibited unless
00021  specifically authorized in writing by STMicroelectronics.
00022 
00023 
00024 ********************************************************************************
00025 
00026  Alternatively, VL53L1 Core may be distributed under the terms of
00027  'BSD 3-clause "New" or "Revised" License', in which case the following
00028  provisions apply instead of the ones
00029  mentioned above :
00030 
00031 ********************************************************************************
00032 
00033  License terms: BSD 3-clause "New" or "Revised" License.
00034 
00035  Redistribution and use in source and binary forms, with or without
00036  modification, are permitted provided that the following conditions are met:
00037 
00038  1. Redistributions of source code must retain the above copyright notice, this
00039  list of conditions and the following disclaimer.
00040 
00041  2. Redistributions in binary form must reproduce the above copyright notice,
00042  this list of conditions and the following disclaimer in the documentation
00043  and/or other materials provided with the distribution.
00044 
00045  3. Neither the name of the copyright holder nor the names of its contributors
00046  may be used to endorse or promote products derived from this software
00047  without specific prior written permission.
00048 
00049  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00050  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00051  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00052  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00053  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00054  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00055  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00056  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00057  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00058  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00059 
00060 
00061 ********************************************************************************
00062 
00063 */
00064 
00065 
00066 
00067 
00068 
00069 #ifndef _VL53L1_HIST_STRUCTS_H_
00070 #define _VL53L1_HIST_STRUCTS_H_
00071 
00072 #include "vl53l1_ll_device.h"
00073 #include "vl53l1_dmax_structs.h"
00074 
00075 #ifdef __cplusplus
00076 extern "C"
00077 {
00078 #endif
00079 
00080 #define  VL53L1_MAX_BIN_SEQUENCE_LENGTH  6
00081 #define  VL53L1_MAX_BIN_SEQUENCE_CODE   15
00082 #define  VL53L1_HISTOGRAM_BUFFER_SIZE   24
00083 #define  VL53L1_XTALK_HISTO_BINS        12
00084 
00085 
00086 
00087 typedef struct {
00088 
00089     uint8_t                          histogram_config__spad_array_selection;
00090 
00091     uint8_t                          histogram_config__low_amb_even_bin_0_1;
00092     uint8_t                          histogram_config__low_amb_even_bin_2_3;
00093     uint8_t                          histogram_config__low_amb_even_bin_4_5;
00094 
00095     uint8_t                          histogram_config__low_amb_odd_bin_0_1;
00096     uint8_t                          histogram_config__low_amb_odd_bin_2_3;
00097     uint8_t                          histogram_config__low_amb_odd_bin_4_5;
00098 
00099     uint8_t                          histogram_config__mid_amb_even_bin_0_1;
00100     uint8_t                          histogram_config__mid_amb_even_bin_2_3;
00101     uint8_t                          histogram_config__mid_amb_even_bin_4_5;
00102 
00103     uint8_t                          histogram_config__mid_amb_odd_bin_0_1;
00104     uint8_t                          histogram_config__mid_amb_odd_bin_2;
00105     uint8_t                          histogram_config__mid_amb_odd_bin_3_4;
00106     uint8_t                          histogram_config__mid_amb_odd_bin_5;
00107 
00108     uint8_t                          histogram_config__user_bin_offset;
00109 
00110     uint8_t                     histogram_config__high_amb_even_bin_0_1;
00111     uint8_t                     histogram_config__high_amb_even_bin_2_3;
00112     uint8_t                     histogram_config__high_amb_even_bin_4_5;
00113 
00114     uint8_t                  histogram_config__high_amb_odd_bin_0_1;
00115     uint8_t                  histogram_config__high_amb_odd_bin_2_3;
00116     uint8_t                  histogram_config__high_amb_odd_bin_4_5;
00117 
00118     uint16_t                         histogram_config__amb_thresh_low;
00119 
00120     uint16_t                         histogram_config__amb_thresh_high;
00121 
00122 
00123 } VL53L1_histogram_config_t;
00124 
00125 
00126 
00127 
00128 typedef struct {
00129 
00130     VL53L1_HistAlgoSelect  hist_algo_select;
00131 
00132 
00133     VL53L1_HistTargetOrder hist_target_order;
00134 
00135 
00136     uint8_t   filter_woi0;
00137 
00138     uint8_t   filter_woi1;
00139 
00140 
00141     VL53L1_HistAmbEstMethod hist_amb_est_method;
00142 
00143     uint8_t   ambient_thresh_sigma0;
00144 
00145     uint8_t   ambient_thresh_sigma1;
00146 
00147 
00148 
00149     uint16_t  ambient_thresh_events_scaler;
00150 
00151 
00152 
00153     int32_t   min_ambient_thresh_events;
00154 
00155     uint16_t  noise_threshold;
00156 
00157 
00158     int32_t   signal_total_events_limit;
00159 
00160     uint8_t   sigma_estimator__sigma_ref_mm;
00161 
00162     uint16_t  sigma_thresh;
00163 
00164     int16_t   range_offset_mm;
00165 
00166     uint16_t  gain_factor;
00167 
00168 
00169     uint8_t   valid_phase_low;
00170 
00171     uint8_t   valid_phase_high;
00172 
00173     uint8_t   algo__consistency_check__phase_tolerance;
00174 
00175     uint8_t   algo__consistency_check__event_sigma;
00176 
00177 
00178 
00179     uint16_t  algo__consistency_check__event_min_spad_count;
00180 
00181 
00182 
00183     uint16_t  algo__consistency_check__min_max_tolerance;
00184 
00185 
00186     uint8_t   algo__crosstalk_compensation_enable;
00187 
00188     uint32_t  algo__crosstalk_compensation_plane_offset_kcps;
00189 
00190     int16_t   algo__crosstalk_compensation_x_plane_gradient_kcps;
00191 
00192     int16_t   algo__crosstalk_compensation_y_plane_gradient_kcps;
00193 
00194 
00195     int16_t   algo__crosstalk_detect_min_valid_range_mm;
00196 
00197     int16_t   algo__crosstalk_detect_max_valid_range_mm;
00198 
00199     uint16_t  algo__crosstalk_detect_max_valid_rate_kcps;
00200 
00201     uint16_t  algo__crosstalk_detect_max_sigma_mm;
00202 
00203 
00204 
00205     uint8_t   algo__crosstalk_detect_event_sigma;
00206 
00207 
00208 
00209     uint16_t  algo__crosstalk_detect_min_max_tolerance;
00210 
00211 
00212 } VL53L1_hist_post_process_config_t;
00213 
00214 
00215 
00216 typedef struct {
00217 
00218 
00219     VL53L1_DeviceState     cfg_device_state;
00220 
00221     VL53L1_DeviceState     rd_device_state;
00222 
00223 
00224     uint8_t  zone_id;
00225 
00226     uint32_t time_stamp;
00227 
00228 
00229     uint8_t  VL53L1_p_022;
00230 
00231     uint8_t  VL53L1_p_023;
00232 
00233     uint8_t  VL53L1_p_024;
00234 
00235     uint8_t  number_of_ambient_bins;
00236 
00237     uint8_t  bin_seq[VL53L1_MAX_BIN_SEQUENCE_LENGTH];
00238 
00239     uint8_t  bin_rep[VL53L1_MAX_BIN_SEQUENCE_LENGTH];
00240 
00241     int32_t  bin_data[VL53L1_HISTOGRAM_BUFFER_SIZE];
00242 
00243 
00244     uint8_t  result__interrupt_status;
00245 
00246     uint8_t  result__range_status;
00247 
00248     uint8_t  result__report_status;
00249 
00250     uint8_t  result__stream_count;
00251 
00252     uint16_t result__dss_actual_effective_spads;
00253 
00254 
00255     uint16_t phasecal_result__reference_phase;
00256 
00257     uint8_t  phasecal_result__vcsel_start;
00258 
00259     uint8_t  cal_config__vcsel_start;
00260 
00261     uint16_t vcsel_width;
00262 
00263     uint8_t  VL53L1_p_009;
00264 
00265     uint16_t VL53L1_p_019;
00266 
00267     uint32_t  total_periods_elapsed;
00268 
00269 
00270     uint32_t peak_duration_us;
00271 
00272     uint32_t woi_duration_us;
00273 
00274 
00275     int32_t  min_bin_value;
00276 
00277     int32_t  max_bin_value;
00278 
00279 
00280     uint16_t zero_distance_phase;
00281 
00282     uint8_t  number_of_ambient_samples;
00283 
00284     int32_t  ambient_events_sum;
00285 
00286     int32_t  VL53L1_p_004;
00287 
00288 
00289     uint8_t  roi_config__user_roi_centre_spad;
00290 
00291     uint8_t  roi_config__user_roi_requested_global_xy_size;
00292 
00293 
00294 } VL53L1_histogram_bin_data_t;
00295 
00296 
00297 
00298 
00299 typedef struct {
00300 
00301 
00302     uint8_t  zone_id;
00303 
00304     uint32_t time_stamp;
00305 
00306 
00307     uint8_t  VL53L1_p_022;
00308 
00309     uint8_t  VL53L1_p_023;
00310 
00311     uint8_t  VL53L1_p_024;
00312 
00313     uint32_t bin_data[VL53L1_XTALK_HISTO_BINS];
00314 
00315 
00316 
00317     uint16_t phasecal_result__reference_phase;
00318 
00319     uint8_t  phasecal_result__vcsel_start;
00320 
00321     uint8_t  cal_config__vcsel_start;
00322 
00323     uint16_t vcsel_width;
00324 
00325     uint16_t VL53L1_p_019;
00326 
00327     uint16_t zero_distance_phase;
00328 
00329 
00330 } VL53L1_xtalk_histogram_shape_t;
00331 
00332 
00333 
00334 
00335 typedef struct {
00336 
00337 
00338     VL53L1_xtalk_histogram_shape_t  xtalk_shape;
00339 
00340     VL53L1_histogram_bin_data_t     xtalk_hist_removed;
00341 
00342 } VL53L1_xtalk_histogram_data_t;
00343 
00344 
00345 
00346 
00347 #ifdef __cplusplus
00348 }
00349 #endif
00350 
00351 #endif
00352 
00353