Index: Common.h =================================================================== diff -u -r193839467da470a839ec2f2a3a04d7ed1a2ad837 -r2f7217131cfe6d5c53a7df934a6f202b00177811 --- Common.h (.../Common.h) (revision 193839467da470a839ec2f2a3a04d7ed1a2ad837) +++ Common.h (.../Common.h) (revision 2f7217131cfe6d5c53a7df934a6f202b00177811) @@ -8,7 +8,7 @@ * @file Common.h * * @author (last) Dara Navaei -* @date (last) 21-May-2022 +* @date (last) 03-Aug-2022 * * @author (original) Sean * @date (original) 04-Feb-2020 @@ -34,6 +34,7 @@ typedef float F32; ///< 32-bit floating point type typedef double F64; ///< 64-bit floating point type +typedef unsigned long long U64; ///< 64-bit unsigned integer type typedef unsigned int U32; ///< 32-bit unsigned integer type typedef int S32; ///< 32-bit signed integer type typedef unsigned short U16; ///< 16-bit unsigned integer type @@ -86,7 +87,7 @@ // **** Common Definitions **** #define NEARLY_INFINITY 1.0E20 ///< Value that is nearly infinity. -#define NEARLY_ZERO 0.00000001 ///< Value that is nearly zero. Used for floating point zero comparisons (e.g. divide by zero checks) +#define NEARLY_ZERO 0.00000001F ///< Value that is nearly zero. Used for floating point zero comparisons (e.g. divide by zero checks) #define HEX_64_K 0x10000 ///< 64K (65536 in decimal) #define HEX_32_BIT_FULL_SCALE 0xFFFFFFFF ///< 32-bit full scale value #define MASK_OFF_MSB 0x00FF ///< Bits to mask off the most significant byte of a 2-byte word @@ -120,6 +121,8 @@ #define BITS_12_FULL_SCALE 4096 ///< Full scale range for 12 bit ADC or DAC #define BITS_14_FULL_SCALE 16384 ///< Full scale range for 14 bit ADC or DAC #define BITS_16_FULL_SCALE 65536 ///< Full scale range for 16 bit ADC or DAC +#define BITS_24_FULL_SCALE 16777216 ///< Full scale range for 24 bit ADC or DAC +#define HALF 0.5F ///< Half // **** Common Macros **** @@ -252,6 +255,58 @@ sendEvent( e, dat1, dat2 ); \ } +// **** Common Broadcast Data **** + +#pragma pack(push,1) +/// Heaters data structure. +typedef struct +{ + F32 mainPrimayHeaterDC; ///< Main primary heater DC + F32 smallPrimaryHeaterDC; ///< Small primary heater DC + F32 trimmerHeaterDC; ///< Trimmer heater DC + F32 primaryTargetTemp; ///< Primary heater target temperature + F32 trimmerTargetTemp; ///< Trimmer heater target temperature + U32 primaryHeaterState; ///< Primary heater state + U32 trimmerHeaterState; ///< Trimmer heater state + F32 primaryEfficiency; ///< Primary heater efficiency + F32 primaryCalcTargetTemp; ///< Primary heater calculated target temperature + F32 trimmerCalcCurrentTemp; ///< Trimmer heater calculated current temperature +} HEATERS_DATA_T; + +/// Temperature sensors data. +typedef struct +{ + F32 inletPrimaryHeater; ///< Inlet primary heater temperature sensor + F32 heatDisinfect; ///< Heat Disinfect temperature sensor + F32 outletPrimaryHeater; ///< Outlet primary heater temperature sensor + F32 conductivitySensor1; ///< Conductivity sensor 1 temperature sensor + F32 conductivitySensor2; ///< Conductivity sensor 2 temperature sensor + F32 outletRedundant; ///< Outlet redundant temperature sensor + F32 inletDialysate; ///< Inlet dialysate temperature sensor + F32 primaryHeaterThermocouple; ///< Primary heaters thermocouple sensor + F32 trimmerHeaterThermocouple; ///< Trimmer heater thermocouple sensor + F32 priamyHeaterColdjunction; ///< Primary heaters cold junction temperature sensor + F32 trimmerHeaterColdjunction; ///< Trimmer heater cold junction temperature sensor + F32 primaryHeaterInternal; ///< Primary heaters internal temperature (calculated from thermocouple and cold junction) + F32 trimmerHeaterInternal; ///< Trimmer heater internal temperature (calculated from thermocouple and cold junction) + F32 fpgaBoard; ///< FPGA board temperature sensor + F32 loadCellA1B1; ///< Load cell A1/B1 temperature sensor + F32 loadCellA2B2; ///< Load cell A2/B2 temperature sensor + F32 internalTHDORTD; ///< THDo RTD channel temperature sensor + F32 internalTDIRTD; ///< TDI RTD channel temperature sensor + F32 internalCondSnsrTemp; ///< Conductivity Sensor internal temperature sensor +} TEMPERATURE_SENSORS_DATA_T; + +/// Loadcell measurements struct. +typedef struct +{ + F32 loadCellA1inGram; ///< Loadcell A1 measurement in gram + F32 loadCellA2inGram; ///< Loadcell A2 measurement in gram + F32 loadCellB1inGram; ///< Loadcell B1 measurement in gram + F32 loadCellB2inGram; ///< Loadcell B2 measurement in gram +} LOAD_CELL_DATA_T; +#pragma pack(pop) + // **** VectorCAST Definitions **** #ifdef _VECTORCAST_