Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -rf7c714a1a09b10d85a8b013712532d37b4d7b97a --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision f7c714a1a09b10d85a8b013712532d37b4d7b97a) @@ -5,28 +5,27 @@ * 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 +* @file FpgaDD.h * * @author (last) Vinayakam Mani * @date (last) 08-Aug-2024 * -* @author (original) Dara Navaei +* @author (original) Vinayakam Mani * @date (original) 08-Aug-2024 * ***************************************************************************/ -#ifndef __FPGADD_H__ -#define __FPGADD_H__ +#ifndef __FPGA_DD_H__ +#define __FPGA_DD_H__ #include "DDCommon.h" -#include "Interrupts.h" -#include "Utilities.h" + /** - * @defgroup FPGADD FPGADD - * @brief FPGA service module. Provides functionality to interact with DD FPGA. + * @defgroup FpgaDD FpgaDD + * @brief FPGA service unit. Provides functionality to interact with DD FPGA. * - * @addtogroup FPGADD + * @addtogroup FpgaDD * @{ */ @@ -41,36 +40,25 @@ void checkFPGACommFailure( void ); BOOL checkFPGAFEOEFailure( void ); -//Set FPGA functions +void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); + +//Valve void setFPGAValveStates( U16 valveStates ); void setFPGABCValveStates( U08 valveStates ); void setFPGAUFValveStates( U08 valveStates ); +U16 getFPGAValveStates( void ); +U08 getFPGAValveBCStates( void ); +U08 getFPGAValveUFStates( void ); + +// Conductivity and Temperature Sensor void setFPGACD12Control( U08 control ); void setFPGACD34Control( U08 control ); void setFPGACD12Address( U16 address ); void setFPGACD34Address( U16 address ); void setFPGACD12Data( U16 data ); void setFPGACD34Data( U16 data ); -void setFPGAAcidPumpSetStepSpeed( U16 stepSpeed ); -void setFPGABicarbSetStepSpeed( U16 stepSpeed ); -void setFPGADialysateOutPumpSpeed( U16 speed ); -void setFPGADialysateOutPumpControl( U08 control ); -void setFPGADialysateInPumpControl( U08 control ); - -void setFPGAAcidPumpControl( U08 control ); -void setFPGABicarbPumpControl( U08 control ); - -// Get FPGA functions -void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); -U16 getFPGAValveStates( void ); -U08 getFPGAValveBCStates( void ); -U08 getFPGAValveUFStates( void ); - -U16 getFPGALevelSensor1( void ); -U16 getFPGALevelSensor2( void ); - U08 getFPGACD1ReadCount( void ); U08 getFPGACD1ErrorCount( void ); U16 getFPGACD1( void ); @@ -95,6 +83,19 @@ U16 getFPGACD4Temp( void ); U16 getFPGACD4Data( void ); +// Pumps ( Concentrate and Gear pumps ) +void setFPGAAcidPumpSetStepSpeed( U16 stepSpeed ); +void setFPGABicarbSetStepSpeed( U16 stepSpeed ); +void setFPGADialysateOutPumpSpeed( U16 speed ); +void setFPGADialysateOutPumpControl( U08 control ); +void setFPGADialysateInPumpControl( U08 control ); +void setFPGAAcidPumpControl( U08 control ); +void setFPGABicarbPumpControl( U08 control ); + +U08 getFPGADialysateOutPumpControl( void ); +U08 getFPGADialysateInPumpControl( void ); + +//Pressure sensor U08 getFPGAPnReadCount( void ); U08 getFPGAPnErrorCount( void ); U32 getFPGAPnRawPressure( void ); @@ -115,114 +116,15 @@ U32 getFPGAPDfRawPressure( void ); U32 getFPGAPDfRawTemperature( void ); -U08 getFPGADialysateOutPumpControl( void ); -U08 getFPGADialysateInPumpControl( void ); - U08 getFPGAPtmReadCount( void ); U08 getFPGAPtmErrorCount( void ); U32 getFPGAPtmRawPressure( void ); U32 getFPGAPtmRawTemperature( void ); -U16 getFPGATimerCount( void ); +//Level sensor +U16 getFPGALevelSensor1( void ); +U16 getFPGALevelSensor2( void ); -//===================================================== -// ToDo : clean up required on following set functions -//===================================================== -void setFPGADrainPumpSpeed( U08 drainPumpDAC ); -void setFPGACPoProbeType( U16 probeType ); -void setFPGACPiProbeType( U16 probeType ); -void setFPGAAcidPumpParkCmd( void ); -void setFPGABicarbPumpParkCmd( void ); -//====================================================== - -//==================================================== -//Todo : Following get functions need clean up -//==================================================== -U16 getFPGADrainPumpSpeed( void ); - -U08 getFPGARTDErrorCount( void ); -U08 getFPGARTDReadCount( void ); - -U32 getFPGATRoTemp( void ); -U08 getFPGATRoErrorCount( void ); -U08 getFPGATRoReadCount( void ); - -U32 getFPGATDiTemp( void ); -U08 getFPGATDiErrorCount( void ); -U08 getFPGATDiReadCount( void ); - -U16 getFPGAPrimaryHeaterTemp( void ); -U08 getFPGAPrimaryHeaterFlags( void ); -U08 getFPGAPrimaryHeaterReadCount( void ); - -U16 getFPGATrimmerHeaterTemp( void ); -U08 getFPGATrimmerHeaterFlags( void ); -U08 getFPGATrimmerHeaterReadCount( void ); - -U16 getFPGAPrimaryColdJunctionTemp( void ); -U16 getFPGATrimmerColdJunctionTemp( void ); - -U08 getFPGAConcentratePumpsFault( void ); -BOOL getFPGAAcidPumpIsParked( void ); -BOOL getFPGABicarbPumpIsParked( void ); -BOOL getFPGAAcidPumpParkFault( void ); -BOOL getFPGABicarbPumpParkFault( void ); - -U16 getFPGACP1HallSensePulseWidth( void ); -U16 getFPGACP2HallSensePulseWidth( void ); - -U16 getFPGABoardTemp( void ); -U32 getFPGATRoInternalTemp( void ); -U32 getFPGATDiInternalTemp( void ); -U32 getFPGACondSnsrInternalTemp( void ); - -U08 getFPGAADC1ReadCount( void ); -U08 getFPGAADC1ErrorCount( void ); - -U08 getFPGAADC2ReadCount( void ); -U08 getFPGAADC2ErrorCount( void ); - -BOOL noFPGAFluidLeakDetected( void ); - -U08 getFPGADialysateCapStatus( void ); -U08 getFPGAConcentrateCapStatus( void ); - -U16 getFPGAInternalVccVoltage( void ); -U16 getFPGAInternalVccAuxiliaryVoltage( void ); -U16 getFPGAVPVNVoltage( void ); - -U08 getFPGABaroReadCount( void ); -U08 getFPGABaroErrorCount( void ); -U16 getFPGABaroMfgInfo( void ); -U16 getFPGABaroPressureSensitivity( void ); -U16 getFPGABaroPressureOffset( void ); -U16 getFPGABaroTempCoeffOfPressSensitvity( void ); -U16 getFPGABaroTempCoeffOfPressOffset( void ); -U16 getFPGABaroReferenceTemperature( void ); -U16 getFPGABaroTempCoeffOfTemperature( void ); -U16 getFPGABaroCoeffsCRC( void ); -U32 getFPGABaroPressure( void ); -U32 getFPGABaroTemperature( void ); - -U32 getFPGATHdTemp( void ); -U32 getFPGATHdInternalTemp( void ); -U08 getFPGATHdReadCount( void ); -U08 getFPGATHdErrorCount( void ); - -U16 getFPGAHeaterGateADC( void ); -U16 getFPGAHeaterGndADC( void ); -U08 getFPGAHeaterGateADCReadCount( void ); -U08 getFPGAHeaterGateADCErrorCount( void ); - -U16 getFPGADrainPumpCurrentFeedback( void ); -U16 getFPGADrainPumpSpeedFeedback( void ); -U08 getFPGADrainPumpDirection( void ); - -U16 getFPGAOnBoardThermistorCount( void ); -U16 getFPGAPowerSupply2ThermistorCount( void ); -//==================================================== - - /**@}*/ #endif