Index: firmware/App/Services/FPGA.h =================================================================== diff -u -rdc0d9b087c609e71cacdb7f0395cccf29d749c00 -rae823785919192402707da5083e9b0ad40bd4938 --- firmware/App/Services/FPGA.h (.../FPGA.h) (revision dc0d9b087c609e71cacdb7f0395cccf29d749c00) +++ firmware/App/Services/FPGA.h (.../FPGA.h) (revision ae823785919192402707da5083e9b0ad40bd4938) @@ -1,92 +1,172 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2022 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 +* @file FPGA.h * -* @author (last) Sean Nash -* @date (last) 19-Aug-2020 +* @author (last) Dara Navaei +* @date (last) 14-Mar-2022 * -* @author (original) Dara Navaei -* @date (original) 05-Nov-2019 +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 * ***************************************************************************/ - -#ifndef __FPGA_H__ -#define __FPGA_H__ - -#include "DGCommon.h" -#include "Interrupts.h" - -// ********** public definitions ********** - -// ********** public function prototypes ********** - -void initFPGA( void ); -void execFPGAIn( void ); -void execFPGAOut( void ); -SELF_TEST_STATUS_T execFPGATest( void ); - -void signalFPGAReceiptCompleted( void ); -void signalFPGATransmitCompleted( void ); - -void setFPGAValveStates( U16 valveStates ); -void setFPGADrainPumpSpeed( U08 drainPumpDAC ); - -void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); -U16 getFPGAValveStates( void ); -U16 getFPGAROPumpFlowRate( void ); -U16 getFPGADrainPumpSpeed( void ); -U32 getFPGALoadCellA1( void ); -U32 getFPGALoadCellA2( void ); -U32 getFPGALoadCellB1( void ); -U32 getFPGALoadCellB2( void ); - -U32 getFPGATPiTemp( void ); -U32 getFPGATPoTemp( void ); - -U32 getFPGACD1Temp( void ); -U32 getFPGACD2Temp( void ); - -U08 getFPGARTDErrorCount( void ); -U08 getFPGARTDReadCount( void ); - -U32 getFPGATHDoTemp( void ); - -U08 getFPGATHDoErrorCount( void ); -U08 getFPGATHDoReadCount( 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 getFPGACPiReadCount ( void ); -U08 getFPGACPiErrorCount ( void ); -U32 getFPGACPi ( void ); +#ifndef __FPGA_H__ +#define __FPGA_H__ -U08 getFPGACPoReadCount ( void ); -U08 getFPGACPoErrorCount ( void ); -U32 getFPGACPo ( void ); - +#include "DGCommon.h" +#include "Interrupts.h" + +/** + * @defgroup FPGA FPGA + * @brief FPGA service module. Provides functionality to interact with DG FPGA. + * + * @addtogroup FPGA + * @{ + */ + +// ********** public definitions ********** + +// ********** public function prototypes ********** + +void initFPGA( void ); +void execFPGAIn( void ); +void execFPGAOut( void ); +SELF_TEST_STATUS_T execFPGATest( void ); + +void signalFPGAReceiptCompleted( void ); +void signalFPGATransmitCompleted( void ); + +void setFPGAValveStates( U16 valveStates ); +void setFPGADrainPumpSpeed( U08 drainPumpDAC ); +void setFPGACPoProbeType( U16 probeType ); +void setFPGACPiProbeType( U16 probeType ); +void setFPGAV3AcidPumpControl( U08 pumpControl ); +void setFPGAV3BicarbPumpControl( U08 pumpControl ); +void setFPGAAcidPumpSetStepSpeed( U16 stepSpeed ); +void setFPGABicarbSetStepSpeed( U16 stepSpeed ); + +void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); +U16 getFPGAValveStates( void ); +U16 getFPGAROPumpFlowRate( void ); +U16 getFPGADialysateFlowRate( void ); +U16 getFPGADrainPumpSpeed( void ); +U32 getFPGALoadCellA1( void ); +U32 getFPGALoadCellA2( void ); +U32 getFPGALoadCellB1( void ); +U32 getFPGALoadCellB2( void ); + +U32 getFPGATPiTemp( void ); +U32 getFPGATPoTemp( void ); + +U32 getFPGACD1Temp( void ); +U32 getFPGACD2Temp( 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 getFPGACPiFault( void ); +U08 getFPGACPiReadCount( void ); +U08 getFPGACPiErrorCount( void ); +U32 getFPGACPi( void ); + +U08 getFPGACPoFault( void ); +U08 getFPGACPoReadCount( void ); +U08 getFPGACPoErrorCount( void ); +U32 getFPGACPo( void ); + +U08 getFPGAConcentratePumpsFault( void ); + +U08 getFPGAEmstatCD1CD2OutByte( void ); +U08 getFPGAEmstatCD1CD2RxErrCount( void ); +U16 getFPGAEmstatCD1CD2RxFifoCount( void ); + +U16 getFPGACP1HallSensePulseWidth( void ); +U16 getFPGACP2HallSensePulseWidth( void ); + void getFPGAAccelAxes( S16 *x, S16 *y, S16 *z ); void getFPGAAccelMaxes( S16 *xm, S16*ym, S16*zm ); void getFPGAAccelStatus( U16 *cnt, U16 *accelFPGAFaultReg ); -#endif +U16 getFPGAInletFan1TogglePeriod( void ); +U16 getFPGAInletFan2TogglePeriod( void ); +U16 getFPGAInletFan3TogglePeriod( void ); +U16 getFPGAOutletFan1TogglePeriod( void ); +U16 getFPGAOutletFan2TogglePeriod( void ); +U16 getFPGAOutletFan3TogglePeriod( void ); + +U16 getFPGABoardTemp( void ); +U32 getFPGALoadCellsA1B1Temp( void ); +U32 getFPGALoadCellsA2B2Temp( 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 ); + +U16 getFPGATimerCount( void ); + +U08 getFPGADialysateCapStatus( void ); +U08 getFPGAConcentrateCapStatus( void ); + +//***************** DVT Functions ***************************/ +void setFPGAAcidPumpControl( U08 control ); +void setFPGABicarbPumpControl( U08 control ); + +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 ); + +U08 getFPGAEmstatCPiCPoByteOut( void ); +U16 getFPGAEmstatCPiCPoRxFifoCount( void ); +U08 getFPGAEmstatCPiCPoRxErrCount( void ); + +U32 getFPGATHdTemp( void ); +U32 getFPGATHdInternalTemp( void ); +U08 getFPGATHdReadCount( void ); +U08 getFPGATHdErrorCount( void ); + +U16 getFPGAROFlowSensorEdgeCount( void ); +U16 getFPGADialysateFlowSensorEdgeCount( void ); + +/**@}*/ + +#endif