Index: firmware/App/Drivers/GPIO.c =================================================================== diff -u -r380b0afc95467d0861ff3aa2cdcde5d5d7ac85e7 -r3a8cf075eb6f0d255f516ac26bac7fbaacfde14a --- firmware/App/Drivers/GPIO.c (.../GPIO.c) (revision 380b0afc95467d0861ff3aa2cdcde5d5d7ac85e7) +++ firmware/App/Drivers/GPIO.c (.../GPIO.c) (revision 3a8cf075eb6f0d255f516ac26bac7fbaacfde14a) @@ -17,6 +17,7 @@ #include "gio.h" #include "mibspi.h" +#include "reg_het.h" #include "GPIO.h" @@ -40,21 +41,27 @@ #define SAFETY_POST_NO_24V_RESTORE 2 ///< Safety shutdown POST failed because 24V was not restored when safety line reset. // GIO port A pin assignments for pins connected to CPLD -#define OFF_BUTTON_GIO_PORT_PIN 0U ///< GPIO pin ID on port A for off button input signal. -#define STOP_BUTTON_GIO_PORT_PIN 1U ///< GPIO pin ID on port A for stop button input signal. -#define SAFETY_GIO_PORT_PIN 3U ///< GPIO pin ID on port A for safety shutdown output signal +#define OFF_BUTTON_GIO_PORT_PIN 0U ///< GPIO pin ID on port A for off button input signal. +#define STOP_BUTTON_GIO_PORT_PIN 1U ///< GPIO pin ID on port A for stop button input signal. // GIO port B pin assignments for pins connected to CPLD -#define OFF_REQUEST_GIO_PORT_PIN 0U ///< GPIO pin ID on port B for power off request output signal. -#define WD_PET_GIO_PORT_PIN 1U ///< GPIO pin ID on port B for watchdog pet output signal. -#define SAFE_GIO_PORT_PIN 2U ///< GPIO pin ID on port B for safety shutdown input signal. +#define OFF_REQUEST_GIO_PORT_PIN 0U ///< GPIO pin ID on port B for power off request output signal. +#define WD_PET_GIO_PORT_PIN 1U ///< GPIO pin ID on port B for watchdog pet output signal. +#define SAFE_GIO_PORT_PIN 2U ///< GPIO pin ID on port B for safety shutdown input signal. +#define SAFETY_GIO_PORT_PIN 3U ///< GPIO pin ID on port B for safety shutdown output signal +// hetPORT1 pin assignments +#define AIR_PUMP_GPIO_PIN 4U ///< GPIO pin ID on hetPORT1 for air pump motor state. + // MIBSPI5 port pin assignments for pins connected to CPLD -#define GREEN_SPI5_PORT_MASK 0x00000200 ///< (CLK - re-purposed as output GPIO) for green alarm lamp signal. -#define BLUE_SPI5_PORT_MASK 0x00000400 ///< (SIMO[0] - re-purposed as output GPIO) for blue alarm lamp signal. -#define RED_SPI5_PORT_MASK 0x00000800 ///< (SOMI[0] - re-purposed as output GPIO) for red alarm lamp signal. -#define AC_PRESENT_SPI5_PORT_MASK 0x00000001 ///< (SOMI[0] - re-purposed as output GPIO) for red alarm lamp signal. +#define GREEN_SPI5_PORT_MASK 0x00000200 ///< (CLK - re-purposed as output GPIO) for green alarm lamp signal. +#define BLUE_SPI5_PORT_MASK 0x00000400 ///< (SIMO[0] - re-purposed as output GPIO) for blue alarm lamp signal. +#define RED_SPI5_PORT_MASK 0x00000800 ///< (SOMI[0] - re-purposed as output GPIO) for red alarm lamp signal. +#define AC_PRESENT_SPI5_PORT_MASK 0x00000001 ///< (NCS[0] - re-purposed as output GPIO) for AC present signal. +// MIBSPI3 port pin assignments for pins connected to CPLD +#define BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK 0x00000001 ///< (NCS[0] - re-purposed as output GPIO for backup alarm audio enable. + // CPLD pin I/O macros #define GET_OFF() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTA, OFF_BUTTON_GIO_PORT_PIN)) ///< Macro to get off button signal state. #define GET_STOP() (PIN_SIGNAL_STATE_T)(gioGetBit(gioPORTA, STOP_BUTTON_GIO_PORT_PIN)) ///< Macro to get stop button signal state. @@ -80,7 +87,6 @@ #define CLR_SAFETY_SHUTDOWN() gioSetBit( gioPORTB, SAFETY_GIO_PORT_PIN, PIN_SIGNAL_LOW ) ///< Macro to set safety shutdown signal state low. // Backup alarm audio enable/disable macros -#define BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK 0x00000001 ///< Pin SPI3-CS0 - re-purposed as output GPIO for backup alarm audio enable. #define SET_BACKUP_AUDIO_ENABLE() {mibspiREG3->PC3 |= BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK;} ///< Macro to enable backup alarm audio. #define CLR_BACKUP_AUDIO_ENABLE() {mibspiREG3->PC3 &= ~BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK;} ///< Macro to disable backup alarm audio. @@ -352,4 +358,18 @@ CLR_BACKUP_AUDIO_ENABLE() } +/*********************************************************************//** + * @brief + * The setAirPumpMotorSignal function sets the air pump output signal to + * the given pin level. + * @details \b Inputs: none + * @details \b Outputs: Air pump output signal set to given level. + * @param signal Signal level to set the air pump output to + * @return none + *************************************************************************/ +void setAirPumpMotorSignal( PIN_SIGNAL_STATE_T signal ) +{ + gioSetBit( hetPORT1, AIR_PUMP_GPIO_PIN, (U32)signal ); +} + /**@}*/