/************************************************************************** * * Copyright (c) 2024-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 FpgaDD.h * * @author (last) Vinayakam Mani * @date (last) 08-Aug-2024 * * @author (original) Vinayakam Mani * @date (original) 08-Aug-2024 * ***************************************************************************/ #ifndef __FPGA_DD_H__ #define __FPGA_DD_H__ #include "DDCommon.h" /** * @defgroup FpgaDD FpgaDD * @brief FPGA service unit. Provides functionality to interact with DD FPGA. * * @addtogroup FpgaDD * @{ */ // ********** public definitions ********** // ********** public function prototypes ********** void initFPGADD( void ); void execFPGAClockSpeedTest( void ); SELF_TEST_STATUS_T execFPGATest( void ); void checkFPGACommFailure( void ); BOOL checkFPGAFEOEFailure( void ); void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); //Valve void setFPGADDValveStates( U16 valveStates ); void setFPGABCValveStates( U08 valveStates ); void setFPGASpareValveStates( U08 valveStates ); U16 getFPGADDValveStates( void ); U08 getFPGAValveBCStates( void ); U08 getFPGAValveSpStates( void ); // Conductivity and Temperature Sensor void setFPGACD12Control( U08 control ); void setFPGACD34Control( U08 control ); void setFPGACD5Control( U08 control ); void setFPGACD12Address( U16 address ); void setFPGACD34Address( U16 address ); void setFPGACD5Address( U16 address ); void setFPGACD12Data( U32 data ); void setFPGACD34Data( U32 data ); void setFPGACD5Data( U32 data ); void setFPGAD17CondReset( void ); void clearFPGAD17CondReset( void ); void setFPGAD17CondInitEnable( void ); void clearFPGAD17CondInitEnable( void ); void setFPGAD17CondWriteEnable( void ); void clearFPGAD17CondWriteEnable( void ); void setFPGAD17CondReadEnable( void ); void clearFPGAD17CondReadEnable( void ); void setFPGAD27CondReset( void ); void clearFPGAD27CondReset( void ); void setFPGAD27CondInitEnable( void ); void clearFPGAD27CondInitEnable( void ); void setFPGAD27CondWriteEnable( void ); void clearFPGAD27CondWriteEnable( void ); void setFPGAD27CondReadEnable( void ); void clearFPGAD27CondReadEnable( void ); void setFPGAD29CondReset( void ); void clearFPGAD29CondReset( void ); void setFPGAD29CondInitEnable( void ); void clearFPGAD29CondInitEnable( void ); void setFPGAD29CondWriteEnable( void ); void clearFPGAD29CondWriteEnable( void ); void setFPGAD29CondReadEnable( void ); void clearFPGAD29CondReadEnable( void ); void setFPGAD43CondReset( void ); void clearFPGAD43CondReset( void ); void setFPGAD43CondInitEnable( void ); void clearFPGAD43CondInitEnable( void ); void setFPGAD43CondWriteEnable( void ); void clearFPGAD43CondWriteEnable( void ); void setFPGAD43CondReadEnable( void ); void clearFPGAD43CondReadEnable( void ); void setFPGAD74CondReset( void ); void clearFPGAD74CondReset( void ); void setFPGAD74CondInitEnable( void ); void clearFPGAD74CondInitEnable( void ); void setFPGAD74CondWriteEnable( void ); void clearFPGAD74CondWriteEnable( void ); void setFPGAD74CondReadEnable( void ); void clearFPGAD74CondReadEnable( void ); U08 getFPGAD17CondReadCount( void ); U08 getFPGAD17CondErrorCount( void ); U16 getFPGAD17Cond( void ); U16 getFPGAD17CondTemp( void ); U32 getFPGAD17CondData( void ); U08 getFPGAD27CondReadCount( void ); U08 getFPGAD27CondErrorCount( void ); U16 getFPGAD27Cond( void ); U16 getFPGAD27CondTemp( void ); U32 getFPGAD27CondData( void ); U08 getFPGAD29CondReadCount( void ); U08 getFPGAD29CondErrorCount( void ); U16 getFPGAD29Cond( void ); U16 getFPGAD29CondTemp( void ); U32 getFPGAD29CondData( void ); U08 getFPGAD43CondReadCount( void ); U08 getFPGAD43CondErrorCount( void ); U16 getFPGAD43Cond( void ); U16 getFPGAD43CondTemp( void ); U32 getFPGAD43CondData( void ); U08 getFPGAD74CondReadCount( void ); U08 getFPGAD74CondErrorCount( void ); U16 getFPGAD74Cond( void ); U16 getFPGAD74CondTemp( void ); U32 getFPGAD74CondData( void ); // Pumps (Dosing and Gear pumps ) void setFPGAD11PumpSetStepSpeed( U16 stepSpeed ); void setFPGAD10PumpSetStepSpeed( U16 stepSpeed ); void setFPGAD76PumpSetStepSpeed( U16 stepSpeed ); void setFPGAD11PumpControl( U08 control ); void setFPGAD10PumpControl( U08 control ); void setFPGAD76PumpControl( U08 control ); void setFPGAD11PumpParkCmd( void ); void setFPGAD10PumpParkCmd( void ); void setFPGAD76PumpParkCmd( void ); void setFPGAD11PumpRevolutionCount( U16 count ); void setFPGAD10PumpRevolutionCount( U16 count ); void setFPGAD76PumpRevolutionCount( U16 count ); U08 getFPGAD11PumpControlStatus( void ); U08 getFPGAD10PumpControlStatus( void ); U08 getFPGAD76PumpControlStatus( void ); U08 getFPGAUFPumpFault( void ); BOOL getFPGAD76PumpParkFault( void ); BOOL getFPGAD76PumpIsParked( void ); U08 getFPGAConcentratePumpsFault( void ); BOOL getFPGAD11PumpIsParked( void ); BOOL getFPGAD10PumpIsParked( void ); BOOL getFPGAD11PumpParkFault( void ); BOOL getFPGAD10PumpParkFault( void ); U16 getFPGAD11PumpHallSensePulseWidth( void ); U16 getFPGAD10PumpHallSensePulseWidth( void ); U16 getFPGAD76PumpHallSensePulseWidth( void ); U16 getFPGAD11PumpRevolutionCountStatus( void ); U16 getFPGAD10PumpRevolutionCountStatus( void ); U16 getFPGAD76PumpRevolutionCountStatus( void ); void setFPGAD48PumpSpeed( U16 speed ); void setFPGAD12PumpSpeed( U16 speed ); void setFPGAD48PumpControl( U08 control ); void setFPGAD12PumpControl( U08 control ); U08 getFPGAD48PumpControl( void ); U08 getFPGAD12PumpControl( void ); U16 getFPGAD48PumpSpeed( void ); U16 getFPGAD12PumpSpeed( void ); BOOL getFPGAD12PumpErrorStatus( void ); BOOL getFPGAD48PumpErrorStatus( void ); U16 getFPGAD12PumpCurrentFeedback( void ); U16 getFPGAD48PumpCurrentFeedback( void ); U08 getFPGAD12PumpHallDirectionStatus( void ); U08 getFPGAD48PumpHallDirectionStatus( void ); //Pressure sensor U16 getFPGAD9PresRawPressure( void ); U16 getFPGAD9PresRawTemperature( void ); U16 getFPGAD66PresRawPressure( void ); U16 getFPGAD66PresRawTemperature( void ); U16 getFPGAD51PresRawPressure( void ); U16 getFPGAD51PresRawTemperature( void ); U16 getFPGAD18PresRawPressure( void ); U16 getFPGAD18PresRawTemperature( void ); U16 getFPGAD41PresRawPressure( void ); U16 getFPGAD41PresRawTemperature( void ); //Level sensor U16 getFPGAD63LevelSensor( void ); U16 getFPGAD46LevelSensor( void ); BOOL getFPGAD6LevelStatus( void ); U08 getFPGAFloater2Status( void ); //Temperature sensors U32 getFPGAD1Temp( void ); U32 getFPGAX6Temp( void ); U32 getFPGAD4Temp( void ); U32 getFPGAD50Temp( void ); U08 getFPGARTDReadCount( void ); U08 getFPGARTDCountErrorCycles( void ); //Primary and Trimmer heater void setFPGAD5HeaterPWMControl( U08 control ); void setFPGAD45HeaterPWMControl( U08 control ); void setFPGAD5HeaterOnOffControl( BOOL flag ); void setFPGAD5HeaterPWMEnableControl( BOOL enable ); void setFPGAD5HeaterPWMLowState( U16 count ); void setFPGAD5HeaterPWMPeriod( U16 period ); //Blood leak detector U08 getFPGABloodLeakStatus( void ); void setFPGABloodLeakUARTControl( U08 value ); void setFPGABloodLeakUARTTransmit( U08 value ); U08 getFPGABloodLeakTxFIFOCount( void ); U16 getFPGABloodLeakRxFIFOCount( void ); U08 getFPGABloodLeakRxErrorCount( void ); U08 getFPGABloodLeakRxFIFODataOut( void ); //*************** IOFP ******************* void setFPGAIOFPValveStates( U08 valveStates ); U08 getFPGAIOFPValveStates( void ); void setFPGAP12PumpEnable( BOOL enable ); void setFPGAP12PumpPWM( U16 pwm ); U16 getFPGAP12PumpPWM( void ); U16 getFPGAP12PumpTachCount( void ); void setFPGAP24Enabled( BOOL enable ); void setFPGAP24PWM( U16 pwm ); S16 getFPGAM1RawPressure( void ); S16 getFPGAM1RawTemperature( void ); S16 getFPGAM3RawPressure( void ); S16 getFPGAM3RawTemperature( void ); S16 getFPGAP8RawPressure( void ); S16 getFPGAP8RawTemperature( void ); S16 getFPGAP13RawPressure( void ); S16 getFPGAP13RawTemperature( void ); S16 getFPGAP17RawPressure( void ); S16 getFPGAP17RawTemperature( void ); U32 getFPGAP23Temperature( void ); U32 getFPGAP22Temperature( void ); U08 getFPGAP25FloaterState( void ); U16 getFPGAFlowP16( void ); U16 getFPGAFlowP16Temp( void ); U16 getFPGAFlowP7( void ); U16 getFPGAFlowP7Temp( void ); void setFPGAP9Control( U08 control ); void setFPGAP9Address( U16 address ); void setFPGAP9Data( U32 data ); void setFPGAP18Control( U08 control ); void setFPGAP18Address( U16 address ); void setFPGAP18Data( U32 data ); void setFPGAP9Reset( void ); void clearFPGAP9Reset( void ); void setFPGAP9InitEnable( void ); void clearFPGAP9InitEnable( void ); void setFPGAP9WriteEnable( void ); void clearFPGAP9WriteEnable( void ); void setFPGAP9ReadEnable( void ); void clearFPGAP9ReadEnable( void ); void setFPGAP18Reset( void ); void clearFPGAP18Reset( void ); void setFPGAP18InitEnable( void ); void clearFPGAP18InitEnable( void ); void setFPGAP18WriteEnable( void ); void clearFPGAP18WriteEnable( void ); void setFPGAP18ReadEnable( void ); void clearFPGAP18ReadEnable( void ); U08 getFPGAP9ReadCount( void ); U08 getFPGAP9ErrorCount( void ); U16 getFPGAP9Conductivity( void ); U16 getFPGAP9Temperature( void ); U32 getFPGAP9Data( void ); U08 getFPGAP18ReadCount( void ); U08 getFPGAP18ErrorCount( void ); U16 getFPGAP18Conductivity( void ); U16 getFPGAP18Temperature( void ); U32 getFPGAP18Data( void ); void setFPGAP40PumpEnable( BOOL enable ); void setFPGAP40PumpPWM( U16 pwm ); U16 getFPGAP40PumpPWM( void ); U16 getFPGAP40PumpTachCount( void ); /**@}*/ #endif