2025-02-06 07:35:32 +00:00
|
|
|
|
#ifndef __CALCULATE_H
|
|
|
|
|
#define __CALCULATE_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (AFE_ID == 0x34)
|
|
|
|
|
#define REF_RES_VAL (680 + 5*ucMTPBuffer[25]) //resistance = (680 + 5*TR[6~0])*10, The unit is 10 ohms
|
|
|
|
|
#else
|
|
|
|
|
#define REF_RES_VAL 1000 //оƬ<D0BE>ڲ<EFBFBD><DAB2>IJο<C4B2><CEBF><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>Ϊ10K=1000*10, <20><>λ<EFBFBD><CEBB>10 ohms
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-02-08 07:27:19 +00:00
|
|
|
|
#define NTC_103AT_3435 0
|
2025-02-06 07:35:32 +00:00
|
|
|
|
#define NTC_103AT_3950 0
|
2025-02-08 07:27:19 +00:00
|
|
|
|
#define NTC_SL 1
|
2025-02-06 07:35:32 +00:00
|
|
|
|
|
2025-02-08 07:27:19 +00:00
|
|
|
|
#define RT_TABLE NTC_SL
|
2025-02-06 07:35:32 +00:00
|
|
|
|
|
|
|
|
|
#if RT_TABLE == NTC_103AT_3435
|
|
|
|
|
#define NTC103AT_ARRAY_LEN 161
|
|
|
|
|
#define TEMP_UPPER_LIMIT 110 // 110<31><30>
|
|
|
|
|
#define TEMP_LOWER_LIMIT -50 // -50<35><30>
|
2025-02-08 07:27:19 +00:00
|
|
|
|
|
2025-02-06 07:35:32 +00:00
|
|
|
|
#elif RT_TABLE == NTC_103AT_3950
|
|
|
|
|
#define NTC103AT_ARRAY_LEN 161
|
|
|
|
|
#define TEMP_UPPER_LIMIT 110 // 110<31><30>
|
|
|
|
|
#define TEMP_LOWER_LIMIT -50 // -50<35><30>
|
2025-02-08 07:27:19 +00:00
|
|
|
|
|
|
|
|
|
#elif RT_TABLE == NTC_SL
|
|
|
|
|
#define NTC103AT_ARRAY_LEN 121
|
|
|
|
|
#define TEMP_UPPER_LIMIT 100 // 100<30><30>
|
|
|
|
|
#define TEMP_LOWER_LIMIT -20 // -20<32><30>
|
|
|
|
|
|
2025-02-06 07:35:32 +00:00
|
|
|
|
#else
|
|
|
|
|
#error "underfined RT_TABLE!"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
extern U16 code NTC103AT[NTC103AT_ARRAY_LEN];
|
|
|
|
|
extern U8 xdata ucChgingCheckCnt;
|
|
|
|
|
extern U8 xdata ucDsgingCheckCnt;
|
|
|
|
|
|
|
|
|
|
extern void AfeCalcuVol(void);
|
|
|
|
|
extern void AfeCalcuTempe(void);
|
|
|
|
|
extern void AFEInfoProcess(void);
|
|
|
|
|
extern U16 CalcuTemp(U16 getdata);
|
|
|
|
|
|
|
|
|
|
#endif
|