Index: firmware/App/Services/FPGA.c =================================================================== diff -u -rc1ef106ed0f97dc998230c6e154aa2362aa476d8 -r7e2931d9a468ca3b6e1f2bb88ef0910960dfdb29 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision c1ef106ed0f97dc998230c6e154aa2362aa476d8) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 7e2931d9a468ca3b6e1f2bb88ef0910960dfdb29) @@ -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) @@ -221,9 +236,8 @@ /*********************************************************************//** * @brief * The initFPGA function initializes the FPGA module. - * @details - * Inputs : none - * Outputs : FPGA module initialized. + * @details Inputs: none + * @details Outputs: FPGA module initialized. * @return none *************************************************************************/ void initFPGA( void ) @@ -336,9 +350,8 @@ /*********************************************************************//** * @brief * The resetFPGACommFlags function resets the various fpga comm flags and counters. - * @details - * Inputs : none - * Outputs : fpga comm flags & counters reset + * @details Inputs: none + * @details Outputs: fpga comm flags & counters reset * @return none *************************************************************************/ static void resetFPGACommFlags( void ) @@ -356,9 +369,8 @@ * @brief * The signalFPGAReceiptCompleted function increments a counter to indicate * that another DMA receipt from the FPGA has completed. - * @details - * Inputs : none - * Outputs : fpgaReceiptCounter + * @details Inputs: none + * @details Outputs: fpgaReceiptCounter * @return none *************************************************************************/ void signalFPGAReceiptCompleted( void ) @@ -391,9 +403,8 @@ * @brief * The signalFPGATransmitCompleted function increments a counter to indicate * that another DMA transmit to the FPGA has completed. - * @details - * Inputs : none - * Outputs : fpgaReceiptCounter + * @details Inputs: none + * @details Outputs: fpgaReceiptCounter * @return none *************************************************************************/ void signalFPGATransmitCompleted( void ) @@ -404,9 +415,8 @@ /*********************************************************************//** * @brief * The execFPGA function manages incoming data exchanges with the FPGA. - * @details - * Inputs : fpgaState - * Outputs : fpgaState + * @details Inputs: fpgaState + * @details Outputs: fpgaState * @return none *************************************************************************/ void execFPGAIn( void ) @@ -457,9 +467,8 @@ /*********************************************************************//** * @brief * The execFPGAOut function manages outgoing data exchanges with the FPGA. - * @details - * Inputs : fpgaState - * Outputs : fpgaState + * @details Inputs: fpgaState + * @details Outputs: fpgaState * @return none *************************************************************************/ void execFPGAOut( void ) @@ -498,9 +507,8 @@ * @brief * The handleFPGAReadHeaderState function handles the FPGA state where * the read header registers command is sent to the FPGA. - * @details - * Inputs : none - * Outputs : read command sent to FPGA + * @details Inputs: none + * @details Outputs: read command sent to FPGA * @return next FPGA state *************************************************************************/ static FPGA_STATE_T handleFPGAReadHeaderState( void ) @@ -530,9 +538,8 @@ * @brief * The handleFPGAReceiveHeaderState function handles the FPGA state * where the header registers read response should be ready to take in. - * @details - * Inputs : none - * Outputs : header register values updated + * @details Inputs: none + * @details Outputs: header register values updated * @return next FPGA state *************************************************************************/ static FPGA_STATE_T handleFPGAReceiveHeaderState( void ) @@ -582,9 +589,8 @@ * @brief * The handleFPGAWriteAllActuatorsState function handles the FPGA state * where the bulk write command is sent to the FPGA. - * @details - * Inputs : actuator set points - * Outputs : actuator set points sent to FPGA + * @details Inputs: actuator set points + * @details Outputs: actuator set points sent to FPGA * @return next FPGA state *************************************************************************/ static FPGA_STATE_T handleFPGAWriteAllActuatorsState( void ) @@ -633,9 +639,8 @@ * @brief * The handleFPGAReceiveAllSensorsState function handles the FPGA state * where the bulk read response should be ready to parse. - * @details - * Inputs : none - * Outputs : sensor values updated + * @details Inputs: none + * @details Outputs: sensor values updated * @return next FPGA state *************************************************************************/ static FPGA_STATE_T handleFPGAReceiveAllSensorsState( void ) @@ -690,9 +695,8 @@ /*********************************************************************//** * @brief * The execFPGATest function executes the FPGA self-test. - * @details - * Inputs : fpgaHeader - * Outputs : none + * @details Inputs: fpgaHeader + * @details Outputs: none * @return passed, or failed *************************************************************************/ SELF_TEST_STATUS_T execFPGATest( void ) @@ -721,9 +725,8 @@ * @brief * The setupDMAForWriteCmd function sets the byte count for the next DMA * write command to the FPGA. - * @details - * Inputs : none - * Outputs : number of bytes for next FPGA write command is set + * @details Inputs: none + * @details Outputs: number of bytes for next FPGA write command is set * @param bytes2Transmit number of bytes to be transmitted via DMA to the FPGA. * @return none *************************************************************************/ @@ -744,9 +747,8 @@ * @brief * The startDMAWriteCmd function initiates the DMA transmit for the next * DMA write command to the FPGA. - * @details - * Inputs : none - * Outputs : DMA write command to FPGA is initiated + * @details Inputs: none + * @details Outputs: DMA write command to FPGA is initiated * @return none *************************************************************************/ static void startDMAWriteCmd( void ) @@ -760,9 +762,8 @@ * @brief * The setupDMAForWriteResp function sets the expected byte count for the * next DMA write command response from the FPGA. - * @details - * Inputs : none - * Outputs : number of expected bytes for next FPGA write command response is set + * @details Inputs: none + * @details Outputs: number of expected bytes for next FPGA write command response is set * @param bytes2Receive number of bytes expected to be transmitted via DMA from the FPGA. * @return none *************************************************************************/ @@ -783,9 +784,8 @@ * @brief * The startDMAReceiptOfWriteResp function initiates readiness of the DMA * receiver for the next DMA write command response from the FPGA. - * @details - * Inputs : none - * Outputs : DMA write command response is ready to be received from the FPGA + * @details Inputs: none + * @details Outputs: DMA write command response is ready to be received from the FPGA * @return none *************************************************************************/ static void startDMAReceiptOfWriteResp( void ) @@ -799,9 +799,8 @@ * @brief * The setupDMAForReadCmd function sets the byte count for the next DMA * read command to the FPGA. - * @details - * Inputs : none - * Outputs : number of bytes for next FPGA read command is set + * @details Inputs: none + * @details Outputs: number of bytes for next FPGA read command is set * @param bytes2Transmit number of bytes to be transmitted via DMA to the FPGA. * @return none *************************************************************************/ @@ -822,9 +821,8 @@ * @brief * The startDMAReadCmd function initiates the DMA transmit for the next * DMA read command to the FPGA. - * @details - * Inputs : none - * Outputs : DMA read command to FPGA is initiated + * @details Inputs: none + * @details Outputs: DMA read command to FPGA is initiated * @return none *************************************************************************/ static void startDMAReadCmd( void ) @@ -838,9 +836,8 @@ * @brief * The setupDMAForReadResp function sets the expected byte count for the * next DMA read command response from the FPGA. - * @details - * Inputs : none - * Outputs : number of expected bytes for next FPGA read command response is set + * @details Inputs: none + * @details Outputs: number of expected bytes for next FPGA read command response is set * @param bytes2Receive number of expected bytes to be transmitted via DMA from the FPGA. * @return none *************************************************************************/ @@ -861,9 +858,8 @@ * @brief * The startDMAReceiptOfReadResp function initiates readiness of the DMA * receiver for the next DMA read command response from the FPGA. - * @details - * Inputs : none - * Outputs : DMA read command response is ready to be received from the FPGA + * @details Inputs: none + * @details Outputs: DMA read command response is ready to be received from the FPGA * @return none *************************************************************************/ static void startDMAReceiptOfReadResp( void ) @@ -877,9 +873,8 @@ * @brief * The consumeUnexpectedData function checks to see if a byte is sitting in * the SCI2 received data register. - * @details - * Inputs : fpgaHeader - * Outputs : none + * @details Inputs: fpgaHeader + * @details Outputs: none * @return fpgaDiag *************************************************************************/ static void consumeUnexpectedData( void ) @@ -911,9 +906,8 @@ * 10..11 - reserved (spare).\n * 12- VPd.\n * 13..15 - reserved or unused. - * @details - * Inputs : none - * Outputs : fpgaActuatorSetPoints.fpgaValveStates + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaValveStates * @param valveStates bit mask for the various valve states * @return none *************************************************************************/ @@ -926,9 +920,8 @@ * @brief * The setFPGADrainPumpSpeed function sets the drain pump target speed. * The drain pump DAC value should be set to 1 count for each 12.94 RPM desired. - * @details - * Inputs : none - * Outputs : fpgaActuatorSetPoints.fpgaDrainPumpSetSpeed + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaDrainPumpSetSpeed * @param drainPumpDAC DAC value to command for the drain pump * @return none *************************************************************************/ @@ -943,10 +936,9 @@ /*********************************************************************//** * @brief * The setFPGACPoProbeType function sets the CPo sensor probe type and - * sets the control register to write probte type to the device. - * @details - * Inputs : none - * Outputs : fpgaActuatorSetPoints.fpgaCPoProbeType, fpgaActuatorSetPoints.fpgaCPoControlReg + * sets the control register to write probe type to the device. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaCPoProbeType, fpgaActuatorSetPoints.fpgaCPoControlReg * @param probeType The probe cell constant value to set to * @return none *************************************************************************/ @@ -958,10 +950,78 @@ /*********************************************************************//** * @brief + * The setFPGACPiProbeType function sets the CPi sensor probe type and + * sets the control register to write probe type to the device. + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaCPiProbeType, fpgaActuatorSetPoints.fpgaCPiControlReg + * @param probeType The probe cell constant value to set to + * @return none + *************************************************************************/ +void setFPGACPiProbeType( U16 probeType ) +{ + fpgaActuatorSetPoints.fpgaCPiProbeType = probeType; + fpgaActuatorSetPoints.fpgaCPiControlReg = 0x1; +} + +/*********************************************************************//** + * @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 - * Outputs : none + * @details Inputs: fpgaHeader + * @details Outputs: none * @return none *************************************************************************/ void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ) @@ -975,9 +1035,8 @@ /*********************************************************************//** * @brief * The getFPGALoadCellA1 function gets the latest load cell A 1 reading. - * @details - * Inputs : fpgaSensorReadings - * Outputs : none + * @details Inputs: fpgaSensorReadings + * @details Outputs: none * @return last load cell A 1 reading *************************************************************************/ U32 getFPGALoadCellA1( void ) @@ -988,9 +1047,8 @@ /*********************************************************************//** * @brief * The getFPGALoadCellA2 function gets the latest load cell A 2 reading. - * @details - * Inputs : fpgaSensorReadings - * Outputs : none + * @details Inputs: fpgaSensorReadings + * @details Outputs: none * @return last load cell A 2 reading *************************************************************************/ U32 getFPGALoadCellA2( void ) @@ -1001,9 +1059,8 @@ /*********************************************************************//** * @brief * The getFPGALoadCellB1 function gets the latest load cell B 1 reading. - * @details - * Inputs : fpgaSensorReadings - * Outputs : none + * @details Inputs: fpgaSensorReadings + * @details Outputs: none * @return last load cell B 1 reading *************************************************************************/ U32 getFPGALoadCellB1( void ) @@ -1014,9 +1071,8 @@ /*********************************************************************//** * @brief * The getFPGALoadCellB2 function gets the latest load cell B 2 reading. - * @details - * Inputs : fpgaSensorReadings - * Outputs : none + * @details Inputs: fpgaSensorReadings + * @details Outputs: none * @return last load cell B 2 reading *************************************************************************/ U32 getFPGALoadCellB2( void ) @@ -1028,9 +1084,8 @@ * @brief * The getFPGAValveStates function gets the latest sensed valve states. * See setFPGAValveStates for valve state bit positions. - * @details - * Inputs : fpgaSensorReadings.fpgaValveStates - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaValveStates + * @details Outputs: none * @return last valve states reading *************************************************************************/ U16 getFPGAValveStates( void ) @@ -1041,9 +1096,8 @@ /*********************************************************************//** * @brief * The getFPGAROPumpFlowRate function gets the latest RO flow rate. - * @details - * Inputs : fpgaSensorReadings.fpgaROFlowRate - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaROFlowRate + * @details Outputs: none * @return last RO flow rate reading *************************************************************************/ U16 getFPGAROPumpFlowRate( void ) @@ -1054,9 +1108,8 @@ /*********************************************************************//** * @brief * The getFPGADrainPumpSpeed function gets the latest sensed drain pump speed. - * @details - * Inputs : fpgaSensorReadings.fpgaDrainPumpSpeed - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaDrainPumpSpeed + * @details Outputs: none * @return last drain pump speed reading *************************************************************************/ U16 getFPGADrainPumpSpeed( void ) @@ -1067,9 +1120,8 @@ /*********************************************************************//** * @brief * The getFPGATPiTemp function gets the latest primary heater inlet temperature reading. - * @details - * Inputs : fpgaSensorReadings.fpgaTPiTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTPiTemp + * @details Outputs: none * @return last primary heater inlet temperature reading *************************************************************************/ U32 getFPGATPiTemp( void ) @@ -1080,9 +1132,8 @@ /*********************************************************************//** * @brief * The getFPGATPoTemp function gets the latest primary heater outlet temperature reading. - * @details - * Inputs : fpgaSensorReadings.fpgaTPoTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTPoTemp + * @details Outputs: none * @return last primary heater outlet temperature reading *************************************************************************/ U32 getFPGATPoTemp( void ) @@ -1094,9 +1145,8 @@ * @brief * The getFPGATD1Temp function gets the latest conductivity sensor 1 * temperature reading in ADC. - * @details - * Inputs : fpgaSensorReadings.fpgaCD1Temp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCD1Temp + * @details Outputs: none * @return last conductivity sensor 1 outlet temperature reading *************************************************************************/ U32 getFPGACD1Temp( void ) @@ -1108,9 +1158,8 @@ * @brief * The getFPGATD2Temp function gets the latest conductivity sensor 2 * temperature reading in ADC. - * @details - * Inputs : fpgaSensorReadings.fpgaCD2Temp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCD2Temp + * @details Outputs: none * @return last conductivity sensor 2 outlet temperature reading *************************************************************************/ U32 getFPGACD2Temp( void ) @@ -1122,9 +1171,8 @@ * @brief * The getFPGARTDErrorCount function gets error count of the RTD. It covers * all the four temperature sensors associates with conductivity sensors. - * @details - * Inputs : fpgaSensorReadings.fpgaRTDErrorCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaRTDErrorCnt + * @details Outputs: none * @return Last error count of the RTD temperature sensors *************************************************************************/ U08 getFPGARTDErrorCount( void ) @@ -1137,9 +1185,8 @@ * The getFPGARTDReadCount function gets the read count of the RTD * temperature sensors. It covers all the four temperature sensors associates * with conductivity sensors. - * @details - * Inputs : fpgaSensorReadings.fpgaRTDReadCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaRTDReadCnt + * @details Outputs: none * @return Last read count of the RTC temperature sensors *************************************************************************/ U08 getFPGARTDReadCount( void ) @@ -1151,9 +1198,8 @@ * @brief * The getFPGATRoTemp function gets the latest redundant sensor outlet * temperature reading in ADC. - * @details - * Inputs : fpgaSensorReadings.fpgaTHDoTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTHDoTemp + * @details Outputs: none * @return Last redundant sensor outlet temperature reading *************************************************************************/ U32 getFPGATHDoTemp( void ) @@ -1164,9 +1210,8 @@ /*********************************************************************//** * @brief * The getFPGATHDoErrorCount gets the error count of the THDo (redundant) temperature sensor. - * @details - * Inputs : fpgaSensorReadings.fpgaTHDoErrorCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTHDoErrorCnt + * @details Outputs: none * @return Last redundant sensor outlet temperature error count *************************************************************************/ U08 getFPGATHDoErrorCount( void ) @@ -1177,9 +1222,8 @@ /*********************************************************************//** * @brief * The getFPGATHDoReadCount gets the read count of the THDo (redundant) temperature sensor. - * @details - * Inputs : fpgaSensorReadings.fpgaTHDoReadCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTHDoReadCnt + * @details Outputs: none * @return Last redundant sensor outlet temperature error count reading *************************************************************************/ U08 getFPGATHDoReadCount( void ) @@ -1190,9 +1234,8 @@ /*********************************************************************//** * @brief * The getFPGATDiTemp function gets the latest dialysate inlet temperature reading in ADC. - * @details - * Inputs : fpgaSensorReadings.fpgaTDiTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTDiTemp + * @details Outputs: none * @return last primary heater outlet temperature reading *************************************************************************/ U32 getFPGATDiTemp( void ) @@ -1203,9 +1246,8 @@ /*********************************************************************//** * @brief * The getFPGATDiErrorCount function gets the latest dialysate inlet temperature error count. - * @details - * Inputs : fpgaSensorReadings.fpgaTDiErrorCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTDiErrorCnt + * @details Outputs: none * @return Last dialysate inlet error count *************************************************************************/ U08 getFPGATDiErrorCount( void ) @@ -1216,9 +1258,8 @@ /*********************************************************************//** * @brief * The getFPGATDiReadCount function gets the latest dialysate inlet temperature read count. - * @details - * Inputs : fpgaSensorReadings.fpgaTDiReadCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTDiReadCnt + * @details Outputs: none * @return Last dialysate inlet read count *************************************************************************/ U08 getFPGATDiReadCount( void ) @@ -1230,9 +1271,8 @@ * @brief * The getFPGAPrimaryHeaterTemp function gets the latest primary heater * internal temperature reading. - * @details - * Inputs : fpgaSensorReadings.fpgaPrimaryHeaterIntTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterIntTemp + * @details Outputs: none * @return last primary heater temperature reading *************************************************************************/ U16 getFPGAPrimaryHeaterTemp( void ) @@ -1244,9 +1284,8 @@ * @brief * The getFPGAPrimaryHeaterFlags function gets the latest primary heater * internal temperature sensor flags read. - * @details - * Inputs : fpgaSensorReadings.fpgaPrimaryHeaterFlags - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterFlags + * @details Outputs: none * @return Last primary heater internal temperature sensor flag read *************************************************************************/ U08 getFPGAPrimaryHeaterFlags( void ) @@ -1258,9 +1297,8 @@ * @brief * The geetFPGAPrimaryHeaterReadCount function gets the latest primary heater * internal temperature sensor read count. - * @details - * Inputs : fpgaSensorReadings.fpgaPrimaryHeaterReadCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterReadCnt + * @details Outputs: none * @return Last primary heater internal temperature sensor read count *************************************************************************/ U08 getFPGAPrimaryHeaterReadCount( void ) @@ -1272,9 +1310,8 @@ * @brief * The getFPGATrimmerHeaterTemp function gets the latest trimmer heater * internal temperature sensor reading. - * @details - * Inputs : fpgaSensorReadings.fpgaTrimmerHeaterIntTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterIntTemp + * @details Outputs: none * @return last trimmer heater temperature reading *************************************************************************/ U16 getFPGATrimmerHeaterTemp( void ) @@ -1286,9 +1323,8 @@ * @brief * The getFPGATrimmerHeaterFlags function gets the latest trimmer heater * internal temperature flags read. - * @details - * Inputs : fpgaSensorReadings.fpgaTrimmerHeaterFlags - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterFlags + * @details Outputs: none * @return Last trimmer heater internal temperature flags read *************************************************************************/ U08 getFPGATrimmerHeaterFlags( void ) @@ -1300,9 +1336,8 @@ * @brief * The getFPGATrimmerHeaterReadCount function gets the latest trimmer heater * internal temperature read count. - * @details - * Inputs : fpgaSensorReadings.fpgaTrimmerHeaterReadCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterReadCnt + * @details Outputs: none * @return Last trimmer heater internal temperature read count *************************************************************************/ U08 getFPGATrimmerHeaterReadCount( void ) @@ -1313,9 +1348,8 @@ /*********************************************************************//** * @brief * The getFPGAPrimaryColdJunctionTemp function gets primary cold junction temperature. - * @details - * Inputs : fpgaSensorReadings.fpgaPrimaryHeaterIntJunctionTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterIntJunctionTemp + * @details Outputs: none * @return Last primary cold junction temperature *************************************************************************/ U16 getFPGAPrimaryColdJunctionTemp( void ) @@ -1326,9 +1360,8 @@ /*********************************************************************//** * @brief * The getFPGATrimmerColdJunctionTemp function gets trimmer cold junction temperature. - * @details - * Inputs : fpgaSensorReadings.fpgaTrimmerHeaterIntJunctionTemp - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterIntJunctionTemp + * @details Outputs: none * @return Last trimmer cold junction temperature *************************************************************************/ U16 getFPGATrimmerColdJunctionTemp( void ) @@ -1340,9 +1373,8 @@ * @brief * The getFPGAAccelAxes function gets the accelerometer axis readings. * Axis readings are in ADC counts. 0.004 g per LSB. - * @details - * Inputs : fpgaSensorReadings - * Outputs : none + * @details Inputs: fpgaSensorReadings + * @details Outputs: none * @param x Populate this param with X axis reading * @param y Populate this param with Y axis reading * @param z Populate this param with Z axis reading @@ -1359,9 +1391,8 @@ * @brief * The getFPGAAccelMaxes function gets the maximum accelerometer axis readings from * last FPGA read (every 10 ms). Axis readings are in ADC counts. 0.004 g per LSB. - * @details - * Inputs : fpgaSensorReadings - * Outputs : none + * @details Inputs: fpgaSensorReadings + * @details Outputs: none * @param x Populate this param with maximum X axis reading * @param y Populate this param with maximum Y axis reading * @param z Populate this param with maximum Z axis reading @@ -1378,9 +1409,8 @@ * @brief * The getFPGAAccelStatus function gets the accelerometer reading count * and error register values. - * @details - * Inputs : fpgaSensorReadings - * Outputs : none + * @details Inputs: fpgaSensorReadings + * @details Outputs: none * @param cnt Populate this param with latest sample counter value * @param err Populate this param with latest error * @return none @@ -1394,9 +1424,8 @@ /*********************************************************************//** * @brief * The getFPGACPiFault function gets CPi conductivity sensor fault. - * @details - * Inputs : fpgaSensorReadings.fpgaCPiFault - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPiFault + * @details Outputs: none * @return Latest CPi conductivity sensor fault *************************************************************************/ U08 getFPGACPiFault( void ) @@ -1407,9 +1436,8 @@ /*********************************************************************//** * @brief * The getFPGACPiReadCount function gets CPi conductivity sensor read count. - * @details - * Inputs : fpgaSensorReadings.fpgaCPiReadCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPiReadCnt + * @details Outputs: none * @return Latest CPi conductivity sensor read count *************************************************************************/ U08 getFPGACPiReadCount( void ) @@ -1420,9 +1448,8 @@ /*********************************************************************//** * @brief * The getFPGACPiErrorCount function gets CPi conductivity sensor error count. - * @details - * Inputs : fpgaSensorReadings.fpgaCPiErrorCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPiErrorCnt + * @details Outputs: none * @return Latest CPi conductivity sensor read error count *************************************************************************/ U08 getFPGACPiErrorCount( void ) @@ -1433,9 +1460,8 @@ /*********************************************************************//** * @brief * The getFPGACPi function gets CPi conductivity sensor value. - * @details - * Inputs : fpgaSensorReadings.fpgaCPi - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPi + * @details Outputs: none * @return Latest CPi conductivity sensor value *************************************************************************/ U32 getFPGACPi( void ) @@ -1446,9 +1472,8 @@ /*********************************************************************//** * @brief * The getFPGACPoFault function gets CPo conductivity sensor fault. - * @details - * Inputs : fpgaSensorReadings.fpgaCPoFault - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPoFault + * @details Outputs: none * @return Latest CPo sensor fault *************************************************************************/ U08 getFPGACPoFault( void ) @@ -1459,9 +1484,8 @@ /*********************************************************************//** * @brief * The getFPGACPoReadCount function gets CPo conductivity sensor read count. - * @details - * Inputs : fpgaSensorReadings.fpgaCPoReadCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPoReadCnt + * @details Outputs: none * @return Latest CPo conductivity sensor read count *************************************************************************/ U08 getFPGACPoReadCount( void ) @@ -1473,9 +1497,8 @@ * @brief * The getFPGACPoErrorCount function gets CPo conductivity sensor error count. * error count - * @details - * Inputs : fpgaSensorReadings.fpgaCPoErrorCnt - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPoErrorCnt + * @details Outputs: none * @return Latest CPo conductivity sensor read error count *************************************************************************/ U08 getFPGACPoErrorCount( void ) @@ -1486,14 +1509,76 @@ /*********************************************************************//** * @brief * The getFPGACPo function gets CPo conductivity sensor value. - * @details - * Inputs : fpgaSensorReadings.fpgaCPo - * Outputs : none + * @details Inputs: fpgaSensorReadings.fpgaCPo + * @details Outputs: none * @return Latest CPo conductivity sensor value *************************************************************************/ U32 getFPGACPo( void ) { 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; +} + /**@}*/