Index: DGDefs.h =================================================================== diff -u --- DGDefs.h (revision 0) +++ DGDefs.h (revision 75d62d058dac89809b0f3d8f08f2eeed65a38e62) @@ -0,0 +1,215 @@ +/**********************************************************************//** + * + * Copyright (c) 2019-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 DGDefs.h + * + * @date 18-May-2020 + * @author S. Nash + * + * @brief header file containing DG definitions information. + * + **************************************************************************/ + +#ifndef __DG_DEFS_H__ +#define __DG_DEFS_H__ + +#include "Common.h" + +// ********** public definitions ********** + +/** + * @addtogroup DGOperationModes + * @{ + */ + +/// Enumeration of operation modes. These are in order of priority (highest to lowest). +typedef enum DG_Op_Modes +{ + DG_MODE_FAUL = 0, ///< Fault mode. + DG_MODE_SERV, ///< Service mode. + DG_MODE_INIT, ///< Initialization & POST mode. + DG_MODE_STAN, ///< Standby mode - connected to HD. + DG_MODE_SOLO, ///< Standby Solo mode - no HD connected. + DG_MODE_CIRC, ///< Re-circulate mode. + DG_MODE_FILL, ///< Fill mode. + DG_MODE_DRAI, ///< Drain mode. + DG_MODE_FLUS, ///< Flush mode. + DG_MODE_HEAT, ///< Heat Disinfect mode. + DG_MODE_CHEM, ///< Chemical Disinfect mode. + DG_MODE_NLEG, ///< Not legal - an illegal mode transition occurred. + NUM_OF_DG_MODES ///< Number of DG operation modes. +} DG_OP_MODE_T; + +/**@}*/ + +/** + * @addtogroup DGInitAndPOSTMode + * @{ + */ + +/// Enumeration of init & POST mode states. +typedef enum DG_POST_States +{ + DG_POST_STATE_START = 0, ///< Start initialize & POST mode state. + DG_POST_STATE_FPGA, ///< FPGA POST test state. + DG_POST_STATE_WATCHDOG, ///< Watchdog POST test state. + DG_POST_STATE_COMPLETED, ///< POST completed successfully state. + DG_POST_STATE_FAILED, ///< POST failed state. + NUM_OF_DG_POST_STATES ///< Number of initialize & POST mode states. +} DG_POST_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGFaultMode + * @{ + */ + +/// Enumeration of fault mode states. +typedef enum DG_Fault_States +{ + DG_FAULT_STATE_START = 0, ///< Start fault state. + NUM_OF_DG_FAULT_STATES ///< Number of fault mode states. +} DG_FAULT_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGSoloStandbyMode + * @{ + */ + +/// Enumeration of solo standby mode states. +typedef enum DG_Solo_States +{ + DG_SOLO_STANDBY_STATE_START = 0, ///< Start solo standby mode state. + NUM_OF_DG_SOLO_STANDBY_STATES ///< Number of solo standby mode states. +} DG_SOLO_STANDBY_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGStandbyMode + * @{ + */ + +/// Enumeration of standby mode states. +typedef enum DG_Standby_Mode_States +{ + DG_STANDBY_MODE_STATE_START = 0, ///< Start standby mode state. + DG_STANDBY_MODE_STATE_IDLE, ///< Idle standby mode state. + DG_STANDBY_MODE_STATE_SAMPLE_WATER, ///< Sample water standby mode state. + NUM_OF_DG_STANDBY_MODE_STATES ///< Number of standby mode states. +} DG_STANDBY_MODE_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGRecirculateMode + * @{ + */ + +/// Enumeration of re-circulation mode states. +typedef enum DG_Recirculate_Mode_States +{ + DG_RECIRCULATE_MODE_STATE_START = 0, ///< Start re-circulation mode state. + DG_RECIRCULATE_MODE_STATE_FLUSH_LINES, ///< Flush lines state. + DG_RECIRCULATE_MODE_STATE_RECIRC_WATER, ///< Re-circulate water state. + DG_RECIRCULATE_MODE_STATE_PAUSE, ///< Pause state (pumps, heaters, lamps off). + NUM_OF_DG_RECIRCULATE_MODE_STATES ///< Number of fill mode states. +} DG_RECIRCULATE_MODE_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGFillMode + * @{ + */ + +/// Enumeration of fill mode states. +typedef enum DG_Fill_Mode_States +{ + DG_FILL_MODE_STATE_START = 0, ///< Start fill mode state. + DG_FILL_MODE_STATE_DIALYSATE_PRODUCTION, ///< Dialysate production state. + DG_FILL_MODE_STATE_DELIVER_DIALYSATE, ///< Deliver dialysate state. + NUM_OF_DG_FILL_MODE_STATES ///< Number of fill mode states. +} DG_FILL_MODE_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGDrainMode + * @{ + */ + +/// Enumeration of drain mode states. +typedef enum DG_Drain_States +{ + DG_DRAIN_STATE_START = 0, ///< Start drain mode state. + DG_DRAIN_STATE_DRAIN, ///< Drain drain mode state. + NUM_OF_DG_DRAIN_STATES ///< Number of drain mode states. +} DG_DRAIN_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGFlushMode + * @{ + */ + +/// Enumeration of flush mode states. +typedef enum DG_Flush_States +{ + DG_FLUSH_STATE_START = 0, ///< Start flush mode state. + NUM_OF_DG_FLUSH_STATES ///< Number of flush mode states. +} DG_FLUSH_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGHeatDisinfectMode + * @{ + */ + +/// Enumeration of heat disinfection mode states. +typedef enum DG_Heat_States +{ + DG_HEAT_DISINFECT_STATE_START = 0, ///< Start heat disinfect mode state. + NUM_OF_DG_HEAT_DISINFECT_STATES ///< Number of heat disinfect mode states. +} DG_HEAT_DISINFECT_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGChemicalDisinfectMode + * @{ + */ + +/// Enumeration of chem. disinfect mode states. +typedef enum DG_Chem_States +{ + DG_CHEM_DISINFECT_STATE_START = 0, ///< Start chemical disinfect mode state. + NUM_OF_DG_CHEM_DISINFECT_STATES ///< Number of chemical disinfect mode states. +} DG_CHEM_DISINFECT_STATE_T; + +/**@}*/ + +/** + * @addtogroup DGServiceMode + * @{ + */ + +/// Enumeration of service mode states. +typedef enum DG_Service_States +{ + DG_SERVICE_STATE_START = 0, ///< Start service mode state. + NUM_OF_DG_SERVICE_STATES ///< Number of service mode states. +} DG_SERVICE_STATE_T; + +/**@}*/ + +#endif Index: HDDefs.h =================================================================== diff -u --- HDDefs.h (revision 0) +++ HDDefs.h (revision 75d62d058dac89809b0f3d8f08f2eeed65a38e62) @@ -0,0 +1,224 @@ +/**********************************************************************//** + * + * Copyright (c) 2019-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 HDDefs.h + * + * @date 29-May-2020 + * @author S. Nash + * + * @brief header file containing HD definitions information. + * + **************************************************************************/ + +#ifndef __HD_DEFS_H__ +#define __HD_DEFS_H__ + +#include "Common.h" + +// ********** public definitions ********** + +/** + * @addtogroup HDOperationModes + * @{ + */ + +/// Enumeration of operation modes. These are in order of priority (highest to lowest). +typedef enum HD_Op_Modes +{ + MODE_FAUL = 0, ///< Fault mode. + MODE_SERV, ///< Service mode. + MODE_INIT, ///< Initialization & POST mode. + MODE_STAN, ///< Standby mode. + MODE_TPAR, ///< Treatment Parameters mode. + MODE_PRET, ///< Pre-Treatment mode. + MODE_TREA, ///< Treatment mode. + MODE_POST, ///< Post-Treatment mode. + MODE_NLEG, ///< Not legal - an illegale mode transition occurred. + NUM_OF_MODES ///< Number of HD operation modes. +} HD_OP_MODE_T; + +/**@}*/ + +/** + * @addtogroup HDInitAndPOSTMode + * @{ + */ + +/// Enumeration of init & POST mode states. +typedef enum HD_POST_States +{ + POST_STATE_START = 0, ///< Start initialize & POST mode state. + POST_STATE_WATCHDOG, ///< Run watchdog test mode state. + POST_STATE_ALARM_LAMP, ///< Run alarm lamp test mode state. + POST_STATE_FPGA, ///< Run FPGA test mode state. + POST_STATE_RTC, ///< Run RTC test mode state. + POST_STATE_NVDATAMGMT, ///< Run NV Data Mgmt. test mode state. + POST_STATE_STUCK_BUTTON, ///< Run stuck button test mode state. + POST_STATE_COMPLETED, ///< POST self tests completed mode state. + POST_STATE_FAILED, ///< POST self tests failed mode state. + NUM_OF_POST_STATES ///< Number of initialize & POST mode states. +} HD_POST_STATE_T; + +/**@}*/ + +/** + * @addtogroup HDFaultMode + * @{ + */ + +/// Enumeration of fault mode states. +typedef enum HD_Fault_States +{ + HD_FAULT_STATE_START = 0, ///< Start fault state. + NUM_OF_HD_FAULT_STATES ///< Number of fault mode states. +} HD_FAULT_STATE_T; + +/**@}*/ + +/** + * @addtogroup HDStandbyMode + * @{ + */ + +/// Sub-mode states while in standby mode +typedef enum HD_Standby_States +{ + STANDBY_START_STATE = 0, ///< Start standby + STANDBY_FLUSH_DG_LINES_STATE, ///< + STANDBY_DRAIN_RESERVOIR_STATE, ///< + STANDBY_WAIT_FOR_PRIME_STATE, ///< + STANDBY_FILL_RESERVOIR_STATE, ///< + STANDBY_WAIT_FOR_TREATMENT_STATE, ///< + NUM_OF_STANDBY_STATES ///< Number of standby states (sub-modes). +} HD_STANDBY_STATE_T; + +/**@}*/ + +/** + * @addtogroup HDTreatmentParamsMode + * @{ + */ + +/// Enumeration of treatment parameters mode states. +typedef enum HD_Treatment_Parameters_Mode_States +{ + HD_TREATMENT_PARAMS_MODE_STATE_START = 0, ///< Start treatment params mode state. + NUM_OF_HD_TREATMENT_PARAMS_MODE_STATES ///< Number of treatment params mode states. +} HD_TREATMENT_PARAMS_MODE_STATE_T; + +/**@}*/ + +/** + * @addtogroup HDPreTreatmentMode + * @{ + */ + +/// Enumeration of pre-treatment mode states. +typedef enum HD_Pre_Treatment_Mode_States +{ + HD_PRE_TREATMENT_STATE_START = 0, ///< Start pre-treatment mode state. + NUM_OF_HD_PRE_TREATMENT_STATES ///< Number of pre-treatment mode states. +} HD_PRE_TREATMENT_MODE_STATE_T; + +/**@}*/ + +/** + * @addtogroup HDTreatmentMode + * @{ + */ + +/// Sub-mode states while in treatment mode +typedef enum Treatment_States +{ + TREATMENT_START_STATE = 0, ///< Start treatment, prime blood side with gradual ramp for 1 min. while dialyzer is bypassed. No dialysis or UF taking place. + TREATMENT_DIALYSIS_STATE, ///< Perform dialysis. Deliver Heparin as prescribed. Deliver UF as prescribed. Handle saline boluses as requested. + TREATMENT_STOP_STATE, ///< Treatment stopped. All pumps off. Dializer bypassed. + TREATMENT_RINSEBACK_STATE, ///< Perform rinseback with saline. Dialyzer bypassed. Dialysate recirculating. + TREATMENT_RINSEBACK_PAUSE_STATE, ///< Rinseback paused. Blood pump off. Dialyzer bypassed. Dialysate recirculating. + TREATMENT_RECIRC_SETUP_STATE, ///< Rinseback complete. Blood pump off. Blood lines closed. User to disconnect and shunt blood lines. + TREATMENT_RECIRC_STATE, ///< Recirculate saline and dialysate while patient disconnected. Blood lines open and shunted. Dialyzer is bypassed. + TREATMENT_RECIRC_PAUSE_STATE, ///< Recirculate paused. Blood pump off. Blood lines closed and shunted. Dialyzer is bypassed. + TREATMENT_RECIRC_STOP_STATE, ///< Recirculate stopped. Blood pump off. Blood lines open. Waiting for patient to unshunt and connect and resume treatment. + TREATMENT_DIALYSIS_END_STATE, ///< Dialysis has ended. Blood pump slowed. Dialyzer is bypassed. Dialysate is recirculated. User can rinseback. + TREATMENT_END_STATE, ///< Treatment has ended. All pumps off. Dialyzer is bypassed. Blood lines are closed. User to disconnect. + NUM_OF_TREATMENT_STATES ///< Number of treatment states (sub-modes). +} TREATMENT_STATE_T; + +/**@}*/ + +/** + * @addtogroup HDPostTreatmentMode + * @{ + */ + +/// Enumeration of post-treatment mode states. +typedef enum HD_Post_Treatment_Mode_States +{ + HD_POST_TREATMENT_STATE_START = 0, ///< Start post-treatment mode state. + NUM_OF_HD_POST_TREATMENT_STATES ///< Number of post-treatment mode states. +} HD_POST_TREATMENT_STATE_T; + +/**@}*/ + +/** + * @addtogroup HDServiceMode + * @{ + */ + +/// Enumeration of service mode states. +typedef enum HD_Service_States +{ + HD_SERVICE_STATE_START = 0, ///< Start service mode state. + NUM_OF_HD_SERVICE_STATES ///< Number of service mode states. +} HD_SERVICE_STATE_T; + +/**@}*/ + +/** + * @addtogroup Dialysis + * @{ + */ + +/// 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_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; + +/// 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; + +/**@}*/ + +#endif Index: MsgDefs.h =================================================================== diff -u -r008cbc4fc1a92c93560e0510d5bfbe3b175dd316 -r75d62d058dac89809b0f3d8f08f2eeed65a38e62 --- MsgDefs.h (.../MsgDefs.h) (revision 008cbc4fc1a92c93560e0510d5bfbe3b175dd316) +++ MsgDefs.h (.../MsgDefs.h) (revision 75d62d058dac89809b0f3d8f08f2eeed65a38e62) @@ -147,6 +147,9 @@ REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE, ///< Ultrafiltration volume is out of range. REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE, ///< Ultrafiltration rate is out of range. REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM, ///< Treatment time change is less than minimum treatment time. + REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS, ///< Ultrafiltration is not currently in progress. + REQUEST_REJECT_REASON_UF_NOT_PAUSED, ///< Ultrafiltration is not currently paused. + REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS, ///< A saline bolus is in progress. NUM_OF_REQUEST_REJECT_REASONS ///< Number of settings change reject codes. }; /// Type for settings change rejection reason codes enumeration.