41 #ifndef FAULT_HANDLER_H 42 #define FAULT_HANDLER_H 61 typedef enum FLT_COMPARE_TYPE_e {
64 FLTCMP_GREATER_THAN = 1,
67 FLTCMP_IS_NOT_EQUAL = 4,
90 } __attribute__((packed)) bits;
149 } __attribute__((packed)) bits;
180 extern volatile uint16_t drv_FaultHandler_ScanObjects(
volatile struct FAULT_OBJECT_s* fltObjectList[],
volatile uint16_t size);
181 extern volatile uint16_t drv_FaultHandler_Dispose(
volatile struct FAULT_OBJECT_s* fltObjectList[],
volatile uint16_t size);
volatile bool Enabled
Bit 15: Control bit enabling/disabling monitoring of the fault object.
volatile uint16_t Counter
Fault event counter (controlled by FAULT HANDLER)
volatile uint16_t(* FaultRecovery)(void)
Function pointer to the common fault recovery function.
enum FLT_COMPARE_TYPE_e CompareType
Bit <10:8>: Fault check comparison type control bits.
volatile struct FLT_COMPARE_OBJECT_s ReferenceObject
Reference object the source should be compared with.
volatile unsigned
Bit <15:2>: (reserved)
volatile struct FLT_OBJECT_STATUS_s Status
Status word of this fault object.
volatile uint16_t FaultStatusList
Status word encoding individual fault object states in order of their list index.
volatile uint16_t * ptrObject
Pointer to register or variable which should be monitored.
volatile uint16_t FaultRecoveryCounter
Most recent number of fault recovery attempts.
volatile uint16_t value
Fault monitor status word.
volatile struct FAULT_MONITOR_STATUS_s Status
Status word of the fault monitor.
volatile uint16_t eventThreshold
Bit mask will be &-ed with source as value (use 0xFFFF for full value comparison)
volatile bool FaultStatus
Bit 0: Flag bit indicating if FAULT has been tripped.
volatile uint16_t FaultLatchCount
Number of fault recovery attempts after which the system gets locked in a latched fault state.
volatile uint16_t compareThreshold
Signal level at which the fault condition will be detected.
volatile unsigned
Bit <7:2>: (reserved)
volatile uint16_t(* ptrResponseFunction)(void)
pointer to a user-defined function called when a defined fault monitoring event is detected
volatile struct FLT_COMPARE_OBJECT_s SourceObject
Object which should be monitored.
volatile bool FaultLatch
Bit 1: Flag bit indicating if a latched FAULT condition has been enforced.
volatile uint16_t bitMask
Bit mask will be &-ed with source as value (use 0xFFFF for full value comparison)
volatile struct FLT_EVENT_RESPONSE_s TripResponse
Settings defining the fault trip event.
volatile bool FaultActive
Bit 1: Flag bit indicating if fault condition has been detected but FAULT has not been tripped yet.
volatile bool FaultStatus
Bit 0: Flag bit indicating if a FAULT condition has been tripped.
volatile struct FLT_EVENT_RESPONSE_s RecoveryResponse
Settings defining the fault recovery event.