/************************************************************************** * * Copyright (c) 2026-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 PinchValve.h * * @author (last) Varshini Nagabooshanam * @date (last) 08-Jul-2026 * * @author (original) Varshini Nagabooshanam * @date (original) 08-Jul-2026 * ***************************************************************************/ #ifndef __PINCHVALVE_H__ #define __PINCHVALVE_H__ #include "TDCommon.h" /** * @defgroup PinchValve PinchValve * @brief pinch valve communication driver. * This driver sends one generic command at a time through the FPGA * interface. High level functions such as homing and movement to positions * A, B, and C belong in the controller layer. * * @addtogroup PinchValve * @{ */ // ********** public definitions ********** /// Valves positions typedef enum valveStatesNames { VALVE_POSITION_NOT_IN_POSITION = 0, ///< Valve position is unknown (cannot be used as a command) VALVE_POSITION_A_INSERT_EJECT, ///< Position A, Insert/Eject VALVE_POSITION_B_OPEN, ///< Position B, Open VALVE_POSITION_C_CLOSE, ///< Position C, Close NUM_OF_VALVE_POSITIONS, ///< Number of valve positions } VALVE_POSITION_T; /// rotary pinch valve names typedef enum valveNames { H1_VALV = 0, ///< Arterial rotary pinch valve FIRST_VALVE = H1_VALV, ///< First valve H19_VALV, ///< Venous rotary pinch valve NUM_OF_VALVES ///< Number of valves } VALVE_T; // ********** public function prototypes ********** void initPinchValveDriver( void ); ///< Initializes the pinch valve driver state, command data, and FPGA interface. void execPinchValveFunction( void ); ///< Executes the pinch valve function state machine void execPinchValveCommand( void ); ///< Executes the FPGA command state machine. BOOL homePinchValve( VALVE_T valve ); ///< Starts the homing sequence for the selected pinch valve. BOOL setPinchValvePosition( VALVE_T valve, VALVE_POSITION_T position ); ///< Starts a movement request to the selected stored valve position S32 getPinchValvePosition( VALVE_T valve ); ///< Returns the latest actual encoder position for the selected valve. void setPinchValveEnableReset( VALVE_T valve, BOOL enable, BOOL reset ); ///< Sets the enable and reset control for the selected pinch valve U08 getPinchValveEnableReset( VALVE_T valve ); ///< Returns the last enable and reset value written for the selected valve. BOOL isPinchValveBusy( VALVE_T valve ); ///< Returns TRUE when the selected valve is executing or waiting for a command. BOOL isPinchValveHomed( VALVE_T valve ); S32 getPinchValveStoredPosition( VALVE_T valve, VALVE_POSITION_T position ); ///< Returns the stored encoder position for the selected valve position. BOOL movePinchValveToStoredPosition( VALVE_T valve, VALVE_POSITION_T position ); ///< Starts movement to a previously stored valve position /**@}*/ #endif