Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r4d7d40a27130dc813d653f044cbb856b1b7d8481 -ra726311564521affd46cbbaf129bdffb22e1d58f --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 4d7d40a27130dc813d653f044cbb856b1b7d8481) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision a726311564521affd46cbbaf129bdffb22e1d58f) @@ -156,16 +156,31 @@ U08 fpgaReserved1; ///< Reg 375. Reserved U16 fpgaValveStates; ///< Reg 376. Valves states + U16 fpgaFan1Pulse; ///< Reg 378. Fan 1 pulse time in 2.5 us solution + U16 fpgaFan2Pulse; ///< Reg 380. Fan 2 pulse time in 2.5 us solution + + U08 fpgaEmstatOutByte; ///< Reg 382. Emstat output FIFO - data from the Emstat device + U08 fpgaEmstatRxErrorCount; ///< Reg 383. Number of receive errors since power-up + U16 fpgaEmstatTxFifoCount; ///< Reg 384. Number of bytes in the Emstat Tx FIFO buffer + U16 fpgaEmstatRxFifoCount; ///< Reg 386. Number of bytes in the Emstat Rx FIFO buffer + U16 fpgaCP1HallSense; ///< Reg 388. Concentrate pump CP1 hall sensor pulse width. + U16 fpgaCP2HallSense; ///< Reg 390. Concentrate pump CP2 hall sensor pulse width. } DG_FPGA_SENSORS_T; typedef struct { - U08 fpgaCPoControlReg; ///< Reg 12. CPo control register - U08 fpgaCPiControlReg; ///< Reg 13. CPi control register - U16 fpgaCPoProbeType; ///< Reg 14. CPo probe type - U16 fpgaCPiProbeType; ///< Reg 16. CPi probe type - U16 fpgaDrainPumpSetSpeed; ///< Reg 18. Drain pump control register - U16 fpgaValveStates; ///< Reg 20. Valve control register + U08 fpgaCPoControlReg; ///< Reg 12. CPo control register + U08 fpgaCPiControlReg; ///< Reg 13. CPi control register + U16 fpgaCPoProbeType; ///< Reg 14. CPo probe type + U16 fpgaCPiProbeType; ///< Reg 16. CPi probe type + U16 fpgaDrainPumpSetSpeed; ///< Reg 18. Drain pump control register + U16 fpgaValveStates; ///< Reg 20. Valve control register + U08 fpgaAcclCmd; ///< Reg 22. Accelerometer interface command register + U08 fpgaCP1Control; ///< Reg 23. Concentrate pump CP1 control register + U16 fpgaCP1StepSpeed; ///< Reg 24. Concentrate pump CP1 step speed register + U16 fpgaCP2StepSpeed; ///< Reg 26. Concentrate pump CP2 step speed register + U08 fpgaCP2Control; ///< Reg 28. Concentrate pump CP2 control register + U08 fpgaEmstatControl; ///< Reg 29. Emstat conductivity sensor control register } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -935,6 +950,60 @@ /*********************************************************************//** * @brief + * The setFPGACP1Control function sets the control configuration for + * concentrate pump CP1. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaCP1Control + * @param pumpControl The concentrate pump control configuration + * @return none + *************************************************************************/ +void setFPGACP1Control( U08 pumpControl ) +{ + fpgaActuatorSetPoints.fpgaCP1Control = pumpControl; +} + +/*********************************************************************//** + * @brief + * The setFPGACP2Control function sets the control configuration for + * concentrate pump CP2. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaCP2Control + * @param pumpControl The concentrate pump control configuration + * @return none + *************************************************************************/ +void setFPGACP2Control( U08 pumpControl ) +{ + fpgaActuatorSetPoints.fpgaCP2Control = pumpControl; +} + +/*********************************************************************//** + * @brief + * The setFPGACP1SetStepSpeed function sets the step speed period for concentrate pump CP1. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaCP1StepSpeed + * @param stepSpeed The concentrate pump step speed period + * @return none + *************************************************************************/ +void setFPGACP1SetStepSpeed( U16 stepSpeed ) +{ + fpgaActuatorSetPoints.fpgaCP1StepSpeed = stepSpeed; +} + +/*********************************************************************//** + * @brief + * The setFPGACP2SetStepSpeed function sets the step speed period for concentrate pump CP2. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaCP2StepSpeed + * @param stepSpeed The concentrate pump step speed period + * @return none + *************************************************************************/ +void setFPGACP2SetStepSpeed( U16 stepSpeed ) +{ + fpgaActuatorSetPoints.fpgaCP2StepSpeed = stepSpeed; +} + +/*********************************************************************//** + * @brief * The getFPGAVersions function gets the FPGA version numbers. * @details Inputs: fpgaHeader * @details Outputs: none @@ -1434,4 +1503,67 @@ return fpgaSensorReadings.fpgaCPo; } +/*********************************************************************//** + * @brief + * The getFPGAEmstatOutByte function gets Emstat conductivity sensor output byte. + * @details Inputs: fpgaSensorReadings.fpgaEmstatOutByte + * @details Outputs: none + * @return Emstat conductivity sensor output byte + *************************************************************************/ +U08 getFPGAEmstatOutByte( void ) +{ + return fpgaSensorReadings.fpgaEmstatOutByte; +} + +/*********************************************************************//** + * @brief + * The getFPGAEmstatRxErrCount function gets Emstat conductivity sensor error count. + * @details Inputs: fpgaSensorReadings.fpgaEmstatRxErrorCount + * @details Outputs: none + * @return Emstat conductivity sensor receive error count + *************************************************************************/ +U08 getFPGAEmstatRxErrCount( void ) +{ + return fpgaSensorReadings.fpgaEmstatRxErrorCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAEmstatRxFifoCount function gets Emstat conductivity sensor receive + * fifo buffer count. + * @details Inputs: fpgaSensorReadings.fpgaEmstatTxFifoCount + * @details Outputs: none + * @return Emstat conductivity sensor receive fifo buffer count + *************************************************************************/ +U16 getFPGAEmstatRxFifoCount( void ) +{ + return fpgaSensorReadings.fpgaEmstatRxFifoCount; +} + +/*********************************************************************//** + * @brief + * The getFPGACP1HallSensePulseWidth function gets concentrate pump CP1 + * hall sense pulse width. + * @details Inputs: fpgaSensorReadings.fpgaCP1HallSense + * @details Outputs: none + * @return concentrate pump CP1 hall sense pulse width + *************************************************************************/ +U16 getFPGACP1HallSensePulseWidth( void ) +{ + return fpgaSensorReadings.fpgaCP1HallSense; +} + +/*********************************************************************//** + * @brief + * The getFPGACP1HallSensePulseWidth function gets concentrate pump CP2 + * hall sense pulse width. + * @details Inputs: fpgaSensorReadings.fpgaCP2HallSense + * @details Outputs: none + * @return concentrate pump CP2 hall sense pulse width + *************************************************************************/ +U16 getFPGACP2HallSensePulseWidth( void ) +{ + return fpgaSensorReadings.fpgaCP2HallSense; +} + /**@}*/