|
@@ -326,29 +326,16 @@ void adc_voSampleDown(const ADC_COF *cof, ADC_DOWN_OUT *out)
|
|
|
out->uwIpeakPu = uwIpeakPu;
|
|
|
}
|
|
|
|
|
|
-void adc_voSampleUp(const ADC_COF *cof, ADC_UP_OUT *out)
|
|
|
+void adc_voSampleUp_High(const ADC_COF *cof, ADC_UP_OUT *out)
|
|
|
{
|
|
|
/* Register value */
|
|
|
out->uwVdcReg = iAdc_GetResultPointer(0)[HW_ADC_UDC_CH];
|
|
|
- out->uwRU6VReg = iAdc_GetResultPointer(0)[HW_ADC_U6V_CH];
|
|
|
- out->uwU5VReg = iAdc_GetResultPointer(0)[HW_ADC_U5V_CH];
|
|
|
- out->PCBTempReg = iAdc_GetResultPointer(0)[HW_ADC_PCBTEMP_CH];
|
|
|
- out->uwFU6VReg = iAdc_GetResultPointer(0)[HW_ADC_MOTTEMP_CH];
|
|
|
- out->uwU12VReg = iAdc_GetResultPointer(0)[HW_ADC_U12V_CH];
|
|
|
- out->uwThrottleReg = iAdc_GetResultPointer(0)[HW_ADC_THRO_CH];
|
|
|
|
|
|
out->uwVdcPu = (UWORD)((ULONG)out->uwVdcReg * cof->uwVdcReg2Pu >> 10); // Q14=Q24-Q10
|
|
|
//out->uwVdcPu = (SLONG)((out->uwVdcReg * cof->uwVdcReg2Pu >> 10) - 410); // Q14=Q24-Q10,电路上DCDC的EN漏电流导致测量偏高1.2V
|
|
|
/* Vdc LPF */
|
|
|
out->uwVdcLpfPu = ((out->uwVdcPu - out->uwVdcLpfPu) >> 1) + out->uwVdcLpfPu;
|
|
|
|
|
|
- out->uwRU6VPu = (UWORD)((ULONG)out->uwRU6VReg * cof->uwU6VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
- out->uwU5VPu = (UWORD)((ULONG)out->uwU5VReg * cof->uwU5VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
- out->PCBTemp = GetPCBTemp(out->PCBTempReg);
|
|
|
- out->uwFU6VPu = (UWORD)((ULONG)out->uwFU6VReg * cof->uwU6VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
- out->uwU12VPu = (UWORD)((ULONG)out->uwU12VReg * cof->uwU12VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
-
|
|
|
-
|
|
|
////////////////// Single Resitance Current Sample//////////////////////////////////////////////////////
|
|
|
if (pwm_stGenOut.blSampleCalibFlag == TRUE)
|
|
|
{
|
|
@@ -383,6 +370,26 @@ void adc_voSampleUp(const ADC_COF *cof, ADC_UP_OUT *out)
|
|
|
|
|
|
}
|
|
|
|
|
|
+void adc_voSampleUp_Low(const ADC_COF *cof, ADC_UP_OUT *out)
|
|
|
+{
|
|
|
+ out->uwRU6VReg = iAdc_GetResultPointer(0)[HW_ADC_U6V_CH];
|
|
|
+ out->uwRU6VPu = (UWORD)((ULONG)out->uwRU6VReg * cof->uwU6VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
+
|
|
|
+ out->uwU5VReg = iAdc_GetResultPointer(0)[HW_ADC_U5V_CH];
|
|
|
+ out->uwU5VPu = (UWORD)((ULONG)out->uwU5VReg * cof->uwU5VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
+
|
|
|
+ out->PCBTempReg = iAdc_GetResultPointer(0)[HW_ADC_PCBTEMP_CH];
|
|
|
+ out->PCBTemp = GetPCBTemp(out->PCBTempReg);
|
|
|
+
|
|
|
+ out->uwFU6VReg = iAdc_GetResultPointer(0)[HW_ADC_MOTTEMP_CH];
|
|
|
+ out->uwFU6VPu = (UWORD)((ULONG)out->uwFU6VReg * cof->uwU6VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
+
|
|
|
+ out->uwU12VReg = iAdc_GetResultPointer(0)[HW_ADC_U12V_CH];
|
|
|
+ out->uwU12VPu = (UWORD)((ULONG)out->uwU12VReg * cof->uwU12VReg2Pu >> 10); // Q14=Q24-Q10;
|
|
|
+
|
|
|
+ out->uwThrottleReg = iAdc_GetResultPointer(0)[HW_ADC_THRO_CH];
|
|
|
+}
|
|
|
+
|
|
|
static SWORD adc_pvt_swSingleReg = 0;
|
|
|
static SLONG adc_pvt_slRdsonReg = 0;
|
|
|
static LPF_OUT adc_pvt_stRdsonCoefLpf = {.slY.sw.hi = 1024, .slY.sw.low = 0};
|