Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r937362196a40d7d55b1b61e33f88c382184fbf2f -r382ed222cde91c19693f4c0f6c28e1d16029da99 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 937362196a40d7d55b1b61e33f88c382184fbf2f) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 382ed222cde91c19693f4c0f6c28e1d16029da99) @@ -330,7 +330,7 @@ ( D65_VALV == valveID ) || ( D64_VALV == valveID ) || ( D31_VALV == valveID ) || ( D34_VALV == valveID ) || ( D35_VALV == valveID ) || ( D40_VALV == valveID ) || ( D47_VALV == valveID ) || ( D3_VALV == valveID ) || ( M4_VALV == valveID ) || ( D23_VALV == valveID ) || ( D19_VALV == valveID ) || ( D25_VALV == valveID ) || ( D21_VALV == valveID ) || ( D24_VALV == valveID ) || ( D20_VALV == valveID ) || - ( D26_VALV == valveID ) || ( D22_VALV == valveID ) || ( D80_VALV == valveID ) || ( D81_VALV == valveID ) || ( D79_PMP_VALV == valveID ) || + ( D26_VALV == valveID ) || ( D22_VALV == valveID ) || ( D80_VALV == valveID ) || ( D81_VALV == valveID ) || ( D88_VALV == valveID ) || ( P11_VALV == valveID ) || ( P33_VALV == valveID ) || ( P34_VALV == valveID ) || ( P37_VALV == valveID ) || ( P6_VALV == valveID ) || ( M12_VALV == valveID ) || ( P39_VALV == valveID ) || ( D83_VALV == valveID ) || ( D91_VALV == valveID ) || ( D100_VALV == valveID ) || ( D85_VALV == valveID ) ) { Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r50144ec3e96785cf76d5bfd22ee65029c82e732b -r382ed222cde91c19693f4c0f6c28e1d16029da99 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 50144ec3e96785cf76d5bfd22ee65029c82e732b) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 382ed222cde91c19693f4c0f6c28e1d16029da99) @@ -262,10 +262,174 @@ U16 fpgaD74CondTemp; ///< Reg 756. D74 Temperature U08 fpgaD74CondReadCnt; ///< Reg 758. D74 successful read count U08 fpgaD74CondErrorCnt; ///< Reg 759. D74 error read count + } DD_FPGA_SENSORS_T; typedef struct { + U16 fpgaCompatibilityRev; ///< Reg 512. Compatibility revision + U16 fpgaTimerCountMS; ///< Reg 514. Internal FPGA timer count in milliseconds + 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 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 + + 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 +}DD_FPGA_SENSORS_BETA_2_T; + +typedef struct +{ U16 fpgaValveControl; ///< Reg 04. Valve control register U16 fpgaValvePWMEnable; ///< Reg 06. Valve PWM enable U16 fpgaDDValvePWMLow; ///< Reg 08. DD valves PWM low. (VDR) @@ -341,7 +505,6 @@ U08 fpgaConSensD43Control; ///< Reg 118. Conductivity/Temperature Sensors D43 Control registers U16 fpgaConSensD43_Addrs; ///< Reg 119. D43 Initialization Address register U32 fpgaConSensD43_Data_In; ///< Reg 121. D43 Initialization data register - } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -364,9 +527,18 @@ *************************************************************************/ void initFPGADD( void ) { - // Initialize fpga driver - initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) != TRUE ) + { + // Initialize fpga driver + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_T), sizeof(FPGA_ACTUATORS_T) ); + } + else + { + // Initialize fpga driver for beta 2 hardware + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, + sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_BETA_2_T), sizeof(FPGA_ACTUATORS_T) ); + } // initialize fpga data structures memset( &fpgaHeader, 0, sizeof( FPGA_HEADER_T ) );