Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r3417933e6edf61a914c428e2fa944b3b349272a4 -rfabb2cc72b3b94c1e02e84894ccb52d05a12d7cd --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 3417933e6edf61a914c428e2fa944b3b349272a4) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision fabb2cc72b3b94c1e02e84894ccb52d05a12d7cd) @@ -35,6 +35,10 @@ #define ENERGIZED 1 ///< 1 for energized valve. #define ALL_VALVES_DEENERGIZED 0x0000 ///< 0 in U16 bit field for all valves. +#define VALVE_PWM_PERIOD 50 ///< Valve PWM Period in 0.1 us res ( 20kHz ) +#define VALVE_PWM_LOW ( VALVE_PWM_PERIOD * 0.2 ) ///< Valve low PWM percentage +#define VALVE_PWM_PULL_IN 100 ///< Valve 'strike' period at 100% PWM in ms + #define MAX_VALVE_STATE_MISMATCH_TIMER_COUNT (100 / TASK_PRIORITY_INTERVAL ) ///< Maximum time commanded valves state can fail to match read back valve states in a row. #define VALVES_STATE_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval ( ms / task time) at which valves states are published on CAN bus. #define DATA_PUBLISH_COUNTER_START_COUNT 50 ///< Data publish counter start count. @@ -71,6 +75,7 @@ static BOOL checkValveStateName( DD_VALVES_T valveID, VALVE_STATE_NAMES_T valveStateName ); static U32 convertValveStateNameToValveState( VALVE_STATE_NAMES_T valveStateName ); static U32 getValveState( U32 valveID ); +static void setFPGAPWMConfigurations( void ); /*********************************************************************//** * @brief @@ -118,16 +123,79 @@ valvesStatesPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; // reset valves states publication timer fpValveStatesPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; // reset valves states publication timer readCommandedValveStates(); + + // initially set valve PWM configuration and enable + setFPGAPWMConfigurations(); + // initially set all valves to de-energized state via FPGA setFPGADDValveStates( commandedValvesStates ); setFPGABCValveStates( commandedBCValveStates ); setFPGASpareValveStates( commandedSpareValveStates ); - setFPGAIOValveStates( commandedIOValveStates ); setFPGAFPValveStates( commandedFPValveStates ); + setFPGAIOValveStates( commandedIOValveStates ); + } /*********************************************************************//** * @brief + * The setFPGAPWMConfigurations function sets the FPGA for Valve PWM control. + * @details \b Inputs: none + * @details \b Outputs: Valves PWM timing set and enabled. + * @return none + *************************************************************************/ +static void setFPGAPWMConfigurations( void ) +{ + // Balancing Chamber valves are not PWM configured. + U32 i; + U16 valveDDBits = 0; + U08 valveSPBits = 0; + U08 valveIOBits = 0; + U08 valveFPBits = 0; + + // set timing values + setFPGAValveDDPWMPullIn( VALVE_PWM_PULL_IN ); + setFPGAValveDDPWMLow( VALVE_PWM_LOW ); + setFPGAValveDDPWMPeriod( VALVE_PWM_PERIOD ); + + setFPGAValveSPPWMPullIn( VALVE_PWM_PULL_IN ); + setFPGAValveSPPWMLow( VALVE_PWM_LOW ); + setFPGAValveSPPWMPeriod( VALVE_PWM_PERIOD ); + + setFPGAValveIOFPPWMPullIn( VALVE_PWM_PULL_IN ); + setFPGAValveIOFPPWMLow( VALVE_PWM_LOW ); + setFPGAValveIOFPPWMPeriod( VALVE_PWM_PERIOD ); + + for ( i = FIRST_HYD_VALVE; i <= LAST_HYD_VALVE; i++ ) + { + valveDDBits |= 0x01 << i; + } + + for ( i = FIRST_SP_VALVE; i <= LAST_SP_VALVE; i++ ) + { + valveSPBits |= 0x01 << ( i - FIRST_SP_VALVE ); + } + + for ( i = FIRST_IO_VALVE; i <= LAST_IO_VALVE; i++ ) + { + valveIOBits |= 0x01 << ( i - FIRST_IO_VALVE ); + } + + for ( i = FIRST_FP_VALVE; i <= LAST_FP_VALVE; i++ ) + { + valveFPBits |= 0x01 << ( i - FIRST_FP_VALVE ); + } + + // set enable + setFPGAValveDDPWMEnable( valveDDBits ); + setFPGAValveSPPWMEnable( valveSPBits ); + setFPGAValveIOPWMEnable( valveIOBits ); + setFPGAValveFPPWMEnable( valveFPBits ); + + +} + +/*********************************************************************//** + * @brief * The execValves function executes the valves driver. * @details \b Inputs: valvesStates, valveStateMismatchCounter * pendingValveStateChangeCountDowns, commandedValvesStates, @@ -141,11 +209,11 @@ void execValves( void ) { U32 i; - U16 readValvesStates = getFPGADDValveStates(); - U08 readValveBCStates = getFPGAValveBCStates(); - U08 readValveSpStates = getFPGAValveSpStates(); - U08 readValveIOStates = getFPGAIOValveStates(); - U08 readValveFPStates = getFPGAFPValveStates(); + U16 readValvesStates = getFPGADDValveStates(); + U08 readValveBCStates = getFPGAValveBCStates(); + U08 readValveSpStates = getFPGAValveSpStates(); + U08 readValveIOStates = getFPGAIOValveStates(); + U08 readValveFPStates = getFPGAFPValveStates(); // Verify read back FPGA valve states match last commanded valve states if ( ( readValvesStates != commandedValvesStates ) || @@ -184,8 +252,8 @@ setFPGADDValveStates( commandedValvesStates ); setFPGABCValveStates( commandedBCValveStates ); setFPGASpareValveStates( commandedSpareValveStates ); - setFPGAIOValveStates( commandedIOValveStates ); setFPGAFPValveStates( commandedFPValveStates ); + setFPGAIOValveStates( commandedIOValveStates ); // Publish valve states on interval publishValvesStates(); Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r3417933e6edf61a914c428e2fa944b3b349272a4 -rfabb2cc72b3b94c1e02e84894ccb52d05a12d7cd --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 3417933e6edf61a914c428e2fa944b3b349272a4) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision fabb2cc72b3b94c1e02e84894ccb52d05a12d7cd) @@ -237,10 +237,10 @@ U16 p12PumpTachCount; ///< Reg 708. P12 pump tachometer counter. U16 dsPumpTachCount; ///< Reg 710. DSP tachometer counter. U16 flowIntTempP7; ///< Reg 712. P7 flow sensor internal temperature. - U08 valveIOControlReadback; ///< Reg 714. Valve IO control bits read back. - U08 valveFPControlReadback; ///< Reg 715. Valve FP control bits read back. - U08 valveIOPWMEnableReadback; ///< Reg 716. Valve IO PWM enable read back. - U08 valveFPPWMEnableReadback; ///< Reg 717. Valve FP PWM enable read back. + U08 valveIOControlReadback; ///< Reg 714. IO Valve control bits read back. + U08 valveFPControlReadback; ///< Reg 715. FP Valve control enable read back. + U08 valveIOPWMEnableReadback; ///< Reg 714. IO Valve PWM enable read back. + U08 valveFPPWMEnableReadback; ///< Reg 715. FP Valve PWM enable read back. U16 p12PumpPWMReadback; ///< Reg 718. P12 pump PWM read back. U16 p40PumpPWMReadback; ///< Reg 720. P40 pump PWM read back. U08 p7flowReadCount; ///< Reg 722. P7 Flow sensor read counter. @@ -298,10 +298,10 @@ U08 fpgaNotUsed; ///< Reg 51. Not used U16 fpgaVBCPWMLow; ///< Reg 52. VBC PWM low ( Balancing chamber valves) U16 fpgaVBCPWMPeriod; ///< Reg 54. VBC PWM period - U16 fpgaVBCPWMPullin; ///< Reg 56. VBC PWM pull in + U16 fpgaVBCPWMPullIn; ///< Reg 56. VBC PWM pull in U16 fpgaVSPPWMLow; ///< Reg 58. VSP PWM low ( Spare valves ) U16 fpgaVSPPWMPeriod; ///< Reg 60. VSP PWM period - U16 fpgaVSPPWMPullin; ///< Reg 62. VSP PWM pull in + U16 fpgaVSPPWMPullIn; ///< Reg 62. VSP PWM pull in U16 fpgaD11PumpRevCount; ///< Reg 64. Acid Concentrate pump revolution count U16 fpgaD10PumpRevCount; ///< Reg 66. Bicarb Concentrate pump revolution count U08 fpgaADCControl; ///< Reg 68. FPGA internal ADC Control register for debugging @@ -313,8 +313,8 @@ U08 fpgaD76PumpControl; ///< Reg 78. UF Pump Control U08 notused; ///< Reg 79. Not used - U08 valveIOControl; ///< Reg 80. Valve IO control register. - U08 valveFPControl; ///< Reg 81. Valve FP control register. + U08 valveIOControl; ///< Reg 80. IO Valve control register. + U08 valveFPControl; ///< Reg 81. FP Valve control register. U08 conductivityP9Control; ///< Reg 82. P9 conductivity control register. U08 conductivityP18Control; ///< Reg 83. P18 conductivity control register. U16 conductivityP9Address; ///< Reg 84. P9 conductivity address register. @@ -324,9 +324,9 @@ U16 descalePumpSpeed; ///< Reg 96. Descaler pump speed register. U08 descalePumpControl; ///< Reg 98. Descaler pump control register. U08 p12PumpControl; ///< Reg 99. P12 pump control register. - U16 valveVwiPWMLow; ///< Reg 100. Valve VWi PWM low pulse period in 0.1 uSec. - U16 valveVwiPWMPeriod; ///< Reg 102. Valve VWi PWM full period in 0.1 uSec. - U16 valvePWMPullIn; ///< Reg 104. Valve PWM high pulse period when valve is on in 0.1 uSec. + U16 valveIOFPPWMLow; ///< Reg 100. Valve VWi PWM low pulse period in 0.1 uSec. + U16 valveIOFPPWMPeriod; ///< Reg 102. Valve VWi PWM full period in 0.1 uSec. + U16 valveIOFPPWMPullIn; ///< Reg 104. Valve PWM high pulse period when valve is on in 0.1 uSec. U16 p12PumpPWMDutyCyclePct; ///< Reg 106. P12 pump PWM duty cycle in percentage. U16 p40PumpPWMDutyCyclePct; ///< Reg 108. P40 pump PWM duty cycle in percentage. U08 p40PumpControl; ///< Reg 110. P40 pump control register. @@ -535,6 +535,219 @@ /*********************************************************************//** * @brief + * The setFPGAValveDDPWMEnable function sets the DD valve 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: fpgaActuatorSetPoints.fpgaValvePWMEnable + * @param valvePWMStates bit mask for requested valve states. + * @return none + *************************************************************************/ +void setFPGAValveDDPWMEnable( U16 valvePWMStates ) +{ + fpgaActuatorSetPoints.fpgaValvePWMEnable = valvePWMStates; +} + +/*********************************************************************//** + * @brief + * The getFPGAValveDDPWMEnable function gets the DD valve 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.fpgaValvePWMEnableStates + * @return none + *************************************************************************/ +U16 getFPGAValveDDPWMEnable( void ) +{ + return fpgaSensorReadings.fpgaValvePWMEnableStates; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveDDPWMPullIn function sets the DD valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAValveDDPWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaDDValvePWMPullin = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveDDPWMLow function sets the DD valves "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveDDPWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaDDValvePWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveDDPWMPeriod function sets the DD valves pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveDDPWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaDDValvePWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveBCPWMEnable function sets the BC valve 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: fpgaActuatorSetPoints.fpgaBCValvePWMControl + * @param valvePWMStates bit mask for requested valve states. + * @return none + *************************************************************************/ +void setFPGAValveBCPWMEnable( U08 valvePWMStates ) +{ + fpgaActuatorSetPoints.fpgaBCValvePWMControl = valvePWMStates; +} + +/*********************************************************************//** + * @brief + * The getFPGAValveBCPWMEnable function gets the BC valve 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.fpgaValveBCPWMStates + * @return none + *************************************************************************/ +U08 getFPGAValveBCPWMEnable( void ) +{ + return fpgaSensorReadings.fpgaValveBCPWMStates; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveBCPWMPullIn function sets the BC valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVBCPWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAValveBCPWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaVBCPWMPullIn = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveBCPWMLow function sets the BC valves "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVBCPWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveBCPWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaVBCPWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveBCPWMPeriod function sets the BC valves pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVBCPWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveBCPWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaVBCPWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveSPPWMEnable function sets the Spare valve 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: fpgaActuatorSetPoints.fpgaDDSpareValvePWMControl + * @param valvePWMStates bit mask for requested valve states. + * @return none + *************************************************************************/ +void setFPGAValveSPPWMEnable( U08 valvePWMStates ) +{ + fpgaActuatorSetPoints.fpgaDDSpareValvePWMControl = valvePWMStates; +} + +/*********************************************************************//** + * @brief + * The getFPGAValveSPPWMEnable function gets the Spare valve 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.fpgaValveSpPWMStates + * @return none + *************************************************************************/ +U08 getFPGAValveSPPWMEnable( void ) +{ + return fpgaSensorReadings.fpgaValveSpPWMStates; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveSPPWMPullIn function sets the Spare valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVSPPWMPullIn + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAValveSPPWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.fpgaVSPPWMPullIn = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveSPPWMLow function sets the Spare valves "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVSPPWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveSPPWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.fpgaVSPPWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveSPPWMPeriod function sets the Spare valves pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaVSPPWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveSPPWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.fpgaVSPPWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief * The setFPGAD48PumpSpeed function sets the speed for the * spent dialysate pump (SDP). * @details \b Inputs: none @@ -2841,42 +3054,56 @@ /*********************************************************************//** * @brief - * The setFPGAIOValveStates function sets the IO valve states with an 8-bit + * The setFPGAFPValveStates function sets the FP valve states with an 8-bit * mask of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: - * 0 - M4.\n - * 1 - M12.\n - * 2:7- Not used. \n + * 0 - P11.\n + * 1 - P33.\n + * 2 - P34.\n + * 3 - P37.\n + * 4 - P39.\n + * 5 - P6.\n + * 6:8 - Not used. \n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveIOControl + * @details \b Outputs: fpgaActuatorSetPoints.valveFPControl * @param valveStates bit mask for requested valve states * @return none *************************************************************************/ -void setFPGAIOValveStates( U08 valveStates ) +void setFPGAFPValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.valveIOControl = valveStates; + fpgaActuatorSetPoints.valveFPControl = valveStates; } /*********************************************************************//** * @brief - * The setFPGAFPValveStates function sets the FP valve states with an 8-bit + * The getFPGAFPValveStates function gets the FP valve commanded states with + * an 8-bit mask representing the set of states with a 1 meaning "energized" + * and a 0 meaning "de-energized". + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.valveFPControlReadback + * @return none + *************************************************************************/ +U08 getFPGAFPValveStates( void ) +{ + return fpgaSensorReadings.valveFPControlReadback; +} + +/*********************************************************************//** + * @brief + * The setFPGAIOValveStates function sets the IO valve states with an 8-bit * mask of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: - * 0 - P11.\n - * 1 - P33.\n - * 2 - P34.\n - * 3 - P37.\n - * 4 - P39.\n - * 5 - P6.\n - * 6:7- Not used. \n + * 0 - M4_VALV.\n + * 1 - M12_VALV.\n + * 2:8 - Not used. \n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveFPControl + * @details \b Outputs: fpgaActuatorSetPoints.valveIOControl * @param valveStates bit mask for requested valve states * @return none *************************************************************************/ -void setFPGAFPValveStates( U08 valveStates ) +void setFPGAIOValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.valveFPControl = valveStates; + fpgaActuatorSetPoints.valveIOControl = valveStates; } /*********************************************************************//** @@ -2895,20 +3122,106 @@ /*********************************************************************//** * @brief - * The getFPGAFPValveStates function gets the FP valve commanded states with - * an 8-bit mask representing the set of states with a 1 meaning "energized" - * and a 0 meaning "de-energized". + * The setFPGAValveIOPWMEnable function sets the IO valve 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.valveFPControlReadback + * @details \b Outputs: fpgaActuatorSetPoints.valveIOPWMEnable + * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ -U08 getFPGAFPValveStates( void ) +void setFPGAValveIOPWMEnable( U08 valvePWMStates ) { - return fpgaSensorReadings.valveFPControlReadback; + fpgaActuatorSetPoints.valveIOPWMEnable = valvePWMStates; } /*********************************************************************//** * @brief + * The getFPGAValveIOPWMEnable function gets the IO valve 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.valveIOPWMEnableReadback + * @return none + *************************************************************************/ +U08 getFPGAValveIOPWMEnable( void ) +{ + return fpgaSensorReadings.valveIOPWMEnableReadback; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveFPPWMEnable function sets the FP valve 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: fpgaActuatorSetPoints.valveFPPWMEnable + * @param valvePWMStates bit mask for requested valve states. + * @return none + *************************************************************************/ +void setFPGAValveFPPWMEnable( U08 valvePWMStates ) +{ + fpgaActuatorSetPoints.valveFPPWMEnable = valvePWMStates; +} + +/*********************************************************************//** + * @brief + * The getFPGAValveFPPWMEnable function gets the FP valve 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.valveFPPWMEnableReadback + * @return none + *************************************************************************/ +U08 getFPGAValveFPPWMEnable( void ) +{ + return fpgaSensorReadings.valveFPPWMEnableReadback; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveIOFPPWMPullIn function sets the IO & FP valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.valveIOFPPWMPullIn + * @param valvePWMPullIn Pull-in period in 1ms resolution. + * @return none + *************************************************************************/ +void setFPGAValveIOFPPWMPullIn( U16 valvePWMPullIn ) +{ + fpgaActuatorSetPoints.valveIOFPPWMPullIn = valvePWMPullIn; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveIOFPPWMLow function sets the IO & FP valves "low" + * period where PWM is at 0% in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.valveIOFPPWMLow + * @param valvePWMLow low period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveIOFPPWMLow( U16 valvePWMLow ) +{ + fpgaActuatorSetPoints.valveIOFPPWMLow = valvePWMLow; +} + +/*********************************************************************//** + * @brief + * The setFPGAValveIOFPPWMPeriod function sets the IO & FP valves pwm + * period in 0.1us resolution. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.valveIOFPPWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. + * @return none + *************************************************************************/ +void setFPGAValveIOFPPWMPeriod( U16 valvePWMPeriod ) +{ + fpgaActuatorSetPoints.valveIOFPPWMPeriod = valvePWMPeriod; +} + +/*********************************************************************//** + * @brief * The setFPGAP12PumpEnable function enables or disables the P12 pump. * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints.p12PumpControl Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r3417933e6edf61a914c428e2fa944b3b349272a4 -rfabb2cc72b3b94c1e02e84894ccb52d05a12d7cd --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 3417933e6edf61a914c428e2fa944b3b349272a4) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision fabb2cc72b3b94c1e02e84894ccb52d05a12d7cd) @@ -43,13 +43,35 @@ //Valve void setFPGADDValveStates( U16 valveStates ); -void setFPGABCValveStates( U08 valveStates ); -void setFPGASpareValveStates( U08 valveStates ); - U16 getFPGADDValveStates( void ); + +void setFPGABCValveStates( U08 valveStates ); U08 getFPGAValveBCStates( void ); + +void setFPGASpareValveStates( U08 valveStates ); U08 getFPGAValveSpStates( void ); +void setFPGAValveDDPWMEnable( U16 valvePWMStates ); +U16 getFPGAValveDDPWMEnable( void ); + +void setFPGAValveBCPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveBCPWMEnable( void ); + +void setFPGAValveSPPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveSPPWMEnable( void ); + +void setFPGAValveDDPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveDDPWMLow( U16 valvePWMLow ); +void setFPGAValveDDPWMPeriod( U16 valvePWMPeriod ); + +void setFPGAValveBCPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveBCPWMLow( U16 valvePWMLow ); +void setFPGAValveBCPWMPeriod( U16 valvePWMPeriod ); + +void setFPGAValveSPPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveSPPWMLow( U16 valvePWMLow ); +void setFPGAValveSPPWMPeriod( U16 valvePWMPeriod ); + // Conductivity and Temperature Sensor void setFPGAD17D74Control( U08 control ); void setFPGAD27D29Control( U08 control ); @@ -233,11 +255,22 @@ //*************** IOFP ******************* -void setFPGAIOValveStates( U08 valveStates ); void setFPGAFPValveStates( U08 valveStates ); -U08 getFPGAIOValveStates( void ); U08 getFPGAFPValveStates( void ); +void setFPGAIOValveStates( U08 valveStates ); +U08 getFPGAIOValveStates( void ); + +void setFPGAValveFPPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveFPPWMEnable( void ); + +void setFPGAValveIOPWMEnable( U08 valvePWMStates ); +U08 getFPGAValveIOPWMEnable( void ); + +void setFPGAValveIOFPPWMPullIn( U16 valvePWMPullIn ); +void setFPGAValveIOFPPWMLow( U16 valvePWMLow ); +void setFPGAValveIOFPPWMPeriod( U16 valvePWMPeriod ); + void setFPGAP12PumpEnable( BOOL enable ); void setFPGAP12PumpPWM( U16 pwm ); U16 getFPGAP12PumpPWM( void );