Index: firmware/App/Controllers/Valves.h =================================================================== diff -u -r200dfbd12ee14a4dbe5ee1daaece7bfce9e8a104 -rb569bc796c56acd5d94d468386f5f42c350cad65 --- firmware/App/Controllers/Valves.h (.../Valves.h) (revision 200dfbd12ee14a4dbe5ee1daaece7bfce9e8a104) +++ firmware/App/Controllers/Valves.h (.../Valves.h) (revision b569bc796c56acd5d94d468386f5f42c350cad65) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-2026 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 ValvesDD.h +* @file Valves.h * -* @author (last) Vinayakam Mani -* @date (last) 14-Aug-2024 +* @author (last) “Raghu +* @date (last) 03-Feb-2026 * * @author (original) Vinayakam Mani -* @date (original) 14-Aug-2024 +* @date (original) 26-Aug-2024 * ***************************************************************************/ @@ -37,16 +37,38 @@ NUM_OF_VALVE_STATES ///< number of valve states } VALVE_STATE_NAMES_T; +/// Enumerations for water recovery options +typedef enum recovery_States +{ + NO_RECOVERY = 0, ///< NO recovery + MEDIUM_RECOVERY, ///< Medium recovery + MAX_RECOVERY, ///< Maximum recovery + NUM_OF_RECOVERY_STATES ///< Number of recovery states +} RECOVERY_STATE_T; + +#define NUM_OF_DD_VALVES ( ( LAST_DD_VALVE - FIRST_DD_VALVE ) + 1 ) +#define NUM_OF_IOFP_VALVES ( ( LAST_FP_VALVE - FIRST_IO_VALVE ) + 1 ) +#define NUM_OF_IO_VALVES ( ( LAST_IO_VALVE - FIRST_IO_VALVE ) + 1 ) +#define NUM_OF_FP_VALVES ( ( LAST_FP_VALVE - FIRST_FP_VALVE ) + 1 ) + #pragma pack(push, 1) /// Valves publish structure typedef struct { U16 valvesStatus; ///< 2 way valves status. U08 valvesBCStatus; ///< Balancing chamber valves status. - U08 valvesUFStatus; ///< Ultrafiltration valves status. - U08 valvesSensedState[ DD_NUM_OF_VALVES ]; ///< DD valves sensed states. + U08 valveSPStatus; ///< Spare valves status. + U08 valvesSensedState[ LAST_DD_VALVE + 1 ]; ///< DD sensed valve states. } DD_VALVES_DATA_T; +/// Valves publish structure +typedef struct +{ + U08 valvesIOState; ///< Commanded IO valve states (bits). + U08 valvesFPState; ///< Commanded FP valve states (bits). + U08 valvesSensedState[ NUM_OF_IOFP_VALVES ]; ///< Sensed FP valve states (enumerations). +} FP_VALVES_DATA_T; + /// Balancing chamber valve states override structure typedef struct { @@ -63,14 +85,18 @@ BOOL setValveStateDelayed( DD_VALVES_T valve, VALVE_STATE_NAMES_T valveState, U32 delayMs ); VALVE_STATE_NAMES_T getValveStateName( DD_VALVES_T valveID ); void setHydValvesStatetoClosedState( void ); -void setUFValvesStatetoClosedState( void ); +void setRecoveryValvesConfig( void ); BOOL testValvesStatesPublishIntervalOverride( MESSAGE_T *message ); BOOL testValveStateOverride( MESSAGE_T *message ); BOOL testBCValveStatesOverride( MESSAGE_T *message ); BOOL testValveSensedStateOverride( MESSAGE_T *message ); BOOL testValveOpenCloseStateOverride( MESSAGE_T *message ); +BOOL testIOFPValvesStatesPublishIntervalOverride( MESSAGE_T *message ); +BOOL testIOFPValveStateOverride( MESSAGE_T *message ); +BOOL testIOFPValveSensedStateOverride( MESSAGE_T *message ); + /**@}*/ #endif