#ifndef __FAULTDETECT_H
#define __FAULTDETECT_H

#include "f28x_project.h"

#define  VOUTOV     (50.0f)
#define  IOUTOV     (20.0f)
#define  TMPOV      (75.0f)
#define  VBUSOV          (500.0f)
#define  IBUSOV          (10.0f)
#define  VBUSUN        (150.0f)
#define  ILOV          (45.0f)

struct	SEC_PROTECT_BIT
{
	Uint32	uVOUTOvValue:1;			//bit0 输出过压
	Uint32	uIoutOvValue:1;			//bit1 输出电流过流
	Uint32	uTMPOvValue:1;			//bit2 w温度过温
	Uint32	uModuleOpr:1;			//bit3 模块正常还是不正常
	Uint32	uVbusOv:1;			    //bit4 输出母线过压
	Uint32	uIbusOv:1;			    //bit5 输出母线电流过流
	Uint32	uVbus_un:1;			    //bit6 输出欠压
	Uint32	uIL_OV:1;			    //bit7 谐振电流过流
	Uint32	uPre_Tim_ov:1;			//bit8 换气超时
	Uint32	uFault_MOS:1;			//bit9 换气超时
	Uint32	Rsvd:22; 				// 10-31reserved
};

union SEC_PROTECT_DATA {
    Uint32 all;
    struct SEC_PROTECT_BIT bit;
};

struct SEC_PRO_DATA
{
    union SEC_PROTECT_DATA SecProtect;
    union SEC_PROTECT_DATA SecProtectFast;
    Uint16 uCOUNT;
};

//extern  union SEC_PROTECT_DATA SecProtect;
//extern  union SEC_PROTECT_DATA SecProtectFast;

//全局变量//
extern  struct SEC_PRO_DATA SecProData;



void vFaultDetect(void);
void vISRFaultDetect(void);
void Fault_DATA_init(void);
void vFaultDetect_ISR(void);

#endif

/*********************************************END OF FILE**********************/

