Index: firmware/App/Modes/Dialysis.h =================================================================== diff -u -r07a5add2dff254f7be3699e4efac2b99d3554847 -re0e66d4c302c2aa43951ca316689ed4debbff1fb --- firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision 07a5add2dff254f7be3699e4efac2b99d3554847) +++ firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision e0e66d4c302c2aa43951ca316689ed4debbff1fb) @@ -1,4 +1,4 @@ -/************************************************************************** +/**********************************************************************//** * * Copyright (c) 2020 Diality Inc. - All Rights Reserved. * @@ -17,10 +17,69 @@ #ifndef __DIALYSIS_H__ #define __DIALYSIS_H__ +#include "HDCommon.h" + +/** + * @defgroup Dialysis Dialysis + * @brief Dialysis sub-mode of treatment mode. + * + * @addtogroup Dialysis + * @{ + */ + +// ********** 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; + +/// Enumeration of ultrafiltration states. +typedef enum UF_States +{ + 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_COMPLETED_OR_OFF_STATE, ///< Completed/off state of the ultrafiltration state machine. + NUM_OF_UF_STATES ///< Number of ultrafiltration states. +} UF_STATE_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; + +/// 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; + // ********** private function prototypes ********** -void initDialysis( void ); // initialize this module -void transitionToDialysis( void ); // prepares for transition to dialysis sub-mode -void execDialysis( void ); // execute the dialysis sub-mode state machine (call from ModeTreatment) +void initDialysis( void ); +void transitionToDialysis( void ); +void execDialysis( void ); +void setDialysisParams( U32 bPFlow, U32 dPFlow, F32 maxUFVol, F32 uFRate ); +void startDialysis( void ); +void stopDialysis( void ); + +DIALYSIS_STATE_T getDialysisState( void ); +UF_STATE_T getUltrafiltrationState( void ); + +BOOL pauseUF( void ); +BOOL resumeUF( void ); + +/**@}*/ + #endif