Index: firmware/App/Services/Reservoirs.h =================================================================== diff -u -r1aeab08c1baf6445514b81fe51fc60a3e536e782 -reeb4e9c7c8ca2bc41168353c3d30f311080972b2 --- firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision 1aeab08c1baf6445514b81fe51fc60a3e536e782) +++ firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision eeb4e9c7c8ca2bc41168353c3d30f311080972b2) @@ -33,43 +33,60 @@ // ********** public definitions ********** #define MAX_RESERVOIR_VOLUME_ML 2000 ///< Maximum reservoir volume in mL. +#define RESERVOIR_EXTRA_TEMPERATURE 2.0 ///< Reservoirs extra margin temperature. -#pragma pack(push,1) - /// Fill command data structure. typedef struct { - U32 fillToVolumeMl; ///< Target volume to fill to (in mL) - U32 cmd; ///< General command (start/stop) + U32 fillToVolumeMl; ///< Target volume to fill to (in mL) + U32 cmd; ///< General command (start/stop) + F32 targetFlowLPM; ///< Target flow rate L/min } FILL_CMD_T; /// Drain command data structure. typedef struct { - U32 targetVolume; ///< Target volume to drain to (in mL) - BOOL tareLoadCell; ///< Flag to tare load call - BOOL rinseConcentrateLines; ///< Flag indicates to rinse concentrate lines or not - U32 cmd; ///< General command (start/stop) + U32 targetVolume; ///< Target volume to drain to (in mL) + BOOL tareLoadCell; ///< Flag to tare load call + BOOL rinseConcentrateLines; ///< Flag indicates to rinse concentrate lines or not + U32 cmd; ///< General command (start/stop) } DRAIN_CMD_T; /// DG command response data record. typedef struct { - U32 commandID; ///< The command DG is responding to - BOOL rejected; ///< Flag indicates if the command has been rejected - U32 rejectCode; ///< Reason code for rejecting the command + U32 commandID; ///< The command DG is responding to + BOOL rejected; ///< Flag indicates if the command has been rejected + U32 rejectCode; ///< Reason code for rejecting the command } DG_CMD_RESPONSE_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 +} DG_CMD_DIALYSATE_HEATING_PARAMS_T; + /// Reservoir data struct. typedef struct { - U32 activeReservoir; ///< Active reservoir ID - U32 fillToVolumeMl; ///< Volume target to fill to - U32 drainToVolumeMl; ///< Volume target to drain to + U32 activeReservoir; ///< Active reservoir ID + U32 fillToVolumeMl; ///< Volume target to fill to + U32 drainToVolumeMl; ///< Volume target to drain to + U32 timeReservoirCycleMS; ///< Reservoir cycle time in milliseconds + U32 timeReservoirFill2SwitchMS; ///< Reservoir fill to switch time in milliseconds + F32 timeUFDecayMS; ///< Ultrafilter temperature decay time in milliseconds + F32 tempUFFill; ///< Ultrafilter fill time in milliseconds + F32 tempReservoirUseActual; ///< Reservoir actual temperature + F32 tempReservoirEndFill; ///< Reservoir end fill temperature + F32 tempAvgFill; ///< Average fill temperature + F32 tempLastFill; ///< Last fill temperature + F32 timereservoirFill; ///< Reservoir fill time in milliseconds } RESERVOIR_DATA_T; -#pragma pack(pop) - // ********** public function prototypes ********** void initReservoirs( void ); @@ -79,7 +96,7 @@ void setActiveReservoirCmd( DG_RESERVOIR_ID_T resID ); // handle switch reservoirs command from HD void changeValveSettingCmd( DG_VALVE_SETTING_ID_T valveSettingID ); // handle valve setting change command from HD -void startFillCmd( U32 fillToVolMl ); // handle fill command from HD +void startFillCmd( U32 fillToVolMl, F32 fillTargetFlowLPM ); // handle fill command from HD void stopFillCmd( void ); // handle stop fill command from HD void startDrainCmd( DRAIN_CMD_T drainCmd ); // handle drain command from HD void stopDrainCmd( void ); // handle stop drain command from HD @@ -88,8 +105,15 @@ void resetReservoirsLowestWeight( void ); DG_RESERVOIR_ID_T getInactiveReservoir( void ); -F32 getReservoirWeight( DG_RESERVOIR_ID_T reservoirId ); +F32 getReservoirWeight( DG_RESERVOIR_ID_T reservoirId ); +void setDialysateHeatingParameters( DG_CMD_DIALYSATE_HEATING_PARAMS_T params ); +U32 getTargetFillVolumeML( void ); +F32 getTargetFillFlowRateLPM( void ); +F32 getReservoirActualTemperature( void ); +F32 getPrimaryHeaterTargetTemperature( void ); +F32 getTargetDialysateFlowLPM( void ); + DG_RESERVOIR_VOLUME_RECORD_T getReservoirsCalRecord( void ); BOOL hasTargetFillVolumeBeenReached( DG_RESERVOIR_ID_T reservoirId );