Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r38c28a43b71d21d72906b07e9d60107b84bffb37 -r224b86c0847207c168d38fa1713a1e9116642267 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 224b86c0847207c168d38fa1713a1e9116642267) @@ -97,7 +97,7 @@ } FPGA_HEADER_T; // read only on FPGA /// FPGA sensors' readings struct. -typedef struct // TODO - add all sensor readings to this structure per FPGA register map +typedef struct { U32 fpgaLCA1; ///< Reg 256. ADC1 channel 0 - load cell A1 U32 fpgaLCB1; ///< Reg 260. ADC1 channel 1 - load cell B1 @@ -218,8 +218,8 @@ U08 fpgaCPiCPoEmstatRxErrCount; ///< Reg 461. CPi/CPo Emstat Rx error count U16 fpgaCPiCPoEmstatTxFIFOCount; ///< Reg 462. CPi/CPo Emstat Tx FIFO count U16 fpgaCPiCPoEmstatRxFIFOCount; ///< Reg 464. CPi/CPo Emstat Rx FIFO count - U08 fpgaDrainPumpFrequency; ///< Reg 466. drain pump frequency - U16 fpgaDrainPumpHallSnsrStatus; ///< Reg 468. drain pump hall sensor status + U16 fpgaPowerSupply2; ///< Reg 466. power supply 2 count + U16 fpgaOnBoardThermistor; ///< Reg 468. onboard thermistor } DG_FPGA_SENSORS_T; typedef struct @@ -290,10 +290,8 @@ U16 fpgaDACRegFIn; ///< Reg 126. Debug DAC channel F output U16 fpgaDACRegGIn; ///< Reg 128. Debug DAC channel G output U16 fpgaDACRegHIn; ///< Reg 130. Debug DAC channel H output - U32 fpgaCP1StepCount; ///< Reg 132. Concentrate pump 1 step count - U32 fpgaCP2StepCount; ///< Reg 136. Concentrate pump 2 step count - U08 fgpaNewCP2Control; ///< Reg 140. Concentrate pump 2 control - U08 fpgaNewCP1Control; ///< Reg 141. Concentrate pump 1 control + U08 fgpaNewCP2Control; ///< Reg 132. Concentrate pump 2 control + U08 fpgaNewCP1Control; ///< Reg 133. Concentrate pump 1 control } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -1117,60 +1115,92 @@ /*********************************************************************//** * @brief - * The setFPGACP1Control function sets the control configuration for + * The setFPGAcidPumpControl 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 ) +void setFPGAV3AcidPumpControl( U08 pumpControl ) { fpgaActuatorSetPoints.fpgaCP1Control = pumpControl; } /*********************************************************************//** * @brief - * The setFPGACP2Control function sets the control configuration for + * The setFPGABicarbPumpControl 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 ) +void setFPGAV3BicarbPumpControl( U08 pumpControl ) { fpgaActuatorSetPoints.fpgaCP2Control = pumpControl; } /*********************************************************************//** * @brief - * The setFPGACP1SetStepSpeed function sets the step speed period for concentrate pump CP1. + * The setFPGAAcidPumpSetStepSpeed 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 ) +void setFPGAAcidPumpSetStepSpeed( U16 stepSpeed ) { fpgaActuatorSetPoints.fpgaCP1StepSpeed = stepSpeed; } /*********************************************************************//** * @brief - * The setFPGACP2SetStepSpeed function sets the step speed period for concentrate pump CP2. + * The setFPGABicarbSetStepSpeed 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 ) +void setFPGABicarbSetStepSpeed( U16 stepSpeed ) { fpgaActuatorSetPoints.fpgaCP2StepSpeed = stepSpeed; } +/****************************DVT Functions*******************************************/ + /*********************************************************************//** * @brief + * The setFPGAAcidPumpControl function sets the DVT concentrate pump 1 + * (acid pump) control mode. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control + * @param control Concentrate pump control set + * @return none + *************************************************************************/ +void setFPGAAcidPumpControl( U08 control ) +{ + fpgaActuatorSetPoints.fpgaNewCP1Control = control; +} + +/*********************************************************************//** + * @brief + * The setFPGABicarbPumpControl function sets the DVT concentrate pump 2 + * (bicarb pump) control mode. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fgpaNewCP2Control + * @param control Concentrate pump control set + * @return none + *************************************************************************/ +void setFPGABicarbPumpControl( U08 control ) +{ + fpgaActuatorSetPoints.fgpaNewCP2Control = control; +} + +/*********************************************************************//** + * @brief * The getFPGAVersions function gets the FPGA version numbers. * @details Inputs: fpgaHeader * @details Outputs: none @@ -1650,11 +1680,7 @@ *************************************************************************/ U32 getFPGACPi( void ) { -#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPi; -#else - return 0; -#endif } /*********************************************************************//** @@ -1715,11 +1741,7 @@ *************************************************************************/ U32 getFPGACPo( void ) { -#ifndef ENABLE_DVT_BOARD return fpgaSensorReadings.fpgaCPo; -#else - return 0; -#endif } /*********************************************************************//** @@ -1742,7 +1764,7 @@ * @details Outputs: none * @return Emstat conductivity sensor output byte *************************************************************************/ -U08 getFPGAEmstatOutByte( void ) +U08 getFPGAEmstatCD1CD2OutByte( void ) { return fpgaSensorReadings.fpgaCD1CD2EmstatOutByte; } @@ -2172,6 +2194,43 @@ return ( fpgaSensorReadings.fpgaBaroTemperature & MASK_OFF_U32_MSB ); } -/****************************DVT Functions*******************************************/ +/*********************************************************************//** + * @brief + * The getFPGAEmstatCPiCPoByteOut function gets the FPGA Emstat CPi/CPo + * byte out data. + * @details Inputs: fpgaSensorReadings.fpgaCPiCPoEmstatOutByte + * @details Outputs: none + * @return CPi/CPo Emstat byte out + *************************************************************************/ +U08 getFPGAEmstatCPiCPoByteOut( void ) +{ + return fpgaSensorReadings.fpgaCPiCPoEmstatOutByte; +} +/*********************************************************************//** + * @brief + * The getFPGAEmstatCPiCPoRxFifoCount function gets the FPGA Emstat CPi/CPo + * receive FIFO count. + * @details Inputs: fpgaSensorReadings.fpgaCD1CD2EmstatRxFifoCount + * @details Outputs: none + * @return CPi/CPo Rx FIFO count + *************************************************************************/ +U16 getFPGAEmstatCPiCPoRxFifoCount( void ) +{ + return fpgaSensorReadings.fpgaCD1CD2EmstatRxFifoCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAEmstatCPiCPoRxErrCount function gets the FPGA Emstat CPi/CPo + * receive FIFO error count. + * @details Inputs: fpgaSensorReadings.fpgaCD1CD2EmstatRxErrorCount + * @details Outputs: none + * @return CPi/CPo Rx FIFO error count + *************************************************************************/ +U08 getFPGAEmstatCPiCPoRxErrCount( void ) +{ + return fpgaSensorReadings.fpgaCD1CD2EmstatRxErrorCount; +} + /**@}*/