第一:VL53L0X_StaticInit(dev);函数中的
/* After static init, some device parameters may be changed, so update them */
VL53L0X_GetDeviceParameters(Dev, &CurrentParameters);//得到设备参数~
上个函数中的
/* Need to be done at the end as it uses VCSELPulsePeriod */
if (Status == VL53L0X_ERROR_NONE)
{
Status = VL53L0X_GetMeasurementTimingBudgetMicroSeconds(Dev,
&(pDeviceParameters->MeasurementTimingBudgetMicroSeconds));
}
执行完这条状态Status就为0xEC了,奇怪的是,我初始化VL53L0X_DataInit的时候也用到了这个函数VL53L0X_GetDeviceParameters();却没有报错这是为什么呢?
在这里我先把这条语句注释了。继续走到下面的问题二。
第二:VL53L0X_PerformRefSpadManagement(dev,&refSpadCount,&isApertureSpads);//执行参考Spad管理
VL53L0X_perform_ref_calibration(Dev, &VhvSettings,&PhaseCal, 0)//下面是伪代码 示意包含的关系
{//...
VL53L0X_perform_vhv_calibration(Dev, pVhvSettings, get_data_enable, 0)
{//...
VL53L0X_perform_single_ref_calibration(Dev, 0x40);
{//...
if (Status == VL53L0X_ERROR_NONE)
Status = VL53L0X_WrByte(Dev, VL53L0X_REG_SYSRANGE_START, //这里不明白或上0x40的具体含义 感觉是这里影响了下面的操作 但不知道什么原因
VL53L0X_REG_SYSRANGE_MODE_START_STOP |
vhv_init_byte);