Index: firmware/App/Services/FPGA.h =================================================================== diff -u -r3ded5ffcbcade3f1da5d40c52936ab5f97fc6ec9 -r8fdca8ef380555c6c93e30b517258988333ffd89 --- firmware/App/Services/FPGA.h (.../FPGA.h) (revision 3ded5ffcbcade3f1da5d40c52936ab5f97fc6ec9) +++ firmware/App/Services/FPGA.h (.../FPGA.h) (revision 8fdca8ef380555c6c93e30b517258988333ffd89) @@ -14,60 +14,74 @@ * @date (original) 05-Nov-2019 * ***************************************************************************/ - -#ifndef __FPGA_H__ -#define __FPGA_H__ - -#include "HDCommon.h" -#include "Interrupts.h" - -/** - * @defgroup FPGA FPGA - * @brief FPGA service module. - * Maintains latest sensor readings at priority task interval. Updates actuator - * states at priority task interval. - * - * @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 getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); - -F32 getFPGABloodFlowSignalStrength( void ); -F32 getFPGADialysateFlowSignalStrength( void ); - -F32 getFPGABloodFlow( void ); -F32 getFPGADialysateFlow( void ); - -U16 getFPGABloodPumpHallSensorCount( void ); -U08 getFPGABloodPumpHallSensorStatus( void ); -U16 getFPGADialInPumpHallSensorCount( void ); -U08 getFPGADialInPumpHallSensorStatus( void ); -U16 getFPGADialOutPumpHallSensorCount( void ); -U08 getFPGADialOutPumpHallSensorStatus( void ); - -S32 getFPGAArterialPressure( void ); -U16 getFPGAVenousPressure( void ); -U16 getFPGABloodPumpOcclusion( void ); -U16 getFPGADialInPumpOcclusion( void ); + +#ifndef __FPGA_H__ +#define __FPGA_H__ + +#include "HDCommon.h" +#include "Interrupts.h" + +/** + * @defgroup FPGA FPGA + * @brief FPGA service module. + * Maintains latest sensor readings at priority task interval. Updates actuator + * states at priority task interval. + * + * @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 getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ); + +F32 getFPGABloodFlowSignalStrength( void ); +F32 getFPGADialysateFlowSignalStrength( void ); + +F32 getFPGABloodFlow( void ); +F32 getFPGADialysateFlow( void ); + +U16 getFPGABloodPumpHallSensorCount( void ); +U08 getFPGABloodPumpHallSensorStatus( void ); +U16 getFPGADialInPumpHallSensorCount( void ); +U08 getFPGADialInPumpHallSensorStatus( void ); +U16 getFPGADialOutPumpHallSensorCount( void ); +U08 getFPGADialOutPumpHallSensorStatus( void ); + +S32 getFPGAArterialPressure( void ); +U16 getFPGAVenousPressure( void ); +U16 getFPGABloodPumpOcclusion( void ); +U16 getFPGADialInPumpOcclusion( void ); U16 getFPGADialOutPumpOcclusion( void ); void getFPGAAccelAxes( S16 *x, S16 *y, S16 *z ); void getFPGAAccelMaxes( S16 *xm, S16*ym, S16*zm ); void getFPGAAccelStatus( U16 *cnt, U16 *accelFPGAFaultReg ); - -/**@}*/ - -#endif + +void enableValvesPIDControl( U16 enableBits ); + +void setDialyzerInletValvePosition( S16 setPoint ); +S16 getDialyzerInletValvePosition( void ); + +void setDialyzerOutletValvePosition( S16 setPoint ); +S16 getDialyzerOutletValvePosition( void ); + +void setVenousBloodValvePosition( S16 setPoint ); +S16 getVenousBloodValvePoistion( void ); + +void setArterialBloodValvePosition( S16 setPoint ); +S16 getArterialBloodValvePoistion( void ); + +/**@}*/ + +#endif