CELIS/APPLICATION/Errcode/Err_code.h

66 lines
1.3 KiB
C
Raw Normal View History

#ifndef __Err_code__H_
#define __Err_code__H_
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
//#define __Err_Debug__
#define Err_Code_Max 16
#define Err_Code_Max_NUM (Err_Code_Max*8)
extern uint8_t Err_Code_BitMap[Err_Code_Max];
typedef struct
{
uint8_t index;
char* data;
}ErrCode_info;
enum Fault_typeSDDC{
Recoverable_shutdown_failure = 0,/*<2A>ɻָ<C9BB>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
Unrecoverable_shutdown_failure = 1,/*<2A><><EFBFBD>ɻָ<C9BB>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
First_Primary_power_limiting_fault = 2,/*һ<><D2BB><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD><C6B9>ʹ<EFBFBD><CAB9><EFBFBD>*/
Second_Primary_power_limiting_fault = 3,/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD><C6B9>ʹ<EFBFBD><CAB9><EFBFBD>*/
Third_Primary_power_limiting_fault = 4,/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD><C6B9>ʹ<EFBFBD><CAB9><EFBFBD>*/
Fault_typeSDDC_Len = 5,
};
#define ARRAY_LENGTH(arr) (sizeof(arr) / sizeof(arr[0]))
struct Err_shine
{
uint8_t Star_Num;
uint8_t Err_shine_len;
};
//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD><EFBFBD><EFBFBD>
bool Err_Set(uint8_t Err_NUM);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool Err_Clear(uint8_t Err_NUM);
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool Err_Read(uint8_t Err_NUM);
//<2F>Ƿ<EFBFBD><C7B7>й<EFBFBD><D0B9><EFBFBD><EFBFBD><EFBFBD>
bool Err_Check(void);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool Err_Traverse(void);
void Print_Err(void);
//<2F><>ѯ<EFBFBD>Ƿ<EFBFBD><C7B7>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool Err_ScanHierarchical_fault(enum Fault_typeSDDC Fault_type);
//<2F><>ѯ<EFBFBD>Ⱥ<EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void ErrGetSequence(void);
//<2F><><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void ErrClearSequence(void);
#endif