Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r74a3506d935a18d4174f94d8c0fdbc750105904f -r794f0aea88a5a860448e54e99db6e2e881b22900 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 74a3506d935a18d4174f94d8c0fdbc750105904f) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 794f0aea88a5a860448e54e99db6e2e881b22900) @@ -1139,30 +1139,82 @@ /*********************************************************************//** * @brief - * The getFPGADialysateFlow function gets the latest dialysate flow reading. + * The getFPGABloodFlowMeterStatus function gets the blood flow meter status. * @details Inputs: fpgaSensorReadings * @details Outputs: none - * @return last dialysate flow reading + * @return current blood flow meter status *************************************************************************/ -F32 getFPGADialysateFlow( void ) +U08 getFPGABloodFlowMeterStatus( void ) { - return fpgaSensorReadings.dialysateFlowLast; + return fpgaSensorReadings.bloodFlowMeterDeviceStatus; } /*********************************************************************//** * @brief - * The getFPGABloodFlowMeterStatus function gets the blood flow meter status. + * The getFPGABloodFlowFastPacketReadCounter function gets the blood + * flow meter fast packet read counter. * @details Inputs: fpgaSensorReadings * @details Outputs: none - * @return current blood flow meter status + * @return current blood flow meter fast packet read counter *************************************************************************/ -U08 getFPGABloodFlowMeterStatus( void ) +U08 getFPGABloodFlowFastPacketReadCounter( void ) { - return fpgaSensorReadings.bloodFlowMeterDeviceStatus; + return fpgaSensorReadings.bloodFlowMeterDataPktCount; } /*********************************************************************//** * @brief + * The getFPGABloodFlowSlowPacketReadCounter function gets the blood + * flow meter slow packet read counter. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return current blood flow meter slow packet read counter + *************************************************************************/ +U08 getFPGABloodFlowSlowPacketReadCounter( void ) +{ + return ( fpgaSensorReadings.bloodFlowMeterSlowPktCounts & MASK_OFF_NIBBLE_LSB ) >> SHIFT_BITS_BY_4; +} + +/*********************************************************************//** + * @brief + * The getFPGABloodFlowStatusPacketReadCounter function gets the blood + * flow meter status packet read counter. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return current blood flow meter status packet read counter + *************************************************************************/ +U08 getFPGABloodFlowStatusPacketReadCounter( void ) +{ + return ( fpgaSensorReadings.bloodFlowMeterSlowPktCounts & MASK_OFF_NIBBLE_MSB ); +} + +/*********************************************************************//** + * @brief + * The getFPGABloodFlowErrorCounter function gets the blood flow meter + * error counter. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return current blood flow meter error counter + *************************************************************************/ +U08 getFPGABloodFlowErrorCounter( void ) +{ + return fpgaSensorReadings.bloodFlowMeterErrorCount; +} + +/*********************************************************************//** + * @brief + * The getFPGADialysateFlow function gets the latest dialysate flow reading. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return last dialysate flow reading + *************************************************************************/ +F32 getFPGADialysateFlow( void ) +{ + return fpgaSensorReadings.dialysateFlowLast; +} + +/*********************************************************************//** + * @brief * The getFPGADialysateFlowMeterStatus function gets the dialysate flow meter status. * @details Inputs: fpgaSensorReadings * @details Outputs: none @@ -1175,6 +1227,58 @@ /*********************************************************************//** * @brief + * The getFPGADialysateFlowFastPacketReadCounter function gets the dialysate + * flow meter fast packet read counter. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return current dialysate flow meter fast packet read counter + *************************************************************************/ +U08 getFPGADialysateFlowFastPacketReadCounter( void ) +{ + return fpgaSensorReadings.dialysateFlowMeterDataPktCount; +} + +/*********************************************************************//** + * @brief + * The getFPGADialysateFlowSlowPacketReadCounter function gets the dialysate + * flow meter slow packet read counter. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return current dialysate flow meter slow packet read counter + *************************************************************************/ +U08 getFPGADialysateFlowSlowPacketReadCounter( void ) +{ + return ( fpgaSensorReadings.dialysateFlowMeterSlowPckCounts & MASK_OFF_NIBBLE_LSB ) >> SHIFT_BITS_BY_4; +} + +/*********************************************************************//** + * @brief + * The getFPGADialysateFlowStatusPacketReadCounter function gets the dialysate + * flow meter status packet read counter. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return current dialysate flow meter status packet read counter + *************************************************************************/ +U08 getFPGADialysateFlowStatusPacketReadCounter( void ) +{ + return ( fpgaSensorReadings.dialysateFlowMeterSlowPckCounts & MASK_OFF_NIBBLE_MSB ); +} + +/*********************************************************************//** + * @brief + * The getFPGADialysateFlowErrorCounter function gets the dialysate flow meter + * error counter. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return current dialysate flow meter error counter + *************************************************************************/ +U08 getFPGADialysateFlowErrorCounter( void ) +{ + return fpgaSensorReadings.dialysateFlowMeterErrorCount; +} + +/*********************************************************************//** + * @brief * The getFPGABloodPumpHallSensorCount function gets the latest blood pump * hall sensor count. Count is a 16 bit free running counter. If counter is * counting up, indicates motor is running in forward direction. If counter is