Index: firmware/App/Services/FpgaRO.c =================================================================== diff -u -ra1907314deab28c20945cd41d2d167924daf2c08 -r08fd3b3564f6852dec6d2038d37f66b8692fdf44 --- firmware/App/Services/FpgaRO.c (.../FpgaRO.c) (revision a1907314deab28c20945cd41d2d167924daf2c08) +++ firmware/App/Services/FpgaRO.c (.../FpgaRO.c) (revision 08fd3b3564f6852dec6d2038d37f66b8692fdf44) @@ -38,6 +38,9 @@ #define MAX_FPGA_COMM_FAILURES 3 ///< FPGA maximum comm failures per MAX_FPGA_COMM_FAILURES_WINDOW_MS #define MIN_POWER_ON_TIME_FOR_COMM_FAILS ( 1 * MS_PER_SECOND ) ///< Allow FPGA comm errors for first second after power-up +#define HEATER_ENABLED 0x01 ///< Heater enable bit. +#define HEATER_DISABLED 0x00 ///< Heater disabled. + #define FPGA_CONDUCTIVITY_RESET_BIT 0x01 ///< Conductivity Sensor reset bit mask. #define FPGA_CONDUCTIVITY_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor initialization enable bit mask. #define FPGA_CONDUCTIVITY_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor write enable bit mask. @@ -403,27 +406,29 @@ /*********************************************************************//** * @brief - * The setROPumpPWMPct function sets the RO pump PWM duty cycle. + * The setROPumpPWM function sets the RO pump PWM duty cycle. * The higher the PWM duty cycle (0..500), the faster the pump will go. + * @note PWM values < 5% or > 95% will cause pump to stop so effective + * range is actually 25..475. * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints.roPumpPWMDutyCyclePct * @param pwm PWM duty cycle magnitude * @return none *************************************************************************/ -void setROPumpPWMPct( U16 pwm ) +void setROPumpPWM( U16 pwm ) { fpgaActuatorSetPoints.roPumpPWMDutyCyclePct = pwm; } /*********************************************************************//** * @brief - * The getROPumpPWMPct function gets a read back from FPGA of RO pump PWM + * The getROPumpPWM function gets a read back from FPGA of RO pump PWM * duty cycle. * @details \b Inputs: fpgaSensorReadings.roPumpPWMReadback * @details \b Outputs: none * @return measured speed (RPM) of the RO pump *************************************************************************/ -U16 getROPumpPWMPct( void ) +U16 getROPumpPWM( void ) { return fpgaSensorReadings.roPumpPWMReadback; } @@ -443,6 +448,42 @@ /*********************************************************************//** * @brief + * The setFPGAHeaterEnabled function sets the heater enable on or off. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.heaterControl + * @param enable Flag indicating whether to enable or disable the heater. + * @return none + *************************************************************************/ +void setFPGAHeaterEnabled( BOOL enable ) +{ + if ( TRUE == enable ) + { + fpgaActuatorSetPoints.heaterControl = HEATER_ENABLED; + } + else + { + fpgaActuatorSetPoints.heaterControl = HEATER_DISABLED; + } +} + +/*********************************************************************//** + * @brief + * The setFPGAHeaterPWM function sets the heater PWM duty cycle. + * The higher the PWM duty cycle (0..500), the faster the pump will go. + * @note PWM values < 5% or > 95% will cause heater to go off so effective + * range is actually 25..475. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.heaterPWMDutyCyclePct + * @param pwm PWM duty cycle magnitude + * @return none + *************************************************************************/ +void setFPGAHeaterPWM( U16 pwm ) +{ + fpgaActuatorSetPoints.heaterPWMDutyCyclePct = pwm; +} + +/*********************************************************************//** + * @brief * The getFPGAPRiRawPressure function gets the PRi pressure reading. * @details \b Inputs: fpgaSensorReadings.pressurePri * @details \b Outputs: none