Index: firmware/App/Modes/ModeTreatmentParams.h =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -rde169e7374f6c7a737995ac8c6c3953dc5c75aa7 --- firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision de169e7374f6c7a737995ac8c6c3953dc5c75aa7) @@ -20,6 +20,7 @@ #include "HDCommon.h" #include "HDDefs.h" +#include "Utilities.h" /** * @defgroup HDTreatmentParamsMode HDTreatmentParamsMode @@ -29,12 +30,62 @@ * @{ */ -// ********** private function prototypes ********** +// ********** public definitions ********** -void initTreatParamsMode( void ); // initialize this module -void transitionToTreatParamsMode( void ); // prepares for transition to treatment parameters mode -U32 execTreatParamsMode( void ); // execute the treatment parameters mode state machine (call from OperationModes) +/// Record structure for a treatment parameters payload. +typedef struct +{ + U32 bloodFlowRate_mL_min; + U32 dialysateFlowRate_mL_min; + U32 treatmentDuration_min; + U32 heparinPreStop_min; + U32 salineBolusVolume_mL; + U32 acidConcentrate; + U32 bicarbConcentrate; + U32 dialyzerType; + U32 bloodPressureMeasurementInterval_min; + U32 rinsebackFlowRate_mL_min; + S32 arterialPressureLowLimit_mmHg; + S32 arterialPressureHighLimit_mmHg; + S32 venousPressureLowLimit_mmHg; + S32 venousPressureHighLimit_mmHg; + F32 heparinDispenseRate_mL_hr; + F32 heparinBolusVolume_mL; + F32 dialysateTemperature_degC; +} TREATMENT_PARAMS_DATA_PAYLOAD_T; +/// Record structure for adjustable treatment parameters +typedef struct +{ + U32 bloodFlowRate_mL_min; + U32 dialysateFlowRate_mL_min; + U32 treatmentDuration_min; + S32 arterialPressureLowLimit_mmHg; + S32 arterialPressureHighLimit_mmHg; + S32 venousPressureLowLimit_mmHg; + S32 venousPressureHighLimit_mmHg; + F32 uFVolume_L; +} ADJ_TREATMENT_PARAMS_T; + +// ********** public function prototypes ********** + +void initTreatParamsMode( void ); // initialize this module +void transitionToTreatParamsMode( void ); // prepares for transition to treatment parameters mode +U32 execTreatParamsMode( void ); // execute the treatment parameters mode state machine (call from OperationModes) + +BOOL validateAndSetTreatmentParameters( TREATMENT_PARAMS_DATA_PAYLOAD_T params ); // user provided treatment params to be set and validated +BOOL signalUserConfirmationOfTreatmentParameters( void ); // User has confirmed treatment parameters +BOOL signalUserCancelTreatment( void ); // User has cancelled treatment + +BOOL setTreatmentParameterU32( TREATMENT_PARAM_T param, U32 value ); // Set a specified unsigned integer treatment parameter value +BOOL setTreatmentParameterS32( TREATMENT_PARAM_T param, S32 value ); // Set a specified signed integer treatment parameter value +BOOL setTreatmentParameterF32( TREATMENT_PARAM_T param, F32 value ); // Set a specified floating point treatment parameter value +U32 getTreatmentParameterU32( TREATMENT_PARAM_T param ); // Get a specified unsigned integer treatment parameter +S32 getTreatmentParameterS32( TREATMENT_PARAM_T param ); // Get a specified signed integer treatment parameter +F32 getTreatmentParameterF32( TREATMENT_PARAM_T param ); // Get a specified floating point treatment parameter + +BOOL testSetTreatmentParameter( TREATMENT_PARAM_T param, CRITICAL_DATAS_T value ); // Set a specific treatment parameter value + /**@}*/ #endif