/************************************************************************** * * Copyright (c) 2019-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 FPGA.h * * @author (last) Sean Nash * @date (last) 30-Jul-2024 * * @author (original) Sean Nash * @date (original) 30-Jul-2024 * ***************************************************************************/ #ifndef __FPGA_TD_H__ #define __FPGA_TD_H__ #include "TDCommon.h" /** * @defgroup FpgaTD FpgaTD * @brief FPGA service unit for TD firmware. * The FPGA unit contains get/set functions for the TD FPGA registers. * * @addtogroup FpgaTD * @{ */ // ********** public definitions ********** #define FPGA_PINCH_VALVES_1_32_STEP 0x03 ///< Bit mask for configuring pinch valve for 1/32 step. #define FPGA_PINCH_VALVES_REVERSE 0x08 ///< Bit mask for configuring pinch valve for reverse direction. #define FPGA_PINCH_VALVES_DISABLE 0x10 ///< Bit mask for configuring pinch valve to be disabled. #define FPGA_PINCH_VALVES_NOT_RESET 0x20 ///< Bit mask for configuring pinch valve to not be in reset. #define FPGA_PINCH_VALVES_NOT_SLEEP 0x40 ///< Bit mask for configuring pinch valve to not be in sleep mode. // ********** public function prototypes ********** void initFpgaTD( void ); SELF_TEST_STATUS_T execFPGATest( void ); void execFPGAClockSpeedTest( void ); void checkFPGACommFailure( void ); void checkFPGAFEOEFailure( void ); U16 getFPGATimerCount( void ); void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); U16 getFPGATemperature( void ); F32 getFPGAVcc( void ); F32 getFPGAVccAux( void ); F32 getFPGAVpvn( void ); void setAlarmAudioState( U32 state, U32 volumeLevel, U32 volumeDivider ); void setBloodPumpEnabled( BOOL enable ); void setBloodPumpDirection( MOTOR_DIR_T dir ); void homeBloodPump( void ); void resetBloodPumpHomeRequest( void ); void setBloodPumpSetSpeed( U16 rpm ); U16 getBloodPumpSpeed( void ); U16 getBloodPumpHallSensorCount( void ); U08 getBloodPumpHallSensorStatus( void ); U16 getPBAPressure( void ); S16 getPBATemperature( void ); U08 getPBAReadCounter( void ); U08 getPBAErrorCounter( void ); U16 getPBOPressure( void ); S16 getPBOTemperature( void ); U08 getPBOReadCounter( void ); U08 getPBOErrorCounter( void ); F32 getFPGABackupAlarmAudioCurrent( void ); void getFPGAAirTrapLevels( BOOL *airAtLower, BOOL *airAtUpper ); BOOL ADVBubbleDetected( void ); void setFPGAVenousBubbleSelfTest( void ); void clearFPGAVenousBubbleSelfTest( void ); void setVBTValveState( OPN_CLS_STATE_T state ); void setVBVControl( U08 controlBits ); U08 getVBVControl( void ); void setVBVPosition( U16 setPoint ); S16 getVBVEncoderPosition( void ); S16 getVBVCmdPosition( void ); U16 getVBVStatus( void ); void setVBAControl( U08 controlBits ); U08 getVBAControl( void ); void setVBAPosition( U16 setPoint ); S16 getVBAEncoderPosition( void ); S16 getVBACmdPosition( void ); U16 getVBAStatus( void ); U16 getFPGABoardTemperature( void ); U32 getFPGAPBAADCTemperature( void ); U16 getFPGAInletFan1TogglePeriod( void ); BOOL getFPGAFrontDoorClosedStatus( void ); /**@}*/ #endif