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

Loading...
Searching...
No Matches
fault_comm_interface.c
Go to the documentation of this file.
1
8#include "fault_common.h"
9#include "pwrctrl/pwrctrl.h"
10
11 enum FAULTLOG_FLAGS_e {
12 FLT_VPRI_OVP,
13 FLT_VPRI_UVP,
14 FLT_VSEC_OVP,
15 FLT_VSEC_UVP,
16 FLT_IPRI_OCP,
17 FLT_ISEC_OCP,
18 FLT_ISNS_SCP,
19 FLT_DAB_TEMP,
20 FLT_RAIL_5V,
21 FLT_LOAD_DISCONNECT,
22 RESET
23};
24 typedef enum FAULTLOG_FLAGS_e FAULTLOG_FLAGS_t;
25
26extern bool loadDisconnect;
27
28uint16_t Fault_GetFlags(void)
29{
30 uint16_t fault = 0;
31
32 // Concatenate the Fault status in one for PBV
33 fault = (dab.Fault.Object.IPrimaryOCP.FaultLatch << FLT_IPRI_OCP) +
34 (dab.Fault.Object.ISecondaryOCP.FaultLatch << FLT_ISEC_OCP) +
35 (dab.Fault.Object.ISenseSCP.FaultLatch << FLT_ISNS_SCP) +
36 (dab.Fault.Object.VPrimaryOVP.FaultLatch << FLT_VPRI_OVP) +
37 (dab.Fault.Object.VPrimaryUVP.FaultLatch << FLT_VPRI_UVP) +
38 (dab.Fault.Object.VSecondaryOVP.FaultLatch << FLT_VSEC_OVP) +
39 (dab.Fault.Object.VSecondaryUVP.FaultLatch << FLT_VSEC_UVP) +
40 (dab.Fault.Object.PowerSupplyOTP.FaultLatch << FLT_DAB_TEMP) +
41 (dab.Fault.Object.VRail_5V.FaultLatch << FLT_RAIL_5V) +
42 (loadDisconnect << FLT_LOAD_DISCONNECT) +
43 (dab.Fault.Object.ISenseSCP.FaultLatch << RESET);
44
45 return(fault);
46}
fault_common.h
Contains fault generic public functions.
loadDisconnect
bool loadDisconnect
Definition fault.c:28
FAULTLOG_FLAGS_e
FAULTLOG_FLAGS_e
Definition fault_comm_interface.c:11
FLT_VSEC_UVP
@ FLT_VSEC_UVP
Definition fault_comm_interface.c:15
FLT_IPRI_OCP
@ FLT_IPRI_OCP
Definition fault_comm_interface.c:16
FLT_DAB_TEMP
@ FLT_DAB_TEMP
Definition fault_comm_interface.c:19
FLT_ISEC_OCP
@ FLT_ISEC_OCP
Definition fault_comm_interface.c:17
RESET
@ RESET
Definition fault_comm_interface.c:22
FLT_VPRI_OVP
@ FLT_VPRI_OVP
Definition fault_comm_interface.c:12
FLT_LOAD_DISCONNECT
@ FLT_LOAD_DISCONNECT
Definition fault_comm_interface.c:21
FLT_VSEC_OVP
@ FLT_VSEC_OVP
Definition fault_comm_interface.c:14
FLT_ISNS_SCP
@ FLT_ISNS_SCP
Definition fault_comm_interface.c:18
FLT_VPRI_UVP
@ FLT_VPRI_UVP
Definition fault_comm_interface.c:13
FLT_RAIL_5V
@ FLT_RAIL_5V
Definition fault_comm_interface.c:20
Fault_GetFlags
uint16_t Fault_GetFlags(void)
Definition fault_comm_interface.c:28
FAULTLOG_FLAGS_t
enum FAULTLOG_FLAGS_e FAULTLOG_FLAGS_t
Definition fault_comm_interface.c:24
dab
POWER_CONTROL_t dab
Global data object for a DAB Converter.
Definition pwrctrl.c:28
FAULT_OBJ_T::FaultLatch
uint8_t FaultLatch
Flag indicating if FAULT has been tripped.
Definition fault_common.h:33
FAULT_s::VRail_5V
FAULT_OBJ_T VRail_5V
Fault object for 5V rail.
Definition fault_typedef.h:30
FAULT_s::VSecondaryUVP
FAULT_OBJ_T VSecondaryUVP
Fault object for Secondary under voltage protection.
Definition fault_typedef.h:27
FAULT_s::PowerSupplyOTP
FAULT_OBJ_T PowerSupplyOTP
Fault object for Power Supply Temperature.
Definition fault_typedef.h:29
FAULT_s::VSecondaryOVP
FAULT_OBJ_T VSecondaryOVP
Fault object for Secondary over voltage protection.
Definition fault_typedef.h:26
FAULT_s::ISecondaryOCP
FAULT_OBJ_T ISecondaryOCP
Fault object for Secondary over current protection.
Definition fault_typedef.h:23
FAULT_s::VPrimaryOVP
FAULT_OBJ_T VPrimaryOVP
Fault object for Primary over voltage protection.
Definition fault_typedef.h:24
FAULT_s::VPrimaryUVP
FAULT_OBJ_T VPrimaryUVP
Fault object for Primary under voltage protection.
Definition fault_typedef.h:25
FAULT_s::IPrimaryOCP
FAULT_OBJ_T IPrimaryOCP
Fault object for Primary over current protection.
Definition fault_typedef.h:22
FAULT_s::ISenseSCP
FAULT_OBJ_T ISenseSCP
Fault object for Short circuit protection.
Definition fault_typedef.h:28
FAULT_SETTINGS_s::Object
FAULT_t Object
Fault Objects.
Definition fault_typedef.h:42
POWER_CONTROL_s::Fault
FAULT_SETTINGS_t Fault
Fault flags and settings.
Definition pwrctrl_typedef.h:173