Index: firmware/App/Services/TDInterface.c =================================================================== diff -u -rb6d20d9e5c704a9f7ebceea9bb12731dac61fc2a -rbbd8ef64eb4b178ca76a9721908fee7347a71c6a --- firmware/App/Services/TDInterface.c (.../TDInterface.c) (revision b6d20d9e5c704a9f7ebceea9bb12731dac61fc2a) +++ firmware/App/Services/TDInterface.c (.../TDInterface.c) (revision bbd8ef64eb4b178ca76a9721908fee7347a71c6a) @@ -39,12 +39,12 @@ // TD status static TD_OP_MODE_T tdCurrentOpMode; ///< Current TD operation mode. static U32 tdSubMode; ///< Current state (sub-mode) of current TD operation mode. -static F32 tdDialysisFlowrate; ///< TD dialysis flow rate +static F32 tdDialysateFlowrate; ///< TD dialysate flow rate static F32 tdUFRate; ///< TD ultrafilteration rate static F32 tdTargetDialysateTemp; ///< TD target dialysate temperature static BOOL tdDialyzerBypass; ///< TD dialyzer bypass -static U32 tdAcidType; ///< TD Acid type -static U32 tdBiCarbType; ///< TD Bicarb type +static DD_ACID_TYPES_T tdAcidType; ///< TD Acid type. +static DD_BICARB_TYPES_T tdBicarbType; ///< TD Bicarb type. static BOOL tdOpModeDataFreshFlag = FALSE; ///< Flag to signal/process fresh TD op mode data @@ -54,22 +54,22 @@ /*********************************************************************//** * @brief - * The initTDInterface function initializes the TDInterface unit. + * The initTDInterface function initializes the TD Interface unit. * @details \b Inputs: none - * @details \b Outputs: TDInterface unit initialized. + * @details \b Outputs: TD Interface unit initialized. * @return none *************************************************************************/ void initTDInterface( void ) { // Initialize unit variables tdCurrentOpMode = MODE_INIT; tdSubMode = 0; - tdDialysisFlowrate = TD_MAX_DIALYSIS_FLOW_RATE; // Will update later based on the TD value + tdDialysateFlowrate = TD_MAX_DIALYSIS_FLOW_RATE; // Will update later based on the TD value tdUFRate = 0.0F; tdTargetDialysateTemp = 0.0F; tdDialyzerBypass = FALSE; - tdAcidType = 0; - tdBiCarbType = 0; + tdAcidType = ACID_08_1251_1; + tdBicarbType = BICARB_08_677753_0; } /**********************************************************************//** @@ -171,15 +171,86 @@ /*********************************************************************//** * @brief - * The getTDDialysateFlowrate function gets the latest TD dialysis flow + * The setTDDialysateFlowrate function sets the latest TD dialysate flow * rate. - * @details \b Inputs: tdDialysisFlowrate + * @details \b Inputs: none + * @details \b Outputs: tdDialysateFlowrate + * @param dialysate flow rate. + * @return none. + *************************************************************************/ +void setTDDialysateFlowrate( F32 dialFlowrate ) +{ + tdDialysateFlowrate = dialFlowrate; +} + +/*********************************************************************//** + * @brief + * The setTDUFRate function sets the latest TD UF rate. + * @details \b Inputs: none + * @details \b Outputs: tdUFRate + * @param ultrafilteration flow rate. + * @return none. + *************************************************************************/ +void setTDUFRate( F32 ufRate ) +{ + tdUFRate = ufRate; +} + +/*********************************************************************//** + * @brief + * The setTDTargetDialysateTemperature function sets the latest TD dialysate + * temperature. + * @details \b Inputs: none + * @details \b Outputs: tdTargetDialysateTemp + * @param Target dialysate temperature. + * @return none. + *************************************************************************/ +void setTDTargetDialysateTemperature( F32 dialTemperature ) +{ + tdTargetDialysateTemp = dialTemperature; +} + +/*********************************************************************//** + * @brief + * The setTDDialyzerBypass function sets the latest TD dialyzer bypass + * enable. + * @details \b Inputs: none + * @details \b Outputs: tdDialyzerBypass + * @param Dialyzer Bypass enable. + * @return none. + *************************************************************************/ +void setTDDialyzerBypass( F32 dialBypass ) +{ + tdDialyzerBypass = dialBypass; +} + +/*********************************************************************//** + * @brief + * The setTDAcidAndBicarbType function sets the acid and bicarb types to be + * used in dialysate generation. + * @details \b Inputs: none + * @details \b Outputs: tdAcidType,tdBicarbType + * @param acid which is the type of acid + * @param bicarb which is the type of bicarb + * @return none + *************************************************************************/ +void setTDAcidAndBicarbType( U32 acid, U32 bicarb ) +{ + tdAcidType = (DD_ACID_TYPES_T)acid; + tdBicarbType = (DD_BICARB_TYPES_T)bicarb; +} + +/*********************************************************************//** + * @brief + * The getTDDialysateFlowrate function gets the latest TD dialysate flow + * rate. + * @details \b Inputs: tdDialysateFlowrate * @details \b Outputs: none - * @return Latest TD dialysis flow rate. + * @return Latest TD dialysate flow rate. *************************************************************************/ F32 getTDDialysateFlowrate( void ) { - return tdDialysisFlowrate; + return tdDialysateFlowrate; } /*********************************************************************//** @@ -210,8 +281,8 @@ /*********************************************************************//** * @brief - * The getTDDialyzerBypass function gets the latest TD - * dailyzer bypass valve enable flag. + * The getTDDialyzerBypass function gets the latest TD dailyzer bypass valve + * enable flag. * @details \b Inputs: tdDialyzerBypass * @details \b Outputs: none * @return Latest dialyzer bypass valve enable. @@ -221,6 +292,32 @@ return tdDialyzerBypass; } +/*********************************************************************//** + * @brief + * The getTDAcidConcentrateType function gets the latest Acid concentrate + * type. + * @details \b Inputs: tdAcidType + * @details \b Outputs: none + * @return Latest acid concentrate type. + *************************************************************************/ +DD_ACID_TYPES_T getTDAcidConcentrateType( void ) +{ + return tdAcidType; +} + +/*********************************************************************//** + * @brief + * The getTDBicarbConcentrateType function gets the latest Bicarb concentrate + * type. + * @details \b Inputs: tdBicarbType + * @details \b Outputs: none + * @return Latest bicarb concentrate type. + *************************************************************************/ +DD_BICARB_TYPES_T getTDBicarbConcentrateType( void ) +{ + return tdBicarbType; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/