Index: firmware/App/Modes/Dialysis.h =================================================================== diff -u -rca8a81beba20b62acf98cea4d934354ce512bcfe -r8e7158d8231435496fcf1d5649e51babf859ccc7 --- firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision ca8a81beba20b62acf98cea4d934354ce512bcfe) +++ firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision 8e7158d8231435496fcf1d5649e51babf859ccc7) @@ -1,23 +1,25 @@ -/**********************************************************************//** - * - * Copyright (c) 2020 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 Dialysis.h - * - * @date 15-Jan-2020 - * @author S. Nash - * - * @brief Header file for Dialysis sub-mode. - * - **************************************************************************/ +/************************************************************************** +* +* Copyright (c) 2019-2021 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 Dialysis.h +* +* @author (last) Sean Nash +* @date (last) 01-Oct-2020 +* +* @author (original) Sean +* @date (original) 15-Jan-2020 +* +***************************************************************************/ #ifndef __DIALYSIS_H__ #define __DIALYSIS_H__ #include "HDCommon.h" +#include "HDDefs.h" /** * @defgroup Dialysis Dialysis @@ -29,59 +31,44 @@ // ********** public definitions ********** -/// Enumeration of dialysis sub-mode states. -typedef enum Dialysis_States -{ - DIALYSIS_START_STATE = 0, ///< Start state of the dialysis sub-mode state machine. - DIALYSIS_UF_STATE, ///< Ultrafiltration state of the dialysis sub-mode state machine. - DIALYSIS_SOLUTION_INFUSION_STATE, ///< Solution infusion state of the dialysis sub-mode state machine. - NUM_OF_DIALYSIS_STATES ///< Number of dialysis sub-mode states. -} DIALYSIS_STATE_T; +#pragma pack(push,1) -/// Enumeration of ultrafiltration states. -typedef enum UF_States +/// Payload record structure for a saline bolus data broadcast message. +typedef struct { - UF_START_STATE = 0, ///< Start state of the ultrafiltration state machine. - UF_PAUSED_STATE, ///< Paused state of the ultrafiltration state machine. - UF_RUNNING_STATE, ///< Running state of the ultrafiltration state machine. - UF_OFF_STATE, ///< Completed/off state of the ultrafiltration state machine. - UF_COMPLETED_STATE, ///< Completed state of ultrafiltration state machine. - NUM_OF_UF_STATES ///< Number of ultrafiltration states. -} UF_STATE_T; + U32 maxSalineVolumeMl; + F32 cumSalineVolumeMl; + F32 bolSalineVolumeMl; +} SALINE_BOLUS_DATA_PAYLOAD_T; -/// Enumeration of system message IDs. -typedef enum UF_Commands -{ - UF_CMD_PAUSE = 0, ///< Pause UF command. - UF_CMD_RESUME, ///< Resume UF command. - NUM_OF_UF_CMDS ///< Number of UF commands. -} UF_CMD_T; +#pragma pack(pop) -/// Enumeration of system message IDs. -typedef enum UF_Adjustments -{ - UF_ADJ_TREATMENT_TIME = 0, ///< Adjust treatment time to achieve new ultrafiltration volume. - UF_ADJ_UF_RATE, ///< Adjust UF rate to achieve new ultrafiltration volume. - NUM_OF_UF_ADJS ///< Number of UF adjustments. -} UF_ADJ_T; +// ********** public function prototypes ********** -// ********** private function prototypes ********** - void initDialysis( void ); +void resetSalineBolus( void ); void transitionToDialysis( void ); void execDialysis( void ); void setDialysisParams( U32 bPFlow, U32 dPFlow, F32 maxUFVol, F32 uFRate ); void startDialysis( void ); void stopDialysis( void ); +void signalStartSalineBolus( void ); +void signalAbortSalineBolus( void ); + DIALYSIS_STATE_T getDialysisState( void ); UF_STATE_T getUltrafiltrationState( void ); +SALINE_BOLUS_STATE_T getSalineBolusState( void ); F32 getUltrafiltrationVolumeCollected( void ); BOOL pauseUF( void ); BOOL resumeUF( void ); +void setStartReservoirVolume( void ); +void signalReservoirsSwitched( void ); +void setFinalReservoirVolume( void ); + /**@}*/ #endif