Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r322747d530c1b8205be257557e53dcfe9caad50a -r521cd469ec8e35476a27475170848d0f62aa0ec8 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 322747d530c1b8205be257557e53dcfe9caad50a) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 521cd469ec8e35476a27475170848d0f62aa0ec8) @@ -90,7 +90,8 @@ #define FPGA_D6_FLOATER_LEVEL_BIT 0x03 ///< Floater level bit mask. -#define FPGA_D5_HEATER_CNTRL_BIT 0x01 ///< FPGA GIO D5 heater control bit mask +#define FPGA_D5_HEATER_CNTRL_BIT 0x01 ///< FPGA GIO D5 heater control bit mask +#define FPGA_D5_HEATER_PWM_ENABLE_BIT 0x02 ///< FPGA D5 PWM based heater control bit mask /// FPGA size of V3 read bytes. #define FPGA_SIZE_OF_V3_READ_BYTES ( FPGA_READ_V3_END_BYTE_NUM - FPGA_READ_V3_START_BYTE_NUM ) @@ -324,6 +325,8 @@ U16 fpgaD10PumpRevCount; ///< Reg 144. Bicarb Concentrate pump revolution count U08 fpgaADCControl; ///< Reg 146. FPGA internal ADC Control register for debugging U08 fpgaGPIOControl; ///< Reg 147. FPGA GPIO control interface + U16 fpgaACRelayPWMLow; ///< Reg 148. Length of time in 10us resoultion that PWM output stays low. + U16 fpgaACRelayPWMPeriod; ///< Reg 150. PWM period for AC relay/heater. } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -1341,6 +1344,55 @@ /*********************************************************************//** * @brief + * The setFPGAD5HeaterPWMEnableControl function sets whether the primary heater + * control based out of On/OFF (0) or PWM based control (1). + * @details \b Inputs: none + * @details \b Outputs: fpgaGPIOControl + * @param enable PWM based heater control when true, otherwise On/Off Control. + * @return none + *************************************************************************/ +void setFPGAD5HeaterPWMEnableControl( BOOL enable ) +{ + if ( TRUE == enable) + { + fpgaActuatorSetPoints.fpgaGPIOControl |= FPGA_D5_HEATER_PWM_ENABLE_BIT; + } + else + { + fpgaActuatorSetPoints.fpgaGPIOControl &= ~FPGA_D5_HEATER_PWM_ENABLE_BIT; + } +} + +/*********************************************************************//** + * @brief + * The setFPGAD5HeaterPWMLowState function sets the PWM low period( Off time) + * for AC heater. + * @details \b Inputs: none + * @details \b Outputs: fpgaACRelayPWMLow + * @param count the number of count that PWM stays low for the AC relay/heater. + * @return none + *************************************************************************/ +void setFPGAD5HeaterPWMLowState( U16 count ) +{ + fpgaActuatorSetPoints.fpgaACRelayPWMLow = count; +} + +/*********************************************************************//** + * @brief + * The setFPGAD5HeaterPWMPeriod function sets the PWM period( On and Off time) + * for AC heater. + * @details \b Inputs: none + * @details \b Outputs: fpgaACRelayPWMPeriod + * @param period the total period of PWM cycle ( On and Off time). + * @return none + *************************************************************************/ +void setFPGAD5HeaterPWMPeriod( U16 period ) +{ + fpgaActuatorSetPoints.fpgaACRelayPWMPeriod = period; +} + +/*********************************************************************//** + * @brief * The getFPGAVersions function gets the FPGA version numbers. * @details \b Inputs: fpgaHeader * @details \b Outputs: none