Index: firmware/App/Services/FPGA.c =================================================================== diff -u -re9cc9eadcf846737bbc4e900db22f4c2a06ad922 -r494fa9614f7ec4cb0f677763c499044336ea8214 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision e9cc9eadcf846737bbc4e900db22f4c2a06ad922) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 494fa9614f7ec4cb0f677763c499044336ea8214) @@ -85,6 +85,9 @@ #define FPGA_BLOOD_LEAK_STATUS_MASK 0x1000 ///< Bit mask for blood leak detector. #define FPGA_BLOOD_LEAK_ZERO_STATE_MASK 0x2000 ///< Bit mask for blood leak detector zero. +#define FPGA_BLOOD_LEAK_ZERO_CMD 0x02 ///< Bit for blood leak detector zero command. +#define FPGA_BLOOD_LEAK_SELF_TEST_CMD 0x01 ///< Bit for blood leak detector self test command. + #define FPGA_ADA_INPUT_STATUS_MASK 0x0001 ///< Bit mask for arterial air bubble detector input status. #define FPGA_ADV_INPUT_STATUS_MASK 0x0002 ///< Bit mask for venous air bubble detector input status. @@ -1436,19 +1439,6 @@ /*********************************************************************//** * @brief - * The setFPGASensorTest function sets the sensor test output. - * @details Inputs: fpgaActuatorSetPoints - * @details Outputs: fpgaActuatorSetPoints - * @param sensorTest - * @return none - *************************************************************************/ -void setFPGASensorTest( U08 sensorTest ) -{ - fpgaActuatorSetPoints.fpgaSensorTest = sensorTest; -} - -/*********************************************************************//** - * @brief * The getDoorState function gets the current state of door switch. * @details Inputs: none * @details Outputs: none @@ -1540,13 +1530,52 @@ * @details Outputs: none * @return FPGABloodLeakZeroDetected *************************************************************************/ -//void setFPGABloodLeakZero( void ) -//{ - // TODO -//} +void setFPGABloodLeakZero( void ) +{ + fpgaActuatorSetPoints.fpgaSensorTest = FPGA_BLOOD_LEAK_ZERO_CMD; +} /*********************************************************************//** * @brief + * The clearFPGABloodLeakZero function clears the Blood Leak detector from + * zeroing mode via the FPGA. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return none + *************************************************************************/ +void clearFPGABloodLeakZero( void ) +{ + fpgaActuatorSetPoints.fpgaSensorTest = 0x00; +} + +/*********************************************************************//** + * @brief + * The setFPGABloodLeakSelfTest function sets the Blood Leak detector into + * self-test mode via the FPGA. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return FPGABloodLeakZeroDetected + *************************************************************************/ +void setFPGABloodLeakSelfTest( void ) +{ + fpgaActuatorSetPoints.fpgaSensorTest = FPGA_BLOOD_LEAK_SELF_TEST_CMD; +} + +/*********************************************************************//** + * @brief + * The clearFPGABloodLeakSelfTest function clears the Blood Leak detector from + * self-test mode via the FPGA. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return none + *************************************************************************/ +void clearFPGABloodLeakSelfTest( void ) +{ + fpgaActuatorSetPoints.fpgaSensorTest = 0x00; +} + +/*********************************************************************//** + * @brief * The setValveDialyzerInletPosition function sets the position of VDi * in counts * @details Inputs: fpgaActuatorSetPoints