Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r5dc6f629ae40d8939fd3bd7c4e3dffb04fa137e7 -rd8b6a463f9e65c8ac145cf634d5d6641fb3bbd89 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 5dc6f629ae40d8939fd3bd7c4e3dffb04fa137e7) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision d8b6a463f9e65c8ac145cf634d5d6641fb3bbd89) @@ -81,6 +81,9 @@ #define FPGA_AIRTRAP_LEVEL_LOW_MASK 0x0008 ///< Bit mask for air trap lower level sensor. #define FPGA_AIRTRAP_LEVEL_HIGH_MASK 0x0004 ///< Bit mask for air trap upper level sensor. +#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. + // FPGA Sensors Record #pragma pack(push,1) /// Record structure for FPGA header read. @@ -1400,6 +1403,36 @@ /*********************************************************************//** * @brief + * The getFPGAArterialAirBubbleStatus function gets the latest arterial air + * bubble detector status. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return TRUE if air bubble is detected, otherwise FALSE + *************************************************************************/ +BOOL getFPGAArterialAirBubbleStatus( void ) +{ + U16 const status = fpgaSensorReadings.fpgaGPIO & FPGA_ADA_INPUT_STATUS_MASK; + + return ( 0 == status ? FALSE : TRUE ); +} + +/*********************************************************************//** + * @brief + * The getFPGAVenousAirBubbleStatus function gets the latest venous air + * bubble detector status. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return TRUE if air bubble is detected, otherwise FALSE + *************************************************************************/ +BOOL getFPGAVenousAirBubbleStatus( void ) +{ + U16 const status = fpgaSensorReadings.fpgaGPIO & FPGA_ADV_INPUT_STATUS_MASK; + + return ( 0 == status ? FALSE : TRUE ); +} + +/*********************************************************************//** + * @brief * The setFPGAValvesControlMode function sets the valves control mode. * @details Inputs: fpgaActuatorSetPoints * @details Outputs: fpgaActuatorSetPoints