/************************************************************************** * * Copyright (c) 2024-2024 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 DialysatePumps.h * * @author (last) Vinayakam Mani * @date (last) 02-Sep-2024 * * @author (original) Vinayakam Mani * @date (original) 02-Sep-2024 * ***************************************************************************/ #ifndef __DIALYSATE_PUMPS_H__ #define __DIALYSATE_PUMPS_H__ #include "DDCommon.h" /** * @defgroup DialysatePumps DialysatePumps * @brief Dialysate Pumps monitor/controller module. Controls and monitors the dialysate pumps. * Dialysate pump manufacturer: Diener Silencer Series Gear Pumps, PN: 01483-PM-3-RA. * The pump shall produce flow rates of 350-2700 ml/min. * * @addtogroup DialysatePumps * @{ */ // ********** public definitions ********** #define MIN_DIALYSATE_PUMP_RPM 350 ///< Minimum RPM target for dialysate pump (though zero is allowed if turning pump off). #define MAX_DIALYSATE_PUMP_RPM 2650 ///< Maximum RPM target for dialysate pump. #define MIN_DIALYSATE_FLOW_RATE ( 100.0F ) ///< Minimum dialysate flow rate #define MAX_DIALYSATE_FLOW_RATE ( 600.0F ) ///< Maximum dialysate flow rate /// Enumeration of dialysate pumps. typedef enum DialysatePumps { D12_PUMP = 0, ///< Fresh dialysate pump DIALYSATE_PUMPS_FIRST = D12_PUMP, ///< First dialysate pump in list D48_PUMP, ///< Spent dialysate pump NUM_OF_DIALYSATE_PUMPS ///< Number of dialysate pumps } DIALYSATE_PUMPS_T; /// Dialysate pumps data publish typedef struct { F32 d12PumpTargetRPM; ///< Fresh dialysate pump speed set point. F32 d48PumpTargetRPM; ///< Spent dialysate pump speed set point. F32 d12PumpMeasuredSpeed; ///< Fresh dialysate pump measured speed. F32 d48PumpMeasuredSpeed; ///< Spent dialysate pump measured speed. F32 d12PumpCurrentSpeed; ///< Fresh dialysate pump current speed. F32 d48PumpCurrentSpeed; ///< Spent dialysate pump current speed. U32 d12PumpState; ///< Fresh dialysate pump state machine state. U32 d48PumpState; ///< Spent state machine state. F32 d12PumpTargetPressure; ///< Fresh dialysate pump target pressure. F32 d48PumpTargetPressure; ///< Spent dialysate pump target pressure. F32 d12PumpMeasuredPressure; ///< Fresh dialysate pump measured pressure. F32 d48PumpMeasuredPressure; ///< Spent dialysate pump measured pressure. F32 d12PumpMeasuredCurrent; ///< Fresh dialysate pump measured current. F32 d48PumpMeasuredCurrent; ///< Spent dialysate pump measured current. U32 d12PumpControl; ///< Fresh dialysate pump control to check run/stop state. U32 d48PumpControl; ///< Spent dialysate pump control to check run/stop state. U32 d12PumpDirErrCnt; ///< Fresh dialysate pump direction error count. U32 d48PumpDirErrCnt; ///< Spent dialysate pump direction error count. U32 d12PumpMeasuredDir; ///< Fresh dialysate pump direction. U32 d48PumpMeasuredDir; ///< Spent dialysate pump direction. } DIALYSATE_PUMPS_PUBLISH_DATA_T; // ********** public function prototypes ********** void initDialysatePump( void ); void execDialysatePumpMonitor( void ); void execDialysatePumpController( void ); SELF_TEST_STATUS_T execDialysatePumpSelfTest( void ); F32 getDialysatePumpTargetSpeed( DIALYSATE_PUMPS_T pumpId ); F32 getDialysatePumpMeasuredSpeed( DIALYSATE_PUMPS_T pumpId ); F32 getDialysatePumpTargetPressure( DIALYSATE_PUMPS_T pumpId ); F32 getDialysatePumpMeasuredCurrentA( DIALYSATE_PUMPS_T pumpId ); U32 getDialysatePumpMeasuredDirection( DIALYSATE_PUMPS_T pumpId ); BOOL isDialysatePumpOn( DIALYSATE_PUMPS_T pumpId ); void signalDialysatePumpHardStop( DIALYSATE_PUMPS_T pumpId ); BOOL setDialysatePumpTargetRPM( DIALYSATE_PUMPS_T pumpId, U32 rpm, BOOL isOpenLoopControlEnabled ); BOOL testDialysatePumpsDataPublishIntervalOverride( MESSAGE_T *message ); BOOL testDialysatePumpTargetSpeedOverride( MESSAGE_T *message ); BOOL testDialysatePumpMeasuredSpeedOverride( MESSAGE_T *message ); BOOL testDialysatePumpTargetPressureOverride( MESSAGE_T *message ); BOOL testDialysatePumpMeasuredCurrentOverride( MESSAGE_T *message ); BOOL testDialysatePumpMeasuredDirectionOverride( MESSAGE_T *message ); BOOL testDialysatePumpStartStopOverride( MESSAGE_T *message ); /**@}*/ #endif