Index: firmware/App/Services/CpldInterface.c =================================================================== diff -u -r772fdd144e4006fada12a2e91519378b29d54bae -r3518e8a088c32e75c0c8960d5e629a7401095feb --- firmware/App/Services/CpldInterface.c (.../CpldInterface.c) (revision 772fdd144e4006fada12a2e91519378b29d54bae) +++ firmware/App/Services/CpldInterface.c (.../CpldInterface.c) (revision 3518e8a088c32e75c0c8960d5e629a7401095feb) @@ -62,10 +62,11 @@ /*********************************************************************//** * @brief - * The initCPLD function initializes the CPLD module. All outputs to CPLD - * (watchdog pet, off request, and alarm lamp LEDs) are set to low. - * @details Inputs: none - * @details Outputs: CPLD module signal outputs set to initial states. + * The initCPLD function initializes the CPLD unit. All outputs to CPLD + * (watchdog pet,power off request, alarm lamp LEDs and safety shutdown) + * are set to low. + * @details \b Inputs: none + * @details \b Outputs: CPLD unit signal outputs set to initial states. * @return none *************************************************************************/ void initCPLD( void ) @@ -93,8 +94,8 @@ /*********************************************************************//** * @brief * The toggleCPLDWatchdog function toggles the watchdog pet signal to CPLD. - * @details Inputs: none - * @details Outputs: watchdog pet signal toggled. + * @details \b Inputs: none + * @details \b Outputs: watchdog pet signal toggled. * @return none *************************************************************************/ void toggleCPLDWatchdog( void ) @@ -104,13 +105,13 @@ /*********************************************************************//** * @brief - * The getCPLDWatchdogExpired function determines the current signal level - * on the watchdog expired pin from the CPLD. - * @details Inputs: Signal from CPLD on watchdog expired pin. - * @details Outputs: none - * @return level (LOW or HIGH) + * The getCPLDSafety function determines the current signal level for the + * safety shutdown pin from the CPLD. + * @details \b Inputs: Signal from CPLD on safety input pin. + * @details \b Outputs: none + * @return level of safety line (LOW=active or HIGH=inactive) *************************************************************************/ -PIN_SIGNAL_STATE_T getCPLDWatchdogExpired( void ) +PIN_SIGNAL_STATE_T getCPLDSafety( void ) { PIN_SIGNAL_STATE_T level = getSafetySignal(); @@ -121,8 +122,8 @@ * @brief * The getCPLDACPowerLossDetected function determines whether the CPLD is * reporting A/C power has been lost. - * @details Inputs: Signal from CPLD on A/C presence pin. - * @details Outputs: none + * @details \b Inputs: Signal from CPLD on A/C presence pin (LOW=AC Power Lost). + * @details \b Outputs: none * @return TRUE if A/C power loss is detected, FALSE if not *************************************************************************/ BOOL getCPLDACPowerLossDetected( void ) @@ -137,9 +138,9 @@ * @brief * The setCPLDLampGreen function sets the alarm lamp green signal to CPLD * to given level. - * @details Inputs: none - * @details Outputs: alarm lamp green signal set to given level. - * @param level LOW or HIGH + * @details \b Inputs: none + * @details \b Outputs: alarm lamp green signal set to given level. + * @param level LOW (green off) or HIGH (green on) * @return none *************************************************************************/ void setCPLDLampGreen( PIN_SIGNAL_STATE_T level ) @@ -158,9 +159,9 @@ * @brief * The setCPLDLampBlue function sets the alarm lamp blue signal to CPLD * to given level. - * @details Inputs: none - * @details Outputs: alarm lamp blue signal set to given level. - * @param level LOW or HIGH + * @details \b Inputs: none + * @details \b Outputs: alarm lamp blue signal set to given level. + * @param level LOW (blue off) or HIGH (blue on) * @return none *************************************************************************/ void setCPLDLampBlue( PIN_SIGNAL_STATE_T level ) @@ -179,9 +180,9 @@ * @brief * The setCPLDLampRed function sets the alarm lamp red signal to CPLD * to given level. - * @details Inputs: none - * @details Outputs: alarm lamp red signal set to given level. - * @param level LOW or HIGH + * @details \b Inputs: none + * @details \b Outputs: alarm lamp red signal set to given level. + * @param level LOW (red off) or HIGH (red on) * @return none *************************************************************************/ void setCPLDLampRed( PIN_SIGNAL_STATE_T level ) @@ -202,8 +203,8 @@ * The off request signal must be toggled 4 times, once every 50 ms, in order * for the CPLD to accept the off request sequence and initiate system power * down. - * @details Inputs: none - * @details Outputs: off request signal toggled. + * @details \b Inputs: none + * @details \b Outputs: off request signal toggled. * @return none *************************************************************************/ void toggleCPLDOffRequest( void ) @@ -215,9 +216,9 @@ * @brief * The getCPLDOffButton function determines the current signal level * on the off button pin from the CPLD. - * @details Inputs: Signal from CPLD on off button pin. - * @details Outputs: none - * @return level (LOW or HIGH) + * @details \b Inputs: Signal from CPLD on off button pin. + * @details \b Outputs: none + * @return level (LOW=released or HIGH=depressed) *************************************************************************/ PIN_SIGNAL_STATE_T getCPLDOffButton( void ) { @@ -230,9 +231,9 @@ * @brief * The getCPLDStopButton function determines the current signal level * on the stop button pin from the CPLD. - * @details Inputs: Signal from CPLD on off button pin. - * @details Outputs: none - * @return level (LOW or HIGH) + * @details \b Inputs: Signal from CPLD on stop button pin. + * @details \b Outputs: none + * @return level (LOW=released or HIGH=depressed) *************************************************************************/ PIN_SIGNAL_STATE_T getCPLDStopButton( void ) { @@ -244,24 +245,29 @@ /*********************************************************************//** * @brief * The activateSafetyShutdown function activates the safety shutdown signal. - * @details Inputs: none - * @details Outputs: Safety Shutdown signal output set to active state. + * @details \b Message \b Sent: MSG_ID_TD_EVENT for software activated safety + * shutdown event. + * @details \b Inputs: none + * @details \b Outputs: safetyShutdownActivated, Safety Shutdown signal output + * set to active state. * @return none *************************************************************************/ void activateSafetyShutdown( void ) { safetyShutdownActivated = TRUE; setSafetyShutdownSignal(); -// SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_SAFETY_LINE, 1, 0 ) + SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_SAFETY_LINE, 1, 0 ) } /*********************************************************************//** * @brief * The isSafetyShutdownActivated function returns whether the safety shutdown - * signal has been activated. - * @details Inputs: none - * @details Outputs: none - * @return safetyShutdownActivated + * signal has been activated by software. + * @note The safety shutdown signal can also be activated by other causes + * (e.g. watchdog expiration). + * @details \b Inputs: safetyShutdownActivated + * @details \b Outputs: none + * @return TRUE if software has activated safety shutdown, FALSE if not *************************************************************************/ BOOL isSafetyShutdownActivated( void ) { @@ -273,8 +279,10 @@ * The execSafetyShutdownTest function executes the safety shutdown test. * This function should be called periodically until a pass or fail * result is returned. - * @details Inputs: safetyShutdownSelfTestState - * @details Outputs: safetyShutdownSelfTestState + * @details \b Alarm: ALARM_ID_HD_SAFETY_SHUTDOWN_POST_TEST_FAILED if self-test fails. + * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if self-test state is invalid. + * @details \b Inputs: safetyShutdownSelfTestState + * @details \b Outputs: safetyShutdownSelfTestState * @return in progress, passed, or failed *************************************************************************/ SELF_TEST_STATUS_T execSafetyShutdownTest( void ) @@ -358,8 +366,8 @@ /*********************************************************************//** * @brief * The resetSafetyShutdownPOSTState function resets safety shutdown POST state. - * @details Inputs: none - * @details Outputs: safetyShutdownSelfTestState + * @details \b Inputs: none + * @details \b Outputs: safetyShutdownSelfTestState * @return none *************************************************************************/ void resetSafetyShutdownPOSTState( void ) @@ -369,10 +377,10 @@ /*********************************************************************//** * @brief - * The testSetSafetyShutdownOverride function overrides the HD safety + * The testSetSafetyShutdownOverride function overrides the safety * shutdown. - * @details Inputs: none - * @details Outputs: HD safety shutdown overridden + * @details \b Inputs: none + * @details \b Outputs: HD safety shutdown overridden * @param value TRUE to activate safety shutdown, FALSE to de-activate it. * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -403,9 +411,9 @@ /*********************************************************************//** * @brief * The testResetSafetyShutdownOverride function resets the override of the - * HD safety shutdown. - * @details Inputs: none - * @details Outputs: shutdown override reset + * safety shutdown. + * @details \b Inputs: none + * @details \b Outputs: shutdown override reset * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetSafetyShutdownOverride( void )