Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r3a87ca0e2a722318216623d7e1f4c354c58c506c -rfefb47e88a5285e99498efb830fdceb9e95c2c3e --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 3a87ca0e2a722318216623d7e1f4c354c58c506c) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision fefb47e88a5285e99498efb830fdceb9e95c2c3e) @@ -183,8 +183,28 @@ U08 fpgaValveUFStates; ///< Reg 352. Ultrafiltration Valves states U08 fpgaValveUFPWMStates; ///< Reg 353. Ultrafiltration Valves PWM states U08 fpgaCPACPBFault; ///< Reg 354. Concentrate pump fault register for CPA and CPB - U16 fpgaCPAHallSense; ///< Reg 356. Concentrate pump CPA hall sensor pulse width - U16 fpgaCPBHallSense; ///< Reg 358. Concentrate pump CPB hall sensor pulse width + U16 fpgaCPAHallSense; ///< Reg 355. Concentrate pump CPA hall sensor pulse width + U16 fpgaCPBHallSense; ///< Reg 357. Concentrate pump CPB hall sensor pulse width + + F32 fpgaTax1Temp; ///< Reg 359. Inlet heat exchanger temperature + F32 fpgaTH2Temp; ///< Reg 363. Inlet heat exchanger temperature + F32 fpgaTH1Temp; ///< Reg 367. Hydraulics primary heater temperature + F32 fpgaTH3Temp; ///< Reg 371. Trimmer heater temperature + U08 fpgaRTDReadCnt; ///< Reg 375. Read count for all RTD sensors + + U08 fpgaBaroReadCount; ///< Reg 376. Barometric sensor read count + U08 fpgaBaroErrorCount; ///< Reg 377. Barometric sensor error count + U16 fpgaBaroManufacInfo; ///< Reg 378. Barometric sensor manufacturing information + U16 fpgaBaroPROMCoeff1; ///< Reg 380. Barometric sensor PROM coefficient 1 + U16 fpgaBaroPROMCoeff2; ///< Reg 382. Barometric sensor PROM coefficient 2 + U16 fpgaBaroPROMCoeff3; ///< Reg 384. Barometric sensor PROM coefficient 3 + U16 fpgaBaroPROMCoeff4; ///< Reg 386. Barometric sensor PROM coefficient 4 + U16 fpgaBaroPROMCoeff5; ///< Reg 390. Barometric sensor PROM coefficient 5 + U16 fpgaBaroPROMCoeff6; ///< Reg 392. Barometric sensor PROM coefficient 6 + U16 fpgaBaroPROMCRC; ///< Reg 394. Barometric sensor PROM CRC + U32 fpgaBaroPressure; ///< Reg 396. Barometric sensor pressure value + U32 fpgaBaroTemperature; ///< Reg 400. Barometric sensor temperature sensor + } DD_FPGA_SENSORS_T; typedef struct @@ -1951,6 +1971,223 @@ /*********************************************************************//** * @brief + * The getFPGAInletHeatExchangerTemp function gets the inlet heat exchanger + * temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return inlet heat exchanger temperature + *************************************************************************/ +U32 getFPGAInletHeatExchangerTemp( void ) +{ + return fpgaSensorReadings.fpgaTax1Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGAOutletHeatExchangerTemp function gets the outlet heat exchanger + * temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return outlet heat exchanger temperature + *************************************************************************/ +U32 getFPGAOutletHeatExchangerTemp( void ) +{ + return fpgaSensorReadings.fpgaTH2Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGAHydraulicsPrimaryHeaterTemp function gets the hydraulics primary + * heater temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return hydraulics primary heater temperature + *************************************************************************/ +U32 getFPGAHydraulicsPrimaryHeaterTemp( void ) +{ + return fpgaSensorReadings.fpgaTH1Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGATrimmerHeaterTemp function gets the trimmer heater temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return trimmer heater temperature + *************************************************************************/ +U32 getFPGATrimmerHeaterTemp( void ) +{ + return fpgaSensorReadings.fpgaTH3Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGARTDReadCount function gets the RTD sensors group read count. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return RTD read count + *************************************************************************/ +U08 getFPGARTDReadCount( void ) +{ + return fpgaSensorReadings.fpgaRTDReadCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroReadCount function gets the FPGA barometric sensor read count. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor read count + *************************************************************************/ +U08 getFPGABaroReadCount( void ) +{ + return fpgaSensorReadings.fpgaBaroReadCount; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroErrorCount function gets the FPGA barometric sensor error count. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor error count + *************************************************************************/ +U08 getFPGABaroErrorCount( void ) +{ + return fpgaSensorReadings.fpgaBaroErrorCount; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroMfgInfo function gets the FPGA barometric pressure + * sensor manufacturing information. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor manufacturing information + *************************************************************************/ +U16 getFPGABaroMfgInfo( void ) +{ + return fpgaSensorReadings.fpgaBaroManufacInfo; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressureSensitivity function gets the FPGA barometric pressure + * sensor sensitivity. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor sensitivity + *************************************************************************/ +U16 getFPGABaroPressureSensitivity( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff1; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressureOffset function gets the FPGA barometric pressure + * sensor offset. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor offset + *************************************************************************/ +U16 getFPGABaroPressureOffset( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff2; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTempCoeffOfPressSensitvity function gets the FPGA barometric + * pressure sensor temperature coefficient of pressure sensitivity. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficient of pressure sensitivity + *************************************************************************/ +U16 getFPGABaroTempCoeffOfPressSensitvity( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff3; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTempCoeffOfPressOffset function gets the FPGA barometric + * pressure sensor temperature coefficient of pressure offset. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficient of pressure offset + *************************************************************************/ +U16 getFPGABaroTempCoeffOfPressOffset( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff4; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroReferenceTemperature function gets the FPGA barometric pressure + * sensor reference temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor reference temperature + *************************************************************************/ +U16 getFPGABaroReferenceTemperature( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff5; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTempCoeffOfTemperature function gets the FPGA barometric pressure + * sensor temperature coefficient of temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficient of temperature + *************************************************************************/ +U16 getFPGABaroTempCoeffOfTemperature( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff6; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroCoeffsCRC function gets the FPGA barometric pressure + * sensor temperature coefficients' CRC. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficients' CRC + *************************************************************************/ +U16 getFPGABaroCoeffsCRC( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCRC; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressure function gets the FPGA barometric pressure sensor + * pressure. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor pressure + *************************************************************************/ +U32 getFPGABaroPressure( void ) +{ + return ( fpgaSensorReadings.fpgaBaroPressure & MASK_OFF_U32_MSB ); +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTemperature function gets the FPGA barometric pressure sensor + * temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature + *************************************************************************/ +U32 getFPGABaroTemperature( void ) +{ + return ( fpgaSensorReadings.fpgaBaroTemperature & MASK_OFF_U32_MSB ); +} + +/*********************************************************************//** + * @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.