#include "vl53l1_ll_def.h"
#include "vl53l1_ll_device.h"
#include "vl53l1_platform.h"
#include "vl53l1_register_map.h"
#include "vl53l1_register_funcs.h"
#include "vl53l1_register_settings.h"
#include "vl53l1_core.h"
#include "vl53l1_wait.h"
#include "vl53l1_api_preset_modes.h"
#include "vl53l1_silicon_core.h"
#include "vl53l1_api_core.h"
#include "vl53l1_api_calibration.h"
Go to the source code of this file.
Macros | |
#define | LOG_FUNCTION_END(status, ...) _LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__) |
#define | LOG_FUNCTION_END_FMT(status, fmt, ...) |
#define | LOG_FUNCTION_START(fmt, ...) _LOG_FUNCTION_START(VL53L1_TRACE_MODULE_CORE, fmt, ##__VA_ARGS__) |
#define | trace_print(level, ...) |
Functions | |
VL53L1_Error | VL53L1_run_device_test (VL53L1_DEV Dev, VL53L1_DeviceTestMode device_test_mode) |
Runs the input Device Test. More... | |
VL53L1_Error | VL53L1_run_offset_calibration (VL53L1_DEV Dev, int16_t cal_distance_mm, VL53L1_Error *pcal_status) |
Run offset calibration. More... | |
VL53L1_Error | VL53L1_run_ref_spad_char (VL53L1_DEV Dev, VL53L1_Error *pcal_status) |
Run Reference Array SPAD Characterisation. More... | |
VL53L1_Error | VL53L1_run_spad_rate_map (VL53L1_DEV Dev, VL53L1_DeviceTestMode device_test_mode, VL53L1_DeviceSscArray array_select, uint32_t ssc_config_timeout_us, VL53L1_spad_rate_data_t *pspad_rate_data) |
Runs SPAD rate map. More... | |
#define LOG_FUNCTION_END | ( | status, | |
... | |||
) | _LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__) |
Definition at line 92 of file vl53l1_api_calibration.c.
#define LOG_FUNCTION_END_FMT | ( | status, | |
fmt, | |||
... | |||
) |
Definition at line 94 of file vl53l1_api_calibration.c.
#define LOG_FUNCTION_START | ( | fmt, | |
... | |||
) | _LOG_FUNCTION_START(VL53L1_TRACE_MODULE_CORE, fmt, ##__VA_ARGS__) |
Definition at line 90 of file vl53l1_api_calibration.c.
#define trace_print | ( | level, | |
... | |||
) |
Definition at line 98 of file vl53l1_api_calibration.c.
VL53L1_Error VL53L1_run_device_test | ( | VL53L1_DEV | Dev, |
VL53L1_DeviceTestMode | device_test_mode | ||
) |
Runs the input Device Test.
Calls
[in] | Dev | : Device handle |
[in] | device_test_mode | : Device test mode register value |
Definition at line 779 of file vl53l1_api_calibration.c.
VL53L1_Error VL53L1_run_offset_calibration | ( | VL53L1_DEV | Dev, |
int16_t | cal_distance_mm, | ||
VL53L1_Error * | pcal_status | ||
) |
Run offset calibration.
Runs the standard ranging MM1 and MM2 calibration presets to generate the MM1 and MM2 range offset data
The range config timeout is used for both MM1 and MM2 so that the sigma delta settling is the same as for the 'real' range
Places results into VL53L1_customer_nvm_managed_t within pdev
Use VL53L1_get_part_to_part_data() to get the offset calibration results
Current FMT settings:
target reflectance = 5%
Note: function parms simplified as part of Patch_CalFunctionSimplification_11791
[in] | Dev | : Device handle |
[in] | cal_distance_mm | : Distance to target in [mm] - the ground truth |
[out] | pcal_status | : Pointer to unfiltered calibration status |
Definition at line 290 of file vl53l1_api_calibration.c.
VL53L1_Error VL53L1_run_ref_spad_char | ( | VL53L1_DEV | Dev, |
VL53L1_Error * | pcal_status | ||
) |
Run Reference Array SPAD Characterisation.
This function finds the required number of reference SPAD to meet the input required peak reference rate.
The algorithm first tries the non apertured reference SPAD's, if the rate is too high for the minimum allowed SPAD count (5) then the algo switches to 5x apertured SPAD's and if the rate is still to high then the 10x apertured SPAD are selected.
The function reads the following results from the device and both caches the values in the pdev->customer structure and writes the data into the G02 customer register group.
Note power force is enabled as the function needs to read data from the Patch RAM.
Should only be called once per part with coverglass attached to generate the required num of SPAD, Ref location and DCR SPAD enable data
[in] | Dev | : Device Handle |
[out] | pcal_status | : Pointer to unfiltered calibration status |
Definition at line 104 of file vl53l1_api_calibration.c.
VL53L1_Error VL53L1_run_spad_rate_map | ( | VL53L1_DEV | Dev, |
VL53L1_DeviceTestMode | device_test_mode, | ||
VL53L1_DeviceSscArray | array_select, | ||
uint32_t | ssc_config_timeout_us, | ||
VL53L1_spad_rate_data_t * | pspad_rate_data | ||
) |
Runs SPAD rate map.
Output structure contains SPAD rate data in SPAD number order
[in] | Dev | : Device handle |
[in] | device_test_mode | : Device test mode register value. Valid options:
|
[in] | array_select | : Device SPAD array select Valid options:
|
[in] | ssc_config_timeout_us | : SSC timeout in [us] e.g 36000us |
[out] | pspad_rate_data | : pointer to output rates structure 1.15 format for LCR_VCSEL_OFF 9.7 format for LCR_VCSEL_ON |
Runs SPAD Rate Map
Definition at line 687 of file vl53l1_api_calibration.c.