/************************************************************************** * * 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. #define FPGA_PINCH_VALVES_NEW_POS_CMD 0x80 ///< Bit mask for configuring pinch valve to accept a new position command. // ********** public function prototypes ********** void initFpgaTD( void ); void fpgaResetTransitoryCmds( 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 setH4Enabled( BOOL enable ); void setH4Direction( MOTOR_DIR_T dir ); void homeH4( void ); void resetH4HomeRequest( void ); void setH4SetSpeed( U16 rpm ); U16 getH4Period( void ); U16 getBloodPumpHallSensorCount( void ); U08 getBloodPumpHallSensorStatus( void ); U16 getH2Pressure( void ); S16 getH2Temperature( void ); U08 getH2ReadCounter( void ); U08 getH2ErrorCounter( void ); U16 getH14Pressure( void ); S16 getH14Temperature( void ); U08 getH14ReadCounter( void ); U08 getH14ErrorCounter( void ); F32 getFPGABackupAlarmAudioCurrent( void ); void getFPGAAirTrapLevels( BOOL *airAtLower, BOOL *airAtUpper ); BOOL H18BubbleDetected( void ); void setFPGAVenousBubbleSelfTest( void ); void clearFPGAVenousBubbleSelfTest( void ); void setH13ValveState( VALVE_3WAY_STATE_T state ); void setH20ValveState( VALVE_3WAY_STATE_T state ); void setAirPumpMotorPowerLevel( U08 power ); void setAirPumpMotorPWMCntTime( U16 tenNS ); void setH19Control( U08 controlBits ); U08 getH19Control( void ); void setH19Position( U16 setPoint ); S16 getH19EncoderPosition( void ); S16 getH19CmdPosition( void ); U16 getH19Status( void ); void setH1Control( U08 controlBits ); U08 getH1Control( void ); void setH1Position( U16 setPoint ); S16 getH1EncoderPosition( void ); S16 getH1CmdPosition( void ); U16 getH1Status( void ); U16 getFPGABoardTemperature( void ); U32 getFPGAPBAADCTemperature( void ); U16 getFPGAInletFan1TogglePeriod( void ); BOOL getFPGAFrontDoorClosedStatus( void ); /**@}*/ #endif