/************************************************************************** * * 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 PistonPumpControl.h * * @author (last) Vinayakam Mani * @date (last) 07-Jan-2025 * * @author (original) Vinayakam Mani * @date (original) 07-Jan-2025 * ***************************************************************************/ #ifdef __PUMPTEST__ #ifndef __PISTON_PUMP_CONTROL_H__ #define __PISTON_PUMP_CONTROL_H__ #include "DDCommon.h" #include "DDDefs.h" /** * @defgroup PistonPumpControl PistonPumpControl * @brief PistonPumpControl unit. Performs Dosing and ultrafilteration functions via a state machine. * * @addtogroup PistonPumpControl * @{ */ // ********** public definitions ********** /// Enumeration of piston pumps. typedef enum PistonPump { PISTONPUMPS_ACID = 0, ///< Acid piston pump PISTONPUMPS_FIRST = PISTONPUMPS_ACID, ///< First piston pump in list PISTONPUMPS_BICARB, ///< Bicarbonate piston pump PISTONPUMPS_UF, ///< Ultrafilteration piston pump NUM_OF_PISTON_PUMPS ///< Number of piston pumps } PISTON_PUMPS_T; /// piston pump control data structure typedef struct { U32 acidPumpControlExecState; ///< Acid piston pump control execution state U32 bicarbPumpControlExecState; ///< Bicarb piston pump control execution state U32 ufPumpControlExecState; ///< UF piston pump control execution state U32 acidPistonPumpSwCounter; ///< Acid piston pump switching counter U32 bicarbPistonPumpSwCounter; ///< Bicarb piston pump switching counter U32 ufPistonPumpSwCounter; ///< UF piston pump switching counter U32 acidPistonPumpCycleCount; ///< Acid piston cycle count U32 bicarbPistonPumpCycleCount; ///< Bicarb piston cycle count U32 ufPistonPumpCycleCount; ///< UF piston cycle count } PISTON_PUMP_CONTROL_DATA_T; // ********** public function prototypes ********** void initPistonPump( void ); // Initialize piston pump control unit void execPistonPumpController( void ); // Execute the piston pump control state machine void startPistonPumpCycle( PISTON_PUMPS_T pumpId, U32 cycleCount, F32 targetVolume_ml, F32 speed ); // Set the piston pump parameters void stopPistonPumpCycle( PISTON_PUMPS_T pumpId ); // Stop the piston pump BOOL testDDPistonPumpControlDataPublishIntervalOverride( MESSAGE_T *message ); // To override the piston pump control data publish interval BOOL testDDPistonPumpStartStopOverride( MESSAGE_T *message ); // To override the piston pump start/stop control /**@}*/ #endif #endif