Index: HDDefs.h =================================================================== diff -u -rea3bf36d20d92e24829b2816bd4cc486dde3ef2b -rc17457e75bce15199acd967951319c7aedd177a1 --- HDDefs.h (.../HDDefs.h) (revision ea3bf36d20d92e24829b2816bd4cc486dde3ef2b) +++ HDDefs.h (.../HDDefs.h) (revision c17457e75bce15199acd967951319c7aedd177a1) @@ -53,14 +53,14 @@ { 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_BLOOD_FLOW, ///< Run Blood Flow test mode state POST_STATE_DIALYSATE_FLOW, ///< Run Dialysate Flow test mode state POST_STATE_ACCELEROMETER, ///< Run Accelerometer test mode state POST_STATE_VALVES, ///< Run Valves test mode state + POST_STATE_ALARM_LAMP, ///< Run alarm lamp 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 @@ -127,15 +127,43 @@ * @{ */ -/// Enumeration of pre-treatment mode states. -enum HD_Pre_Treatment_Mode_States +/// Enumeration of pre-treatment mode states (sub-mode). +enum 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 + PRE_TREATMENT_START_STATE = 0, ///< Start pre-treatment mode state + PRE_TREATMENT_WATER_SAMPLE_STATE, ///< Water sample state + PRE_TREATMENT_SELF_TEST_NO_CART_STATE, ///< Self tests with no cartridge state + PRE_TREATMENT_CART_INSTALL_STATE, ///< Consumable and cartridge installation state + PRE_TREATMENT_SELF_TEST_DRY_STATE, ///< Self tests dry-run state + PRE_TREATMENT_PRIME_STATE, ///< Prime both blood and dialysate circuits state + PRE_TREATMENT_SELF_TEST_WET_STATE, ///< Self tests wet-run state + PRE_TREATMENT_RECIRC_STATE, ///< Re-circulate blood and dialysate circuits state + PRE_TREATMENT_PATIENT_CONNECTION_STATE, ///< Patient connection state + NUM_OF_PRE_TREATMENT_STATES ///< Number of pre-treatment mode states }; -typedef enum HD_Pre_Treatment_Mode_States HD_PRE_TREATMENT_MODE_STATE_T; ///< Type for HD pre-treatment mode states enumeration +typedef enum Pre_Treatment_Mode_States PRE_TREATMENT_MODE_STATE_T; ///< Type for HD pre-treatment mode states enumeration /**@}*/ + +/** + * @addtogroup Prime + * @{ + */ + +/// Enumeration of prime sub-mode states. +enum Pre_Treatment_Prime_States +{ + PRIME_START_STATE = 0, ///< Prime start state + PRIME_SALINE_SETUP_STATE, ///< Saline setup state + PRIME_SALINE_PURGE_AIR_STATE, ///< Saline purge air state + PRIME_SALINE_CIRC_BLOOD_CIRCUIT_STATE, ///< Circulate blood circuit state + PRIME_RESERVOIR_ONE_FILL_COMPLETE_STATE, ///< Wait for reservoir 1 fill complete + PRIME_DIALYSATE_DIALYZER_STATE, ///< Dialysate dialyzer state + NUM_OF_PRIME_STATES ///< Number of prime sub-mode states +}; +typedef enum Pre_Treatment_Prime_States PRE_TREATMENT_PRIME_STATE_T; ///< Type for HD pre-treatment prime sub-mode states enumeration + +/**@}*/ /** * @addtogroup HDTreatmentMode @@ -149,11 +177,7 @@ 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) @@ -251,6 +275,42 @@ /**@}*/ /** + * @addtogroup Rinseback + * @{ + */ + +/// Enumeration of rinseback sub-mode states. +enum Rinseback_States +{ + RINSEBACK_STOP_INIT_STATE = 0, ///< Start state (stopped) of the rinseback sub-mode state machine + RINSEBACK_RUN_STATE, ///< Rinseback running state of the rinseback sub-mode state machine + RINSEBACK_PAUSED_STATE, ///< Rinseback paused state of the rinseback sub-mode state machine + RINSEBACK_STOP_STATE, ///< Rinseback stopped (done) state of the rinseback sub-mode state machine + RINSEBACK_RUN_ADDITIONAL_STATE, ///< Additional rinseback volume (10 mL) state of the rinseback sub-mode state machine + NUM_OF_RINSEBACK_STATES ///< Number of rinseback sub-mode states +}; +typedef enum Rinseback_States RINSEBACK_STATE_T; ///< Type for rinseback states enumeration. + +/**@}*/ + +/** + * @addtogroup TreatmentRecirc + * @{ + */ + +/// Enumeration of treatment re-circulation sub-mode states. +enum Treatment_Recirc_States +{ + TREATMENT_RECIRC_RECIRC_STATE = 0, ///< Re-circulate state of the treatment re-circulate sub-mode state machine + TREATMENT_RECIRC_UF_STATE, ///< Stopped state of the treatment re-circulate sub-mode state machine + NUM_OF_TREATMENT_RECIRC_STATES ///< Number of treatment re-circulate sub-mode states +}; +/// Type for treatment re-circulation states enumeration. +typedef enum Treatment_Recirc_States TREATMENT_RECIRC_STATE_T; + +/**@}*/ + +/** * @addtogroup HDTreatmentParamsMode * @{ */