|
Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
|
|
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;
enum FLT_COMPARE_TYPE_e CompareType
Bit <10:8>: Fault check comparison type control bits.
volatile struct FLT_EVENT_RESPONSE_s RecoveryResponse
Settings defining the fault recovery event.
volatile struct FLT_OBJECT_STATUS_s Status
Status word of this fault object.
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 struct FAULT_OBJECT_s fltObjectClear
Clears the fault objects.
This data structure defines the fault monitor event response object.
volatile struct FLT_COMPARE_OBJECT_s SourceObject
Object which should be monitored.
volatile struct FLT_COMPARE_OBJECT_s ReferenceObject
Reference object the source should be compared with.
volatile uint16_t eventThreshold
Bit mask will be &-ed with source as value (use 0xFFFF for full value comparison)
volatile uint16_t compareThreshold
Signal level at which the fault condition will be detected.
volatile bool Enabled
Bit 15: Control bit enabling/disabling monitoring of the fault object.
volatile uint16_t drv_FaultHandler_CheckObject(volatile struct FAULT_OBJECT_s *fltobj)
Check current fault status of a user-defined fault object.
This data structure defines the data object which will be monitored by the fault handler.
volatile uint16_t * ptrObject
Pointer to register or variable which should be monitored.
volatile uint16_t(* ptrResponseFunction)(void)
pointer to a user-defined function called when a defined fault monitoring event is detected
volatile uint16_t Counter
Fault event counter (controlled by FAULT HANDLER)
This data structure is a collection of data structures for fault handling.
volatile uint16_t bitMask
Bit mask will be &-ed with source as value (use 0xFFFF for full value comparison)
volatile unsigned
Bit <7:2>: (reserved)
volatile bool FaultStatus
Bit 0: Flag bit indicating if FAULT has been tripped.
This data structure defines the fault object status.