Functions
vl53l1_api_calibration.h File Reference
#include "vl53l1_platform.h"
Include dependency graph for vl53l1_api_calibration.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...
 

Function Documentation

◆ VL53L1_run_device_test()

VL53L1_Error VL53L1_run_device_test ( VL53L1_DEV  Dev,
VL53L1_DeviceTestMode  device_test_mode 
)

Runs the input Device Test.

Calls

Parameters
[in]Dev: Device handle
[in]device_test_mode: Device test mode register value
Returns
VL53L1_ERROR_NONE Success
"Other error code" See VL53L1_Error

Definition at line 779 of file vl53l1_api_calibration.c.

◆ VL53L1_run_offset_calibration()

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:

  • offset_calibration_mode = VL53L1_OFFSETCALIBRATIONMODE__STANDARD_RANGING
  • dss_config__target_total_rate_mcps = 0x0A00 (20.0Mcps) to 0x1400 (40.0Mcps)
  • phasecal_config_timeout_us = 1000
  • range_config_timeout_us = 13000
  • pre_num_of_samples = 32
  • mm1_num_of_samples = 100
  • mm2_range_num_of_samples = 64
  • target_distance_mm = 140 mm
  • target reflectance = 5%

    Note: function parms simplified as part of Patch_CalFunctionSimplification_11791

Parameters
[in]Dev: Device handle
[in]cal_distance_mm: Distance to target in [mm] - the ground truth
[out]pcal_status: Pointer to unfiltered calibration status
Returns
VL53L1_ERROR_NONE Success
VL53L1_WARNING_OFFSET_CAL_INSUFFICIENT_MM1_SPADS Effective MM1 SPAD count too low (<5.0). Out with recommended calibration condition. Accuracy of offset calibration may be degraded.
VL53L1_WARNING_OFFSET_CAL_PRE_RANGE_RATE_TOO_HIGH Pre range too high (>40.0) in pile up region. Out with recommended calibration condition. Accuracy of offset calibration may be degraded.

Definition at line 290 of file vl53l1_api_calibration.c.

◆ VL53L1_run_ref_spad_char()

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.

  • num_ref_spads
  • ref_location
  • DCR SPAD enables for selected reference location

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

Parameters
[in]Dev: Device Handle
[out]pcal_status: Pointer to unfiltered calibration status
Returns
VL53L1_ERROR_NONE Success
VL53L1_WARNING_REF_SPAD_CHAR_NOT_ENOUGH_SPADS Less than 5 Good SPAD available, output not valid
VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_HIGH At end of search reference rate > 40.0 Mcps Offset stability may be degraded.
VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_LOW At end of search reference rate < 10.0 Mcps Offset stability may be degraded.

Definition at line 104 of file vl53l1_api_calibration.c.

◆ VL53L1_run_spad_rate_map()

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

Parameters
[in]Dev: Device handle
[in]device_test_mode: Device test mode register value. Valid options:
  • VL53L1_DEVICETESTMODE_LCR_VCSEL_OFF
  • VL53L1_DEVICETESTMODE_LCR_VCSEL_ON
[in]array_select: Device SPAD array select Valid options:
  • VL53L1_DEVICESSCARRAY_RTN
  • VL53L1_DEVICESSCARRAY_REF
[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
Returns
VL53L1_ERROR_NONE Success
"Other error code" See VL53L1_Error

Runs SPAD Rate Map

Definition at line 687 of file vl53l1_api_calibration.c.



vl53l1x
Author(s):
autogenerated on Fri Aug 2 2024 08:35:54