Index: firmware/App/Controllers/ROPump.h =================================================================== diff -u -r138efd92a8645e0d2fe422409ef5a33dd2929a25 -r599bf09c73fca5e18a55e750133ac2eb93dd2c51 --- firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision 138efd92a8645e0d2fe422409ef5a33dd2929a25) +++ firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision 599bf09c73fca5e18a55e750133ac2eb93dd2c51) @@ -1,51 +1,87 @@ -/************************************************************************** - * - * Copyright (c) 2019-2020 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 ROPump.h - * - * @date 03-Apr-2020 - * @author S. Nash - * - * @brief ROPump header file. - * - **************************************************************************/ - -#ifndef __RO_PUMP_H__ -#define __RO_PUMP_H__ - -#include "DGCommon.h" - -// ********** public definitions ********** - -#define MAX_RO_PRESSURE 140 // PSI -#define MIN_RO_PRESSURE 100 // PSI - -// ********** public function prototypes ********** - -void initROPump( void ); -void execROPumpMonitor( void ); -void execROPumpController( void ); - -BOOL setROPumpTargetPressure( U32 flowRate, PUMP_CONTROL_MODE_T mode ); -void signalROPumpHardStop( void ); - -SELF_TEST_STATUS_T execROPumpTest( void ); - -DATA_GET_PROTOTYPE( S32, getTargetROPressure ); -DATA_GET_PROTOTYPE( F32, getMeasuredROPressure); -DATA_GET_PROTOTYPE( F32, getMeasuredROPumpSpeed ); - -BOOL testSetROPumpDataPublishIntervalOverride( U32 value ); -BOOL testResetROPumpDataPublishIntervalOverride( void ); -BOOL testSetTargetROPressureOverride( S32 value ); -BOOL testResetTargetROPressureOverride( void ); -BOOL testSetMeasuredROPressureOverride( F32 value ); -BOOL testResetMeasuredROPressureOverride( void ); -BOOL testSetMeasuredROPumpSpeedOverride( F32 value ); -BOOL testResetMeasuredROPumpSpeedOverride( void ); - -#endif +/************************************************************************** +* +* Copyright (c) 2020-2022 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 ROPump.h +* +* @author (last) Dara Navaei +* @date (last) 31-May-2022 +* +* @author (original) Sean +* @date (original) 04-Apr-2020 +* +***************************************************************************/ + +#ifndef __RO_PUMP_H__ +#define __RO_PUMP_H__ + +#include "DGCommon.h" + +/** + * @defgroup ROPump ROPump + * @brief RO Pump monitor and controller module. Controls and monitors the RO pump. + * The flow meter is manufactured by SwissFlow, PN: 82015311. + * The diaphragm (RO) pump is manufactured by Aquatec, PN: 5889-2MM1-V724DY. + * + * @addtogroup ROPump + * @{ + */ + +// ********** public definitions ********** +#define MAX_RO_FLOWRATE_LPM 1.8F ///< Maximum target RO flow rate in L/min. +#define MIN_RO_FLOWRATE_LPM 0.2F ///< Minimum target RO flow rate in L/min. + +/// RO pump data struct. +typedef struct +{ + F32 roPumpTgtPressure; ///< RO pump target pressure. + F32 measROFlowRate; ///< RO flow rate measurement. + F32 roPumpDutyCycle; ///< RO pump duty cycle. + U32 roPumpState; ///< RO pump current state. + F32 roPumpTgtFlowRateLM; ///< RO pump target flow rate in L/min + F32 roPumpFBDutyCycle; ///< RO pump feedback duty cycle. + F32 roPumpMeasFlowWithConcPumps; ///< RO pump measured flow with the concentrate pumps. +} RO_PUMP_DATA_T; + +// ********** public function prototypes ********** + +void initROPump( void ); +void execROPumpMonitor( void ); +void execROPumpController( void ); + +SELF_TEST_STATUS_T execROPumpSelfTest( void ); + +BOOL setROPumpTargetFlowRateLPM( F32 roFlowRate, U32 maxPressure ); +BOOL setROPumpTargetFlowRateDelayed( F32 roFlowRate, U32 maxPressure, U32 delayMs ); + +void signalROPumpHardStop( void ); + +BOOL isROPumpRunning( void ); + +F32 getTargetROPumpFlowRateLPM( void ); +F32 getMeasuredROFlowRateLPM( void ); +F32 getMeasuredROFlowRateWithConcPumpsLPM( void ); + +F32 getTargetROPumpPressure( void ); + +F32 getROGeneratedVolumeL( void ); +void resetROGenerateVolumeL( void ); + +BOOL testSetROPumpDataPublishIntervalOverride( U32 value ); +BOOL testResetROPumpDataPublishIntervalOverride( void ); + +BOOL testSetMeasuredROFlowRateOverride( F32 value ); +BOOL testResetMeasuredROFlowRateOverride( void ); + +BOOL testSetTargetROPumpFlow( F32 flow ); + +BOOL testSetTargetROPumpPressure( U32 value ); + +BOOL testSetTargetDutyCycle( F32 value ); + +/**@}*/ + +#endif