Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r22176ce95e49213c48454f34ddf5d29b8109f2cb -rf91baac9704a90ab0fea1dd05e11833ffc5a5a4e --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 22176ce95e49213c48454f34ddf5d29b8109f2cb) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision f91baac9704a90ab0fea1dd05e11833ffc5a5a4e) @@ -120,8 +120,13 @@ U32 fpgaTDi; ///< Reg 308. ADC TDi channel 0 - temperature U32 fpgaTDiTemp; ///< Reg 312. ADC TDi channel 1 - internal temperature +#ifndef ENABLE_DVT_BOARD U32 fpgaCPo; ///< Reg 316. CPo conductivity sensor value U32 fpgaCPi; ///< Reg 320. CPi conductivity sensor value +#else + U32 fpgaTHDi; ///< Reg 316. ADC THD channel 0 - temperature + U32 fpgaTHDiTemp; ///< Reg 320. ADC THD channel 1 - internal temperature +#endif U16 fpgaPrimaryHeaterIntTemp; ///< Reg 324. Primary heater temperature U16 fpgaPrimaryHeaterIntJunctionTemp; ///< Reg 326. Primary heater internal temperature @@ -156,6 +161,8 @@ U08 fpgaPrimaryHeaterReadCnt; ///< Reg 365. Primary heater read count U08 fpgaTrimmerHeaterFlags; ///< Reg 366. Trimmer heater flags U08 fpgaTrimmerHeaterReadCnt; ///< Reg 367. Trimmer heater read count + +#ifndef ENABLE_DVT_BOARD U08 fpgaCPoFault; ///< Reg 368. CPo conductivity sensor fault U08 fpgaCPoReadCnt; ///< Reg 369. CPo conductivity sensor read count U08 fpgaCPoErrorCnt; ///< Reg 370. CPo conductivity sensor error count @@ -164,6 +171,14 @@ U08 fpgaCPiErrorCnt; ///< Reg 373. CPi conductivity sensor error count U08 fpgaCP1CP2Fault; ///< Reg 374. Concentrate pump fault register for CP1 and CP2 U08 fpgaReserved1; ///< Reg 375. Reserved +#else + U08 fpgaCPiCPoEmstatOutByte; ///< Reg 368. CPi/CPo Emstat output FIFO + U08 fpgaCPiCPoEmstatRxErrCount; ///< Reg 369. CPi/CPo Emstat receive error count + U16 fpgaCPiCPoEmstatTxFIFOCount; ///< Reg 370. CPi/CPo Emstat transmit FIFO count + U16 fpgaCPiCPoEmstatRxFIFOCount; ///< Reg 372. CPi/CPo Emstat receive FIFO count + U08 fpgaCP1CP2Fault; ///< Reg 374. Concentrate pump fault register for CP1 and CP2 + U08 fpgaDRPHallStatus; ///< Reg 375. Drain pump hall sensor status +#endif U16 fpgaValveStates; ///< Reg 376. Valves states U16 fpgaFanIn1Pulse; ///< Reg 378. Fan inlet 1 pulse time in 2.5 us resolution @@ -188,10 +203,34 @@ U16 fpgaADCVccInt; ///< Reg 406. Internal FPGA Vcc Voltage. U16 fpgaADCVccAux; ///< Reg 408. Internal FPGA Vcc auxiliary voltage. U16 fpgaADCVPVN; ///< Reg 410. Internal FPGA VPVN voltage. - U16 fpgaOpenRegister; ///< Reg 412. Open register. + + // DVT only + U08 fpgaBaroReadCount; ///< Reg 412. Barometric sensor read count + U08 fpgaBaroErroCount; ///< Reg 413. Barometric sensor error count + // DVT only + U16 fpgaDrainPumpSpeedFeedback; ///< Reg 414. Drain pump speed feedback. U16 fpgaDrainPumpCurrentFeedback; ///< Reg 416. Drain pump current feedback. U16 fpgaDialysateFlowRate; ///< Req 418. Dialysate flow rate measurement + + // DVT only + U16 fpgaHeaterGateADC; ///< Reg 420. Heater gate ADC + U16 fpgaHeaterGNDADC; ///< Reg 422. Heater ground ADC + U08 fpgaHeater1ADCReadCount; ///< Reg 424. Heater 1 ADC read count + U08 fpgaHeater1ADCErrorCount; ///< Reg 425. Heater 1 ADC error count + U16 fpgaBaroManufacInfo; ///< Reg 426. Barometric sensor manufacturing information + U16 fpgaBaroPROMCoeff1; ///< Reg 428. Barometric sensor PROM coefficient 1 + U16 fpgaBaroPROMCoeff2; ///< Reg 430. Barometric sensor PROM coefficient 2 + U16 fpgaBaroPROMCoeff3; ///< Reg 432. Barometric sensor PROM coefficient 3 + U16 fpgaBaroPROMCoeff4; ///< Reg 434. Barometric sensor PROM coefficient 4 + U16 fpgaBaroPROMCoeff5; ///< Reg 436. Barometric sensor PROM coefficient 5 + U16 fpgaBaroPROMCoeff6; ///< Reg 438. Barometric sensor PROM coefficient 6 + U16 fpgaBaroPROMCRC; ///< Reg 440. Barometric sensor PROM CRC + U32 fpgaBaroPressure; ///< Reg 442. Barometric sensor pressure value + U32 fpgaBaroTemperature; ///< Reg 446. Barometric sensor temperature sensor + U08 fpgaTHDRTDReadCount; ///< Reg 450. THD RTD read count + U08 fpgaTHDRTDErrorCount; ///< Reg 451. THD RTD error count + // DVT only } DG_FPGA_SENSORS_T; typedef struct @@ -1517,7 +1556,11 @@ *************************************************************************/ U08 getFPGACPiFault( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPiFault; +#else + return 0; +#endif } /*********************************************************************//** @@ -1529,7 +1572,11 @@ *************************************************************************/ U08 getFPGACPiReadCount( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPiReadCnt; +#else + return 0; +#endif } /*********************************************************************//** @@ -1541,7 +1588,11 @@ *************************************************************************/ U08 getFPGACPiErrorCount( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPiErrorCnt; +#else + return 0; +#endif } /*********************************************************************//** @@ -1553,7 +1604,11 @@ *************************************************************************/ U32 getFPGACPi( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPi; +#else + return 0; +#endif } /*********************************************************************//** @@ -1565,7 +1620,11 @@ *************************************************************************/ U08 getFPGACPoFault( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPoFault; +#else + return 0; +#endif } /*********************************************************************//** @@ -1577,7 +1636,11 @@ *************************************************************************/ U08 getFPGACPoReadCount( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPoReadCnt; +#else + return 0; +#endif } /*********************************************************************//** @@ -1590,7 +1653,11 @@ *************************************************************************/ U08 getFPGACPoErrorCount( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPoErrorCnt; +#else + return 0; +#endif } /*********************************************************************//** @@ -1602,7 +1669,11 @@ *************************************************************************/ U32 getFPGACPo( void ) { +#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPo; +#else + return 0; +#endif } /*********************************************************************//** @@ -1927,4 +1998,132 @@ return ( fpgaSensorReadings.fpgaGPIO & CONCENTRATE_CAP_SWITCH_MASK ); } +/*********************************************************************//** + * @brief + * The getFPGABaroReadCount function gets the FPGA barometric sensor read count. + * @details Inputs: fpgaSensorReadings + * @details 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 Inputs: fpgaSensorReadings + * @details Outputs: none + * @return barometric pressure sensor error count + *************************************************************************/ +U08 getFPGABaroErrorCount( void ) +{ + return fpgaSensorReadings.fpgaBaroErroCount; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressureSensitivity function gets the FPGA barometric pressure + * sensor sensitivity. + * @details Inputs: fpgaSensorReadings + * @details 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 Inputs: fpgaSensorReadings + * @details 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 Inputs: fpgaSensorReadings + * @details 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 Inputs: fpgaSensorReadings + * @details Outputs: none + * @return barometric pressure sensor temperature coefficient of pressure offset + *************************************************************************/ +U16 getFPGABaroTempCoeffOfPressOffset( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff4; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroReferenceTemp function gets the FPGA barometric pressure + * sensor reference temperature. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return barometric pressure sensor reference temperature + *************************************************************************/ +U16 getFPGABaroReferenceTemp( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff5; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTempCoeffOfTemperature function gets the FPGA barometric pressure + * sensor temperature coefficient of temperature. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return barometric pressure sensor temperature coefficient of temperature + *************************************************************************/ +U16 getFPGABaroTempCoeffOfTemperature( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff6; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressure function gets the FPGA barometric pressure sensor + * pressure. + * @details Inputs: fpgaSensorReadings + * @details 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 Inputs: fpgaSensorReadings + * @details Outputs: none + * @return barometric pressure sensor temperature + *************************************************************************/ +U32 getFPGABaroTemperature( void ) +{ + return ( fpgaSensorReadings.fpgaBaroTemperature & MASK_OFF_U32_MSB ); +} + /**@}*/