Index: firmware/App/Services/DDInterface.h =================================================================== diff -u -rda59fa4a98dbc11c37677e92a66aa940d251678f -r222b05e39082f727dcfa2d144fa6e040501882f0 --- firmware/App/Services/DDInterface.h (.../DDInterface.h) (revision da59fa4a98dbc11c37677e92a66aa940d251678f) +++ firmware/App/Services/DDInterface.h (.../DDInterface.h) (revision 222b05e39082f727dcfa2d144fa6e040501882f0) @@ -14,23 +14,23 @@ * @date (original) 01-Aug-2024 * ***************************************************************************/ - -#ifndef __DD_INTERFACE_H__ -#define __DD_INTERFACE_H__ - + +#ifndef __DD_INTERFACE_H__ +#define __DD_INTERFACE_H__ + #include "TDCommon.h" #include "TDDefs.h" -#include "DDDefs.h" - -/** - * @defgroup DDInterface DDInterface - * @brief DD interface & monitor unit. Interfaces with and monitors the - * DD (dialysate delivery) sub-system. - * - * @addtogroup DDInterface - * @{ - */ - +#include "DDDefs.h" + +/** + * @defgroup DDInterface DDInterface + * @brief DD interface & monitor unit. Interfaces with and monitors the + * DD (dialysate delivery) sub-system. + * + * @addtogroup DDInterface + * @{ + */ + // ********** public definitions ********** /// DD command response data record structure. @@ -41,32 +41,45 @@ U32 rejectCode; ///< Reason code for rejecting the command } DD_CMD_RESPONSE_T; -// ********** public function prototypes ********** - +/// DD ultrafiltration broadcast data (matches DD UF_DATA_T layout). +typedef struct +{ + U32 ufExecState; ///< Ultrafiltration execution state + F32 ufRate; ///< Ultrafiltration rate from TD + F32 compUFrate; ///< Compensated UF rate + U32 isUFRequested; ///< Ultrafiltration run or pause request + F32 ufVolumeDeliveredMl; ///< UF volume delivered in mL +} DD_UF_DATA_T; + +// ********** public function prototypes ********** + void initDDInterface( void ); void resetDDInterface( void ); void execDDInterfaceMonitor( void ); DD_OP_MODE_T getDDOpMode( void ); -U32 getDDSubMode( void ); +U32 getDDSubMode( void ); F32 getDialysatePressure( void ); BOOL getDialysateGoodToDeliverStatus( void ); +F32 getDDUFVolumeDeliveredLiters( void ); BOOL setDDOpMode( MESSAGE_T *message ); BOOL setDialysateData( MESSAGE_T *message ); +BOOL setUFData( MESSAGE_T *message ); BOOL setDialysatePressure( MESSAGE_T *message ); void cmdStartPreGenerateDialysate( F32 qd, F32 dialTemp, F32 acidConvFactor, F32 bicarbConvFactor, U32 sodium, U32 bicarbonate ); -void cmdStartGenerateDialysate( F32 qd, F32 quf, F32 dialTemp, BOOL bypass, F32 acidConvFactor, F32 bicarbConvFactor, U32 sodium, U32 bicarbonate ); +void cmdStartGenerateDialysate( F32 qd, F32 quf, F32 dialTemp, U32 genDialysateState, F32 acidConvFactor, F32 bicarbConvFactor, U32 sodium, U32 bicarbonate ); void cmdChangeQd( F32 qd ); void cmdChangeQuf( F32 quf ); +void cmdSetGenDialysateState( U32 genDialysateState ); void cmdBypassDialyzer( BOOL bypass ); -void cmdStopGenerateDialysate( void ); +void cmdStopGenerateDialysate( void ); void handleDDCommandResponse( DD_CMD_RESPONSE_T *ddCmdRespPtr ); BOOL getDDCommandResponse( U32 commandID, DD_CMD_RESPONSE_T *cmdRespPtr ); -/**@}*/ - -#endif +/**@}*/ + +#endif