/************************************************************************** * * Copyright (c) 2022-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 FlowSensors.h * * @author (last) Dara Navaei * @date (last) 01-Aug-2022 * * @author (original) Dara Navaei * @date (original) 21-Jul-2022 * ***************************************************************************/ #ifndef _FLOW_SENSORS_H_ #define _FLOW_SENSORS_H_ #include "DGCommon.h" /** * @defgroup FlowSensors * @brief Dialysate and RO flow rate monitor module. Monitors the flow sensors. * The flow sensors are manufactured by Swiss Flow, PN: 0045 * * @addtogroup FlowSensors * @{ */ // ********** public definitions ********** #define MAX_DIALYSATE_FLOWRATE_LPM 2.00F ///< Maximum target flow rate in L/min. #define MIN_DIALYSATE_FLOWRATE_LPM 0.05F ///< Minimum target flow rate in L/min. /// Flow meters name typedef enum { RO_FLOW_SENSOR = 0, ///< RO flow sensor. DIALYSATE_FLOW_SENSOR, ///< Dialysate flow sensor. NUM_OF_FLOW_SENSORS, ///< Number of flow sensors. } FLOW_SENSORS_T; /// Flow meters data struct. typedef struct { F32 ROFlowRateLPM; ///< RO flow rate in L/min. F32 ROFlowRateWithCPsLPM; ///< RO flow rate with concentrate pumps in L/min. F32 dialysateFlowRateLPM; ///< Dialysate flow rate L/min. } FLOW_SENSORS_DATA_T; // ********** public function prototypes ********** void initFlowSensors( void ); SELF_TEST_STATUS_T execFlowSensorsSelfTest( void ); void execFlowSesnorsMonitor( void ); F32 getMeasuredFlowRateLPM( FLOW_SENSORS_T sensorId ); BOOL testSetFlowDataPublishIntervalOverride( U32 value ); BOOL testResetFlowDataPublishIntervalOverride( void ); BOOL testSetMeasuredFlowRateOverride( U32 sensorId, F32 flowLPM ); BOOL testResetMeasuredFlowRateOverride( U32 sensorId ); /**@}*/ #endif