123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #include "typedefine.h"
- #ifndef __MOSRESCALIB_H
- #define __MOSRESCALIB_H
- #define BIT0 0x0001 /*!< number 0 */
- #define BIT1 0x0002 /*!< number 1 */
- #define BIT2 0x0004 /*!< number 2 */
- #define BIT3 0x0008 /*!< number 3 */
- #define BIT4 0x0010 /*!< number 4 */
- #define BIT5 0x0020 /*!< number 5 */
- #define BIT6 0x0040 /*!< number 6 */
- #define BIT7 0x0080 /*!< number 7 */
- #define BIT8 0x0100 /*!< number 8 */
- #define BIT9 0x0200 /*!< number 9 */
- #define BIT10 0x0400 /*!< number 10 */
- #define BIT11 0x0800 /*!< number 11 */
- #define BIT12 0x1000 /*!< number 12 */
- #define BIT13 0x2000 /*!< number 13 */
- #define BIT14 0x4000 /*!< number 14 */
- #define BIT15 0x8000 /*!< number 15 */
- #define MAXCURCOF 52958
- #define delay_time 64 //开管牙齿时间 ,单位128us
- #define LIBCURMIN (7<<14)/60 //7A
- #define LIBCURMAX (20<<14)/60 //20A
- typedef enum
- {
- FSMCALINULL=0,
- FSMCALIA = 1,
- FSMCALIB = 2,
- FSMCALIC = 3
- } CALIB_Struct;
- typedef struct
- {
- //UWORD uwMOS_Ra;
- //UWORD uwMOS_Rb;
- //UWORD uwMOS_Rc;
- //SWORD swPCBTEMP;
- //BOOL Samp_A_COMIT;
- //BOOL Samp_B_COMIT;
- //BOOL Samp_C_COMIT;
- BOOL blCalibFlag;
- BOOL bllibFinishFlag;
- BOOL blCalibFault;
- }MOSINSIDE_Struct;
- typedef struct
- {
- UWORD K50;
- UWORD K75;
- UWORD K100;
- UWORD K125;
- UWORD K150;
- }K_Struct;
- typedef struct
- {
- UWORD uwTEMP_RES0;//0度电阻值
- UWORD uwTEMP_RES1;//25度电阻值
- UWORD uwTEMP_RES2;//50度电阻值
- UWORD uwTEMP_RES3;//75度电阻值
- UWORD uwTEMP_RES4;//100度电阻值
- UWORD uwTEMP_RES5;//125度电阻值
- UWORD uwTEMP_RES6;//150度电阻值
- UWORD uwTEMP_libres;//当下环境下的电阻值
- UWORD swTEMP;//当下温度值
- }TEMP_RES_Struct;
- typedef struct
- {
- SWORD uwMOS_i_Value;//MOS电流
- UWORD uwCalRes_i_Value;//校准电阻电流
- //K_Struct uwMOS_K; //k值
- UWORD uwCalib_R_Value ;//实时温度对应的电阻
- TEMP_RES_Struct RES; //不同温度下的电阻值
- UWORD uwMaxiPhoseCurAp;//相电流系数
- UWORD uwCurReg2Pu;//相电流系数
- UWORD uwCurRegPu_25d;//相电流系数
- UWORD MOS_i_ValueCOM[50];
- UWORD Res_i_ValueCOM[50];
- }MOSCALIB_Struct;
- typedef struct
- {
- UWORD CM1;
- UWORD CM2;
- UWORD CCTRL;
- } phase_Struct;
- typedef struct
- {
- UWORD PWM1;
- UWORD PWM2;
- UWORD PWM3;
- } phasePWM_Struct;
- extern MOSCALIB_Struct MosCal_A;
- extern MOSCALIB_Struct MosCal_B;
- extern MOSCALIB_Struct MosCal_C;
- extern MOSINSIDE_Struct MosResInside;
- void MosResRead(void);
- void ReceiveCmdHandle(void);
- void MosResHandle(MOSCALIB_Struct *moscal,ADC_SUMCOF *K);
- void CalcTempRes(MOSCALIB_Struct *y,MOSEEPROM_Struct *Eep);
- void CalcResVaule(MOSCALIB_Struct *y , SWORD Temp);
- void CalcMaXAdcCur(MOSCALIB_Struct *y);
- #endif
|