Index: firmware/App/Services/FpgaRO.c =================================================================== diff -u -rf47296145b6a0adb78df0e325587629171909fd6 -rce66580e076bffa157868ff7e422556f78a95cac --- firmware/App/Services/FpgaRO.c (.../FpgaRO.c) (revision f47296145b6a0adb78df0e325587629171909fd6) +++ firmware/App/Services/FpgaRO.c (.../FpgaRO.c) (revision ce66580e076bffa157868ff7e422556f78a95cac) @@ -126,17 +126,18 @@ U16 roPumpTachCount; ///< Reg 360. ROP tachometer counter. U16 dsPumpTachCount; ///< Reg 362. DSP tachometer counter. U16 flowIntTempFmp; ///< Reg 364. FMP flow sensor internal temperature. - U08 valveControlReadback; ///< Reg 366. Valve control bits read back. - U08 valvePWMEnableReadback; ///< Reg 367. Valve PWM enable read back. + U16 valveControlReadback; ///< Reg 366. Valve control bits read back. U16 roPumpPWMReadback; ///< Reg 368. ROP PWM read back. U16 heaterPWMReadback; ///< Reg 370. Heater PWM read back. + U08 flowReadCount; ///< Reg 372. Flow sensor read counter. + U08 flowErrorCount; ///< Reg 373. Flow sensor error counter. + U16 valvePWMEnableReadback; ///< Reg 374. Valve PWM enable read back. } FPGA_SENSORS_T; /// Record structure for FPGA continuous priority writes. typedef struct { - U08 valveControl; ///< Reg 04. Valve control register. - U08 valvePWMEnable; ///< Reg 05. Valve PWM enable register. + U16 valveControl; ///< Reg 04. Valve control register. U08 conductivityCPiControl; ///< Reg 06. CPi conductivity control register. U08 conductivityCPoControl; ///< Reg 07. CPo conductivity control register. U16 conductivityCPiAddress; ///< Reg 08. CPi conductivity address register. @@ -146,12 +147,17 @@ U16 fpgaGenWrRd; ///< Reg 20. FPGA general write/read-back register (mirrored to a general read register in read page at addr 256). U16 descalePumpSpeed; ///< Reg 22. Descaler pump speed register. U08 descalePumpControl; ///< Reg 24. Descaler pump control register. - U08 reserved1; ///< Reg 25. Reserved. + U08 roPumpControl; ///< Reg 25. RO pump control register.. U16 valveVwiPWMLow; ///< Reg 26. Valve VWi PWM low pulse period in 0.1 uSec. U16 valveVwiPWMPeriod; ///< Reg 28. Valve VWi PWM full period in 0.1 uSec. U16 valvePWMPullIn; ///< Reg 30. Valve PWM high pulse period when valve is on in 0.1 uSec. U16 roPumpPWMDutyCyclePct; ///< Reg 32. ROP PWM duty cycle in percentage. U16 heaterPWMDutyCyclePct; ///< Reg 34. HRO PWM duty cycle in percentage. + U08 reserved1; ///< Reg 36. Not used. + U08 heaterControl; ///< Reg 37. Heater (HRO) control register. + U08 flowControl; ///< Reg 38. AVS Romer flow sensor control register. + U08 flowAddress; ///< Reg 39. AVS Romer flow sensor I2C slave address register. + U16 valvePWMEnable; ///< Reg 40. Valve PWM enable register. } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -375,13 +381,26 @@ * @details \b Outputs: fpgaSensorReadings.valveControlReadback * @return none *************************************************************************/ -U08 getFPGAValveStates( void ) +U16 getFPGAValveStates( void ) { return fpgaSensorReadings.valveControlReadback; } /*********************************************************************//** * @brief + * The setROPumpEnable function enables or disables the RO pump. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.roPumpControl + * @param enable flag indicating whether to enable or disable the RO pump. + * @return none + *************************************************************************/ +void setROPumpEnable( BOOL enable ) +{ + fpgaActuatorSetPoints.roPumpControl = ( TRUE == enable ? 0x1 : 0x0 ); +} + +/*********************************************************************//** + * @brief * The setROPumpPWMPct function sets the RO pump PWM duty cycle. * The higher the PWM duty cycle (0..500), the faster the pump will go. * @details \b Inputs: none @@ -662,6 +681,54 @@ /*********************************************************************//** * @brief + * The getFPGAPPiRawPressure function gets the PPi pressure reading. + * @details \b Inputs: fpgaSensorReadings.pressurePpi + * @details \b Outputs: none + * @return PPi pressure + *************************************************************************/ +S16 getFPGAPPiRawPressure( void ) +{ + return fpgaSensorReadings.pressurePpi; +} + +/*********************************************************************//** + * @brief + * The getFPGAPPiRawTemperature function gets the PPi sensor temperature. + * @details \b Inputs: fpgaSensorReadings.temperaturePpi + * @details \b Outputs: none + * @return PPi sensor temperature + *************************************************************************/ +S16 getFPGAPPiRawTemperature( void ) +{ + return fpgaSensorReadings.temperaturePpi; +} + +/*********************************************************************//** + * @brief + * The getFPGAPPiReadCount function gets the PPi sensor read count. + * @details \b Inputs: fpgaSensorReadings.readCountPpi + * @details \b Outputs: none + * @return PPi sensor read count + *************************************************************************/ +U08 getFPGAPPiReadCount( void ) +{ + return fpgaSensorReadings.readCountPpi; +} + +/*********************************************************************//** + * @brief + * The getFPGAPPiErrorCount function gets the PPi sensor error count. + * @details \b Inputs: fpgaSensorReadings.errorCountPpi + * @details \b Outputs: none + * @return PPi sensor error count + *************************************************************************/ +U08 getFPGAPPiErrorCount( void ) +{ + return fpgaSensorReadings.errorCountPpi; +} + +/*********************************************************************//** + * @brief * The getFPGAFloaterState function gets the floater level state. * @details \b Inputs: fpgaSensorReadings.levelSwitch * @details \b Outputs: none