/************************************************************************** * * Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file CPLD.h * * @author (last) Sean * @date (last) 07-Aug-2024 * * @author (original) Sean * @date (original) 07-Aug-2024 * ***************************************************************************/ #ifndef __CPLD_H__ #define __CPLD_H__ #include "TDCommon.h" /** * @defgroup CPLD_Interface CPLD_Interface * @brief The CPLD interface module provides functions to interface with the * CPLD (watchdog, safety, alarm lamp, off/stop buttons, power off request). * * @addtogroup CPLD_Interface * @{ */ // ********** public definitions ********** /// Safety shutdown broadcast data typedef struct { U32 isSafetyShutdownActivated; ///< Is safety shutdown active boolean flag } TD_SAFETY_SHUTDOWN_DATA_T; // ********** public function prototypes ********** void initCPLD( void ); void toggleCPLDWatchdog( void ); PIN_SIGNAL_STATE_T getCPLDWatchdogExpired( void ); void setCPLDLampGreen( PIN_SIGNAL_STATE_T level ); void setCPLDLampBlue( PIN_SIGNAL_STATE_T level ); void setCPLDLampRed( PIN_SIGNAL_STATE_T level ); void toggleCPLDOffRequest( void ); PIN_SIGNAL_STATE_T getCPLDOffButton( void ); PIN_SIGNAL_STATE_T getCPLDStopButton( void ); BOOL getCPLDACPowerLossDetected( void ); void activateSafetyShutdown( void ); BOOL isSafetyShutdownActivated( void ); SELF_TEST_STATUS_T execSafetyShutdownTest( void ); void resetSafetyShutdownPOSTState( void ); BOOL testSetSafetyShutdownOverride( U32 value ); BOOL testResetSafetyShutdownOverride( void ); /**@}*/ #endif