Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r2a50e5931dcdf6ac21f1a41aa51ee7e01e4e54ac -rdcdc84e87fe5d67c15e83bc4e4a4bbacb0f4b63b --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 2a50e5931dcdf6ac21f1a41aa51ee7e01e4e54ac) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision dcdc84e87fe5d67c15e83bc4e4a4bbacb0f4b63b) @@ -3273,6 +3273,162 @@ /*********************************************************************//** * @brief + * The getFPGAIOExpanderReadCount function gets the number of successful + * I2C transactions with the IO expander. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return IO expander successful transaction count + *************************************************************************/ +U08 getFPGAIOExpanderReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaIOExpReadCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAIOExpanderErrorCount function gets the number of unsuccessful + * I2C transactions with the IO expander. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return IO expander error transaction count + *************************************************************************/ +U08 getFPGAIOExpanderErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaIOExpERrorCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAHallSensorStatus function gets the aggregated hall sensor status. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return hall sensor status bits + *************************************************************************/ +U08 getFPGAHallSensorStatus( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaHallSensorStatus; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAGPIOStatus function gets the GPIO status register value. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return GPIO status register + *************************************************************************/ +U08 getFPGAGPIOStatus( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaGPIOStatus; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGATempTax1 function gets the Tax1 temperature sensor reading. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return Tax1 temperature + *************************************************************************/ +U32 getFPGATempTax1( void ) +{ + U32 result = 0UL; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.tempTax1; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGATempRTD function gets the spare RTD temperature sensor reading. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return spare RTD temperature + *************************************************************************/ +U32 getFPGATempRTD( void ) +{ + U32 result = 0UL; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.tempRTD; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAAD7124ReadCount function gets the number of valid AD7124 + * transactions. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return AD7124 valid transaction count + *************************************************************************/ +U08 getFPGAAD7124ReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.ad7124readcnt; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAAD7124ErrorCount function gets the number of invalid AD7124 + * transactions. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return AD7124 error transaction count + *************************************************************************/ +U08 getFPGAAD7124ErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.ad7124errcnt; + } + + return result; +} + +/*********************************************************************//** + * @brief * The checkFPGACommFailure function increments the FPGA comm failure * windowed timer and returns whether or not the number of failures in * the window have been reached. @@ -3961,6 +4117,86 @@ /*********************************************************************//** * @brief + * The getFPGAFlowP7ReadCount function gets the number of successful + * reads from the P7 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P7 flow sensor read counter + *************************************************************************/ +U08 getFPGAFlowP7ReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p7flowReadCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAFlowP7ErrorCount function gets the number of failed + * reads from the P7 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P7 flow sensor error counter + *************************************************************************/ +U08 getFPGAFlowP7ErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p7flowErrorCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAFlowP16ReadCount function gets the number of successful + * reads from the P16 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P16 flow sensor read counter + *************************************************************************/ +U08 getFPGAFlowP16ReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p16flowReadCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAFlowP16ErrorCount function gets the number of failed + * reads from the P16 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P16 flow sensor error counter + *************************************************************************/ +U08 getFPGAFlowP16ErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p16flowErrorCount; + } + + return result; +} + +/*********************************************************************//** + * @brief * The setFPGAP9Control function sets the FPGA P9 sensor control register * to perform a given action. * bit 4..7: unused Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r3393de3377c15fcbe223326fed40a840f16d7ce9 -rdcdc84e87fe5d67c15e83bc4e4a4bbacb0f4b63b --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 3393de3377c15fcbe223326fed40a840f16d7ce9) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision dcdc84e87fe5d67c15e83bc4e4a4bbacb0f4b63b) @@ -241,6 +241,14 @@ U32 getFPGAD99Temp( void ); U08 getFPGARTDReadCount( void ); U08 getFPGARTDCountErrorCycles( void ); +U08 getFPGAIOExpanderReadCount( void ); +U08 getFPGAIOExpanderErrorCount( void ); +U08 getFPGAHallSensorStatus( void ); +U08 getFPGAGPIOStatus( void ); +U32 getFPGATempTax1( void ); +U32 getFPGATempRTD( void ); +U08 getFPGAAD7124ReadCount( void ); +U08 getFPGAAD7124ErrorCount( void ); //Primary and Trimmer heater void setFPGAD5HeaterPWMControl( U08 control ); @@ -309,6 +317,10 @@ U16 getFPGAFlowP7( void ); U16 getFPGAFlowP7Temp( void ); U16 getFPGAFlowP7InternalTemp( void ); +U08 getFPGAFlowP7ReadCount( void ); +U08 getFPGAFlowP7ErrorCount( void ); +U08 getFPGAFlowP16ReadCount( void ); +U08 getFPGAFlowP16ErrorCount( void ); void setFPGAP9Control( U08 control ); void setFPGAP9Address( U16 address );