Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r498757853c009a4e25dec98461be91fcadd8057d -r11fcfaffab49f00f358124c8c285a821632eba24 --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 498757853c009a4e25dec98461be91fcadd8057d) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 11fcfaffab49f00f358124c8c285a821632eba24) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-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 FpgaDD.h * -* @author (last) Vinayakam Mani -* @date (last) 08-Aug-2024 +* @author (last) Michael Garthwaite +* @date (last) 07-Apr-2026 * * @author (original) Vinayakam Mani -* @date (original) 08-Aug-2024 +* @date (original) 26-Aug-2024 * ***************************************************************************/ @@ -20,7 +20,6 @@ #include "DDCommon.h" - /** * @defgroup FpgaDD FpgaDD * @brief FPGA service unit. Provides functionality to interact with DD FPGA. @@ -31,9 +30,18 @@ // ********** public definitions ********** +/// Leak sensor status from FPGA GPIO_Status register. +typedef enum FpgaGpioLeakSensorStatus +{ + FPGA_GPIO_LEAK_SENSOR_NOT_DETECTED = 0, ///< No leak + FPGA_GPIO_LEAK_SENSOR_DETECTED, ///< Leak detected + NUM_OF_FPGA_GPIO_LEAK_SENSOR_STATUS +} FPGA_GPIO_LEAK_SENSOR_STATUS_T; + // ********** public function prototypes ********** void initFPGADD( void ); +void initFPGAPerHW( BOOL isHWBeta2 ); void execFPGAClockSpeedTest( void ); SELF_TEST_STATUS_T execFPGATest( void ); @@ -43,117 +51,103 @@ void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); //Valve -void setFPGAValveStates( U16 valveStates ); -void setFPGABCValveStates( U08 valveStates ); -void setFPGAUFValveStates( U08 valveStates ); +void setFPGADDValveStates( U16 valveStates ); +U16 getFPGADDValveStates( void ); -U16 getFPGAValveStates( void ); +void setFPGABCValveStates( U08 valveStates ); U08 getFPGAValveBCStates( void ); -U08 getFPGAValveUFStates( 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 setFPGASpareValveStates( U08 valveStates ); +U08 getFPGAValveSpStates( void ); -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 setFPGAValveDDPWMEnable( U16 valvePWMStates ); +U16 getFPGAValveDDPWMEnable( 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 setFPGAValveBCPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveBCPWMEnable( 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 setFPGAValveSPPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveSPPWMEnable( 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 setFPGAValveDDPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveDDPWMLow( U16 valvePWMLow ); +void setFPGAValveDDPWMPeriod( U16 valvePWMPeriod ); -void setFPGAD74CondReset( void ); -void clearFPGAD74CondReset( void ); -void setFPGAD74CondInitEnable( void ); -void clearFPGAD74CondInitEnable( void ); -void setFPGAD74CondWriteEnable( void ); -void clearFPGAD74CondWriteEnable( void ); -void setFPGAD74CondReadEnable( void ); -void clearFPGAD74CondReadEnable( void ); +void setFPGAValveBCPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveBCPWMLow( U16 valvePWMLow ); +void setFPGAValveBCPWMPeriod( U16 valvePWMPeriod ); +void setFPGAValveSPPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveSPPWMLow( U16 valvePWMLow ); +void setFPGAValveSPPWMPeriod( U16 valvePWMPeriod ); + +// Conductivity and Temperature Sensor U08 getFPGAD17CondReadCount( void ); U08 getFPGAD17CondErrorCount( void ); -U16 getFPGAD17Cond( void ); -U16 getFPGAD17CondTemp( void ); -U32 getFPGAD17CondData( void ); +U08 getFPGAD17TempReadCount( void ); +U08 getFPGAD17TempErrorCount( void ); +F32 getFPGAD17CondData( void ); +F32 getFPGAD17CondTemp( void ); +U32 getFPGAD17CondCalData( void ); +U08 getFPGAD17CalMemCounter( void ); U08 getFPGAD27CondReadCount( void ); U08 getFPGAD27CondErrorCount( void ); -U16 getFPGAD27Cond( void ); -U16 getFPGAD27CondTemp( void ); -U32 getFPGAD27CondData( void ); +U08 getFPGAD27TempReadCount( void ); +U08 getFPGAD27TempErrorCount( void ); +F32 getFPGAD27CondData( void ); +F32 getFPGAD27CondTemp( void ); +U32 getFPGAD27CondCalData( void ); +U08 getFPGAD27CalMemCounter( void ); U08 getFPGAD29CondReadCount( void ); U08 getFPGAD29CondErrorCount( void ); -U16 getFPGAD29Cond( void ); -U16 getFPGAD29CondTemp( void ); -U32 getFPGAD29CondData( void ); +U08 getFPGAD29TempReadCount( void ); +U08 getFPGAD29TempErrorCount( void ); +F32 getFPGAD29CondData( void ); +F32 getFPGAD29CondTemp( void ); +U32 getFPGAD29CondCalData( void ); +U08 getFPGAD29CalMemCounter( void ); U08 getFPGAD43CondReadCount( void ); U08 getFPGAD43CondErrorCount( void ); -U16 getFPGAD43Cond( void ); -U16 getFPGAD43CondTemp( void ); -U32 getFPGAD43CondData( void ); +U08 getFPGAD43TempReadCount( void ); +U08 getFPGAD43TempErrorCount( void ); +F32 getFPGAD43CondData( void ); +F32 getFPGAD43CondTemp( void ); +U32 getFPGAD43CondCalData( void ); +U08 getFPGAD43CalMemCounter( void ); U08 getFPGAD74CondReadCount( void ); U08 getFPGAD74CondErrorCount( void ); -U16 getFPGAD74Cond( void ); -U16 getFPGAD74CondTemp( void ); -U32 getFPGAD74CondData( void ); +U08 getFPGAD74TempReadCount( void ); +U08 getFPGAD74TempErrorCount( void ); +F32 getFPGAD74CondData( void ); +F32 getFPGAD74CondTemp( void ); +U32 getFPGAD74CondCalData( void ); +U08 getFPGAD74CalMemCounter( void ); // Pumps (Dosing and Gear pumps ) -void setFPGAD11PumpSetStepSpeed( U16 stepSpeed ); -void setFPGAD10PumpSetStepSpeed( U16 stepSpeed ); -void setFPGAD76PumpSetStepSpeed( U16 stepSpeed ); +void setFPGAD11PumpSetStepSpeed( U32 stepSpeed ); +void setFPGAD10PumpSetStepSpeed( U32 stepSpeed ); +void setFPGAD76PumpSetStepSpeed( U32 stepSpeed ); +void setFPGAD92PumpSetStepSpeed( U32 stepSpeed ); void setFPGAD11PumpControl( U08 control ); void setFPGAD10PumpControl( U08 control ); void setFPGAD76PumpControl( U08 control ); +void setFPGAD92PumpControl( U08 control ); void setFPGAD11PumpParkCmd( void ); void setFPGAD10PumpParkCmd( void ); void setFPGAD76PumpParkCmd( void ); -void setFPGAD11PumpRevolutionCount( U16 count ); -void setFPGAD10PumpRevolutionCount( U16 count ); -void setFPGAD76PumpRevolutionCount( U16 count ); +void setFPGAD11PumpRevolutionCount( U32 count ); +void setFPGAD10PumpRevolutionCount( U32 count ); +void setFPGAD76PumpRevolutionCount( U32 count ); +void setFPGAD92PumpRevolutionCount( U32 count ); U08 getFPGAD11PumpControlStatus( void ); U08 getFPGAD10PumpControlStatus( void ); U08 getFPGAD76PumpControlStatus( void ); +U08 getFPGAD92PumpControlStatus( void ); U08 getFPGAUFPumpFault( void ); BOOL getFPGAD76PumpParkFault( void ); BOOL getFPGAD76PumpIsParked( void ); @@ -162,12 +156,12 @@ 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 ); +U32 getFPGAD11PumpHallSensePulseWidth( void ); +U32 getFPGAD10PumpHallSensePulseWidth( void ); +U32 getFPGAD76PumpHallSensePulseWidth( void ); +U32 getFPGAD11PumpRevolutionCountStatus( void ); +U32 getFPGAD10PumpRevolutionCountStatus( void ); +U32 getFPGAD76PumpRevolutionCountStatus( void ); void setFPGAD48PumpSpeed( U16 speed ); void setFPGAD12PumpSpeed( U16 speed ); @@ -186,69 +180,52 @@ U08 getFPGAD48PumpHallDirectionStatus( void ); //Pressure sensor -U08 getFPGAD9PresReadCount( void ); -U08 getFPGAD9PresErrorCount( void ); U16 getFPGAD9PresRawPressure( void ); U16 getFPGAD9PresRawTemperature( void ); -U08 getFPGAD66PresReadCount( void ); -U08 getFPGAD66PresErrorCount( void ); U16 getFPGAD66PresRawPressure( void ); U16 getFPGAD66PresRawTemperature( void ); -U08 getFPGAD51PresReadCount( void ); -U08 getFPGAD51PresErrorCount( void ); U16 getFPGAD51PresRawPressure( void ); U16 getFPGAD51PresRawTemperature( void ); -U08 getFPGAD18PresReadCount( void ); -U08 getFPGAD18PresErrorCount( void ); U16 getFPGAD18PresRawPressure( void ); U16 getFPGAD18PresRawTemperature( void ); -U08 getFPGAD41PresReadCount( void ); -U08 getFPGAD41PresErrorCount( void ); U16 getFPGAD41PresRawPressure( void ); U16 getFPGAD41PresRawTemperature( void ); -U08 getFPGAM1PresReadCount( void ); -U08 getFPGAM1PresErrorCount( void ); -U16 getFPGAM1PresRawPressure( void ); -U16 getFPGAM1PresRawTemperature( void ); +U16 getFPGAD87PresRawPressure( void ); +U16 getFPGAD87PresRawTemperature( void ); -U08 getFPGAM3PresReadCount( void ); -U08 getFPGAM3PresErrorCount( void ); -U16 getFPGAM3PresRawPressure( void ); -U16 getFPGAM3PresRawTemperature( void ); - //Level sensor U16 getFPGAD63LevelSensor( void ); +U16 getFPGAD98LevelSensor( void ); U16 getFPGAD46LevelSensor( void ); -BOOL getFPGAD6LevelStatus( void ); +U08 getFPGAD6LevelStatus( void ); U08 getFPGAFloater2Status( void ); //Temperature sensors U32 getFPGAD1Temp( void ); -U32 getFPGAX6Temp( void ); +U32 getFPGAD78Temp( void ); U32 getFPGAD4Temp( void ); U32 getFPGAD50Temp( void ); +U32 getFPGAD99Temp( void ); U08 getFPGARTDReadCount( void ); U08 getFPGARTDCountErrorCycles( void ); +U08 getFPGAIOExpanderReadCount( void ); +U08 getFPGAIOExpanderErrorCount( void ); +U08 getFPGAHallSensorStatus( void ); +U08 getFPGAGPIOStatus( void ); -//Barometric sensor -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 ); +BOOL getACSwitchStatus( void ); +FPGA_GPIO_LEAK_SENSOR_STATUS_T getFPGALeakSensorStatus( void ); +U32 getFPGATempTax1( void ); +U32 getFPGATempRTD( void ); +U08 getFPGAAD7124ReadCount( void ); +U08 getFPGAAD7124ErrorCount( void ); + //Primary and Trimmer heater void setFPGAD5HeaterPWMControl( U08 control ); void setFPGAD45HeaterPWMControl( U08 control ); @@ -266,6 +243,85 @@ U08 getFPGABloodLeakRxErrorCount( void ); U08 getFPGABloodLeakRxFIFODataOut( void ); +// Rinse pump +void setFPGAD79RinsePumpControl( U08 value ); +void setFPGAD79RinsePumpPWMControl( U08 value ); +U16 getFPGAD79RinsePumpPulseWidth( void ); + +//*************** IOFP ******************* + +void setFPGAFPValveStates( U08 valveStates ); +U08 getFPGAFPValveStates( void ); + +void setFPGAIOValveStates( U08 valveStates ); +U08 getFPGAIOValveStates( void ); + +void setFPGAValveFPPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveFPPWMEnable( void ); + +void setFPGAValveIOPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveIOPWMEnable( void ); + +void setFPGAValveIOFPPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveIOFPPWMLow( U16 valvePWMLow ); +void setFPGAValveIOFPPWMPeriod( U16 valvePWMPeriod ); + +void setFPGAP12PumpEnable( BOOL enable ); +void setFPGAP12PumpPWM( U16 pwm ); +U16 getFPGAP12PumpPWM( void ); +U16 getFPGAP12PumpTachCount( void ); + +void setFPGAP24Enabled( BOOL enable ); +void setFPGAP24PWM( U16 pwm ); + +S16 getFPGAP46RawPressure( void ); +S16 getFPGAP46RawTemperature( 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 ); + +U08 getFPGAP25FloaterState( void ); + +U16 getFPGAFlowP16( void ); +U16 getFPGAFlowP16Temp( void ); +U16 getFPGAFlowP16InternalTemp( void ); +U16 getFPGAFlowP7( void ); +U16 getFPGAFlowP7Temp( void ); +U16 getFPGAFlowP7InternalTemp( void ); +U08 getFPGAFlowP7ReadCount( void ); +U08 getFPGAFlowP7ErrorCount( void ); +U08 getFPGAFlowP16ReadCount( void ); +U08 getFPGAFlowP16ErrorCount( void ); + +// Conductivity +U08 getFPGAP9CondReadCount( void ); +U08 getFPGAP9CondErrorCount( void ); +U08 getFPGAP9TempReadCount( void ); +U08 getFPGAP9TempErrorCount( void ); +F32 getFPGAP9CondData( void ); +F32 getFPGAP9CondTemp( void ); +U32 getFPGAP9CondCalData( void ); +U08 getFPGAP9CalMemCounter( void ); + +U08 getFPGAP18CondReadCount( void ); +U08 getFPGAP18CondErrorCount( void ); +U08 getFPGAP18TempReadCount( void ); +U08 getFPGAP18TempErrorCount( void ); +F32 getFPGAP18CondData( void ); +F32 getFPGAP18CondTemp( void ); +U32 getFPGAP18CondCalData( void ); +U08 getFPGAP18CalMemCounter( void ); + +void setFPGAP40PumpEnable( BOOL enable ); +void setFPGAP40PumpPWM( U16 pwm ); +U16 getFPGAP40PumpPWM( void ); +U16 getFPGAP40PumpTachCount( void ); + /**@}*/ #endif