2026-04-08 12:49:16 +08:00
|
|
|
|
#ifndef VL53L1_CALIBRATION_CONFIG_H
|
|
|
|
|
|
#define VL53L1_CALIBRATION_CONFIG_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "vl53l1_def.h"
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
uint8_t calibrated;
|
|
|
|
|
|
VL53L1_CalibrationData_t data;
|
|
|
|
|
|
} Vl53L1RuntimeCalibration_t;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* VL53L1X 按 UM2356 建议应在产线完成 RefSPAD / Offset / Xtalk 校准,
|
|
|
|
|
|
* 上电后在 DataInit() + StaticInit() 之后用 SetCalibrationData() 回灌。
|
|
|
|
|
|
*
|
|
|
|
|
|
* 当前先提供空白占位,未标定时保持 calibrated = 0,驱动将跳过加载。
|
|
|
|
|
|
*/
|
|
|
|
|
|
static const Vl53L1RuntimeCalibration_t k_vl53l1_left_calibration[2] = {
|
2026-04-10 17:04:09 +08:00
|
|
|
|
{
|
2026-04-11 14:18:53 +08:00
|
|
|
|
.calibrated = 0u,
|
2026-04-10 17:04:09 +08:00
|
|
|
|
.data = {
|
|
|
|
|
|
.struct_version = 3970629922u,
|
|
|
|
|
|
.customer = {
|
|
|
|
|
|
.global_config__spad_enables_ref_0 = 223u,
|
|
|
|
|
|
.global_config__spad_enables_ref_1 = 247u,
|
|
|
|
|
|
.global_config__spad_enables_ref_2 = 251u,
|
|
|
|
|
|
.global_config__spad_enables_ref_3 = 254u,
|
|
|
|
|
|
.global_config__spad_enables_ref_4 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_5 = 7u,
|
|
|
|
|
|
.global_config__ref_en_start_select = 0u,
|
|
|
|
|
|
.ref_spad_man__num_requested_ref_spads = 11u,
|
|
|
|
|
|
.ref_spad_man__ref_location = 1u,
|
|
|
|
|
|
.algo__crosstalk_compensation_plane_offset_kcps = 0u,
|
|
|
|
|
|
.algo__crosstalk_compensation_x_plane_gradient_kcps = 0,
|
|
|
|
|
|
.algo__crosstalk_compensation_y_plane_gradient_kcps = 0,
|
|
|
|
|
|
.ref_spad_char__total_rate_target_mcps = 2560u,
|
|
|
|
|
|
.algo__part_to_part_range_offset_mm = 0,
|
|
|
|
|
|
.mm_config__inner_offset_mm = 35,
|
|
|
|
|
|
.mm_config__outer_offset_mm = 9,
|
|
|
|
|
|
},
|
|
|
|
|
|
.add_off_cal_data = {
|
|
|
|
|
|
.result__mm_inner_actual_effective_spads = 280u,
|
|
|
|
|
|
.result__mm_outer_actual_effective_spads = 1344u,
|
|
|
|
|
|
.result__mm_inner_peak_signal_count_rtn_mcps = 397u,
|
|
|
|
|
|
.result__mm_outer_peak_signal_count_rtn_mcps = 1305u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.optical_centre = {
|
|
|
|
|
|
.x_centre = 144u,
|
|
|
|
|
|
.y_centre = 112u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.gain_cal = {
|
|
|
|
|
|
.standard_ranging_gain_factor = 2011u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.cal_peak_rate_map = {
|
|
|
|
|
|
.cal_distance_mm = 0,
|
|
|
|
|
|
.max_samples = 0u,
|
|
|
|
|
|
.width = 0u,
|
|
|
|
|
|
.height = 0u,
|
|
|
|
|
|
.peak_rate_mcps = {
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-04-11 14:18:53 +08:00
|
|
|
|
.calibrated = 0u,
|
2026-04-10 17:04:09 +08:00
|
|
|
|
.data = {
|
|
|
|
|
|
.struct_version = 3970629922u,
|
|
|
|
|
|
.customer = {
|
|
|
|
|
|
.global_config__spad_enables_ref_0 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_1 = 189u,
|
|
|
|
|
|
.global_config__spad_enables_ref_2 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_3 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_4 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_5 = 15u,
|
|
|
|
|
|
.global_config__ref_en_start_select = 0u,
|
|
|
|
|
|
.ref_spad_man__num_requested_ref_spads = 14u,
|
|
|
|
|
|
.ref_spad_man__ref_location = 1u,
|
|
|
|
|
|
.algo__crosstalk_compensation_plane_offset_kcps = 0u,
|
|
|
|
|
|
.algo__crosstalk_compensation_x_plane_gradient_kcps = 0,
|
|
|
|
|
|
.algo__crosstalk_compensation_y_plane_gradient_kcps = 0,
|
|
|
|
|
|
.ref_spad_char__total_rate_target_mcps = 2560u,
|
|
|
|
|
|
.algo__part_to_part_range_offset_mm = 0,
|
|
|
|
|
|
.mm_config__inner_offset_mm = 37,
|
|
|
|
|
|
.mm_config__outer_offset_mm = 9,
|
|
|
|
|
|
},
|
|
|
|
|
|
.add_off_cal_data = {
|
|
|
|
|
|
.result__mm_inner_actual_effective_spads = 280u,
|
|
|
|
|
|
.result__mm_outer_actual_effective_spads = 1288u,
|
|
|
|
|
|
.result__mm_inner_peak_signal_count_rtn_mcps = 470u,
|
|
|
|
|
|
.result__mm_outer_peak_signal_count_rtn_mcps = 1456u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.optical_centre = {
|
|
|
|
|
|
.x_centre = 112u,
|
|
|
|
|
|
.y_centre = 128u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.gain_cal = {
|
|
|
|
|
|
.standard_ranging_gain_factor = 2011u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.cal_peak_rate_map = {
|
|
|
|
|
|
.cal_distance_mm = 0,
|
|
|
|
|
|
.max_samples = 0u,
|
|
|
|
|
|
.width = 0u,
|
|
|
|
|
|
.height = 0u,
|
|
|
|
|
|
.peak_rate_mcps = {
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-04-08 12:49:16 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const Vl53L1RuntimeCalibration_t k_vl53l1_right_calibration[2] = {
|
2026-04-10 17:04:09 +08:00
|
|
|
|
{
|
2026-04-11 14:18:53 +08:00
|
|
|
|
.calibrated = 0u,
|
2026-04-10 17:04:09 +08:00
|
|
|
|
.data = {
|
|
|
|
|
|
.struct_version = 3970629922u,
|
|
|
|
|
|
.customer = {
|
|
|
|
|
|
.global_config__spad_enables_ref_0 = 159u,
|
|
|
|
|
|
.global_config__spad_enables_ref_1 = 254u,
|
|
|
|
|
|
.global_config__spad_enables_ref_2 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_3 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_4 = 239u,
|
|
|
|
|
|
.global_config__spad_enables_ref_5 = 15u,
|
|
|
|
|
|
.global_config__ref_en_start_select = 0u,
|
|
|
|
|
|
.ref_spad_man__num_requested_ref_spads = 6u,
|
|
|
|
|
|
.ref_spad_man__ref_location = 1u,
|
|
|
|
|
|
.algo__crosstalk_compensation_plane_offset_kcps = 0u,
|
|
|
|
|
|
.algo__crosstalk_compensation_x_plane_gradient_kcps = 0,
|
|
|
|
|
|
.algo__crosstalk_compensation_y_plane_gradient_kcps = 0,
|
|
|
|
|
|
.ref_spad_char__total_rate_target_mcps = 2560u,
|
|
|
|
|
|
.algo__part_to_part_range_offset_mm = 0,
|
|
|
|
|
|
.mm_config__inner_offset_mm = 54,
|
|
|
|
|
|
.mm_config__outer_offset_mm = 31,
|
|
|
|
|
|
},
|
|
|
|
|
|
.add_off_cal_data = {
|
|
|
|
|
|
.result__mm_inner_actual_effective_spads = 224u,
|
|
|
|
|
|
.result__mm_outer_actual_effective_spads = 1456u,
|
|
|
|
|
|
.result__mm_inner_peak_signal_count_rtn_mcps = 336u,
|
|
|
|
|
|
.result__mm_outer_peak_signal_count_rtn_mcps = 1382u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.optical_centre = {
|
|
|
|
|
|
.x_centre = 112u,
|
|
|
|
|
|
.y_centre = 112u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.gain_cal = {
|
|
|
|
|
|
.standard_ranging_gain_factor = 2011u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.cal_peak_rate_map = {
|
|
|
|
|
|
.cal_distance_mm = 0,
|
|
|
|
|
|
.max_samples = 0u,
|
|
|
|
|
|
.width = 0u,
|
|
|
|
|
|
.height = 0u,
|
|
|
|
|
|
.peak_rate_mcps = {
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-04-11 14:18:53 +08:00
|
|
|
|
.calibrated = 0u,
|
2026-04-10 17:04:09 +08:00
|
|
|
|
.data = {
|
|
|
|
|
|
.struct_version = 3970629922u,
|
|
|
|
|
|
.customer = {
|
|
|
|
|
|
.global_config__spad_enables_ref_0 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_1 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_2 = 255u,
|
|
|
|
|
|
.global_config__spad_enables_ref_3 = 191u,
|
|
|
|
|
|
.global_config__spad_enables_ref_4 = 191u,
|
|
|
|
|
|
.global_config__spad_enables_ref_5 = 11u,
|
|
|
|
|
|
.global_config__ref_en_start_select = 0u,
|
|
|
|
|
|
.ref_spad_man__num_requested_ref_spads = 11u,
|
|
|
|
|
|
.ref_spad_man__ref_location = 2u,
|
|
|
|
|
|
.algo__crosstalk_compensation_plane_offset_kcps = 0u,
|
|
|
|
|
|
.algo__crosstalk_compensation_x_plane_gradient_kcps = 0,
|
|
|
|
|
|
.algo__crosstalk_compensation_y_plane_gradient_kcps = 0,
|
|
|
|
|
|
.ref_spad_char__total_rate_target_mcps = 2560u,
|
|
|
|
|
|
.algo__part_to_part_range_offset_mm = 0,
|
|
|
|
|
|
.mm_config__inner_offset_mm = 30,
|
|
|
|
|
|
.mm_config__outer_offset_mm = 5,
|
|
|
|
|
|
},
|
|
|
|
|
|
.add_off_cal_data = {
|
|
|
|
|
|
.result__mm_inner_actual_effective_spads = 224u,
|
|
|
|
|
|
.result__mm_outer_actual_effective_spads = 1456u,
|
|
|
|
|
|
.result__mm_inner_peak_signal_count_rtn_mcps = 334u,
|
|
|
|
|
|
.result__mm_outer_peak_signal_count_rtn_mcps = 1524u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.optical_centre = {
|
|
|
|
|
|
.x_centre = 112u,
|
|
|
|
|
|
.y_centre = 96u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.gain_cal = {
|
|
|
|
|
|
.standard_ranging_gain_factor = 2011u,
|
|
|
|
|
|
},
|
|
|
|
|
|
.cal_peak_rate_map = {
|
|
|
|
|
|
.cal_distance_mm = 0,
|
|
|
|
|
|
.max_samples = 0u,
|
|
|
|
|
|
.width = 0u,
|
|
|
|
|
|
.height = 0u,
|
|
|
|
|
|
.peak_rate_mcps = {
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
|
|
|
|
|
|
0u
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-04-08 12:49:16 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* VL53L1_CALIBRATION_CONFIG_H */
|