Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -r736cc5b56cc9c784ab1d8fc8687a73d190c35759 -r2f9807457197c347c20a24c64492edcf063f3daa --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 736cc5b56cc9c784ab1d8fc8687a73d190c35759) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 2f9807457197c347c20a24c64492edcf063f3daa) @@ -14,28 +14,28 @@ * @date (original) 07-Nov-2019 * ***************************************************************************/ - -#ifndef __ALARM_MGMT_H__ -#define __ALARM_MGMT_H__ - -#include "HDCommon.h" - -/** - * @defgroup AlarmManagement AlarmManagement - * @brief Alarm Management service module. Provides general alarm management - * functionality including support functions for triggering and clearing - * specific alarms. - * - * @addtogroup AlarmManagement - * @{ - */ - -// ********** public definitions ********** - + +#ifndef __ALARM_MGMT_H__ +#define __ALARM_MGMT_H__ + +#include "HDCommon.h" + +/** + * @defgroup AlarmManagement AlarmManagement + * @brief Alarm Management service module. Provides general alarm management + * functionality including support functions for triggering and clearing + * specific alarms. + * + * @addtogroup AlarmManagement + * @{ + */ + +// ********** public definitions ********** + #include "AlarmDefs.h" -#include "AlarmMgmtSWFaults.h" +#include "AlarmMgmtSWFaults.h" -/// Interval (in ms) at which alarm lamp and audio control will be executed. +/// Interval (in ms) at which alarm lamp and audio control will be executed. #define ALARM_LAMP_AND_AUDIO_CONTROL_INTERVAL_MS 250 #define MAX_ALARM_VOLUME_LEVEL 5 ///< Maximum alarm audio level. @@ -54,72 +54,72 @@ NUMBER_OF_ALARM_ACTIONS ///< Number of alarm actions } ALARM_ACTION_T; -#pragma pack(push, 4) -/// Record structure for detailing the properties of the current composite alarm status. -typedef struct -{ - ALARM_PRIORITY_T alarmsState; ///< Current alarm priority level - BOOL alarmsSilenced; ///< Alarms are currently silenced? - U32 alarmsSilenceStart; ///< Time stamp for when alarms were silenced (ms) +#pragma pack(push, 4) +/// Record structure for detailing the properties of the current composite alarm status. +typedef struct +{ + ALARM_PRIORITY_T alarmsState; ///< Current alarm priority level + BOOL alarmsSilenced; ///< Alarms are currently silenced? + U32 alarmsSilenceStart; ///< Time stamp for when alarms were silenced (ms) U32 alarmsSilenceExpiresIn; ///< Time until alarm silence expires (seconds) - BOOL alarmsToEscalate; ///< Are any active alarms due to escalate (should UI show count down timer?) - U32 alarmsEscalatesIn; ///< Time until alarm will escalate (seconds) + BOOL alarmsToEscalate; ///< Are any active alarms due to escalate (should UI show count down timer?) + U32 alarmsEscalatesIn; ///< Time until alarm will escalate (seconds) ALARM_ID_T alarmTop; ///< ID of current top alarm that will drive lamp/audio and UI should be displaying right now - BOOL topAlarmConditionDetected; ///< Condition for top alarm is still being detected - BOOL systemFault; ///< A system fault is active? - BOOL stop; ///< We should be in controlled stop right now - BOOL noClear; ///< No recovery will be possible - BOOL noResume; ///< Treatment may not be resumed at this time - BOOL noRinseback; ///< Rinseback may not be initiated at this time - BOOL noEndTreatment; ///< Ending the treatment is not an option at this time + BOOL topAlarmConditionDetected; ///< Condition for top alarm is still being detected + BOOL systemFault; ///< A system fault is active? + BOOL stop; ///< We should be in controlled stop right now + BOOL noClear; ///< No recovery will be possible + BOOL noResume; ///< Treatment may not be resumed at this time + BOOL noRinseback; ///< Rinseback may not be initiated at this time + BOOL noEndTreatment; ///< Ending the treatment is not an option at this time BOOL noBloodRecirc; ///< No blood re-circulation allowed at this time - BOOL noDialRecirc; ///< No dialysate re-circulation allowed at this time + BOOL noDialRecirc; ///< No dialysate re-circulation allowed at this time BOOL ok; ///< Display OK button instead of other options BOOL noMinimize; ///< Prevent user from minimizing the alarm window BOOL lampOn; ///< The alarm lamp is on BOOL noReTrigger; ///< Alarm flag to block re-trigger is set -} COMP_ALARM_STATUS_T; - -/// Record structure for unsigned integer alarm data. -typedef struct -{ - U32 data; ///< Alarm data of unsigned integer type. -} ALARM_DATA_U32_T; - -/// Record structure for signed integer alarm data. -typedef struct -{ - S32 data; ///< Alarm data of signed integer type. -} ALARM_DATA_S32_T; - -/// Record structure for floating point alarm data. -typedef struct -{ - F32 data; ///< Alarm data of floating point type. -} ALARM_DATA_F32_T; - -/// Record structure for boolean alarm data. -typedef struct -{ - BOOL data; ///< Alarm data of boolean type. -} ALARM_DATA_BOOL_T; - -/// Record structure for alarm data of any supported type. -typedef union -{ - ALARM_DATA_U32_T uInt; ///< Alarm data of unsigned integer type. - ALARM_DATA_S32_T sInt; ///< Alarm data of signed integer type. - ALARM_DATA_F32_T flt; ///< Alarm data of floating point type. - ALARM_DATA_BOOL_T bln; ///< Alarm data of boolean type. -} ALARM_DATAS_T; - -/// Record structure for alarm data including the data type to aid in interpretation. -typedef struct -{ - ALARM_DATA_TYPES_T dataType; ///< The type of alarm data provided. - ALARM_DATAS_T data; ///< The alarm data of specified type. -} ALARM_DATA_T; +} COMP_ALARM_STATUS_T; +/// Record structure for unsigned integer alarm data. +typedef struct +{ + U32 data; ///< Alarm data of unsigned integer type. +} ALARM_DATA_U32_T; + +/// Record structure for signed integer alarm data. +typedef struct +{ + S32 data; ///< Alarm data of signed integer type. +} ALARM_DATA_S32_T; + +/// Record structure for floating point alarm data. +typedef struct +{ + F32 data; ///< Alarm data of floating point type. +} ALARM_DATA_F32_T; + +/// Record structure for boolean alarm data. +typedef struct +{ + BOOL data; ///< Alarm data of boolean type. +} ALARM_DATA_BOOL_T; + +/// Record structure for alarm data of any supported type. +typedef union +{ + ALARM_DATA_U32_T uInt; ///< Alarm data of unsigned integer type. + ALARM_DATA_S32_T sInt; ///< Alarm data of signed integer type. + ALARM_DATA_F32_T flt; ///< Alarm data of floating point type. + ALARM_DATA_BOOL_T bln; ///< Alarm data of boolean type. +} ALARM_DATAS_T; + +/// Record structure for alarm data including the data type to aid in interpretation. +typedef struct +{ + ALARM_DATA_TYPES_T dataType; ///< The type of alarm data provided. + ALARM_DATAS_T data; ///< The alarm data of specified type. +} ALARM_DATA_T; + /// Payload record structure for the alarm triggered message. typedef struct { @@ -180,7 +180,7 @@ typedef struct { U32 alarmID; ///< Alarm ID. -} ALARM_ID_DATA_PUBLISH_T; +} ALARM_ID_DATA_PUBLISH_T; /// Alarm list request response payload record structure. typedef struct @@ -190,46 +190,47 @@ U32 activeAlarmList[ MAX_ALARM_LIST_SIZE ]; ///< Active Alarm List array. } ACTIVE_ALARM_LIST_RESPONSE_PAYLOAD_T; -// ********** public function prototypes ********** - -void initAlarmMgmt( void ); -void execAlarmMgmt( void ); - -void activateAlarmNoData( ALARM_ID_T alarm ); -void activateAlarm1Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData ); -void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2, BOOL outside ); +// ********** public function prototypes ********** + +void initAlarmMgmt( void ); +void execAlarmMgmt( void ); + +void activateAlarmNoData( ALARM_ID_T alarm ); +void activateAlarm1Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData ); +void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2, BOOL outside ); void clearAlarm( ALARM_ID_T alarm ); void clearAlarmCondition( ALARM_ID_T alarm ); void clearNoRetriggerFlag( void ); BOOL getNoRetriggerFlag( void ); -void setAlarmUserActionEnabled( ALARM_USER_ACTION_T action, BOOL enabled ); +void setAlarmUserActionEnabled( ALARM_USER_ACTION_T action, BOOL enabled ); void signalAlarmSilence( ALARM_SILENCE_CMD_T cmd ); void signalAlarmUserActionInitiated( ALARM_USER_ACTION_T action ); BOOL isAlarmActive( ALARM_ID_T alarm ); BOOL isAlarmConditionDetected( ALARM_ID_T alarm ); BOOL isAnyAlarmActive( void ); BOOL isBloodRecircBlocked( void ); BOOL isDialysateRecircBlocked( void ); +BOOL isRinseBackBlocked( void ); BOOL doesAlarmStatusIndicateStop( void ); BOOL doesAlarmIndicateNoResume( void ); BOOL doesAlarmStatusIndicateEndTxOnly( void ); -ALARM_PRIORITY_T getCurrentAlarmStatePriority( void ); +ALARM_PRIORITY_T getCurrentAlarmStatePriority( void ); BOOL isAlarmRecoverable( ALARM_ID_T alarm ); void setAlarmAudioVolume( U32 volumeLevel ); void handleActiveAlarmListRequest( void ); -void handleResendActiveAlarmsRequest( void ); +void handleResendActiveAlarmsRequest( void ); U32 getAlarmAudioVolume( void ); F32 getAlarmAudioPrimaryHighGainCurrent( void ); F32 getAlarmAudioPrimaryLowGainCurrent( void ); F32 getAlarmAudioBackupCurrent( void ); SELF_TEST_STATUS_T execAlarmAudioSelfTest( void ); void resetAlarmAudioPOSTState( void ); - -BOOL testSetAlarmStateOverride( U32 alarmID, BOOL value ); -BOOL testResetAlarmStateOverride( U32 alarmID ); -BOOL testSetAlarmStartOverride( U32 alarmID, U32 value ); + +BOOL testSetAlarmStateOverride( U32 alarmID, BOOL value ); +BOOL testResetAlarmStateOverride( U32 alarmID ); +BOOL testSetAlarmStartOverride( U32 alarmID, U32 value ); BOOL testResetAlarmStartOverride( U32 alarmID ); BOOL testClearAllAlarms( U32 key ); BOOL testSetAlarmStatusPublishIntervalOverride( U32 ms ); @@ -243,8 +244,8 @@ BOOL testSetPrimaryAlarmAudioCurrentLGOverride( F32 mA ); BOOL testResetPrimaryAlarmAudioCurrentLGOverride( void ); BOOL testSetBackupAlarmAudioCurrentOverride( F32 mA ); -BOOL testResetBackupAlarmAudioCurrentOverride( void ); - +BOOL testResetBackupAlarmAudioCurrentOverride( void ); + /**@}*/ -#endif +#endif