Hello, I'm learning the UCD3138 full-bridge hard switch development board firmware
I do not quite understand the void configure_fault_levels(void) function
Void configure_fault_levels(void)
{
//This struct represents the floating point number: 8.33333
// struct qnote vin_scale = {17067 , -11};
Struct qnote vin_scale = {574 , 0}; //574*2e0=574
Struct qnote vin_eadc_scale = {10069 , -10};
//This struct represents the floating point number: 10.24=20972/2e11=20972/2048=10.24
Struct qnote constant_10_24 = {20972 , -11};
Pmbus_dcdc_config_translated[0].vout_uv_fault_limit = qnote_linear16_multiply_fit(constant_145_211, pmbus_dcdc_config[0].vout_uv_fault_limit, -VOUT_MODE_EXP, MAX_VALUE_FIT_12_BITS);
Pmbus_dcdc_config_translated[0].temp_ot_fault_limit = qnote_linear11_multiply_fit(constant_10_24, pmbus_dcdc_config[0].temp_ot_fault_limit, MAX_VALUE_FIT_12_BITS) + 694;
Pmbus_dcdc_config_translated[0].vin_ov_fault_limit = qnote_linear11_multiply_fit(vin_eadc_scale, pmbus_dcdc_config[0].vin_ov_fault_limit, MAX_VALUE_FIT_12_BITS);
Pmbus_dcdc_config_translated[0].vin_uv_fault_limit = qnote_linear11_multiply_fit(vin_scale, pmbus_dcdc_config[0].vin_uv_fault_limit, MAX_VALUE_FIT_12_BITS);
}
I understand that qnote_linear16_multiply_fit() converts the linear16 data format number to floating-point data, multiplies the scaling factor constant_145_211, and clamps MAX_VALUE_FIT_12_BITS.
Do not know my understanding right? How is the scaling factor constant_145_211 obtained?
I understand that qnote_linear11_multiply_fit() converts the linear11 data format number to floating-point data, multiplies the scaling factor constant_10_24, and clamps MAX_VALUE_FIT_12_BITS.
Do not know my understanding right? How is the scaling factor constant_10_24 obtained? And why should we add 694. What does this 694 do?