
#define NOT_USED     0
#define FLOAT        1
#define UNSIGNED16   2
#define SIGNED16     3
#define UNSIGNED32   4
#define SIGNED32     5

// Shutdown +15V and -15V. +/-15V is power for current sensors. It also goes to Auxiliary connector.
#define ENABLE_15V            (GpioDataRegs.GPDCLEAR.bit.GPIO124 = 1)
#define DISABLE_15V           (GpioDataRegs.GPDSET.bit.GPIO124 = 1)
#define ENABLE_N15V           (GpioDataRegs.GPDCLEAR.bit.GPIO125 = 1)
#define DISABLE_N15V          (GpioDataRegs.GPDSET.bit.GPIO125 = 1)

// LED
#define LED_R_ON              (GpioDataRegs.GPCSET.bit.GPIO65 = 1)
#define LED_R_OFF             (GpioDataRegs.GPCCLEAR.bit.GPIO65 = 1)
#define LED_R_TOGGLE          (GpioDataRegs.GPCTOGGLE.bit.GPIO65 = 1)
#define LED_Y_ON              (GpioDataRegs.GPBSET.bit.GPIO52 = 1)
#define LED_Y_OFF             (GpioDataRegs.GPBCLEAR.bit.GPIO52 = 1)
#define LED_Y_TOGGLE          (GpioDataRegs.GPBTOGGLE.bit.GPIO52 = 1)
#define LED_G_ON              (GpioDataRegs.GPBSET.bit.GPIO41 = 1)
#define LED_G_OFF             (GpioDataRegs.GPBCLEAR.bit.GPIO41 = 1)
#define LED_G_TOGGLE          (GpioDataRegs.GPBTOGGLE.bit.GPIO41 = 1)

#define LED_CASE1_ON          (GpioDataRegs.GPASET.bit.GPIO10 = 1)
#define LED_CASE1_OFF         (GpioDataRegs.GPACLEAR.bit.GPIO10 = 1)
#define LED_CASE1_TOGGLE      (GpioDataRegs.GPATOGGLE.bit.GPIO10 = 1)
#define LED_CASE2_ON          (GpioDataRegs.GPASET.bit.GPIO11 = 1)
#define LED_CASE2_OFF         (GpioDataRegs.GPACLEAR.bit.GPIO11 = 1)
#define LED_CASE2_TOGGLE      (GpioDataRegs.GPATOGGLE.bit.GPIO11 = 1)

// GPIOs for FAULTS
#define FAULT_PHA             GpioDataRegs.GPADAT.bit.GPIO6
#define FAULT_PHB             GpioDataRegs.GPADAT.bit.GPIO7
#define FAULT_PHC             GpioDataRegs.GPADAT.bit.GPIO8
#define FAULT_GLOBAL          GpioDataRegs.GPADAT.bit.GPIO15

// Gate drive power supply enables - pull high for enable, low to disable
#define EN_PS_PH_A            (GpioDataRegs.GPESET.bit.GPIO131 = 1)
#define DIS_PS_PH_A           (GpioDataRegs.GPECLEAR.bit.GPIO131 = 1)
#define EN_PS_PH_B            (GpioDataRegs.GPCSET.bit.GPIO66 = 1)
#define DIS_PS_PH_B           (GpioDataRegs.GPCCLEAR.bit.GPIO66 = 1)
#define EN_PS_PH_C            (GpioDataRegs.GPASET.bit.GPIO14 = 1)
#define DIS_PS_PH_C           (GpioDataRegs.GPACLEAR.bit.GPIO14 = 1)

// Logic Enable signal enables diff receiver for PWM signal on the gate drive board.
#define EN_PWM_PH_A            (GpioDataRegs.GPASET.bit.GPIO27 = 1)
#define DIS_PWM_PH_A           (GpioDataRegs.GPACLEAR.bit.GPIO27 = 1)
#define EN_PWM_PH_B            (GpioDataRegs.GPCSET.bit.GPIO64 = 1)
#define DIS_PWM_PH_B           (GpioDataRegs.GPCCLEAR.bit.GPIO64 = 1)
#define EN_PWM_PH_C            (GpioDataRegs.GPESET.bit.GPIO130 = 1)
#define DIS_PWM_PH_C           (GpioDataRegs.GPECLEAR.bit.GPIO130 = 1)

// Gate driver chip fault rest input, active high
#define RST_FLT_PH_A           (GpioDataRegs.GPASET.bit.GPIO25 = 1)
#define NOT_RST_FLT_PH_A       (GpioDataRegs.GPACLEAR.bit.GPIO25 = 1)
#define RST_FLT_PH_B           (GpioDataRegs.GPASET.bit.GPIO26 = 1)
#define NOT_RST_FLT_PH_B       (GpioDataRegs.GPACLEAR.bit.GPIO26 = 1)
#define RST_FLT_PH_C           (GpioDataRegs.GPBSET.bit.GPIO63 = 1)
#define NOT_RST_FLT_PH_C       (GpioDataRegs.GPBCLEAR.bit.GPIO63 = 1)

