Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r498757853c009a4e25dec98461be91fcadd8057d -r166d929af60e9051ca100b6914d0bc0af76576b5 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 498757853c009a4e25dec98461be91fcadd8057d) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 166d929af60e9051ca100b6914d0bc0af76576b5) @@ -395,11 +395,9 @@ // Set the valve control mode and default state of valve fpgaActuatorSetPoints.fpgaValveControl = FPGA_ENABLE_VALVES_CONTROL; - fpgaActuatorSetPoints.fpgaValvePWMEnable = FPGA_ENABLE_VALVES_PWM; fpgaActuatorSetPoints.fpgaBCValveControl = FPGA_ENABLE_BC_VALVES_CONTROL; fpgaActuatorSetPoints.fpgaBCValvePWMControl = FPGA_ENABLE_BC_VALVES_PWM; fpgaActuatorSetPoints.fpgaUFValveControl = FPGA_ENABLE_UF_VALVES_CONTROL; - fpgaActuatorSetPoints.fpgaUFValvePWMControl = FPGA_ENABLE_UF_VALVES_PWM; fpgaActuatorSetPoints.fpgaADCControl = FPGA_ADC_AUTO_READ_ENABLE; // initialize FPGA clock speed error time windowed count @@ -555,6 +553,685 @@ /*********************************************************************//** * @brief + * The setFPGAValvePWMEnable function sets the DD valve PWM states with a 16-bit + * set of states - one bit per valve, with a 1 meaning "enabled" and a 0 + * meaning "disabled". The bit positions for these bit states are as follows: + * 0 - D53Valve.\n + * 1 - D52Valve.\n + * 2 - D8Valve.\n + * 3 - D54Valve.\n + * 4 - D14Valve.\n + * 5 - D65Valve.\n + * 6 - D64Valve.\n + * 7 - D31Valve.\n + * 8 - D34Valve.\n + * 9 - D35Valve.\n + * 10 - D40Valve.\n + * 11 - D47Valve.\n + * 12 - D3Valve.\n + * 13 - M4Valve.\n + * 14..15 - reserved or unused. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaValvePWMEnable + * @param valveStates bit mask for the various valve states + * @return none + *************************************************************************/ +void setFPGAValvePWMEnable( U16 valvePWMStates ) +{ + fpgaActuatorSetPoints.fpgaValvePWMEnable = valvePWMStates; +} + +/*********************************************************************//** + * @brief + * The setFPGAUFValvePWMEnable function sets the DD ultrafiltration valve pwm states with a + * 8-bit set of states - one bit per valve, with a 1 meaning "enabled" and a 0 + * meaning "disabled". The bit positions for these bit states are as follows: + * 0 - UFi1.\n + * 1 - UFi2.\n + * 2 - UFo1.\n + * 3 - UFo2.\n + * 4..7 - Unused or reserved.\n + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaUFValvePWMControl + * @param valveStates bit mask for the balancing chamber valve states + * @return none + *************************************************************************/ +void setFPGAUFValvePWMEnable( U08 valvePWMStates ) +{ + fpgaActuatorSetPoints.fpgaUFValvePWMControl = valvePWMStates; +} + +/*********************************************************************//** + * @brief + * The setFPGAD53PWMPullIn function sets the D53 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD53ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD53PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD53ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD53PWMLow function sets the D53 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD53ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD53PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD53ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD53PWMPeriod function sets the D53 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD53ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD53PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD53ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD52PWMPullIn function sets the D52 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD52ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD52PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD52ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD52PWMLow function sets the D52 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.setFPGAD52PWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD52PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD52ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD52PWMPeriod function sets the D52 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD52ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD52PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD52ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD8PWMPullIn function sets the D8 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD8ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD8PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD8ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD8PWMLow function sets the D8 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.setFPGAD8PWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD8PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD8ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD8PWMPeriod function sets the D8 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD8ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD8PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD8ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD54PWMPullIn function sets the D54 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD54ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD54PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD54ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD54PWMLow function sets the D54 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD54ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD54PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD54ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD54PWMPeriod function sets the D54 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD54ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD54PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD54ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD14PWMPullIn function sets the D14 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD14ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD14PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD14ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD14PWMLow function sets the D14 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD14ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD14PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD14ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD14PWMPeriod function sets the D14 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD14ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD14PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD14ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD65PWMPullIn function sets the D65 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD65ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD65PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD65ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD65PWMLow function sets the D65 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD65ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD65PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD65ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD65PWMPeriod function sets the D65 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD65ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD65PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD65ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD64PWMPullIn function sets the D64 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD64ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD64PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD64ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD64PWMLow function sets the D64 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD64ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD64PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD64ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD64PWMPeriod function sets the D64 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD64ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD64PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD64ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD31PWMPullIn function sets the D31 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD31ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD31PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD31ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD31PWMLow function sets the D31 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD31ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD31PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD31ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD31PWMPeriod function sets the D31 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD31ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD31PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD31ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD34PWMPullIn function sets the D34 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD34ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD34PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD34ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD34PWMLow function sets the D34 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD34ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD34PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD34ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD34PWMPeriod function sets the D34 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD34ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD34PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD34ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD35PWMPullIn function sets the D35 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD35ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD35PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD35ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD35PWMLow function sets the D35 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD35ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD35PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD35ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD35PWMPeriod function sets the D35 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD35ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD35PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD35ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD40PWMPullIn function sets the D40 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD40ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD40PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD40ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD40PWMLow function sets the D40 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD40ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD40PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD40ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD40PWMPeriod function sets the D40 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD40ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD40PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD40ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD47PWMPullIn function sets the D47 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD47ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD47PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD47ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD47PWMLow function sets the D47 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD47ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD47PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD47ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD47PWMPeriod function sets the D47 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD47ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD47PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD47ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAD3PWMPullIn function sets the D3 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD3ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAD3PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaD3ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAD3PWMLow function sets the D3 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD3ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD3PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaD3ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAD3PWMPeriod function sets the D3 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD3ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAD3PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaD3ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAM4PWMPullIn function sets the M4 valve Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaM4ValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAM4PWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaM4ValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAM4PWMLow function sets the M4 valve "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaM4ValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAM4PWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaM4ValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAM4PWMPeriod function sets the M4 valve pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaM4ValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAM4PWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaM4ValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAUFValvePWMPullIn function sets the UF valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVUFPWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAUFValvePWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaVUFPWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAUFValvePWMLow function sets the UF valves "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVUFPWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAUFValvePWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaVUFPWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAUFValvePWMPeriod function sets the UF valves pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVUFPWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAUFValvePWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaVUFPWMPeriod = valvePWMPeriod; +} +/*********************************************************************//** + * @brief * The setFPGAD48PumpSpeed function sets the speed for the * spent dialysate pump (SDP). * @details \b Inputs: none @@ -2058,6 +2735,20 @@ /*********************************************************************//** * @brief + * The getFPGAValvePWMStates function gets the valves pwm states with + * an 16-bit mask representing the set of states with a 1 meaning "enabled" + * and a 0 meaning "disabled". + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaValvePWMEnableStates + * @return none + *************************************************************************/ +U16 getFPGAValvePWMStates( void ) +{ + return fpgaSensorReadings.fpgaValvePWMEnableStates; +} + +/*********************************************************************//** + * @brief * The getFPGAValveBCStates function gets the latest sensed balancing * chamber valve states. * See setFPGABCValveStates for BC valve state bit positions. @@ -2086,6 +2777,19 @@ /*********************************************************************//** * @brief + * The getFPGAValvePWMStates function gets the UF valves pwm states with + * an 8-bit mask representing the set of states with a 1 meaning "enabled" + * and a 0 meaning "disabled". + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaValveUFPWMStates + * @return none + *************************************************************************/ +U08 getFPGAValveUFPWMStates( void ) +{ + return fpgaSensorReadings.fpgaValveUFPWMStates; +} +/*********************************************************************//** + * @brief * The getFPGAD9PresReadCount function gets hydraulics outlet pressure sensor counter of * good SPI transmissions between FPGA and Sensor. * @details \b Inputs: fpgaSensorReadings.fpgaD9PresReadCnt