Index: Utilities.h =================================================================== diff -u -rba25a0ba6b7f7cf1abe752543746c05a16740964 -r527e5b84c94f89391b3c9023066f5a1bda270afc --- Utilities.h (.../Utilities.h) (revision ba25a0ba6b7f7cf1abe752543746c05a16740964) +++ Utilities.h (.../Utilities.h) (revision 527e5b84c94f89391b3c9023066f5a1bda270afc) @@ -28,6 +28,7 @@ // ********** public definitions ********** +// ******* Time Windowed Count Definitions ********* #define MAX_TIME_WINDOWED_COUNT 5 ///< Maximum # of counts that a time windowed count can count to. /// Enumeration of time-windowed counts. @@ -48,13 +49,41 @@ #endif NUM_OF_TIME_WINDOWED_COUNTS ///< Number of pressure sensors. } TIME_WINDOWED_COUNT_T; - + +// ******* Critical Data Definitions ********* +/// Critical data types list. +typedef enum Critical_Data_Types +{ + CRITICAL_DATA_TYPE_U32 = 0, ///< Critical data is unsigned 32-bit integer type + CRITICAL_DATA_TYPE_F32, ///< Critical data is 32-bit floating point type + NUM_OF_CRITICAL_DATA_TYPES ///< Total number of critical data types. +} CRITICAL_DATA_TYPES_T; + +/// Record structure for alarm data of any supported type. +typedef union +{ + U32 uInt; ///< critical data of unsigned integer type. + F32 flt; ///< critical data of floating point type. +} CRITICAL_DATAS_T; + +/// critical integer data structure. +typedef struct +{ + CRITICAL_DATA_TYPES_T typ; ///< Type of data + CRITICAL_DATAS_T data; ///< Data value + U32 comp; ///< One's compliment of value + BOOL set; ///< Flag indicates data has been set +} CRITICAL_DATA_T; + // ********** public function prototypes ********** U16 crc16( const U08 *address, U32 len ); U08 crc8( const U08 *address, U32 len ); void initTimeWindowedCount( TIME_WINDOWED_COUNT_T cnt, U32 maxCnt, U32 winMs ); -BOOL incTimeWindowedCount( TIME_WINDOWED_COUNT_T cnt ); +BOOL incTimeWindowedCount( TIME_WINDOWED_COUNT_T cnt ); +CRITICAL_DATAS_T getCriticalData( CRITICAL_DATA_T *data ); +void setCriticalData( CRITICAL_DATA_T *data, CRITICAL_DATAS_T value ); +void resetCriticalData( CRITICAL_DATA_T *data ); /**@}*/