Index: Common.h =================================================================== diff -u -rd8db872b5c1a03ec99f342f92ca7942a04fc18e2 -r59871c9964559b5137781af9c2eeed6bab18ef73 --- Common.h (.../Common.h) (revision d8db872b5c1a03ec99f342f92ca7942a04fc18e2) +++ Common.h (.../Common.h) (revision 59871c9964559b5137781af9c2eeed6bab18ef73) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-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 Common.h * -* @author (last) Dara Navaei -* @date (last) 18-Oct-2022 +* @author (last) Sean Nash +* @date (last) 09-Aug-2023 * * @author (original) Sean * @date (original) 04-Feb-2020 @@ -209,7 +209,7 @@ dat1.data.uInt.data = (U32)(d1); \ dat2.dataType = ALARM_DATA_TYPE_U32; \ dat2.data.uInt.data = (U32)(d2); \ - activateAlarm2Data( a, dat1, dat2 ); \ + activateAlarm2Data( a, dat1, dat2, FALSE ); \ } /// Macro to set a specific alarm with 2 pieces of floating point alarm data. @@ -220,7 +220,7 @@ dat1.data.flt.data = (F32)(d1); \ dat2.dataType = ALARM_DATA_TYPE_F32; \ dat2.data.flt.data = (F32)(d2); \ - activateAlarm2Data( a, dat1, dat2 ); \ + activateAlarm2Data( a, dat1, dat2, FALSE ); \ } /// Record structure for unsigned integer event data. @@ -296,9 +296,18 @@ sendEvent( e, dat1, dat2 ); \ } -// **** Common Broadcast Data **** +// **** Common Data **** -#pragma pack(push,1) +#ifndef _RELEASE_ +/// Hardware configuration +typedef enum Hardware_Configurations +{ + HW_CONFIG_BETA = 1, ///< Hardware configuration beta + HW_CONFIG_DVT, ///< Hardware configuration DVT + NUM_OF_HW_CONFIGS, ///< Number of hardware configurations +} HARDWARE_CONFIG_T; +#endif + /// Heaters data structure. typedef struct { @@ -312,6 +321,9 @@ F32 primaryEfficiency; ///< Primary heater efficiency F32 primaryCalcTargetTemp; ///< Primary heater calculated target temperature F32 trimmerCalcCurrentTemp; ///< Trimmer heater calculated current temperature + U32 trimmerUseLastDC; ///< Trimmer heater use last duty cycle + F32 previsouFlow; ///< Trimmer heater previous flow L/min + U32 controlCounter; ///< Trimmer heater control count } HEATERS_DATA_T; /// Temperature sensors data structure. @@ -338,8 +350,21 @@ F32 interalTHDRTD; ///< THd RTD channel temperature sensor F32 internalCondSnsrTemp; ///< Conductivity Sensor internal temperature sensor F32 baroTempSensor; ///< Barometric temperature sensor + F32 dialysateInletMovingAvg; ///< Dialysate inlet moving average + F32 redundantOutletMovingAvg; ///< Redundant outlet moving average } TEMPERATURE_SENSORS_DATA_T; +/// Dialysate heating parameters +typedef struct +{ + F32 trimmerTargetTemperature; ///< Trimmer Target temperature. + U32 timeReservoirCycleMS; ///< Reservoir cycle time in milliseconds. + F32 timeReservoirFillMS; ///< Reservoir fill time in milliseconds. + U32 timeReservoirWait2SwitchMS; ///< Wait to switch active reservoir time in milliseconds. + F32 dialysateFlowLPM; ///< Dialysate flow rate in L/min. + BOOL usePriTargetTempEquation; ///< Use primary heater target temperature estimation equation or not. +} DG_CMD_DIALYSATE_HEATING_PARAMS_T; + /// Loadcell measurements struct. typedef struct { @@ -355,13 +380,96 @@ F32 ROFlowRateLPM; ///< RO flow rate in L/min. F32 ROFlowRateWithCPsLPM; ///< RO flow rate with concentrate pumps in L/min. F32 dialysateFlowRateLPM; ///< Dialysate flow rate L/min. + F32 RORawFlowRateLPM; ///< Raw RO flow rate in L/min. + F32 dialysateRawFlowRateLPM; ///< Raw dialysate flow rate in L/min. } FLOW_SENSORS_DATA_T; + +/// DG switch reservoirs command structure +typedef struct +{ + U32 reservoirID; ///< DG reservoir ID. + BOOL useLastTrimmerHeaterDC; ///< Use last trimmer heater duty cycle flag. +} DG_SWITCH_RSRVRS_CMD_T; + +/// DG change valve settings command structure +typedef struct +{ + U32 valveSettingCmd; ///< DG valve setting command. +} DG_VALVE_SETTING_CMD_REQUEST_T; + +/// DG fill command structure +typedef struct +{ + U32 fillToVolMl; ///< fill to volume in mL. + U32 cmd; ///< DG cmd. + F32 targetFlowRateLPM; ///< target flow rate in LPM. +} DG_FILL_CMD_T; + +/// DG start stop command structure +typedef struct +{ + BOOL start; ///< DG start stop cmd. + U32 acidType; ///< Acid type. + U32 bicarbType; ///< Bicarb type. +} DG_START_STOP_TX_CMD_REQUEST_T; + +/// DG start stop trimmer heater command structure +typedef struct +{ + BOOL start; ///< DG start stop trimmer heater. +} DG_START_STOP_TRIMMER_HEATER_CMD_T; + +typedef struct +{ + BOOL start; ///< DG start stop flush mode. +} DG_FLUSH_MODE_CMD_T; + +typedef struct +{ + BOOL start; ///< DG start stop heat disinfection mode. +} DG_HEAT_DISINFECTION_MODE_CMD_T; + +typedef struct +{ + BOOL start; ///< DG start stop chem disinfection mode. +} DG_CHEM_DISINFECTION_MODE_CMD_T; + +typedef struct +{ + U32 cmd; ///< DG sample water command. +} DG_SAMPLE_WATER_CMD_REQUEST_T; + +#pragma pack(push, 1) +/// DG usage info structure. +typedef struct +{ + F32 roWaterGenTotalL; ///< Total RO water generated in liters. (Cannot be reset) + F32 roWaterGenSinceLastServiceL; ///< RO water generated since last treatment in liters. + U32 lastBasicFlushCompleteDateEpoch; ///< Last basic flush complete date in epoch. + U32 lastChemDisStartDateEpoch; ///< Last chemical disinfect start date in epoch. + U32 lastChemDisCompleteDateEpoch; ///< Last chemical disinfect complete date in epoch. + U32 lastChemDisFlushCompleteDateEpoch; ///< Last chemical disinfect flush complete date in epoch. + U32 lastHeatDisCompleteDateEpoch; ///< Last heat disinfect complete date in epoch. + U32 lastHeatActiveCoolCompleteDateEpoch; ///< Last heat disinfect active cool complete date in epoch. + U32 lastFilterFlushCompleteDateEpoch; ///< Last filter flush complete date in epoch. + U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. + U16 crc; ///< CRC for the DG usage info structure. +} DG_USAGE_INFO_RECORD_T; + +/// DG service record structure +typedef struct +{ + U08 serviceLoc; ///< DG service location. + U32 lastServiceEpochDate; ///< DG last service date in epoch. + U32 serviceIntervalSeconds; ///< DG service interval in seconds. + U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. + U16 crc; ///< CRC for the DG service record structure. +} DG_SERVICE_RECORD_T; #pragma pack(pop) // **** VectorCAST Definitions **** #ifdef _VECTORCAST_ - #define _enable_IRQ() #define _disable_IRQ() #define _enable_FIQ()