Index: firmware/App/Monitors/Level.c =================================================================== diff -u -r3393de3377c15fcbe223326fed40a840f16d7ce9 -r4440a7a6b86afcaed7573596abe30bcf5820aba4 --- firmware/App/Monitors/Level.c (.../Level.c) (revision 3393de3377c15fcbe223326fed40a840f16d7ce9) +++ firmware/App/Monitors/Level.c (.../Level.c) (revision 4440a7a6b86afcaed7573596abe30bcf5820aba4) @@ -36,10 +36,10 @@ #define FPGA_LEVEL_LOW 2 ///< Floater low level status #define FPGA_LEVEL_MEDIUM 0 ///< Floater medium level status #define FPGA_LEVEL_HIGH 4 ///< Floater high level status -#define FPGA_B2_LEVEL_EMPTY 0xB ///< Floater empty level status for beta 2.0 -#define FPGA_B2_LEVEL_LOW 0xA ///< Floater low level status for beta 2.0 +#define FPGA_B2_LEVEL_EMPTY 0x0B ///< Floater empty level status for beta 2.0 +#define FPGA_B2_LEVEL_LOW 0x0A ///< Floater low level status for beta 2.0 #define FPGA_B2_LEVEL_MEDIUM 8 ///< Floater medium level status for beta 2.0 -#define FPGA_B2_LEVEL_HIGH 0xC ///< Floater high level status for beta 2.0 +#define FPGA_B2_LEVEL_HIGH 0x0C ///< Floater high level status for beta 2.0 #define LEVEL_COUNT_LOW 0xFFFF ///< Level sensor count when fluid level is low or non submerged #define LEVEL_COUNT_HIGH_START 0x0000 ///< Start range of level sensor count when fluid level is high or submerged #define LEVEL_COUNT_HIGH_END 0x2FFF ///< End range of level sensor count when fluid level is high or submerged Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r3393de3377c15fcbe223326fed40a840f16d7ce9 -r4440a7a6b86afcaed7573596abe30bcf5820aba4 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 3393de3377c15fcbe223326fed40a840f16d7ce9) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 4440a7a6b86afcaed7573596abe30bcf5820aba4) @@ -38,6 +38,12 @@ // ********** private definitions ********** +///// +//#define FPGASENSORREADINGS ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) != TRUE ? (DD_FPGA_SENSORS_T*)&fpgaSensorReadings : (DD_FPGA_SENSORS_BETA_2_T*)&fpgaBeta2SensorReadings ) +// +///// +//#define FPGAACTUATORSETPOINTS ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) != TRUE ? (FPGA_ACTUATORS_T*)&fpgaActuatorSetPoints : (FPGA_ACTUATORS_BETA_2_T*)&fpgaBeta2ActuatorSetPoints ) + #define FPGA_EXPECTED_ID 0x04 ///< FPGA expected ID. #define MAX_COMM_ERROR_RETRIES 5 ///< Maximum number of communication error retries @@ -91,7 +97,7 @@ #define FPGA_D12_PUMP_ERROR_BIT 0x01 ///< Fresh dialysate pump error bit mask. #define FPGA_D48_PUMP_ERROR_BIT 0x02 ///< Spent dialysate pump error bit mask. -#define FPGA_D6_FLOATER_LEVEL_BIT 0x07 ///< Floater level bit mask. +#define FPGA_FLOATER_LEVEL_BIT 0x0F ///< Floater level bit mask(D6 and P25). #define FPGA_D5_HEATER_CNTRL_BIT 0x01 ///< FPGA GIO D5 heater control bit mask #define FPGA_D5_HEATER_PWM_ENABLE_BIT 0x02 ///< FPGA D5 PWM based heater control bit mask @@ -272,160 +278,160 @@ U16 fpgaRemoteUpdateRead; ///< Reg 516. FPGA Remote Update Read ( copy contents from remote update write) U08 fpgaIOErrorCntProcessor; ///< Reg 518. Number of errors in Microprocessor UART interface U08 fpgaIOErrorCntPC; ///< Reg 519. Number of errors in PC UART interface - U16 fpgaD9PresPressure; ///< Reg 520. D9 MPM pressure sensor RAW pressure data - U16 fpgaD9PresTemp; ///< Reg 522. D9 MPM pressure sensor RAW temperature data - U16 fpgaD66PresPressure; ///< Reg 524. D66 MPM pressure sensor RAW pressure data - U16 fpgaD66PresTemp; ///< Reg 526. D66 MPM pressure sensor RAW temperature data - U16 fpgaD51PresPressure; ///< Reg 528. D51 MPM pressure sensor RAW pressure data - U16 fpgaD51PresTemp; ///< Reg 530. D51 MPM pressure sensor RAW temperature data - U16 fpgaD18PresPressure; ///< Reg 532. D18 MPM pressure sensor RAW pressure data - U16 fpgaD18PresTemp; ///< Reg 534. D18 MPM pressure sensor RAW temperature data - U16 fpgaD41PresPressure; ///< Reg 536. D41 MPM pressure sensor RAW pressure data - U16 fpgaD41PresTemp; ///< Reg 538. D41 MPM pressure sensor RAW temperature data + U16 fpgaD9PresPressure; ///< Reg 520. D9 MPM pressure sensor RAW pressure data + U16 fpgaD9PresTemp; ///< Reg 522. D9 MPM pressure sensor RAW temperature data + U16 fpgaD66PresPressure; ///< Reg 524. D66 MPM pressure sensor RAW pressure data + U16 fpgaD66PresTemp; ///< Reg 526. D66 MPM pressure sensor RAW temperature data + U16 fpgaD51PresPressure; ///< Reg 528. D51 MPM pressure sensor RAW pressure data + U16 fpgaD51PresTemp; ///< Reg 530. D51 MPM pressure sensor RAW temperature data + U16 fpgaD18PresPressure; ///< Reg 532. D18 MPM pressure sensor RAW pressure data + U16 fpgaD18PresTemp; ///< Reg 534. D18 MPM pressure sensor RAW temperature data + U16 fpgaD41PresPressure; ///< Reg 536. D41 MPM pressure sensor RAW pressure data + U16 fpgaD41PresTemp; ///< Reg 538. D41 MPM pressure sensor RAW temperature data U16 fpgaAvailableRegister1; ///< Reg 540. Available register 1 - U16 fpgaAvailableRegister2; ///< Reg 542. Available register 2 - U08 fpgaHallSensInputs; ///< Reg 544. Hall sensor Inputs - U08 fpgaD42TxFIFOCnt; ///< Reg 545. Blood leak sensor transmit FIFO count - U16 fpgaD42RxErrorCnt; ///< Reg 546. Blood leak sensor Receive error count - U16 fpgaD42RxFIFOCnt; ///< Reg 548. Blood leak sensor Receive FIFO count - U08 fpgaD42RxFIFODataOut; ///< Reg 550. Blood leak sensor Receive data - U08 fpgaD42PulseStatus; ///< Reg 551. Blood leak sensor status - U16 fpgaValveStates; ///< Reg 552. Valve status read - U16 fpgaValvePWMEnableStates; ///< Reg 554. Valve PWM Enable status read - U08 fpgaValveBCStates; ///< Reg 556. Balancing chamber Valves states - U08 fpgaValveBCPWMStates; ///< Reg 557. Balancing Chamber Valve PWM states - U08 fpgaValveSpStates; ///< Reg 558. DD Spare Valves states - U08 fpgaValveSpPWMStates; ///< Reg 559. Spare Valves PWM states - U08 fpgaD11_D10_PumpFault; ///< Reg 560. Concentrate pump fault register for D11_Pump and D10_Pump - U08 fpgaRTDCountErrorCycles; ///< Reg 561. Count of each incomplete seq of reads from RTD ADC. - U16 fpgaAvailableRegister3; ///< Reg 562. Available register 3 - U16 fpgaAvailableRegister4; ///< Reg 564. Available register 4 - U32 fpgaD78Temp; ///< Reg 566. Outlet heat exchanger temperature - U32 fpgaD1Temp; ///< Reg 570. Inlet heat exchanger temperature - U32 fpgaD4Temp; ///< Reg 574. Hydraulics primary heater temperature - U32 fpgaD50Temp; ///< Reg 578. Trimmer heater temperature - U08 fpgaIOExpReadCount; ///< Reg 582. Number of successful i2c transactions - U08 fpgaIOExpERrorCount; ///< Reg 583. Number of unsuccessful i2c transactions - U16 fpgaD12MeasuredSpeed; ///< Reg 584. Fresh dialysate pump measured speed - U16 fpgaD48MeasuredSpeed; ///< Reg 586. Spent dialysate pump measured speed - U08 fpgaRTDReadCnt; ///< Reg 588. Read count for all RTD sensors - U08 fpgaD12D48PumpStatus; ///< Reg 589. Dialysate pumps Error status - U16 fpgaD12CurrentFeedback; ///< Reg 590. Fresh dialysate pump current feedback - U16 fpgaD48CurrentFeedback; ///< Reg 592. Spent dialysate pump current feedback - U08 fpgaD12HallStatus; ///< Reg 594. Fresh dialysate pump hall sensor direction status - U08 fpgaD48HallStatus; ///< Reg 595. Spent dialysate pump hall sensor direction status - U08 fpgaD6FloaterStatus; ///< Reg 596. Floater 1 level sensor status - U08 fpgaConductiveLevelStatus; ///< Reg 597. Conductive level sensor status - U16 fpgaD11PumpStepCountStatus; ///< Reg 598. Acid concentrate pump revolution down count status - U16 fpgaD10PumpStepCountStatus; ///< Reg 600. Bicarb concentrate pump revolution down count status - U16 fpgaAdcTemp; ///< Reg 602. TBD - U16 fpgaAdcVccInt; ///< Reg 604. TBD - U16 fpgaAdcVccAux; ///< Reg 606. TBD - U16 fpgaAdcVpVn; ///< Reg 608. TBD - U16 fpgaD12PumpSpeedFeedback; ///< Reg 610. D12 Pump speed feedback - U16 fpgaD48PumpSpeedFeedback; ///< Reg 612. D48 Pump Speed feedback - U16 fpgaAvailableRegister5; ///< Reg 614. Available register 5 - U16 fpgaD76PumpStepCountStatus; ///< Reg 616. UF pump revolution down count status - U08 fpgaD76PumpFault; ///< Reg 618: UF pump fault - U08 fpgaHallSensorStatus; ///< reg 619: Hall sensor status + U16 fpgaAvailableRegister2; ///< Reg 542. Available register 2 + U08 fpgaHallSensInputs; ///< Reg 544. Hall sensor Inputs + U08 fpgaD42TxFIFOCnt; ///< Reg 545. Blood leak sensor transmit FIFO count + U16 fpgaD42RxErrorCnt; ///< Reg 546. Blood leak sensor Receive error count + U16 fpgaD42RxFIFOCnt; ///< Reg 548. Blood leak sensor Receive FIFO count + U08 fpgaD42RxFIFODataOut; ///< Reg 550. Blood leak sensor Receive data + U08 fpgaD42PulseStatus; ///< Reg 551. Blood leak sensor status + U16 fpgaValveStates; ///< Reg 552. Valve status read + U16 fpgaValvePWMEnableStates; ///< Reg 554. Valve PWM Enable status read + U08 fpgaValveBCStates; ///< Reg 556. Balancing chamber Valves states + U08 fpgaValveBCPWMStates; ///< Reg 557. Balancing Chamber Valve PWM states + U08 fpgaValveSpStates; ///< Reg 558. DD Spare Valves states + U08 fpgaValveSpPWMStates; ///< Reg 559. Spare Valves PWM states + U08 fpgaD11_D10_PumpFault; ///< Reg 560. Concentrate pump fault register for D11_Pump and D10_Pump + U08 fpgaRTDCountErrorCycles; ///< Reg 561. Count of each incomplete seq of reads from RTD ADC. + U16 fpgaAvailableRegister3; ///< Reg 562. Available register 3 + U16 fpgaAvailableRegister4; ///< Reg 564. Available register 4 + U32 fpgaD78Temp; ///< Reg 566. Outlet heat exchanger temperature + U32 fpgaD1Temp; ///< Reg 570. Inlet heat exchanger temperature + U32 fpgaD4Temp; ///< Reg 574. Hydraulics primary heater temperature + U32 fpgaD50Temp; ///< Reg 578. Trimmer heater temperature + U08 fpgaIOExpReadCount; ///< Reg 582. Number of successful i2c transactions + U08 fpgaIOExpERrorCount; ///< Reg 583. Number of unsuccessful i2c transactions + U16 fpgaD12MeasuredSpeed; ///< Reg 584. Fresh dialysate pump measured speed + U16 fpgaD48MeasuredSpeed; ///< Reg 586. Spent dialysate pump measured speed + U08 fpgaRTDReadCnt; ///< Reg 588. Read count for all RTD sensors + U08 fpgaD12D48PumpStatus; ///< Reg 589. Dialysate pumps Error status + U16 fpgaD12CurrentFeedback; ///< Reg 590. Fresh dialysate pump current feedback + U16 fpgaD48CurrentFeedback; ///< Reg 592. Spent dialysate pump current feedback + U08 fpgaD12HallStatus; ///< Reg 594. Fresh dialysate pump hall sensor direction status + U08 fpgaD48HallStatus; ///< Reg 595. Spent dialysate pump hall sensor direction status + U08 fpgaD6FloaterStatus; ///< Reg 596. Floater 1 level sensor status + U08 fpgaConductiveLevelStatus; ///< Reg 597. Conductive level sensor status + U16 fpgaD11PumpStepCountStatus; ///< Reg 598. Acid concentrate pump revolution down count status + U16 fpgaD10PumpStepCountStatus; ///< Reg 600. Bicarb concentrate pump revolution down count status + U16 fpgaAdcTemp; ///< Reg 602. TBD + U16 fpgaAdcVccInt; ///< Reg 604. TBD + U16 fpgaAdcVccAux; ///< Reg 606. TBD + U16 fpgaAdcVpVn; ///< Reg 608. TBD + U16 fpgaD12PumpSpeedFeedback; ///< Reg 610. D12 Pump speed feedback + U16 fpgaD48PumpSpeedFeedback; ///< Reg 612. D48 Pump Speed feedback + U16 fpgaAvailableRegister5; ///< Reg 614. Available register 5 + U16 fpgaD76PumpStepCountStatus; ///< Reg 616. UF pump revolution down count status + U08 fpgaD76PumpFault; ///< Reg 618: UF pump fault + U08 fpgaHallSensorStatus; ///< reg 619: Hall sensor status - S16 pressureP46; ///< Reg 620. P46 pressure data. - U16 temperatureP46; ///< Reg 622. P46 temperature data. - S16 pressureM3; ///< Reg 624. M3 pressure data. - U16 temperatureM3; ///< Reg 626. M3 temperature data. - S16 pressureP8; ///< Reg 628. P8 pressure data. - U16 temperatureP8; ///< Reg 630. P8 temperature data. - S16 pressureP13; ///< Reg 632. P13 pressure data. - U16 temperatureP13; ///< Reg 634. P13 temperature data. - S16 pressureP17; ///< Reg 636. P17 pressure data. - U16 temperatureP17; ///< Reg 638. P17 temperature data. - U16 p40PumpTachCount; ///< Reg 640. P40 pump tachometer counter. - U08 p25LevelSwitch; ///< Reg 642. P25 level switch. - U08 fpgaGPIOStatus; ///< Reg 643. GPIO Status - U16 flowRateP7; ///< Reg 644. P7 flow sensor rate. - U16 flowTempP7; ///< Reg 646. P7 flow sensor temperature. - U16 p12PumpTachCount; ///< Reg 648. P12 pump tachometer counter. - U16 d79SpeedPulseWidth; ///< Reg 650. D79 pusle width feedback. - U16 flowIntTempP7; ///< Reg 652. P7 flow sensor internal temperature. - U08 valveIOControlReadback; ///< Reg 654. IO Valve control bits read back. - U08 valveFPControlReadback; ///< Reg 655. FP Valve control enable read back. - U08 valveIOPWMEnableReadback; ///< Reg 656. IO Valve PWM enable read back. - U08 valveFPPWMEnableReadback; ///< Reg 657. FP Valve PWM enable read back. - U16 p12PumpPWMReadback; ///< Reg 658. P12 pump PWM read back. - U16 p40PumpPWMReadback; ///< Reg 660. P40 pump PWM read back. - U08 p7flowReadCount; ///< Reg 662. P7 Flow sensor read counter. - U08 p7flowErrorCount; ///< Reg 663. P7 Flow sensor error counter. - U16 fpgaD87PresPressure; ///< Reg 664. D87 MPM pressure sensor RAW pressure data - U16 fpgaD87PresTemp; ///< Reg 666. D87 MPM pressure sensor RAW temperature data - U32 fpgaD99Temp; ///< Reg 668. D99 temperature sensor - U32 tempTax1; ///< Reg 672. ( Tax1 ) temperature sensor reading. - U32 tempRTD; ///< Reg 676. spare temperature sensor reading. - U08 ad7124errcnt; ///< Reg 680. Counter which increments when an invalid transaction happen between FPGA and AD7124. - U08 ad7124readcnt; ///< Reg 681. Counter which increments when a valid transaction happens between FPGA and AD7124. - U16 flowRateP16; ///< Reg 682. P16 flow sensor rate. - U16 flowTempP16; ///< Reg 684. P16 flow sensor temperature. - U16 flowIntTempP16; ///< Reg 686. P16 flow sensor internal temperature. - U08 p16flowReadCount; ///< Reg 688. P16 Flow sensor read counter. - U08 p16flowErrorCount; ///< Reg 689. P16 Flow sensor error counter. - U32 fpgaD11PumpHallSense; ///< Reg 690. Concentrate pump D11_Pump hall sensor pulse width - U32 fpgaD10PumpHallSense; ///< Reg 694. Concentrate pump D10_Pump hall sensor pulse width - U32 fpgaD76PumpHallSense; ///< Reg 698. Concentrate pump D76_Pump hall sensor pulse width - U32 fpgaD17CondDataCal; ///< Reg 702. D17 CAL word update - U32 fpgaD17CondCond; ///< Reg 706. D17 conductivity - U32 fpgaD17CondTemp; ///< Reg 710. D17 Temperature - U08 fpgaD17CondReadCnt; ///< Reg 714. D17 successful read count - U08 fpgaD17CondErrorCnt; ///< Reg 715. D17 error read count - U08 fpgaD17TempReadCount; ///< Reg 716. D17 temperature successful read count - U08 fpgaD17TempErrorCount; ///< Reg 717. D17 Temperature error read count - U08 fpgaD17CalMemCounter; ///< Reg 718. TBD - U08 fpgaD75CalMemCounter; ///< Reg 719. TBD - U32 fpgaD75CondDataCal; ///< Reg 720. D75 CAL word update - U32 fpgaD75CondCond; ///< Reg 724. D75 conductivity - U32 fpgaD75CondTemp; ///< Reg 728. D75 Temperature - U08 fpgaD75CondReadCnt; ///< Reg 732. D75 successful read count - U08 fpgaD75CondErrorCnt; ///< Reg 733. D75 error read count - U08 fpgaD75TempReadCount; ///< Reg 734. D75 temperature successful read count - U08 fpgaD75TempErrorCount; ///< Reg 735. D75 Temperature error read count - U32 fpgaD28CondDataCal; ///< Reg 736. D28 CAL word update - U32 fpgaD28CondCond; ///< Reg 740. D28 conductivity - U32 fpgaD28CondTemp; ///< Reg 744. D28 Temperature - U08 fpgaD28CondReadCnt; ///< Reg 748. D28 successful read count - U08 fpgaD28CondErrorCnt; ///< Reg 749. D28 error read count - U08 fpgaD28TempReadCount; ///< Reg 750. D28 temperature successful read count - U08 fpgaD28TempErrorCount; ///< Reg 751. D28 Temperature error read count - U08 fpgaD28CalMemCounter; ///< Reg 752. TBD - U08 fpgaD30CalMemCounter; ///< Reg 753. TBD - U32 fpgaD30CondDataCal; ///< Reg 754. D30 CAL word update - U32 fpgaD30CondCond; ///< Reg 758. D30 conductivity - U32 fpgaD30CondTemp; ///< Reg 762. D30 Temperature - U08 fpgaD30CondReadCnt; ///< Reg 766. D30 successful read count - U08 fpgaD30CondErrorCnt; ///< Reg 767. D30 error read count - U08 fpgaD30TempReadCount; ///< Reg 768. D30 temperature successful read count - U08 fpgaD30TempErrorCount; ///< Reg 769. D30 Temperature error read count - U32 fpgaD44CondDataCal; ///< Reg 770. D44 CAL word update - U32 fpgaD44CondCond; ///< Reg 774. D44 conductivity - U32 fpgaD44CondTemp; ///< Reg 778. D44 Temperature - U08 fpgaD44CondReadCnt; ///< Reg 782. D44 successful read count - U08 fpgaD44CondErrorCnt; ///< Reg 783. D44 error read count - U08 fpgaD44TempReadCount; ///< Reg 784. D44 temperature successful read count - U08 fpgaD44TempErrorCount; ///< Reg 785. D44 Temperature error read count - U08 fpgaD44CalMemCounter; ///< Reg 786. TBD - U08 fpgaP10CalMemCounter; ///< Reg 787. TBD - U32 fpgaP10CondDataCal; ///< Reg 788. P10 CAL word update - U32 fpgaP10CondCond; ///< Reg 792. P10 Conductivity - U32 fpgaP10CondTemp; ///< Reg 796. P10 Temperature - U08 fpgaP10CondReadCnt; ///< Reg 800. P10 successful read count - U08 fpgaP10CondErrorCnt; ///< Reg 801. P10 error read count - U08 fpgaP10TempReadCount; ///< Reg 802. P10 temperature successful read count - U08 fpgaP10TempErrorCount; ///< Reg 803. P10 Temperature error read count - U32 fpgaP19CondDataCal; ///< Reg 804. P19 CAL word update - U32 fpgaP19CondCond; ///< Reg 808. P19 Conductivity - U32 fpgaP19CondTemp; ///< Reg 812. P19 Temperature - U08 fpgaP19CondReadCnt; ///< Reg 816. P19 successful read count - U08 fpgaP19CondErrorCnt; ///< Reg 817. P19 error read count - U08 fpgaP19TempReadCount; ///< Reg 818. P19 temperature successful read count - U08 fpgaP19TempErrorCount; ///< Reg 819. P19 Temperature error read count - U08 fpgaP19CalMemCounter; ///< Reg 820. TBD + S16 pressureP46; ///< Reg 620. P46 pressure data. + U16 temperatureP46; ///< Reg 622. P46 temperature data. + S16 pressureM3; ///< Reg 624. M3 pressure data. + U16 temperatureM3; ///< Reg 626. M3 temperature data. + S16 pressureP8; ///< Reg 628. P8 pressure data. + U16 temperatureP8; ///< Reg 630. P8 temperature data. + S16 pressureP13; ///< Reg 632. P13 pressure data. + U16 temperatureP13; ///< Reg 634. P13 temperature data. + S16 pressureP17; ///< Reg 636. P17 pressure data. + U16 temperatureP17; ///< Reg 638. P17 temperature data. + U16 p40PumpTachCount; ///< Reg 640. P40 pump tachometer counter. + U08 p25LevelSwitch; ///< Reg 642. P25 level switch. + U08 fpgaGPIOStatus; ///< Reg 643. GPIO Status + U16 flowRateP7; ///< Reg 644. P7 flow sensor rate. + U16 flowTempP7; ///< Reg 646. P7 flow sensor temperature. + U16 p12PumpTachCount; ///< Reg 648. P12 pump tachometer counter. + U16 d79SpeedPulseWidth; ///< Reg 650. D79 pusle width feedback. + U16 flowIntTempP7; ///< Reg 652. P7 flow sensor internal temperature. + U08 valveIOControlReadback; ///< Reg 654. IO Valve control bits read back. + U08 valveFPControlReadback; ///< Reg 655. FP Valve control enable read back. + U08 valveIOPWMEnableReadback; ///< Reg 656. IO Valve PWM enable read back. + U08 valveFPPWMEnableReadback; ///< Reg 657. FP Valve PWM enable read back. + U16 p12PumpPWMReadback; ///< Reg 658. P12 pump PWM read back. + U16 p40PumpPWMReadback; ///< Reg 660. P40 pump PWM read back. + U08 p7flowReadCount; ///< Reg 662. P7 Flow sensor read counter. + U08 p7flowErrorCount; ///< Reg 663. P7 Flow sensor error counter. + U16 fpgaD87PresPressure; ///< Reg 664. D87 MPM pressure sensor RAW pressure data + U16 fpgaD87PresTemp; ///< Reg 666. D87 MPM pressure sensor RAW temperature data + U32 fpgaD99Temp; ///< Reg 668. D99 temperature sensor + U32 tempTax1; ///< Reg 672. ( Tax1 ) temperature sensor reading. + U32 tempRTD; ///< Reg 676. spare temperature sensor reading. + U08 ad7124readcnt; ///< Reg 680. Counter which increments when an invalid transaction happen between FPGA and AD7124. + U08 ad7124errcnt; ///< Reg 681. Counter which increments when a valid transaction happens between FPGA and AD7124. + U16 flowRateP16; ///< Reg 682. P16 flow sensor rate. + U16 flowTempP16; ///< Reg 684. P16 flow sensor temperature. + U16 flowIntTempP16; ///< Reg 686. P16 flow sensor internal temperature. + U08 p16flowReadCount; ///< Reg 688. P16 Flow sensor read counter. + U08 p16flowErrorCount; ///< Reg 689. P16 Flow sensor error counter. + U32 fpgaD11PumpHallSense; ///< Reg 690. Concentrate pump D11_Pump hall sensor pulse width + U32 fpgaD10PumpHallSense; ///< Reg 694. Concentrate pump D10_Pump hall sensor pulse width + U32 fpgaD76PumpHallSense; ///< Reg 698. Concentrate pump D76_Pump hall sensor pulse width + U32 fpgaD17CondDataCal; ///< Reg 702. D17 CAL word update + U32 fpgaD17CondCond; ///< Reg 706. D17 conductivity + U32 fpgaD17CondTemp; ///< Reg 710. D17 Temperature + U08 fpgaD17CondReadCnt; ///< Reg 714. D17 successful read count + U08 fpgaD17CondErrorCnt; ///< Reg 715. D17 error read count + U08 fpgaD17TempReadCount; ///< Reg 716. D17 temperature successful read count + U08 fpgaD17TempErrorCount; ///< Reg 717. D17 Temperature error read count + U08 fpgaD17CalMemCounter; ///< Reg 718. TBD + U08 fpgaD74CalMemCounter; ///< Reg 719. TBD + U32 fpgaD74CondDataCal; ///< Reg 720. D75 CAL word update + U32 fpgaD74CondCond; ///< Reg 724. D75 conductivity + U32 fpgaD74CondTemp; ///< Reg 728. D75 Temperature + U08 fpgaD74CondReadCnt; ///< Reg 732. D75 successful read count + U08 fpgaD74CondErrorCnt; ///< Reg 733. D75 error read count + U08 fpgaD74TempReadCount; ///< Reg 734. D75 temperature successful read count + U08 fpgaD74TempErrorCount; ///< Reg 735. D75 Temperature error read count + U32 fpgaD27CondDataCal; ///< Reg 736. D28 CAL word update + U32 fpgaD27CondCond; ///< Reg 740. D28 conductivity + U32 fpgaD27CondTemp; ///< Reg 744. D28 Temperature + U08 fpgaD27CondReadCnt; ///< Reg 748. D28 successful read count + U08 fpgaD27CondErrorCnt; ///< Reg 749. D28 error read count + U08 fpgaD27TempReadCount; ///< Reg 750. D28 temperature successful read count + U08 fpgaD27TempErrorCount; ///< Reg 751. D28 Temperature error read count + U08 fpgaD27CalMemCounter; ///< Reg 752. TBD + U08 fpgaD29CalMemCounter; ///< Reg 753. TBD + U32 fpgaD29CondDataCal; ///< Reg 754. D30 CAL word update + U32 fpgaD29CondCond; ///< Reg 758. D30 conductivity + U32 fpgaD29CondTemp; ///< Reg 762. D30 Temperature + U08 fpgaD29CondReadCnt; ///< Reg 766. D30 successful read count + U08 fpgaD29CondErrorCnt; ///< Reg 767. D30 error read count + U08 fpgaD29TempReadCount; ///< Reg 768. D30 temperature successful read count + U08 fpgaD29TempErrorCount; ///< Reg 769. D30 Temperature error read count + U32 fpgaD43CondDataCal; ///< Reg 770. D44 CAL word update + U32 fpgaD43CondCond; ///< Reg 774. D44 conductivity + U32 fpgaD43CondTemp; ///< Reg 778. D44 Temperature + U08 fpgaD43CondReadCnt; ///< Reg 782. D44 successful read count + U08 fpgaD43CondErrorCnt; ///< Reg 783. D44 error read count + U08 fpgaD43TempReadCount; ///< Reg 784. D44 temperature successful read count + U08 fpgaD43TempErrorCount; ///< Reg 785. D44 Temperature error read count + U08 fpgaD43CalMemCounter; ///< Reg 786. TBD + U08 fpgaP9CalMemCounter; ///< Reg 787. TBD + U32 conductivityP9Data; ///< Reg 788. P10 CAL word update + U32 conductivityP9Cond; ///< Reg 792. P10 Conductivity + U32 conductivityP9Temp; ///< Reg 796. P10 Temperature + U08 conductivityP9ReadCount; ///< Reg 800. P10 successful read count + U08 conductivityP9ErrorCount; ///< Reg 801. P10 error read count + U08 fpgaP9TempReadCount; ///< Reg 802. P10 temperature successful read count + U08 fpgaP9TempErrorCount; ///< Reg 803. P10 Temperature error read count + U32 conductivityP18Data; ///< Reg 804. P19 CAL word update + U32 conductivityP18Cond; ///< Reg 808. P19 Conductivity + U32 conductivityP18Temp; ///< Reg 812. P19 Temperature + U08 conductivityP18ReadCount; ///< Reg 816. P19 successful read count + U08 conductivityP18ErrorCount; ///< Reg 817. P19 error read count + U08 fpgaP18TempReadCount; ///< Reg 818. P19 temperature successful read count + U08 fpgaP18TempErrorCount; ///< Reg 819. P19 Temperature error read count + U08 fpgaP18CalMemCounter; ///< Reg 820. TBD }DD_FPGA_SENSORS_BETA_2_T; typedef struct @@ -593,10 +599,18 @@ // ********** private data ********** -static FPGA_HEADER_T fpgaHeader; ///< FPGA header structure. -static DD_FPGA_SENSORS_T fpgaSensorReadings; ///< DD FPGA sensors structure. -static FPGA_ACTUATORS_T fpgaActuatorSetPoints; ///< FPGA actuator set points structure. +static FPGA_HEADER_T fpgaHeader; ///< FPGA header structure. +static DD_FPGA_SENSORS_T fpgaSensorReadings; ///< DD FPGA sensors structure. +static FPGA_ACTUATORS_T fpgaActuatorSetPoints; ///< FPGA actuator set points structure. +static DD_FPGA_SENSORS_BETA_2_T fpgaBeta2SensorReadings; ///< DD FPGA sensors structure for beta 2. +static FPGA_ACTUATORS_BETA_2_T fpgaBeta2ActuatorSetPoints; ///< FPGA actuator set points structure for beta 2. +/// Macro to retrieve the FPGA sensor field based on HW type +#define GET_FPGA_SENSOR_FIELD(field) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? fpgaBeta2SensorReadings.field : fpgaSensorReadings.field) + +/// Macro to retrieve the FPGA actuator field based on HW type +#define GET_FPGA_ACTUATOR_FIELD(field) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? fpgaBeta2ActuatorSetPoints.field : fpgaActuatorSetPoints.field) + // ********** private function prototypes ********** static U16 getFPGATimerCount( void ); @@ -619,6 +633,10 @@ memset( &fpgaSensorReadings, 0, sizeof( DD_FPGA_SENSORS_T ) ); memset( &fpgaActuatorSetPoints, 0, sizeof( FPGA_ACTUATORS_T ) ); + // initialize FPGA data structure for beta 2 HW + memset( &fpgaBeta2SensorReadings, 0, sizeof( DD_FPGA_SENSORS_BETA_2_T ) ); + memset( &fpgaBeta2ActuatorSetPoints, 0, sizeof( FPGA_ACTUATORS_BETA_2_T ) ); + // Set the valve control mode and default state of valve fpgaActuatorSetPoints.fpgaValveControl = FPGA_ENABLE_VALVES_CONTROL; fpgaActuatorSetPoints.fpgaValvePWMEnable = FPGA_ENABLE_VALVES_PWM; @@ -628,6 +646,15 @@ fpgaActuatorSetPoints.fpgaDDSpareValvePWMControl = FPGA_ENABLE_UF_VALVES_PWM; fpgaActuatorSetPoints.fpgaADCControl = FPGA_ADC_AUTO_READ_ENABLE; + // Set the valve control mode and default state of valve for Beta 2.0 HW + fpgaBeta2ActuatorSetPoints.fpgaValveControl = FPGA_ENABLE_VALVES_CONTROL; + fpgaBeta2ActuatorSetPoints.fpgaValvePWMEnable = FPGA_ENABLE_VALVES_PWM; + fpgaBeta2ActuatorSetPoints.fpgaBCValveControl = FPGA_ENABLE_BC_VALVES_CONTROL; + fpgaBeta2ActuatorSetPoints.fpgaBCValvePWMControl = FPGA_ENABLE_BC_VALVES_PWM; + fpgaBeta2ActuatorSetPoints.fpgaDDSpareValveControl = FPGA_ENABLE_SPARE_VALVES_CNTRL; + fpgaBeta2ActuatorSetPoints.fpgaDDSpareValvePWMControl = FPGA_ENABLE_UF_VALVES_PWM; + fpgaBeta2ActuatorSetPoints.fpgaADCControl = FPGA_ADC_AUTO_READ_ENABLE; + // initialize FPGA clock speed error time windowed count initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES, MAX_FPGA_COMM_FAILURES, MAX_FPGA_COMM_FAILURES_WINDOW_MS); } @@ -650,7 +677,7 @@ else { // Initialize fpga driver for beta 2 hardware - initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaBeta2SensorReadings, (U08*)&fpgaBeta2ActuatorSetPoints, sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_BETA_2_T), sizeof(FPGA_ACTUATORS_BETA_2_T) ); } } @@ -2777,7 +2804,7 @@ *************************************************************************/ U32 getFPGAD17CondData( void ) { - return fpgaSensorReadings.fpgaD17CondDataOut; + return fpgaSensorReadings.fpgaD17CondCond; } /*********************************************************************//** @@ -2837,7 +2864,7 @@ *************************************************************************/ U32 getFPGAD27CondData( void ) { - return fpgaSensorReadings.fpgaD27CondDataOut; + return fpgaSensorReadings.fpgaD27CondCond; } /*********************************************************************//** @@ -2897,7 +2924,7 @@ *************************************************************************/ U32 getFPGAD29CondData( void ) { - return fpgaSensorReadings.fpgaD29CondDataOut; + return fpgaSensorReadings.fpgaD29CondCond; } /*********************************************************************//** @@ -2957,7 +2984,7 @@ *************************************************************************/ U32 getFPGAD43CondData( void ) { - return fpgaSensorReadings.fpgaD43CondDataOut; + return fpgaSensorReadings.fpgaD43CondCond; } /*********************************************************************//** @@ -3017,7 +3044,7 @@ *************************************************************************/ U32 getFPGAD74CondData( void ) { - return fpgaSensorReadings.fpgaD74CondDataOut; + return fpgaSensorReadings.fpgaD74CondCond; } /*********************************************************************//** @@ -3030,7 +3057,14 @@ *************************************************************************/ U16 getFPGAD63LevelSensor( void ) { - return fpgaSensorReadings.fpgaD63LevelSensor; + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) != TRUE ) + { + return 0; + } + else + { + return fpgaBeta2SensorReadings.fpgaConductiveLevelStatus; + } } /*********************************************************************//** @@ -3043,7 +3077,14 @@ *************************************************************************/ U16 getFPGAD98LevelSensor( void ) { - return fpgaSensorReadings.fpgaD98LevelSensor; + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + return fpgaBeta2SensorReadings.fpgaConductiveLevelStatus; + } + else + { + return 0; + } } /*********************************************************************//** @@ -3056,7 +3097,15 @@ *************************************************************************/ U16 getFPGAD46LevelSensor( void ) { - return fpgaSensorReadings.fpgaD46LevelSensor; +// return GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + return fpgaBeta2SensorReadings.fpgaConductiveLevelStatus; + } + else + { + return 0; + } } /*********************************************************************//** @@ -3069,7 +3118,7 @@ *************************************************************************/ U08 getFPGAD6LevelStatus( void ) { - return ( fpgaSensorReadings.fpgaD6FloaterStatus & FPGA_D6_FLOATER_LEVEL_BIT ); + return ( fpgaSensorReadings.fpgaD6FloaterStatus & FPGA_FLOATER_LEVEL_BIT ); } /*********************************************************************//** @@ -3082,7 +3131,15 @@ *************************************************************************/ U08 getFPGAFloater2Status( void ) { - return fpgaSensorReadings.fpgaFloater2Status; +// return GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + return fpgaBeta2SensorReadings.fpgaConductiveLevelStatus; + } + else + { + return 0; + } } /*********************************************************************//** @@ -3792,7 +3849,10 @@ *************************************************************************/ U08 getFPGAP25FloaterState( void ) { - return fpgaSensorReadings.p25LevelSwitch; +// U08 result = ( fpgaSensorReadings.p25LevelSwitch & FPGA_FLOATER_LEVEL_BIT ); + U08 result = ( GET_FPGA_SENSOR_FIELD( p25LevelSwitch ) & FPGA_FLOATER_LEVEL_BIT ); + + return result; } /*********************************************************************//** @@ -3804,7 +3864,7 @@ *************************************************************************/ U16 getFPGAFlowP16( void ) { - return fpgaSensorReadings.flowRateP16; + return GET_FPGA_SENSOR_FIELD( flowRateP16 ); } /*********************************************************************//**