|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
fault_common.h
Go to the documentation of this file.
1
8#ifndef FAULT_COMMON_H
9#define FAULT_COMMON_H
10
11#include <stdint.h>
12#include <stdbool.h>
13
14
22 typedef struct
23{
24 int16_t Val1_Threshold;
25 int16_t Val1_Hysteresis;
26 int16_t Val2_Threshold;
27 int16_t Val2_Hysteresis;
28 uint16_t CounterSet;
29 uint32_t CounterReset;
30 uint16_t FaultCounter;
31 uint16_t FaultCode;
32 uint8_t FaultActive;
33 uint8_t FaultLatch;
34}FAULT_OBJ_T;
35
36 typedef void(*FAULT_CALLBACK)(void);
37
38void FAULT_Init(FAULT_OBJ_T *faultInput,
39 int16_t threshold, int16_t hysLimit,
40 uint16_t thresholdCnt, uint32_t hysCnt);
41
42void FAULT_InitRange(FAULT_OBJ_T *faultInput,
43 int16_t thresholdMin, int16_t hysLimitMin,
44 int16_t thresholdMax, int16_t hysLimitMax,
45 uint16_t thresholdCnt, uint32_t hysCnt);
46
47void FAULT_SetCounters(FAULT_OBJ_T *faultInput, uint16_t fltThresholdCnt, uint32_t fltHysCnt);
48void FAULT_SetThresholds(FAULT_OBJ_T *faultInput, int16_t fltThreshold, int16_t fltHysLimit);
49bool FAULT_CheckMax(FAULT_OBJ_T *faultInput, int16_t faultSource, FAULT_CALLBACK callback);
50bool FAULT_CheckMin(FAULT_OBJ_T *faultInput, int16_t faultSource, FAULT_CALLBACK callback);
51bool FAULT_CheckBit(FAULT_OBJ_T *faultInput, bool faultBit, FAULT_CALLBACK callback);
52bool FAULT_CheckRange(FAULT_OBJ_T *faultInput, int16_t inputValue, FAULT_CALLBACK callback);
53
54
55#endif
FAULT_CALLBACK
void(* FAULT_CALLBACK)(void)
Definition fault_common.h:36
FAULT_CheckMax
bool FAULT_CheckMax(FAULT_OBJ_T *faultInput, int16_t faultSource, FAULT_CALLBACK callback)
This function compares the fault source value with the threshold limits and sets (or) resets the faul...
Definition fault_common.c:126
FAULT_CheckRange
bool FAULT_CheckRange(FAULT_OBJ_T *faultInput, int16_t inputValue, FAULT_CALLBACK callback)
Definition fault_common.c:287
FAULT_CheckBit
bool FAULT_CheckBit(FAULT_OBJ_T *faultInput, bool faultBit, FAULT_CALLBACK callback)
Definition fault_common.c:236
FAULT_InitRange
void FAULT_InitRange(FAULT_OBJ_T *faultInput, int16_t thresholdMin, int16_t hysLimitMin, int16_t thresholdMax, int16_t hysLimitMax, uint16_t thresholdCnt, uint32_t hysCnt)
This function initializes the fault object data structure with the values that required to detect a f...
Definition fault_common.c:55
FAULT_SetCounters
void FAULT_SetCounters(FAULT_OBJ_T *faultInput, uint16_t fltThresholdCnt, uint32_t fltHysCnt)
This function initializes/sets the fault structure with the counter limits.
Definition fault_common.c:83
FAULT_SetThresholds
void FAULT_SetThresholds(FAULT_OBJ_T *faultInput, int16_t fltThreshold, int16_t fltHysLimit)
This function initializes/sets the fault structure with the threshold limits.
Definition fault_common.c:101
FAULT_CheckMin
bool FAULT_CheckMin(FAULT_OBJ_T *faultInput, int16_t faultSource, FAULT_CALLBACK callback)
This function compares the fault source value with the threshold limits and sets (or) resets the faul...
Definition fault_common.c:184
FAULT_Init
void FAULT_Init(FAULT_OBJ_T *faultInput, int16_t threshold, int16_t hysLimit, uint16_t thresholdCnt, uint32_t hysCnt)
This function initializes the fault object data structure with the values that required to detect a f...
Definition fault_common.c:27
FAULT_OBJ_T
The Fault object data structure contains a list of elements/variables that are used to detect/check a...
Definition fault_common.h:23
FAULT_OBJ_T::FaultCounter
uint16_t FaultCounter
Internal counter for activating/removing fault.
Definition fault_common.h:30
FAULT_OBJ_T::FaultActive
uint8_t FaultActive
Set/Cleared inside flt check loop
Definition fault_common.h:32
FAULT_OBJ_T::Val1_Hysteresis
int16_t Val1_Hysteresis
Fault hysteresis limit. If hysteresis is not needed, fltThreshold = fltHysLimit.
Definition fault_common.h:25
FAULT_OBJ_T::FaultLatch
uint8_t FaultLatch
Flag indicating if FAULT has been tripped.
Definition fault_common.h:33
FAULT_OBJ_T::FaultCode
uint16_t FaultCode
Code that can be used to display fault (1st fault occurred) to global variable.
Definition fault_common.h:31
FAULT_OBJ_T::Val1_Threshold
int16_t Val1_Threshold
Fault threshold limit: Range of -32768 to 32767.
Definition fault_common.h:24
FAULT_OBJ_T::Val2_Hysteresis
int16_t Val2_Hysteresis
Fault hysteresis limit. If hysteresis is not needed, fltThreshold = fltHysLimit.
Definition fault_common.h:27
FAULT_OBJ_T::CounterReset
uint32_t CounterReset
Number of consecutive events when input outside hysteresis limit in order to remove fault,...
Definition fault_common.h:29
FAULT_OBJ_T::CounterSet
uint16_t CounterSet
Number of consecutive fault events before fault becomes active.
Definition fault_common.h:28
FAULT_OBJ_T::Val2_Threshold
int16_t Val2_Threshold
Fault threshold limit: Range of -32768 to 32767.
Definition fault_common.h:26