Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r290cac3c0557c978647cef2972800dfe137dd662 -r8e93771bd0894bf1308747d1e520d620d7821fab --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 290cac3c0557c978647cef2972800dfe137dd662) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 8e93771bd0894bf1308747d1e520d620d7821fab) @@ -450,7 +450,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_79_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 -rd748813399d38ef5b71d760e327e368cc82d7a38 -r8e93771bd0894bf1308747d1e520d620d7821fab --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision d748813399d38ef5b71d760e327e368cc82d7a38) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 8e93771bd0894bf1308747d1e520d620d7821fab) @@ -38,6 +38,26 @@ // ********** private definitions ********** +/// 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 ? fpgaSensorReadings.field : fpgaBeta19SensorReadings.field) +//#define GET_FPGA_SENSOR_FIELD(field) (fpgaSensorReadings.field) + +/// Macro to retrieve the FPGA sensor field based on HW type +#define GET_FPGA_ACTUATOR_FIELD(field) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? fpgaActuatorSetPoints.field : fpgaBeta19ActuatorSetPoints.field) +//#define GET_FPGA_ACTUATOR_FIELD(field) (fpgaActuatorSetPoints.field) + +/// Macro to set the FPGA actuator field value based on HW type +#define SET_FPGA_ACTUATOR_FIELD(field, value) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? ( fpgaActuatorSetPoints.field = value ) : ( fpgaBeta19ActuatorSetPoints.field = value )) +//#define SET_FPGA_ACTUATOR_FIELD(field, value) (fpgaActuatorSetPoints.field = value) + +/// Macro to set the FPGA actuator bits based on HW type +#define SET_FPGA_ACTUATOR_BITS(field, bits) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? ( fpgaActuatorSetPoints.field |= bits ) : ( fpgaBeta19ActuatorSetPoints.field |= bits )) +//#define SET_FPGA_ACTUATOR_BITS(field, bits) (fpgaActuatorSetPoints.field |= bits) + +/// Macro to clear the FPGA actuator bits based on HW type +#define CLEAR_FPGA_ACTUATOR_BITS(field, bits) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? ( fpgaActuatorSetPoints.field &= bits ) : ( fpgaBeta19ActuatorSetPoints.field &= bits )) +//#define CLEAR_FPGA_ACTUATOR_BITS(field, bits) (fpgaActuatorSetPoints.field &= bits) + #define FPGA_EXPECTED_ID 0x04 ///< FPGA expected ID. #define MAX_COMM_ERROR_RETRIES 5 ///< Maximum number of communication error retries @@ -91,7 +111,10 @@ #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_D46_LEVEL_BIT 0x01 ///< D46 conductive level sensor bit mask. +#define FPGA_D63_LEVEL_BIT 0x02 ///< D63 conductive level sensor bit mask. +#define FPGA_D98_LEVEL_BIT 0x04 ///< D98 conductive level sensor bit mask. #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 @@ -124,6 +147,7 @@ U08 fpgaRevLab; ///< Reg 3. FPGA revision (lab) being reported } FPGA_HEADER_T; // read only on FPGA +// Remove when Beta 1.9 is obsolete /// FPGA sensor readings struct. typedef struct { @@ -266,8 +290,172 @@ U32 fpgaD10PumpHallSense; ///< Reg 764. Concentrate pump D10_Pump hall sensor pulse width U32 fpgaD76PumpHallSense; ///< Reg 768. UF D76_Pump hall sensor pulse width U32 fpgaTestBytes; ///< Reg 772. FPGA Test 4 bytes +} DD_FPGA_SENSORS_BETA_1_9_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 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_T; +// Remove when Beta 1.9 is obsolete typedef struct { U16 fpgaValveControl; ///< Reg 04. Valve control register @@ -349,14 +537,99 @@ U32 fpgaD11PumpSpeed; ///< Reg 126. Acid Concentrate Pump Speed/RPM Control U32 fpgaD10PumpSpeed; ///< Reg 130. BiCarb Concentrate Pump Speed/RPM Control U32 fpgaD76PumpSpeed; ///< Reg 134. UF Pump Speed/RPM Control +} FPGA_ACTUATORS_BETA_1_9_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) + U16 fpgaDDValvePWMPeriod; ///< Reg 10. DD valves PWM period (VDR) + U16 fpgaDDValvePWMPullin; ///< Reg 12. DD valves pull in (VDR) + U08 fpgaBCValveControl; ///< Reg 14. Balancing Chamber Valves Control Registers + U08 fpgaBCValvePWMControl; ///< Reg 15. Balancing Chamber Valves PWM control + U08 fpgaDDSpareValveControl; ///< Reg 16. Spare Valves Control Registers + U08 fpgaDDSpareValvePWMControl; ///< Reg 17. Spare Valves PWM control + U08 fpgaConSensD17D74Control; ///< Reg 18. Conductivity/Temperature Sensors D17 & D74 Control registers + U08 fpgaConSensD27D29Control; ///< Reg 19. Conductivity/Temperature Sensors D27 & D29 Control registers + U16 fpgaConSensD17D74_Addrs; ///< Reg 20. D17,D74 Initialization Address register + U32 fpgaConSensD17D74_Data_In; ///< Reg 22. D17,D74 Initialization data register + U16 fpgaConSensD27D29_Addrs; ///< Reg 26. D27,D29 Initialization Address register + U32 fpgaConSensD27D29_Data_In; ///< Reg 28. D27,D29 Initialization data register + U16 fpgaRemoteUpdate_Write; ///< Reg 32.Register for Remote update used by SW. + U16 fpgaD12PumpSpeed; ///< Reg 34. D48 Speed/RPM Control + U08 fpgaD12PumpControl; ///< Reg 36. DGP Control + U08 fpgaD48PumpControl; ///< Reg 37. SDP Control + U16 fpgaD48PumpSpeed; ///< Reg 38. SDP Speed/RPM Control + U16 unusedRegister; ///< Reg 40. Unused register + U08 fpgaD11PumpControl; ///< Reg 42. Acid Concentrate Pump Control + U08 fpgaD10PumpControl; ///< Reg 43. BiCarb Concentrate Pump Control + U16 unusedRegister1; ///< Reg 44. Unused register1 + U08 fpgaD42SensorTest; ///< Reg 46. Blood leak sensor test + U08 fpgaD42UARTControl; ///< Reg 47. Blood leak sensor UART control + U08 fpgaD42FIFOTx; ///< Reg 48. Blood leak sensor FIFO transmit control + U08 fpgaD5HeaterPWMControl; ///< Reg 49. Primary heater PWM control + U08 fpgaD45HeaterPWMControl; ///< Reg 50. Trimmer heater PWM control + U08 fpgaD79PWMPumpCtl; ///< Reg 51. Rinse pump PWM control + U16 fpgaVBCPWMLow; ///< Reg 52. VBC PWM low ( Balancing chamber valves) + U16 fpgaVBCPWMPeriod; ///< Reg 54. VBC PWM period + U16 fpgaVBCPWMPullIn; ///< Reg 56. VBC PWM pull in + U16 fpgaVSPPWMLow; ///< Reg 58. VSP PWM low ( Spare valves ) + U16 fpgaVSPPWMPeriod; ///< Reg 60. VSP PWM period + U16 fpgaVSPPWMPullIn; ///< Reg 62. VSP PWM pull in + U16 fpgaD11PumpRevCount; ///< Reg 64. Acid Concentrate pump revolution count + U16 fpgaD10PumpRevCount; ///< Reg 66. Bicarb Concentrate pump revolution count + U08 fpgaADCControl; ///< Reg 68. FPGA internal ADC Control register for debugging + U08 fpgaGPIOControl; ///< Reg 69. FPGA GPIO control interface + U16 fpgaACRelayPWMLow; ///< Reg 70. Length of time in 10us resoultion that PWM output stays low. + U16 fpgaACRelayPWMPeriod; ///< Reg 72. PWM period for AC relay/heater. + U16 unusedRegister2; ///< Reg 74. Unsed register2 + U16 fpgaD76PumpRevCount; ///< Reg 76. UF pump revolution count + U08 fpgaD76PumpControl; ///< Reg 78. UF Pump Control + + U08 notused; ///< Reg 79. Not used + U08 valveIOControl; ///< Reg 80. IO Valve control register. + U08 valveFPControl; ///< Reg 81. FP Valve control register. + U08 conductivityP9Control; ///< Reg 82. P9 conductivity control register. + U08 conductivityP18Control; ///< Reg 83. P18 conductivity control register. + U16 conductivityP9Address; ///< Reg 84. P9 conductivity address register. + U32 conductivityP9Data; ///< Reg 86. P9 conductivity data in register. + U16 conductivityP18Address; ///< Reg 90. P18 conductivity address register. + U32 conductivityP18Data; ///< Reg 92. P18 conductivity data in register. + U16 descalePumpSpeed; ///< Reg 96. Descaler pump speed register. + U08 descalePumpControl; ///< Reg 98. Descaler pump control register. + U08 p12PumpControl; ///< Reg 99. P12 pump control register. + U16 valveIOFPPWMLow; ///< Reg 100. Valve VWi PWM low pulse period in 0.1 uSec. + U16 valveIOFPPWMPeriod; ///< Reg 102. Valve VWi PWM full period in 0.1 uSec. + U16 valveIOFPPWMPullIn; ///< Reg 104. Valve PWM high pulse period when valve is on in 0.1 uSec. + U16 p12PumpPWMDutyCyclePct; ///< Reg 106. P12 pump PWM duty cycle in percentage. + U16 p40PumpPWMDutyCyclePct; ///< Reg 108. P40 pump PWM duty cycle in percentage. + U08 p40PumpControl; ///< Reg 110. P40 pump control register. + U08 reserved1; ///< Reg 111. Reserved. + U08 flowControlp7; ///< Reg 112. P7 AVS Romer flow sensor control register. + U08 flowAddressp7; ///< Reg 113. P7 AVS Romer flow sensor I2C slave address register. + U08 valveIOPWMEnable; ///< Reg 114. Valve IO PWM enable register. + U08 valveFPPWMEnable; ///< Reg 115. Valve FP PWM enable register. + U08 flowControlp16; ///< Reg 116. P16 AVS Romer flow sensor control register. + U08 flowAddressp16; ///< Reg 117. P16 AVS Romer flow sensor I2C slave address register. + + 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 + U08 unsuedRegister; ///< Reg 125. Unused register. + U32 fpgaD11PumpSpeed; ///< Reg 126. Acid Concentrate Pump Speed/RPM Control + U32 fpgaD10PumpSpeed; ///< Reg 130. BiCarb Concentrate Pump Speed/RPM Control + U32 fpgaD76PumpSpeed; ///< Reg 134. UF Pump Speed/RPM Control } FPGA_ACTUATORS_T; #pragma pack(pop) // ********** 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_BETA_1_9_T fpgaBeta19SensorReadings; ///< DD FPGA sensors structure. +static FPGA_ACTUATORS_BETA_1_9_T fpgaBeta19ActuatorSetPoints; ///< FPGA actuator set points structure. +static DD_FPGA_SENSORS_T fpgaSensorReadings; ///< DD FPGA sensors structure for beta 2. +static FPGA_ACTUATORS_T fpgaActuatorSetPoints; ///< FPGA actuator set points structure for beta 2. // ********** private function prototypes ********** @@ -372,11 +645,15 @@ void initFPGADD( void ) { // Initialize fpga driver - initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, - sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_T), sizeof(FPGA_ACTUATORS_T) ); + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaBeta19SensorReadings, (U08*)&fpgaBeta19ActuatorSetPoints, + sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_BETA_1_9_T), sizeof(FPGA_ACTUATORS_BETA_1_9_T) ); // initialize fpga data structures memset( &fpgaHeader, 0, sizeof( FPGA_HEADER_T ) ); + memset( &fpgaBeta19SensorReadings, 0, sizeof( DD_FPGA_SENSORS_BETA_1_9_T ) ); + memset( &fpgaBeta19ActuatorSetPoints, 0, sizeof( FPGA_ACTUATORS_BETA_1_9_T ) ); + + // initialize FPGA data structure for beta 2 HW memset( &fpgaSensorReadings, 0, sizeof( DD_FPGA_SENSORS_T ) ); memset( &fpgaActuatorSetPoints, 0, sizeof( FPGA_ACTUATORS_T ) ); @@ -389,12 +666,47 @@ fpgaActuatorSetPoints.fpgaDDSpareValvePWMControl = FPGA_ENABLE_UF_VALVES_PWM; fpgaActuatorSetPoints.fpgaADCControl = FPGA_ADC_AUTO_READ_ENABLE; +#if 1 // Remove when Beta 1.9 is obsolete + // Set the valve control mode and default state of valve for Beta 1.9 HW + fpgaBeta19ActuatorSetPoints.fpgaValveControl = FPGA_ENABLE_VALVES_CONTROL; + fpgaBeta19ActuatorSetPoints.fpgaValvePWMEnable = FPGA_ENABLE_VALVES_PWM; + fpgaBeta19ActuatorSetPoints.fpgaBCValveControl = FPGA_ENABLE_BC_VALVES_CONTROL; + fpgaBeta19ActuatorSetPoints.fpgaBCValvePWMControl = FPGA_ENABLE_BC_VALVES_PWM; + fpgaBeta19ActuatorSetPoints.fpgaDDSpareValveControl = FPGA_ENABLE_SPARE_VALVES_CNTRL; + fpgaBeta19ActuatorSetPoints.fpgaDDSpareValvePWMControl = FPGA_ENABLE_UF_VALVES_PWM; + fpgaBeta19ActuatorSetPoints.fpgaADCControl = FPGA_ADC_AUTO_READ_ENABLE; +#endif + // 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); } /*********************************************************************//** * @brief + * The initFPGAPerHW function reconfigures the FPGA driver to use appropriate + * FPGA register maps. + * @details \b Inputs: none + * @details \b Outputs: FPGA registers initialized. + * @return none + *************************************************************************/ +void initFPGAPerHW( BOOL isHWBeta2 ) +{ + if ( isHWBeta2 != TRUE ) + { + // Initialize fpga driver + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaBeta19SensorReadings, (U08*)&fpgaBeta19ActuatorSetPoints, + sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_BETA_1_9_T), sizeof(FPGA_ACTUATORS_BETA_1_9_T) ); + } + else + { + // Initialize fpga driver for beta 2 hardware + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, + sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_T), sizeof(FPGA_ACTUATORS_T) ); + } +} + +/*********************************************************************//** + * @brief * The execFPGATest function executes the FPGA self-test. * @details \b Inputs: fpgaHeader * @details \b Outputs: none @@ -410,14 +722,14 @@ if ( FPGA_EXPECTED_ID == fpgaHeader.fpgaId ) { // Check FPGA compatibility w/ firmware - if ( DD_FPGA_COMPATIBILITY_REV == fpgaSensorReadings.fpgaCompatibilityRev ) + if ( DD_FPGA_COMPATIBILITY_REV == GET_FPGA_SENSOR_FIELD( fpgaCompatibilityRev ) ) { result = SELF_TEST_STATUS_PASSED; } else { result = SELF_TEST_STATUS_FAILED; - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_POST_TEST_FAILED, (U32)DD_FPGA_COMPATIBILITY_REV, (U32)fpgaSensorReadings.fpgaCompatibilityRev ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_POST_TEST_FAILED, (U32)DD_FPGA_COMPATIBILITY_REV, (U32)GET_FPGA_SENSOR_FIELD( fpgaCompatibilityRev ) ) } } else @@ -488,13 +800,13 @@ * 13 - M4Valve.\n * 14..15 - reserved or unused. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaValveControl + * @details \b Outputs: fpgaValveControl * @param valveStates bit mask for the various valve states * @return none *************************************************************************/ void setFPGADDValveStates( U16 valveStates ) { - fpgaActuatorSetPoints.fpgaValveControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( fpgaValveControl, valveStates ); } /*********************************************************************//** @@ -511,13 +823,13 @@ * 6 - D26.\n * 7 - D22.\n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaBCValveControl + * @details \b Outputs: fpgaBCValveControl * @param valveStates bit mask for the balancing chamber valve states * @return none *************************************************************************/ void setFPGABCValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.fpgaBCValveControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( fpgaBCValveControl, valveStates ); } /*********************************************************************//** @@ -531,13 +843,13 @@ * 3 - Not used.\n * 4..7 - Unused or reserved.\n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDSpareValveControl + * @details \b Outputs: fpgaDDSpareValveControl * @param valveStates bit mask for the spare valve states * @return none *************************************************************************/ void setFPGASpareValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.fpgaDDSpareValveControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( fpgaDDSpareValveControl, valveStates ); } /*********************************************************************//** @@ -546,13 +858,13 @@ * * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled" * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaValvePWMEnable + * @details \b Outputs: fpgaValvePWMEnable * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveDDPWMEnable( U16 valvePWMStates ) { - fpgaActuatorSetPoints.fpgaValvePWMEnable = valvePWMStates; + SET_FPGA_ACTUATOR_FIELD( fpgaValvePWMEnable, valvePWMStates ); } /*********************************************************************//** @@ -561,54 +873,54 @@ * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled". * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaValvePWMEnableStates + * @details \b Outputs: fpgaValvePWMEnableStates * @return none *************************************************************************/ U16 getFPGAValveDDPWMEnable( void ) { - return fpgaSensorReadings.fpgaValvePWMEnableStates; + return GET_FPGA_SENSOR_FIELD( fpgaValvePWMEnableStates ); } /*********************************************************************//** * @brief * The setFPGAValveDDPWMPullIn function sets the DD valves Pull-in "strike" * period where PWM is at 100% in 1ms resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDValvePWMPullin + * @details \b Outputs: fpgaDDValvePWMPullin * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveDDPWMPullIn( U16 valvePWMPullIn ) { - fpgaActuatorSetPoints.fpgaDDValvePWMPullin = valvePWMPullIn; + SET_FPGA_ACTUATOR_FIELD( fpgaDDValvePWMPullin, valvePWMPullIn ); } /*********************************************************************//** * @brief * The setFPGAValveDDPWMLow function sets the DD valves "low" * period where PWM is at 0% in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDValvePWMLow + * @details \b Outputs: fpgaDDValvePWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveDDPWMLow( U16 valvePWMLow ) { - fpgaActuatorSetPoints.fpgaDDValvePWMLow = valvePWMLow; + SET_FPGA_ACTUATOR_FIELD( fpgaDDValvePWMLow, valvePWMLow ); } /*********************************************************************//** * @brief * The setFPGAValveDDPWMPeriod function sets the DD valves pwm * period in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDValvePWMPeriod + * @details \b Outputs: fpgaDDValvePWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveDDPWMPeriod( U16 valvePWMPeriod ) { - fpgaActuatorSetPoints.fpgaDDValvePWMPeriod = valvePWMPeriod; + SET_FPGA_ACTUATOR_FIELD( fpgaDDValvePWMPeriod, valvePWMPeriod ); } /*********************************************************************//** @@ -617,13 +929,13 @@ * * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled" * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaBCValvePWMControl + * @details \b Outputs: fpgaBCValvePWMControl * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveBCPWMEnable( U08 valvePWMStates ) { - fpgaActuatorSetPoints.fpgaBCValvePWMControl = valvePWMStates; + SET_FPGA_ACTUATOR_FIELD( fpgaBCValvePWMControl, valvePWMStates ); } /*********************************************************************//** @@ -632,54 +944,54 @@ * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled". * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaValveBCPWMStates + * @details \b Outputs: fpgaValveBCPWMStates * @return none *************************************************************************/ U08 getFPGAValveBCPWMEnable( void ) { - return fpgaSensorReadings.fpgaValveBCPWMStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveBCPWMStates ); } /*********************************************************************//** * @brief * The setFPGAValveBCPWMPullIn function sets the BC valves Pull-in "strike" * period where PWM is at 100% in 1ms resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaVBCPWMPullin + * @details \b Outputs: fpgaVBCPWMPullin * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveBCPWMPullIn( U16 valvePWMPullIn ) { - fpgaActuatorSetPoints.fpgaVBCPWMPullIn = valvePWMPullIn; + SET_FPGA_ACTUATOR_FIELD( fpgaVBCPWMPullIn, valvePWMPullIn ); } /*********************************************************************//** * @brief * The setFPGAValveBCPWMLow function sets the BC valves "low" * period where PWM is at 0% in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaVBCPWMLow + * @details \b Outputs: fpgaVBCPWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveBCPWMLow( U16 valvePWMLow ) { - fpgaActuatorSetPoints.fpgaVBCPWMLow = valvePWMLow; + SET_FPGA_ACTUATOR_FIELD( fpgaVBCPWMLow, valvePWMLow ); } /*********************************************************************//** * @brief * The setFPGAValveBCPWMPeriod function sets the BC valves pwm * period in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaVBCPWMPeriod + * @details \b Outputs: fpgaVBCPWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveBCPWMPeriod( U16 valvePWMPeriod ) { - fpgaActuatorSetPoints.fpgaVBCPWMPeriod = valvePWMPeriod; + SET_FPGA_ACTUATOR_FIELD( fpgaVBCPWMPeriod, valvePWMPeriod ); } /*********************************************************************//** @@ -688,13 +1000,13 @@ * * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled" * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDSpareValvePWMControl + * @details \b Outputs: fpgaDDSpareValvePWMControl * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveSPPWMEnable( U08 valvePWMStates ) { - fpgaActuatorSetPoints.fpgaDDSpareValvePWMControl = valvePWMStates; + SET_FPGA_ACTUATOR_FIELD( fpgaDDSpareValvePWMControl, valvePWMStates ); } /*********************************************************************//** @@ -703,62 +1015,62 @@ * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled". * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaValveSpPWMStates + * @details \b Outputs: fpgaValveSpPWMStates * @return none *************************************************************************/ U08 getFPGAValveSPPWMEnable( void ) { - return fpgaSensorReadings.fpgaValveSpPWMStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveSpPWMStates ); } /*********************************************************************//** * @brief * The setFPGAValveSPPWMPullIn function sets the Spare valves Pull-in "strike" * period where PWM is at 100% in 1ms resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaVSPPWMPullIn + * @details \b Outputs: fpgaVSPPWMPullIn * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveSPPWMPullIn( U16 valvePWMPullIn ) { - fpgaActuatorSetPoints.fpgaVSPPWMPullIn = valvePWMPullIn; + SET_FPGA_ACTUATOR_FIELD( fpgaVSPPWMPullIn, valvePWMPullIn ); } /*********************************************************************//** * @brief * The setFPGAValveSPPWMLow function sets the Spare valves "low" * period where PWM is at 0% in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaVSPPWMLow + * @details \b Outputs: fpgaVSPPWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveSPPWMLow( U16 valvePWMLow ) { - fpgaActuatorSetPoints.fpgaVSPPWMLow = valvePWMLow; + SET_FPGA_ACTUATOR_FIELD( fpgaVSPPWMLow, valvePWMLow ); } /*********************************************************************//** * @brief * The setFPGAValveSPPWMPeriod function sets the Spare valves pwm * period in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaVSPPWMPeriod + * @details \b Outputs: fpgaVSPPWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveSPPWMPeriod( U16 valvePWMPeriod ) { - fpgaActuatorSetPoints.fpgaVSPPWMPeriod = valvePWMPeriod; + SET_FPGA_ACTUATOR_FIELD( fpgaVSPPWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @brief * The setFPGAD48PumpSpeed function sets the speed for the * spent dialysate pump (SDP). * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpSpeed + * @details \b Outputs: fpgaD48PumpSpeed * @param speed The spent dialysate pump speed * @return none *************************************************************************/ @@ -767,11 +1079,11 @@ #ifdef __MAXON_SPEED_UPDATE__ { U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); - fpgaActuatorSetPoints.fpgaD48PumpSpeed = currentSpeed; + SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpSpeed, currentSpeed ); } #else { - fpgaActuatorSetPoints.fpgaD48PumpSpeed = speed; + SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpSpeed, speed ); } #endif } @@ -781,7 +1093,7 @@ * The setFPGAD12PumpSpeed function sets the speed for the * fresh dialysate pump (DGP). * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpSpeed + * @details \b Outputs: fpgaD12PumpSpeed * @param speed The fresh dialysate pump speed * @return none *************************************************************************/ @@ -790,11 +1102,11 @@ #ifdef __MAXON_SPEED_UPDATE__ { U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); - fpgaActuatorSetPoints.fpgaD12PumpSpeed = currentSpeed; + SET_FPGA_ACTUATOR_FIELD( fpgaD12PumpSpeed, currentSpeed ); } #else { - fpgaActuatorSetPoints.fpgaD12PumpSpeed = speed; + SET_FPGA_ACTUATOR_FIELD( fpgaD12PumpSpeed, speed ); } #endif } @@ -811,13 +1123,13 @@ * bit 1-2: Reserved * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpControl + * @details \b Outputs: fpgaD48PumpControl * @param control The dialysate out pump controls * @return none *************************************************************************/ void setFPGAD48PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD48PumpControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpControl, control ); } /*********************************************************************//** @@ -832,55 +1144,55 @@ * bit 1-2: Reserved * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpControl + * @details \b Outputs: fpgaD12PumpControl * @param control The dialysate In pump controls * @return none *************************************************************************/ void setFPGAD12PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD12PumpControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaD12PumpControl, control ); } /*********************************************************************//** * @brief * The setFPGAD11PumpSetStepSpeed function sets the step speed period for * concentrate pump D11_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpSpeed + * @details \b Outputs: fpgaD11PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ void setFPGAD11PumpSetStepSpeed( U32 stepSpeed ) { - fpgaActuatorSetPoints.fpgaD11PumpSpeed = stepSpeed; + SET_FPGA_ACTUATOR_FIELD( fpgaD11PumpSpeed, stepSpeed ); } /*********************************************************************//** * @brief * The setFPGAD10PumpSetStepSpeed function sets the step speed period for * concentrate pump D10_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpSpeed + * @details \b Outputs: fpgaD10PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ void setFPGAD10PumpSetStepSpeed( U32 stepSpeed ) { - fpgaActuatorSetPoints.fpgaD10PumpSpeed = stepSpeed; + SET_FPGA_ACTUATOR_FIELD( fpgaD10PumpSpeed, stepSpeed ); } /*********************************************************************//** * @brief * The setFPGAD76PumpSetStepSpeed function sets the step speed period for * UF D76_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpSpeed + * @details \b Outputs: fpgaD76PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ void setFPGAD76PumpSetStepSpeed( U32 stepSpeed ) { - fpgaActuatorSetPoints.fpgaD76PumpSpeed = stepSpeed; + SET_FPGA_ACTUATOR_FIELD( fpgaD76PumpSpeed, stepSpeed ); } /*********************************************************************//** @@ -894,14 +1206,14 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl + * @details \b Outputs: fpgaD11PumpControl * @param control Concentrate pump control set * @return none *************************************************************************/ void setFPGAD11PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD11PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaD11PumpControl |= control; + CLEAR_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, FPGA_CONC_PUMP_PARK_COMMAND); // preserve msb (park command bit) + SET_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, control); } /*********************************************************************//** @@ -915,14 +1227,14 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl + * @details \b Outputs: fpgaD10PumpControl * @param control Concentrate pump control set * @return none *************************************************************************/ void setFPGAD10PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD10PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaD10PumpControl |= control; + CLEAR_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // preserve msb (park command bit) + SET_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, control ); } /*********************************************************************//** @@ -936,14 +1248,14 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl + * @details \b Outputs: fpgaD76PumpControl * @param control UF pump control set * @return none *************************************************************************/ void setFPGAD76PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD76PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaD76PumpControl |= control; + CLEAR_FPGA_ACTUATOR_BITS( fpgaD76PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // preserve msb (park command bit) + SET_FPGA_ACTUATOR_BITS( fpgaD76PumpControl, control ); } /*********************************************************************//** @@ -953,13 +1265,13 @@ * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl + * @details \b Outputs: fpgaD11PumpControl * @param Park command bit set * @return none *************************************************************************/ void setFPGAD11PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaD11PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + SET_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** @@ -969,13 +1281,13 @@ * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl + * @details \b Outputs: fpgaD10PumpControl * @param Park command bit set * @return none *************************************************************************/ void setFPGAD10PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaD10PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + SET_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** @@ -985,77 +1297,77 @@ * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl + * @details \b Outputs: fpgaD76PumpControl * @param Park command bit set * @return none *************************************************************************/ void setFPGAD76PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaD76PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + SET_FPGA_ACTUATOR_BITS( fpgaD76PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** * @brief * The setFPGAD17CondReset function resets the FPGA Conductivity * Sensor D17. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD17CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D17_RESET_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D17_RESET_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD17CondReset function clears the reset of FPGA Conductivity * Sensor D17. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D17_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D17_RESET_BIT ); } /*********************************************************************//** * @brief * The setFPGAD17CondInitEnable function enables the FPGA Conductivity * Sensor D17 initialzation procedure. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD17CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D17_INIT_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D17_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD17CondInitEnable function clears the init process of FPGA Conductivity * Sensor D17. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D17_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D17_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD17CondWriteEnable function enables the FPGA Conductivity * Sensor D17 write transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGAD17D74Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate @@ -1064,29 +1376,29 @@ *************************************************************************/ void setFPGAD17CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D17_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D17_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD17CondWriteEnable function clears the write enable of FPGA Conductivity * Sensor D17. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D17_WR_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D17_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD17CondReadEnable function enables the FPGA Conductivity * Sensor D17 read transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGAD17D74Address) register must be populated * before invoking this read enable function to initiate read transaction @@ -1095,85 +1407,85 @@ *************************************************************************/ void setFPGAD17CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D17_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D17_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD17CondReadEnable function clears the read enable of FPGA Conductivity * Sensor D17. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D17_RD_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D17_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD27CondReset function resets the FPGA Conductivity * Sensor D27. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD27CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D27_RESET_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D27_RESET_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD27CondReset function clears the reset of FPGA Conductivity * Sensor D27. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D27_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D27_RESET_BIT ); } /*********************************************************************//** * @brief * The setFPGAD27CondInitEnable function enables the FPGA Conductivity * Sensor D27 initialzation procedure. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD27CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D27_INIT_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D27_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD27CondInitEnable function clears the init process of FPGA Conductivity * Sensor D27. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D27_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D27_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD27CondWriteEnable function enables the FPGA Conductivity * Sensor D27 write transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate @@ -1182,29 +1494,29 @@ *************************************************************************/ void setFPGAD27CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D27_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D27_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD27CondWriteEnable function clears the write enable of FPGA Conductivity * Sensor D27. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D27_WR_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D27_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD27CondReadEnable function enables the FPGA Conductivity * Sensor D27 read transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) register must be populated * before invoking this read enable function to initiate read transaction @@ -1213,85 +1525,85 @@ *************************************************************************/ void setFPGAD27CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D27_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D27_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD27CondReadEnable function clears the read enable of FPGA Conductivity * Sensor D27. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D27_RD_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D27_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGD29CondReset function resets the FPGA Conductivity * Sensor D29. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD29CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D29_RESET_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D29_RESET_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD29CondReset function clears the reset of FPGA Conductivity * Sensor D29. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D29_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D29_RESET_BIT ); } /*********************************************************************//** * @brief * The setFPGAD29CondInitEnable function enables the FPGA Conductivity * Sensor D29 initialzation procedure. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD29CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D29_INIT_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D29_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD29CondInitEnable function clears the init process of FPGA Conductivity * Sensor D29. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D29_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D29_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD29CondWriteEnable function enables the FPGA Conductivity * Sensor D29 write transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate @@ -1300,29 +1612,29 @@ *************************************************************************/ void setFPGAD29CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D29_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D29_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD29CondWriteEnable function clears the write enable of FPGA Conductivity * Sensor D29. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D29_WR_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D29_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD29CondReadEnable function enables the FPGA Conductivity * Sensor D29 read transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) register must be populated * before invoking this read enable function to initiate read transaction @@ -1331,85 +1643,85 @@ *************************************************************************/ void setFPGAD29CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control |= FPGA_D29_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, FPGA_D29_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD29CondReadEnable function clears the read enable of FPGA Conductivity * Sensor D29. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29Control + * @details \b Outputs: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control &= ~FPGA_D29_RD_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD27D29Control, ~FPGA_D29_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD43CondReset function resets the FPGA Conductivity * Sensor D43. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void setFPGAD43CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control |= FPGA_D43_RESET_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, FPGA_D43_RESET_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD43CondReset function clears the reset of FPGA Conductivity * Sensor D43. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control &= ~FPGA_D43_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, ~FPGA_D43_RESET_BIT ); } /*********************************************************************//** * @brief * The setFPGAD43CondInitEnable function enables the FPGA Conductivity * Sensor D43 initialzation procedure. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void setFPGAD43CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control |= FPGA_D43_INIT_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, FPGA_D43_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD43CondInitEnable function clears the init process of FPGA Conductivity * Sensor D43. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control &= ~FPGA_D43_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, ~FPGA_D43_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD43CondWriteEnable function enables the FPGA Conductivity * Sensor D43 write transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @warning: The address (setFPGACD12Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate @@ -1418,29 +1730,29 @@ *************************************************************************/ void setFPGAD43CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control |= FPGA_D43_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, FPGA_D43_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD43CondWriteEnable function clears the write enable of FPGA Conductivity * Sensor D43. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control &= ~FPGA_D43_WR_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, ~FPGA_D43_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD43CondReadEnable function enables the FPGA Conductivity * Sensor D43 read transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @warning: The address (setFPGACD12Address) register must be populated * before invoking this read enable function to initiate read transaction @@ -1449,85 +1761,85 @@ *************************************************************************/ void setFPGAD43CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control |= FPGA_D43_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, FPGA_D43_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD43CondReadEnable function clears the read enable of FPGA Conductivity * Sensor D43. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43Control + * @details \b Outputs: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD43Control &= ~FPGA_D43_RD_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD43Control, ~FPGA_D43_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD74CondReset function resets the FPGA Conductivity * Sensor D74. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD74CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D74_RESET_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D74_RESET_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD74CondReset function clears the reset of FPGA Conductivity * Sensor D74. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondReset( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D74_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D74_RESET_BIT ); } /*********************************************************************//** * @brief * The setFPGAD74CondInitEnable function enables the FPGA Conductivity * Sensor D74 initialzation procedure. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD74CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D74_INIT_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D74_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD74CondInitEnable function clears the init process of FPGA Conductivity * Sensor D74. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondInitEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D74_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D74_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD74CondWriteEnable function enables the FPGA Conductivity * Sensor D74 write transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGACD74Address) and data (setFPGACD74Data) register * must be populated before invoking this write enable function to initiate @@ -1536,29 +1848,29 @@ *************************************************************************/ void setFPGAD74CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D74_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D74_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD74CondWriteEnable function clears the write enable of FPGA Conductivity * Sensor D74. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondWriteEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D74_WR_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D74_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD74CondReadEnable function enables the FPGA Conductivity * Sensor D74 read transaction. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGACD74Address) register must be populated * before invoking this read enable function to initiate read transaction @@ -1567,21 +1879,21 @@ *************************************************************************/ void setFPGAD74CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control |= FPGA_D74_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, FPGA_D74_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAD74CondReadEnable function clears the read enable of FPGA Conductivity * Sensor D74. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondReadEnable( void ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control &= ~FPGA_D74_RD_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D74_RD_ENABLE_BIT ); } @@ -1598,13 +1910,13 @@ * bit 1: Enable D17 Init procedure (1) * bit 0: reset D17 Conduct sensor (1) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74Control + * @details \b Outputs: fpgaConSensD17D74Control * @param control Conductivity Sensor control set * @return none *************************************************************************/ void setFPGAD17D74Control( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensD17D74Control = control; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD17D74Control, control ); } /*********************************************************************//** @@ -1620,13 +1932,13 @@ * bit 1: Enable D27 Init procedure (1) * bit 0: reset D27 Conduct sensor (1) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @details \b Outputs: fpgaConSensTD34Control * @param control Conductivity sensor control set * @return none *************************************************************************/ void setFPGAD27D29Control( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensD27D29Control = control; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD27D29Control, control ); } /*********************************************************************//** @@ -1639,97 +1951,97 @@ * bit 1: Enable D43 Init procedure (1) * bit 0: reset D43 Conduct sensor (1) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control + * @details \b Outputs: fpgaConSensD74Control * @param control Conductivity sensor control set * @return none *************************************************************************/ void setFPGAD43Control( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensD43Control = control; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD43Control, control ); } /*********************************************************************//** * @brief * The setFPGAD17D74Address function sets the conductivity sensor * CD12 address register to perform read and write operations. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74_Addrs + * @details \b Outputs: fpgaConSensD17D74_Addrs * @param address The conductivity sensor D17 and D74 address * @return none *************************************************************************/ void setFPGAD17D74Address( U16 address ) { - fpgaActuatorSetPoints.fpgaConSensD17D74_Addrs = address; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD17D74_Addrs, address ); } /*********************************************************************//** * @brief * The setFPGAD27D29Address function sets the conductivity sensor * CD34 address register to perform read and write operations. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29_Addrs + * @details \b Outputs: fpgaConSensD27D29_Addrs * @param address The conductivity sensor CD34 address * @return none *************************************************************************/ void setFPGAD27D29Address( U16 address ) { - fpgaActuatorSetPoints.fpgaConSensD27D29_Addrs = address; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD27D29_Addrs, address ); } /*********************************************************************//** * @brief * The setFPGAD43Address function sets the conductivity sensor * D74 address register to perform read and write operations. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43_Addrs + * @details \b Outputs: fpgaConSensD43_Addrs * @param address The conductivity sensor D43 address * @return none *************************************************************************/ void setFPGAD43Address( U16 address ) { - fpgaActuatorSetPoints.fpgaConSensD43_Addrs = address; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD43_Addrs, address ); } /*********************************************************************//** * @brief * The setFPGAD17D74Data function sets the conductivity sensor * CD12 data outputfor write operations. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD17D74_Data_In + * @details \b Outputs: fpgaConSensD17D74_Data_In * @param data The conductivity sensor D17 and D74 Data * @return none *************************************************************************/ void setFPGAD17D74Data( U32 data ) { - fpgaActuatorSetPoints.fpgaConSensD17D74_Data_In = data; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD17D74_Data_In, data ); } /*********************************************************************//** * @brief * The setFPGAD27D29Data function sets the conductivity sensor * CD34 data outputfor write operations. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD27D29_Data_In + * @details \b Outputs: fpgaConSensD27D29_Data_In * @param data The conductivity sensor D27 and D29 Data * @return none *************************************************************************/ void setFPGAD27D29Data( U32 data ) { - fpgaActuatorSetPoints.fpgaConSensD27D29_Data_In = data; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD27D29_Data_In, data ); } /*********************************************************************//** * @brief * The setFPGAD43Data function sets the conductivity sensor * D43 data output for write operations. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD43_Data_In + * @details \b Outputs: fpgaConSensD43_Data_In * @param data The conductivity sensor D43 Data * @return none *************************************************************************/ void setFPGAD43Data( U32 data ) { - fpgaActuatorSetPoints.fpgaConSensD43_Data_In = data; + SET_FPGA_ACTUATOR_FIELD( fpgaConSensD43_Data_In, data ); } /*********************************************************************//** @@ -1743,7 +2055,7 @@ *************************************************************************/ void setFPGAD5HeaterPWMControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD5HeaterPWMControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaD5HeaterPWMControl, control ); } /*********************************************************************//** @@ -1757,7 +2069,7 @@ *************************************************************************/ void setFPGAD45HeaterPWMControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD45HeaterPWMControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaD45HeaterPWMControl, control ); } /*********************************************************************//** @@ -1771,7 +2083,7 @@ *************************************************************************/ void setFPGAD11PumpRevolutionCount( U16 count ) { - fpgaActuatorSetPoints.fpgaD11PumpRevCount = count; + SET_FPGA_ACTUATOR_FIELD( fpgaD11PumpRevCount, count ); } /*********************************************************************//** @@ -1785,7 +2097,7 @@ *************************************************************************/ void setFPGAD10PumpRevolutionCount( U16 count ) { - fpgaActuatorSetPoints.fpgaD10PumpRevCount = count; + SET_FPGA_ACTUATOR_FIELD( fpgaD10PumpRevCount, count ); } /*********************************************************************//** @@ -1799,7 +2111,7 @@ *************************************************************************/ void setFPGAD76PumpRevolutionCount( U16 count ) { - fpgaActuatorSetPoints.fpgaD76PumpRevCount = count; + SET_FPGA_ACTUATOR_FIELD( fpgaD76PumpRevCount, count ); } /*********************************************************************//** @@ -1815,11 +2127,11 @@ { if ( TRUE == flag) { - fpgaActuatorSetPoints.fpgaGPIOControl |= FPGA_D5_HEATER_CNTRL_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaGPIOControl, FPGA_D5_HEATER_CNTRL_BIT ); } else { - fpgaActuatorSetPoints.fpgaGPIOControl &= ~FPGA_D5_HEATER_CNTRL_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaGPIOControl, ~FPGA_D5_HEATER_CNTRL_BIT ); } } @@ -1836,11 +2148,11 @@ { if ( TRUE == enable) { - fpgaActuatorSetPoints.fpgaGPIOControl |= FPGA_D5_HEATER_PWM_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaGPIOControl, FPGA_D5_HEATER_PWM_ENABLE_BIT ); } else { - fpgaActuatorSetPoints.fpgaGPIOControl &= ~FPGA_D5_HEATER_PWM_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaGPIOControl, ~FPGA_D5_HEATER_PWM_ENABLE_BIT ); } } @@ -1855,7 +2167,7 @@ *************************************************************************/ void setFPGAD5HeaterPWMLowState( U16 count ) { - fpgaActuatorSetPoints.fpgaACRelayPWMLow = count; + SET_FPGA_ACTUATOR_FIELD( fpgaACRelayPWMLow, count ); } /*********************************************************************//** @@ -1869,7 +2181,7 @@ *************************************************************************/ void setFPGAD5HeaterPWMPeriod( U16 period ) { - fpgaActuatorSetPoints.fpgaACRelayPWMPeriod = period; + SET_FPGA_ACTUATOR_FIELD( fpgaACRelayPWMPeriod, period ); } /*********************************************************************//** @@ -1899,12 +2211,12 @@ * bit 1-2: TBD * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpControl + * @details \b Outputs: fpgaD48PumpControl * @return Dialysate Out pump control status bit *************************************************************************/ U08 getFPGAD48PumpControl( void ) { - return fpgaActuatorSetPoints.fpgaD48PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD48PumpControl ); } /*********************************************************************//** @@ -1919,38 +2231,38 @@ * bit 1-2: TBD * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpControl + * @details \b Outputs: fpgaD12PumpControl * @return Dialysate Inlet pump control status bit *************************************************************************/ U08 getFPGAD12PumpControl( void ) { - return fpgaActuatorSetPoints.fpgaD12PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD12PumpControl ); } /*********************************************************************//** * @brief * The getFPGAD48PumpSpeed function gets the spent dialysate * pump speed. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD48MeasuredSpeed + * @details \b Outputs: fpgaD48MeasuredSpeed * @return Spent dialysate pump measured speed. *************************************************************************/ U16 getFPGAD48PumpSpeed( void ) { - return fpgaSensorReadings.fpgaD48MeasuredSpeed; + return GET_FPGA_SENSOR_FIELD( fpgaD48MeasuredSpeed ); } /*********************************************************************//** * @brief * The getFPGAD12PumpSpeed function gets the fresh dialysate * pump speed. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12MeasuredSpeed + * @details \b Outputs: fpgaD12MeasuredSpeed * @return fresh dialysate pump measured speed. *************************************************************************/ U16 getFPGAD12PumpSpeed( void ) { - return fpgaSensorReadings.fpgaD12MeasuredSpeed; + return GET_FPGA_SENSOR_FIELD( fpgaD12MeasuredSpeed ); } /*********************************************************************//** @@ -1961,12 +2273,12 @@ * bit 1 : spent dialysate pump error (1), no error(0) * bit 0 : fresh dialysate pump error (1), no error(0) * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12D48PumpStatus + * @details \b Outputs: fpgaD12D48PumpStatus * @return fresh dialysate pump error status. *************************************************************************/ BOOL getFPGAD12PumpErrorStatus( void ) { - U08 mask = fpgaSensorReadings.fpgaD12D48PumpStatus & FPGA_D12_PUMP_ERROR_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD12D48PumpStatus ) & FPGA_D12_PUMP_ERROR_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1980,12 +2292,12 @@ * bit 1 : spent dialysate pump error (1), no error(0) * bit 0 : fresh dialysate pump error (1), no error(0) * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12D48PumpStatus + * @details \b Outputs: fpgaD12D48PumpStatus * @return spent dialysate pump error status. *************************************************************************/ BOOL getFPGAD48PumpErrorStatus( void ) { - U08 mask = fpgaSensorReadings.fpgaD12D48PumpStatus & FPGA_D48_PUMP_ERROR_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD12D48PumpStatus ) & FPGA_D48_PUMP_ERROR_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1996,51 +2308,51 @@ * The getFPGAD12PumpCurrentFeedback function gets the fresh dialysate * pump current consumption. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12CurrentFeedback + * @details \b Outputs: fpgaD12CurrentFeedback * @return fresh dialysate pump measured current. *************************************************************************/ U16 getFPGAD12PumpCurrentFeedback( void ) { - return fpgaSensorReadings.fpgaD12CurrentFeedback; + return GET_FPGA_SENSOR_FIELD( fpgaD12CurrentFeedback ); } /*********************************************************************//** * @brief * The getFPGAD48PumpCurrentFeedback function gets the spent dialysate * pump current consumption. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD48CurrentFeedback + * @details \b Outputs: fpgaD48CurrentFeedback * @return spent dialysate pump measured current. *************************************************************************/ U16 getFPGAD48PumpCurrentFeedback( void ) { - return fpgaSensorReadings.fpgaD48CurrentFeedback; + return GET_FPGA_SENSOR_FIELD( fpgaD48CurrentFeedback ); } /*********************************************************************//** * @brief * The getFPGAD12PumpHallDirectionStatus function gets the fresh dialysate * pump hall sensor based direction error status. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12HallStatus + * @details \b Outputs: fpgaD12HallStatus * @return fresh dialysate pump hall sensor based direction status. *************************************************************************/ U08 getFPGAD12PumpHallDirectionStatus( void ) { - return fpgaSensorReadings.fpgaD12HallStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD12HallStatus ); } /*********************************************************************//** * @brief * The getFPGAD48PumpHallDirectionStatus function gets the spent dialysate * pump hall sensor based direction error status. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD48HallStatus + * @details \b Outputs: fpgaD48HallStatus * @return spent dialysate pump hall sensor based direction status. *************************************************************************/ U08 getFPGAD48PumpHallDirectionStatus( void ) { - return fpgaSensorReadings.fpgaD48HallStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD48HallStatus ); } /*********************************************************************//** @@ -2054,12 +2366,12 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl + * @details \b Outputs: fpgaD11PumpControl * @return Acid pump control status bit *************************************************************************/ U08 getFPGAD11PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaD11PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD11PumpControl ); } /*********************************************************************//** @@ -2073,12 +2385,12 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl + * @details \b Outputs: fpgaD10PumpControl * @return Bicarb pump control status bit *************************************************************************/ U08 getFPGAD10PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaD10PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD10PumpControl ); } /*********************************************************************//** @@ -2092,38 +2404,38 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl + * @details \b Outputs: fpgaD76PumpControl * @return UF pump control status bit *************************************************************************/ U08 getFPGAD76PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaD76PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD76PumpControl ); } /*********************************************************************//** * @brief * The getFPGAUFPumpFault function gets UF pumps fault * reported by FGPA. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpFault + * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return Latest UF pumps fault value *************************************************************************/ U08 getFPGAUFPumpFault( void ) { - return ( ( fpgaSensorReadings.fpgaD76PumpFault & FPGA_UF_PUMP_FAULT_BIT ) << UF_PUMP_FAULT_SHIFT ); + return ( ( GET_FPGA_SENSOR_FIELD( fpgaD76PumpFault ) & FPGA_UF_PUMP_FAULT_BIT ) << UF_PUMP_FAULT_SHIFT ); } /*********************************************************************//** * @brief * The getFPGAD76PumpIsParked function gets whether the UF pump is currently * parked. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpFault + * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return TRUE if UF pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD76PumpIsParked( void ) { - U08 mask = fpgaSensorReadings.fpgaD76PumpFault & FPGA_UF_PUMP_PARKED_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD76PumpFault ) & FPGA_UF_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -2133,13 +2445,13 @@ * @brief * The getFPGAD76PumpParkFault function gets whether the UF pump park command * has faulted. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpFault + * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return TRUE if UF pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAD76PumpParkFault( void ) { - U08 mask = fpgaSensorReadings.fpgaD76PumpFault & FPGA_UF_PUMP_PARK_FAULT_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD ( fpgaD76PumpFault ) & FPGA_UF_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -2149,26 +2461,26 @@ * @brief * The getFPGAConcentratePumpsFault function gets concentrate pumps fault * reported by FGPA. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return Latest concentrate pumps fault value *************************************************************************/ U08 getFPGAConcentratePumpsFault( void ) { - return fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_CONC_PUMP_FAULT_BITS; + return ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_CONC_PUMP_FAULT_BITS ); } /*********************************************************************//** * @brief * The getFPGAD11PumpIsParked function gets whether the acid pump is currently * parked. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if acid pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD11PumpIsParked( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D11_PUMP_PARKED_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D11_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -2178,13 +2490,13 @@ * @brief * The getFPGAD10PumpIsParked function gets whether the bicarb pump is currently * parked. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if bicarb pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD10PumpIsParked( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D10_PUMP_PARKED_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D10_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -2194,13 +2506,13 @@ * @brief * The getFPGAD11PumpParkFault function gets whether the acid pump park command * has faulted. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if acid pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAD11PumpParkFault( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D11_PUMP_PARK_FAULT_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D11_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -2210,13 +2522,13 @@ * @brief * The getFPGAD10PumpParkFault function gets whether the bicarb pump park command * has faulted. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if bicarb pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAD10PumpParkFault( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D10_PUMP_PARK_FAULT_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D10_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -2226,601 +2538,657 @@ * @brief * The getFPGAD11PumpHallSensePulseWidth function gets concentrate pump D11_Pump * hall sense pulse width. - * @details \b Inputs: fpgaSensorReadings.fpgaD11PumpHallSense + * @details \b Inputs: fpgaD11PumpHallSense * @details \b Outputs: none * @return concentrate pump D11_Pump hall sense pulse width *************************************************************************/ U32 getFPGAD11PumpHallSensePulseWidth( void ) { - return fpgaSensorReadings.fpgaD11PumpHallSense; + return GET_FPGA_SENSOR_FIELD( fpgaD11PumpHallSense ); } /*********************************************************************//** * @brief * The getFPGAD10PumpHallSensePulseWidth function gets concentrate pump D10_Pump * hall sense pulse width. - * @details \b Inputs: fpgaSensorReadings.fpgaD10PumpHallSense + * @details \b Inputs: fpgaD10PumpHallSense * @details \b Outputs: none * @return concentrate pump D10_Pump hall sense pulse width *************************************************************************/ U32 getFPGAD10PumpHallSensePulseWidth( void ) { - return fpgaSensorReadings.fpgaD10PumpHallSense; + return GET_FPGA_SENSOR_FIELD( fpgaD10PumpHallSense ); } /*********************************************************************//** * @brief * The getFPGAD76PumpHallSensePulseWidth function gets UF pump D76_Pump * hall sense pulse width. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpHallSense + * @details \b Inputs: fpgaD76PumpHallSense * @details \b Outputs: none * @return ultrafiltration pump D76_Pump hall sense pulse width *************************************************************************/ U32 getFPGAD76PumpHallSensePulseWidth( void ) { - return fpgaSensorReadings.fpgaD76PumpHallSense; + return GET_FPGA_SENSOR_FIELD( fpgaD76PumpHallSense ); } /*********************************************************************//** * @brief * The getFPGADDValveStates function gets the latest sensed valve states. * See setFPGADDValveStates for valve state bit positions. - * @details \b Inputs: fpgaSensorReadings.fpgaValveStates + * @details \b Inputs: fpgaValveStates * @details \b Outputs: none * @return last valve states reading *************************************************************************/ U16 getFPGADDValveStates( void ) { - return fpgaSensorReadings.fpgaValveStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveStates ); } /*********************************************************************//** * @brief * The getFPGAValveBCStates function gets the latest sensed balancing * chamber valve states. * See setFPGABCValveStates for BC valve state bit positions. - * @details \b Inputs: fpgaSensorReadings.fpgaValveBCStates + * @details \b Inputs: fpgaValveBCStates * @details \b Outputs: none * @return last balancing chamber valve states reading *************************************************************************/ U08 getFPGAValveBCStates( void ) { - return fpgaSensorReadings.fpgaValveBCStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveBCStates ); } /*********************************************************************//** * @brief * The getFPGAValveSpStates function gets the latest sensed spare * valve states. * See setFPGAUFValveStates for Spare valve state bit positions. - * @details \b Inputs: fpgaSensorReadings.fpgaValveSpStates + * @details \b Inputs: fpgaValveSpStates * @details \b Outputs: none * @return last spare valve states reading *************************************************************************/ U08 getFPGAValveSpStates( void ) { - return fpgaSensorReadings.fpgaValveSpStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveSpStates ); } /*********************************************************************//** * @brief * The getFPGAD9PresRawPressure function gets hydraulics outlet pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD9PresPressure + * @details \b Inputs: fpgaD9PresPressure * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD9PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD9PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD9PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD9PresRawTemperature function gets hydraulics outlet pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD9PresTemp + * @details \b Inputs: fpgaD9PresTemp * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD9PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD9PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD9PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD66PresRawPressure function gets Bibag pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD66PresPressure + * @details \b Inputs: fpgaD66PresPressure * @details \b Outputs: none * @return Latest Bibag pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD66PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD66PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD66PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD66PresRawTemperature function gets Bibag pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD66PresTemp + * @details \b Inputs: fpgaD66PresTemp * @details \b Outputs: none * @return Latest Bibag pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD66PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD66PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD66PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD51PresRawPressure function gets spent dialysate pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD51PresPressure + * @details \b Inputs: fpgaD51PresPressure * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD51PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD51PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD51PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD51PresRawTemperature function gets spent dialysate pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD51PresTemp + * @details \b Inputs: fpgaD51PresTemp * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD51PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD51PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD51PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD18PresRawPressure function gets fresh dialysate pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD18PresPressure + * @details \b Inputs: fpgaD18PresPressure * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD18PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD18PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD18PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD18PresRawTemperature function gets fresh dialysate pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD18PresTemp + * @details \b Inputs: fpgaD18PresTemp * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD18PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD18PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD18PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD41PresRawPressure function gets transmembrane pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD41PresPressure + * @details \b Inputs: fpgaD41PresPressure * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD41PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD41PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD41PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD41PresRawTemperature function gets transmembrane pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD41PresTemp + * @details \b Inputs: fpgaD41PresTemp * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD41PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD41PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD41PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD87PresRawPressure function gets fresh dialysate post ultrafilter * pressure sensor raw pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD87PresPressure + * @details \b Inputs: fpgaD87PresPressure * @details \b Outputs: none * @return Fresh dialysate post ultrafilter pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD87PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD87PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD87PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD87PresRawTemperature function gets fresh dialysate post ultrafilter * pressure sensor raw temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD87PresTemp + * @details \b Inputs: fpgaD87PresTemp * @details \b Outputs: none * @return Fresh dialysate post ultrafilter pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD87PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD87PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD87PresTemp ); } /*********************************************************************//** * @brief * The getFPGACD1ReadCount function gets D17 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD17CondReadCnt + * @details \b Inputs: fpgaD17CondReadCnt * @details \b Outputs: none * @return Latest D17 conductivity sensor read count *************************************************************************/ U08 getFPGAD17CondReadCount( void ) { - return fpgaSensorReadings.fpgaD17CondReadCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD17CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD17CondErrorCount function gets D17 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD17CondErrorCnt + * @details \b Inputs: fpgaD17CondErrorCnt * @details \b Outputs: none * @return Latest D17 conductivity sensor read error count *************************************************************************/ U08 getFPGAD17CondErrorCount( void ) { - return fpgaSensorReadings.fpgaD17CondErrorCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD17CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD17Cond function gets D17 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD1 + * @details \b Inputs: fpgaCD1 * @details \b Outputs: none * @return Latest D17 conductivity sensor value *************************************************************************/ U16 getFPGAD17Cond( void ) { - return fpgaSensorReadings.fpgaD17CondCond; + return GET_FPGA_SENSOR_FIELD( fpgaD17CondCond ); } /*********************************************************************//** * @brief * The getFPGAD17CondTemp function gets D17 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD1Temp + * @details \b Inputs: fpgaCD1Temp * @details \b Outputs: none * @return Latest D17 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD17CondTemp( void ) { - return fpgaSensorReadings.fpgaD17CondTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD17CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD17CondData function gets D17 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD17CondDataOut + * @details \b Inputs: fpgaD17CondDataOut * @details \b Outputs: none * @return Latest D17 conductivity sensor register data value *************************************************************************/ U32 getFPGAD17CondData( void ) { - return fpgaSensorReadings.fpgaD17CondDataOut; + return GET_FPGA_SENSOR_FIELD( fpgaD17CondCond ); } /*********************************************************************//** * @brief * The getFPGAD27CondReadCount function gets D27 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondReadCnt + * @details \b Inputs: fpgaD27CondReadCnt * @details \b Outputs: none * @return Latest D27 conductivity sensor read count *************************************************************************/ U08 getFPGAD27CondReadCount( void ) { - return fpgaSensorReadings.fpgaD27CondReadCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD27CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD27CondErrorCount function gets D27 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondErrorCnt + * @details \b Inputs: fpgaD27CondErrorCnt * @details \b Outputs: none * @return Latest D27 conductivity sensor read error count *************************************************************************/ U08 getFPGAD27CondErrorCount( void ) { - return fpgaSensorReadings.fpgaD27CondErrorCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD27CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD27Cond function gets D27 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD27Cond + * @details \b Inputs: fpgaD27Cond * @details \b Outputs: none * @return Latest D27 conductivity sensor value *************************************************************************/ U16 getFPGAD27Cond( void ) { - return fpgaSensorReadings.fpgaD27CondCond; + return GET_FPGA_SENSOR_FIELD( fpgaD27CondCond ); } /*********************************************************************//** * @brief * The getFPGAD27CondTemp function gets D27 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondTemp + * @details \b Inputs: fpgaD27CondTemp * @details \b Outputs: none * @return Latest D27 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD27CondTemp( void ) { - return fpgaSensorReadings.fpgaD27CondTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD27CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD27CondData function gets D27 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondDataOut + * @details \b Inputs: fpgaD27CondDataOut * @details \b Outputs: none * @return Latest D27 conductivity sensor register data value *************************************************************************/ U32 getFPGAD27CondData( void ) { - return fpgaSensorReadings.fpgaD27CondDataOut; + return GET_FPGA_SENSOR_FIELD( fpgaD27CondCond ); } /*********************************************************************//** * @brief * The getFPGAD29CondReadCount function gets D29 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondReadCnt + * @details \b Inputs: fpgaD29CondReadCnt * @details \b Outputs: none * @return Latest D29 conductivity sensor read count *************************************************************************/ U08 getFPGAD29CondReadCount( void ) { - return fpgaSensorReadings.fpgaD29CondReadCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD29CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD29CondErrorCount function gets D29 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondErrorCnt + * @details \b Inputs: fpgaD29CondErrorCnt * @details \b Outputs: none * @return Latest D29 conductivity sensor read error count *************************************************************************/ U08 getFPGAD29CondErrorCount( void ) { - return fpgaSensorReadings.fpgaD29CondErrorCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD29CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD29Cond function gets D29 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD29Cond + * @details \b Inputs: fpgaD29Cond * @details \b Outputs: none * @return Latest D29 conductivity sensor value *************************************************************************/ U16 getFPGAD29Cond( void ) { - return fpgaSensorReadings.fpgaD29CondCond; + return GET_FPGA_SENSOR_FIELD( fpgaD29CondCond ); } /*********************************************************************//** * @brief * The getFPGAD29CondTemp function gets D29 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondTemp + * @details \b Inputs: fpgaD29CondTemp * @details \b Outputs: none * @return Latest D29 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD29CondTemp( void ) { - return fpgaSensorReadings.fpgaD29CondTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD29CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD29CondData function gets D29 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondDataOut + * @details \b Inputs: fpgaD29CondDataOut * @details \b Outputs: none * @return Latest D29 conductivity sensor register data value *************************************************************************/ U32 getFPGAD29CondData( void ) { - return fpgaSensorReadings.fpgaD29CondDataOut; + return GET_FPGA_SENSOR_FIELD( fpgaD29CondCond ); } /*********************************************************************//** * @brief * The getFPGAD43CondReadCount function gets D43 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondReadCnt + * @details \b Inputs: fpgaD43CondReadCnt * @details \b Outputs: none * @return Latest D43 conductivity sensor read count *************************************************************************/ U08 getFPGAD43CondReadCount( void ) { - return fpgaSensorReadings.fpgaD43CondReadCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD43CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD43CondErrorCount function gets D43 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondErrorCnt + * @details \b Inputs: fpgaD43CondErrorCnt * @details \b Outputs: none * @return Latest D43 conductivity sensor read error count *************************************************************************/ U08 getFPGAD43CondErrorCount( void ) { - return fpgaSensorReadings.fpgaD43CondErrorCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD43CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD43Cond function gets D43 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD43Cond + * @details \b Inputs: fpgaD43Cond * @details \b Outputs: none * @return Latest D43 conductivity sensor value *************************************************************************/ U16 getFPGAD43Cond( void ) { - return fpgaSensorReadings.fpgaD43CondCond; + return GET_FPGA_SENSOR_FIELD( fpgaD43CondCond ); } /*********************************************************************//** * @brief * The getFPGAD43CondTemp function gets D43 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondTemp + * @details \b Inputs: fpgaD43CondTemp * @details \b Outputs: none * @return Latest D43 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD43CondTemp( void ) { - return fpgaSensorReadings.fpgaD43CondTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD43CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD43CondData function gets D43 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondDataOut + * @details \b Inputs: fpgaD43CondDataOut * @details \b Outputs: none * @return Latest D43 conductivity sensor register data value *************************************************************************/ U32 getFPGAD43CondData( void ) { - return fpgaSensorReadings.fpgaD43CondDataOut; + return GET_FPGA_SENSOR_FIELD( fpgaD43CondCond ); } /*********************************************************************//** * @brief * The getFPGAD74CondReadCount function gets D74 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondReadCnt + * @details \b Inputs: fpgaD74CondReadCnt * @details \b Outputs: none * @return Latest D74 conductivity sensor read count *************************************************************************/ U08 getFPGAD74CondReadCount( void ) { - return fpgaSensorReadings.fpgaD74CondReadCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD74CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD74CondErrorCount function gets D74 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondErrorCnt + * @details \b Inputs: fpgaD74CondErrorCnt * @details \b Outputs: none * @return Latest D74 conductivity sensor read error count *************************************************************************/ U08 getFPGAD74CondErrorCount( void ) { - return fpgaSensorReadings.fpgaD74CondErrorCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD74CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD74Cond function gets D74 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD74Cond + * @details \b Inputs: fpgaD74Cond * @details \b Outputs: none * @return Latest D74 conductivity sensor value *************************************************************************/ U16 getFPGAD74Cond( void ) { - return fpgaSensorReadings.fpgaD74CondCond; + return GET_FPGA_SENSOR_FIELD( fpgaD74CondCond ); } /*********************************************************************//** * @brief * The getFPGAD74CondTemp function gets D74 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondTemp + * @details \b Inputs: fpgaD74CondTemp * @details \b Outputs: none * @return Latest D74 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD74CondTemp( void ) { - return fpgaSensorReadings.fpgaD74CondTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD74CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD74CondData function gets D74 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondDataOut + * @details \b Inputs: fpgaD74CondDataOut * @details \b Outputs: none * @return Latest D74 conductivity sensor register data value *************************************************************************/ U32 getFPGAD74CondData( void ) { - return fpgaSensorReadings.fpgaD74CondDataOut; + return GET_FPGA_SENSOR_FIELD( fpgaD74CondCond ); } /*********************************************************************//** * @brief * The getFPGAD63LevelSensor function gets the latest FPGA D63 upper level * sensor reading. - * @details \b Inputs: fpgaSensorReadings.fpgaD63LevelSensor + * @details \b Inputs: fpgaD63LevelSensor * @details \b Outputs: none * @return last FPGA D63 upper level sensor reading *************************************************************************/ U16 getFPGAD63LevelSensor( void ) { - return fpgaSensorReadings.fpgaD63LevelSensor; + U08 result; +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D63_LEVEL_BIT ); + } + else + { + result = fpgaBeta19SensorReadings.fpgaD63LevelSensor; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; } /*********************************************************************//** * @brief * The getFPGAD98LevelSensor function gets the latest FPGA D98 lower level * sensor reading. - * @details \b Inputs: fpgaSensorReadings.fpgaD98LevelSensor + * @details \b Inputs: fpgaD98LevelSensor * @details \b Outputs: none * @return last FPGA D98 lower level sensor reading *************************************************************************/ U16 getFPGAD98LevelSensor( void ) { - return fpgaSensorReadings.fpgaD98LevelSensor; + U08 result; +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D98_LEVEL_BIT ); + } + else + { + result = fpgaBeta19SensorReadings.fpgaD98LevelSensor; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; } /*********************************************************************//** * @brief * The getFPGAD46LevelSensor function gets the latest FPGA level sensor 2 * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaD46LevelSensor + * @details \b Inputs: fpgaD46LevelSensor * @details \b Outputs: none * @return last FPGA level sensor2 reading *************************************************************************/ U16 getFPGAD46LevelSensor( void ) { - return fpgaSensorReadings.fpgaD46LevelSensor; + U08 result; +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D46_LEVEL_BIT ); + } + else + { + result = fpgaBeta19SensorReadings.fpgaD46LevelSensor; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; } /*********************************************************************//** * @brief * The getFPGAD6LevelStatus function gets the latest FPGA floater D6 level * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaD6FloaterStatus + * @details \b Inputs: fpgaD6FloaterStatus * @details \b Outputs: none * @return last FPGA floater D6 level reading *************************************************************************/ U08 getFPGAD6LevelStatus( void ) { - return ( fpgaSensorReadings.fpgaD6FloaterStatus & FPGA_D6_FLOATER_LEVEL_BIT ); + return ( GET_FPGA_SENSOR_FIELD( fpgaD6FloaterStatus ) & FPGA_FLOATER_LEVEL_BIT ); } /*********************************************************************//** * @brief * The getFPGAFloater2Status function gets the latest FPGA floater 2 level * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaFloater2Status + * @details \b Inputs: fpgaFloater2Status * @details \b Outputs: none * @return last FPGA floater 2 level reading *************************************************************************/ U08 getFPGAFloater2Status( void ) { - return fpgaSensorReadings.fpgaFloater2Status; + U08 result; +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaConductiveLevelStatus; + } + else + { + result = fpgaBeta19SensorReadings.fpgaFloater2Status; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; } /*********************************************************************//** @@ -2832,7 +3200,7 @@ *************************************************************************/ static U16 getFPGATimerCount( void ) { - return fpgaSensorReadings.fpgaTimerCountMS; + return GET_FPGA_SENSOR_FIELD( fpgaTimerCountMS ); } /*********************************************************************//** @@ -2845,7 +3213,7 @@ *************************************************************************/ U32 getFPGAD1Temp( void ) { - return fpgaSensorReadings.fpgaD1Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD1Temp ); } /*********************************************************************//** @@ -2858,7 +3226,7 @@ *************************************************************************/ U32 getFPGAD78Temp( void ) { - return fpgaSensorReadings.fpgaD78Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD78Temp ); } /*********************************************************************//** @@ -2871,7 +3239,7 @@ *************************************************************************/ U32 getFPGAD4Temp( void ) { - return fpgaSensorReadings.fpgaD4Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD4Temp ); } /*********************************************************************//** @@ -2883,7 +3251,7 @@ *************************************************************************/ U32 getFPGAD50Temp( void ) { - return fpgaSensorReadings.fpgaD50Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD50Temp ); } /*********************************************************************//** @@ -2895,7 +3263,7 @@ *************************************************************************/ U32 getFPGAD99Temp( void ) { - return fpgaSensorReadings.fpgaD99Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD99Temp ); } /*********************************************************************//** @@ -2907,7 +3275,7 @@ *************************************************************************/ U08 getFPGARTDReadCount( void ) { - return fpgaSensorReadings.fpgaRTDReadCnt; + return GET_FPGA_SENSOR_FIELD( fpgaRTDReadCnt ); } /*********************************************************************//** @@ -2920,11 +3288,167 @@ *************************************************************************/ U08 getFPGARTDCountErrorCycles( void ) { - return fpgaSensorReadings.fpgaRTDCountErrorCycles; + return GET_FPGA_SENSOR_FIELD( fpgaRTDCountErrorCycles ); } /*********************************************************************//** * @brief + * The getFPGAIOExpanderReadCount function gets the number of successful + * I2C transactions with the IO expander. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return IO expander successful transaction count + *************************************************************************/ +U08 getFPGAIOExpanderReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaIOExpReadCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAIOExpanderErrorCount function gets the number of unsuccessful + * I2C transactions with the IO expander. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return IO expander error transaction count + *************************************************************************/ +U08 getFPGAIOExpanderErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaIOExpERrorCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAHallSensorStatus function gets the aggregated hall sensor status. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return hall sensor status bits + *************************************************************************/ +U08 getFPGAHallSensorStatus( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaHallSensorStatus; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAGPIOStatus function gets the GPIO status register value. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return GPIO status register + *************************************************************************/ +U08 getFPGAGPIOStatus( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaGPIOStatus; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGATempTax1 function gets the Tax1 temperature sensor reading. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return Tax1 temperature + *************************************************************************/ +U32 getFPGATempTax1( void ) +{ + U32 result = 0UL; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.tempTax1; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGATempRTD function gets the spare RTD temperature sensor reading. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return spare RTD temperature + *************************************************************************/ +U32 getFPGATempRTD( void ) +{ + U32 result = 0UL; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.tempRTD; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAAD7124ReadCount function gets the number of valid AD7124 + * transactions. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return AD7124 valid transaction count + *************************************************************************/ +U08 getFPGAAD7124ReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.ad7124readcnt; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAAD7124ErrorCount function gets the number of invalid AD7124 + * transactions. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return AD7124 error transaction count + *************************************************************************/ +U08 getFPGAAD7124ErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.ad7124errcnt; + } + + return result; +} + +/*********************************************************************//** + * @brief * The checkFPGACommFailure function increments the FPGA comm failure * windowed timer and returns whether or not the number of failures in * the window have been reached. @@ -2939,7 +3463,7 @@ if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { //TODO : Enable alarm later - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)GET_FPGA_SENSOR_FIELD( fpgaIOErrorCntProcessor ) ) } } } @@ -2954,7 +3478,7 @@ *************************************************************************/ U16 getFPGAD11PumpRevolutionCountStatus( void ) { - return fpgaSensorReadings.fpgaD11PumpStepCountStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD11PumpStepCountStatus ); } /*********************************************************************//** @@ -2967,7 +3491,7 @@ *************************************************************************/ U16 getFPGAD10PumpRevolutionCountStatus( void ) { - return fpgaSensorReadings.fpgaD10PumpStepCountStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD10PumpStepCountStatus ); } /*********************************************************************//** @@ -2980,7 +3504,7 @@ *************************************************************************/ U16 getFPGAD76PumpRevolutionCountStatus( void ) { - return fpgaSensorReadings.fpgaD76PumpStepCountStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD76PumpStepCountStatus ); } /*********************************************************************//** @@ -3007,7 +3531,7 @@ if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { //TODO : Enable alarm later - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)GET_FPGA_SENSOR_FIELD( fpgaIOErrorCntProcessor ) ) status = TRUE; } } @@ -3027,7 +3551,7 @@ *************************************************************************/ U08 getFPGABloodLeakStatus( void ) { - U08 selfTestStatus = ( fpgaSensorReadings.fpgaD42PulseStatus & FPGA_D42_BLOOD_LEAK_STATUS_MASK ) >> FPGA_D42_BLOOD_LEAK_ST_BIT_INDEX; + U08 selfTestStatus = ( ( GET_FPGA_SENSOR_FIELD( fpgaD42PulseStatus ) & FPGA_D42_BLOOD_LEAK_STATUS_MASK ) >> FPGA_D42_BLOOD_LEAK_ST_BIT_INDEX ); return selfTestStatus; } @@ -3042,7 +3566,7 @@ *************************************************************************/ void setFPGABloodLeakUARTControl( U08 value ) { - fpgaActuatorSetPoints.fpgaD42UARTControl = value; + SET_FPGA_ACTUATOR_FIELD( fpgaD42UARTControl, value ); } /*********************************************************************//** @@ -3055,7 +3579,7 @@ *************************************************************************/ void setFPGABloodLeakUARTTransmit( U08 value ) { - fpgaActuatorSetPoints.fpgaD42FIFOTx = value; + SET_FPGA_ACTUATOR_FIELD( fpgaD42FIFOTx, value ); } /*********************************************************************//** @@ -3064,11 +3588,11 @@ * FIFO count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42TxFIFOCnt + * @return fpgaD42TxFIFOCnt *************************************************************************/ U08 getFPGABloodLeakTxFIFOCount( void ) { - return fpgaSensorReadings.fpgaD42TxFIFOCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD42TxFIFOCnt ); } /*********************************************************************//** @@ -3077,11 +3601,11 @@ * FIFO count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42RxFIFOCnt + * @return fpgaD42RxFIFOCnt *************************************************************************/ U16 getFPGABloodLeakRxFIFOCount( void ) { - return fpgaSensorReadings.fpgaD42RxFIFOCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD42RxFIFOCnt ); } /*********************************************************************//** @@ -3090,11 +3614,11 @@ * error count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42RxErrorCnt + * @return fpgaD42RxErrorCnt *************************************************************************/ U08 getFPGABloodLeakRxErrorCount( void ) { - return fpgaSensorReadings.fpgaD42RxErrorCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD42RxErrorCnt ); } /*********************************************************************//** @@ -3103,37 +3627,37 @@ * FIFO data out. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42RxFIFODataOut + * @return fpgaD42RxFIFODataOut *************************************************************************/ U08 getFPGABloodLeakRxFIFODataOut( void ) { - return fpgaSensorReadings.fpgaD42RxFIFODataOut; + return GET_FPGA_SENSOR_FIELD( fpgaD42RxFIFODataOut ); } /*********************************************************************//** * @brief * The setFPGAD79RinsePumpControl function sets the control bit of the rinse * pump to turn it on or off. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDDSpareValveControl + * @details \b Outputs: fpgaDDSpareValveControl * @return none *************************************************************************/ void setFPGAD79RinsePumpControl( U08 value ) { - fpgaActuatorSetPoints.fpgaDDSpareValveControl &= value; + CLEAR_FPGA_ACTUATOR_BITS( fpgaDDSpareValveControl, value ); } /*********************************************************************//** * @brief * The setFPGAD79RinsePumpPWMControl function sets the PWM value of the rinse * pump to turn it on or off. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD79PWMPumpCtl + * @details \b Outputs: fpgaD79PWMPumpCtl * @return none *************************************************************************/ void setFPGAD79RinsePumpPWMControl( U08 value ) { - fpgaActuatorSetPoints.fpgaD79PWMPumpCtl = value; + SET_FPGA_ACTUATOR_FIELD( fpgaD79PWMPumpCtl, value ); } /*********************************************************************//** @@ -3142,11 +3666,11 @@ * pulse width. * @details \b Inputs: d79SpeedPulseWidth * @details \b Outputs: none - * @return fpgaSensorReadings.d79SpeedPulseWidth + * @return d79SpeedPulseWidth *************************************************************************/ U16 getFPGAD79RinsePumpPulseWidth( void ) { - return fpgaSensorReadings.d79SpeedPulseWidth; + return GET_FPGA_SENSOR_FIELD( d79SpeedPulseWidth ); } /*********************************************************************//** @@ -3162,13 +3686,13 @@ * 5 - P6.\n * 6:8 - Not used. \n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveFPControl + * @details \b Outputs: valveFPControl * @param valveStates bit mask for requested valve states * @return none *************************************************************************/ void setFPGAFPValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.valveFPControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( valveFPControl, valveStates ); } /*********************************************************************//** @@ -3177,12 +3701,12 @@ * an 8-bit mask representing the set of states with a 1 meaning "energized" * and a 0 meaning "de-energized". * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.valveFPControlReadback + * @details \b Outputs: valveFPControlReadback * @return none *************************************************************************/ U08 getFPGAFPValveStates( void ) { - return fpgaSensorReadings.valveFPControlReadback; + return GET_FPGA_SENSOR_FIELD( valveFPControlReadback ); } /*********************************************************************//** @@ -3194,13 +3718,13 @@ * 1 - M12_VALV.\n * 2:8 - Not used. \n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveIOControl + * @details \b Outputs: valveIOControl * @param valveStates bit mask for requested valve states * @return none *************************************************************************/ void setFPGAIOValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.valveIOControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( valveIOControl, valveStates ); } /*********************************************************************//** @@ -3209,12 +3733,12 @@ * an 8-bit mask representing the set of states with a 1 meaning "energized" * and a 0 meaning "de-energized". * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.valveIOControlReadback + * @details \b Outputs: valveIOControlReadback * @return none *************************************************************************/ U08 getFPGAIOValveStates( void ) { - return fpgaSensorReadings.valveIOControlReadback; + return GET_FPGA_SENSOR_FIELD( valveIOControlReadback ); } /*********************************************************************//** @@ -3223,13 +3747,13 @@ * * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled" * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveIOPWMEnable + * @details \b Outputs: valveIOPWMEnable * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveIOPWMEnable( U08 valvePWMStates ) { - fpgaActuatorSetPoints.valveIOPWMEnable = valvePWMStates; + SET_FPGA_ACTUATOR_FIELD( valveIOPWMEnable, valvePWMStates ); } /*********************************************************************//** @@ -3238,12 +3762,12 @@ * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled". * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.valveIOPWMEnableReadback + * @details \b Outputs: valveIOPWMEnableReadback * @return none *************************************************************************/ U08 getFPGAValveIOPWMEnable( void ) { - return fpgaSensorReadings.valveIOPWMEnableReadback; + return GET_FPGA_SENSOR_FIELD( valveIOPWMEnableReadback ); } /*********************************************************************//** @@ -3252,13 +3776,13 @@ * * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled" * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveFPPWMEnable + * @details \b Outputs: valveFPPWMEnable * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveFPPWMEnable( U08 valvePWMStates ) { - fpgaActuatorSetPoints.valveFPPWMEnable = valvePWMStates; + SET_FPGA_ACTUATOR_FIELD( valveFPPWMEnable, valvePWMStates ); } /*********************************************************************//** @@ -3267,67 +3791,67 @@ * an 8-bit mask representing the set of states with a 1 meaning "enabled" * and a 0 meaning "disabled". * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.valveFPPWMEnableReadback + * @details \b Outputs: valveFPPWMEnableReadback * @return none *************************************************************************/ U08 getFPGAValveFPPWMEnable( void ) { - return fpgaSensorReadings.valveFPPWMEnableReadback; + return GET_FPGA_SENSOR_FIELD( valveFPPWMEnableReadback ); } /*********************************************************************//** * @brief * The setFPGAValveIOFPPWMPullIn function sets the IO & FP valves Pull-in "strike" * period where PWM is at 100% in 1ms resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveIOFPPWMPullIn + * @details \b Outputs: valveIOFPPWMPullIn * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveIOFPPWMPullIn( U16 valvePWMPullIn ) { - fpgaActuatorSetPoints.valveIOFPPWMPullIn = valvePWMPullIn; + SET_FPGA_ACTUATOR_FIELD( valveIOFPPWMPullIn, valvePWMPullIn ); } /*********************************************************************//** * @brief * The setFPGAValveIOFPPWMLow function sets the IO & FP valves "low" * period where PWM is at 0% in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveIOFPPWMLow + * @details \b Outputs: valveIOFPPWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveIOFPPWMLow( U16 valvePWMLow ) { - fpgaActuatorSetPoints.valveIOFPPWMLow = valvePWMLow; + SET_FPGA_ACTUATOR_FIELD( valveIOFPPWMLow, valvePWMLow ); } /*********************************************************************//** * @brief * The setFPGAValveIOFPPWMPeriod function sets the IO & FP valves pwm * period in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.valveIOFPPWMPeriod + * @details \b Outputs: valveIOFPPWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveIOFPPWMPeriod( U16 valvePWMPeriod ) { - fpgaActuatorSetPoints.valveIOFPPWMPeriod = valvePWMPeriod; + SET_FPGA_ACTUATOR_FIELD( valveIOFPPWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @brief * The setFPGAP12PumpEnable function enables or disables the P12 pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.p12PumpControl + * @details \b Outputs: p12PumpControl * @param enable flag indicating whether to enable or disable the P12 pump. * @return none *************************************************************************/ void setFPGAP12PumpEnable( BOOL enable ) { - fpgaActuatorSetPoints.p12PumpControl = ( TRUE == enable ? 0x1 : 0x0 ); + SET_FPGA_ACTUATOR_FIELD( p12PumpControl, ( TRUE == enable ? 0x1 : 0x0 ) ); } /*********************************************************************//** @@ -3337,46 +3861,46 @@ * @note PWM values < 5% or > 95% will cause pump to stop so effective * range is actually 25..475. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.p12PumpPWMDutyCyclePct + * @details \b Outputs: p12PumpPWMDutyCyclePct * @param pwm PWM duty cycle magnitude * @return none *************************************************************************/ void setFPGAP12PumpPWM( U16 pwm ) { - fpgaActuatorSetPoints.p12PumpPWMDutyCyclePct = pwm; + SET_FPGA_ACTUATOR_FIELD( p12PumpPWMDutyCyclePct, pwm ); } /*********************************************************************//** * @brief * The getFPGAP12PumpPWM function gets a read back from FPGA of RO pump PWM * duty cycle. - * @details \b Inputs: fpgaSensorReadings.roPumpPWMReadback + * @details \b Inputs: roPumpPWMReadback * @details \b Outputs: none * @return measured speed (RPM) of the RO pump *************************************************************************/ U16 getFPGAP12PumpPWM( void ) { - return fpgaSensorReadings.p12PumpPWMReadback; + return GET_FPGA_SENSOR_FIELD( p12PumpPWMReadback ); } /*********************************************************************//** * @brief * The getFPGAP12PumpTachCount function gets the running 16-bit tachometer count * from the P12 pump hall sensor. - * @details \b Inputs: fpgaSensorReadings.p12PumpTachCount + * @details \b Inputs: p12PumpTachCount * @details \b Outputs: none * @return P12 pump tachometer count *************************************************************************/ U16 getFPGAP12PumpTachCount( void ) { - return fpgaSensorReadings.p12PumpTachCount; + return GET_FPGA_SENSOR_FIELD( p12PumpTachCount ); } /*********************************************************************//** * @brief * The setFPGAP24Enabled function sets the heater enable on or off. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.p24Control + * @details \b Outputs: p24Control * @param enable Flag indicating whether to enable or disable the P24 heater. * @return none *************************************************************************/ @@ -3392,7 +3916,7 @@ * @note PWM values < 5% or > 95% will cause heater to go off so effective * range is actually 25..475. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.p24PWMDutyCyclePct + * @details \b Outputs: p24PWMDutyCyclePct * @param pwm PWM duty cycle magnitude * @return none *************************************************************************/ @@ -3404,213 +3928,295 @@ /*********************************************************************//** * @brief * The getFPGAP46RawPressure function gets the P46 pressure reading. - * @details \b Inputs: fpgaSensorReadings.pressureP46 + * @details \b Inputs: pressureP46 * @details \b Outputs: none * @return P46 pressure *************************************************************************/ S16 getFPGAP46RawPressure( void ) { - return fpgaSensorReadings.pressureP46; + return GET_FPGA_SENSOR_FIELD( pressureP46 ); } /*********************************************************************//** * @brief * The getFPGAP46RawTemperature function gets the P46 sensor temperature reading. - * @details \b Inputs: fpgaSensorReadings.temperatureP46 + * @details \b Inputs: temperatureP46 * @details \b Outputs: none * @return P46 sensor temperature *************************************************************************/ S16 getFPGAP46RawTemperature( void ) { - return fpgaSensorReadings.temperatureP46; + return GET_FPGA_SENSOR_FIELD( temperatureP46 ); } /*********************************************************************//** * @brief * The getFPGAM3RawPressure function gets the M3 pressure reading. - * @details \b Inputs: fpgaSensorReadings.pressureM3 + * @details \b Inputs: pressureM3 * @details \b Outputs: none * @return M3 pressure *************************************************************************/ S16 getFPGAM3RawPressure( void ) { - return fpgaSensorReadings.pressureM3; + return GET_FPGA_SENSOR_FIELD( pressureM3 ); } /*********************************************************************//** * @brief * The getFPGAM3RawTemperature function gets the M3 sensor temperature. - * @details \b Inputs: fpgaSensorReadings.temperatureM3 + * @details \b Inputs: temperatureM3 * @details \b Outputs: none * @return M3 sensor temperature *************************************************************************/ S16 getFPGAM3RawTemperature( void ) { - return fpgaSensorReadings.temperatureM3; + return GET_FPGA_SENSOR_FIELD( temperatureM3 ); } /*********************************************************************//** * @brief * The getFPGAP8RawPressure function gets the P8 pressure reading. - * @details \b Inputs: fpgaSensorReadings.pressureP8 + * @details \b Inputs: pressureP8 * @details \b Outputs: none * @return P8 pressure *************************************************************************/ S16 getFPGAP8RawPressure( void ) { - return fpgaSensorReadings.pressureP8; + return GET_FPGA_SENSOR_FIELD( pressureP8 ); } /*********************************************************************//** * @brief * The getFPGAP8RawTemperature function gets the P8 sensor temperature. - * @details \b Inputs: fpgaSensorReadings.temperatureP8 + * @details \b Inputs: temperatureP8 * @details \b Outputs: none * @return P8 sensor temperature *************************************************************************/ S16 getFPGAP8RawTemperature( void ) { - return fpgaSensorReadings.temperatureP8; + return GET_FPGA_SENSOR_FIELD( temperatureP8 ); } /*********************************************************************//** * @brief * The getFPGAP13RawPressure function gets the P13 pressure reading. - * @details \b Inputs: fpgaSensorReadings.pressureP13 + * @details \b Inputs: pressureP13 * @details \b Outputs: none * @return P13 pressure *************************************************************************/ S16 getFPGAP13RawPressure( void ) { - return fpgaSensorReadings.pressureP13; + return GET_FPGA_SENSOR_FIELD( pressureP13 ); } /*********************************************************************//** * @brief * The getFPGAP13RawTemperature function gets the P13 sensor temperature. - * @details \b Inputs: fpgaSensorReadings.temperatureP13 + * @details \b Inputs: temperatureP13 * @details \b Outputs: none * @return P13 sensor temperature *************************************************************************/ S16 getFPGAP13RawTemperature( void ) { - return fpgaSensorReadings.temperatureP13; + return GET_FPGA_SENSOR_FIELD( temperatureP13 ); } /*********************************************************************//** * @brief * The getFPGAP17RawPressure function gets the P17 pressure reading. - * @details \b Inputs: fpgaSensorReadings.pressureP17 + * @details \b Inputs: pressureP17 * @details \b Outputs: none * @return P17 pressure *************************************************************************/ S16 getFPGAP17RawPressure( void ) { - return fpgaSensorReadings.pressureP17; + return GET_FPGA_SENSOR_FIELD( pressureP17 ); } /*********************************************************************//** * @brief * The getFPGAP17RawTemperature function gets the P17 sensor temperature. - * @details \b Inputs: fpgaSensorReadings.temperatureP17 + * @details \b Inputs: temperatureP17 * @details \b Outputs: none * @return P17 sensor temperature *************************************************************************/ S16 getFPGAP17RawTemperature( void ) { - return fpgaSensorReadings.temperatureP17; + return GET_FPGA_SENSOR_FIELD( temperatureP17 ); } /*********************************************************************//** * @brief * The getFPGAP25FloaterState function gets the P25 floater level state. - * @details \b Inputs: fpgaSensorReadings.levelSwitch + * @details \b Inputs: levelSwitch * @details \b Outputs: none * @return P25 floater level state *************************************************************************/ U08 getFPGAP25FloaterState( void ) { - return fpgaSensorReadings.p25LevelSwitch; + U08 result = ( GET_FPGA_SENSOR_FIELD( p25LevelSwitch ) & FPGA_FLOATER_LEVEL_BIT ); + + return result; } /*********************************************************************//** * @brief * The getFPGAFlowFMP function gets the P16 flow rate (in mL/min). - * @details \b Inputs: fpgaSensorReadings.flowRateP16 + * @details \b Inputs: flowRateP16 * @details \b Outputs: none * @return P16 flow rate (in mL/min) *************************************************************************/ U16 getFPGAFlowP16( void ) { - return fpgaSensorReadings.flowRateP16; + return GET_FPGA_SENSOR_FIELD( flowRateP16 ); } /*********************************************************************//** * @brief * The getFPGAFlowP16Temp function gets the P16 flow sensor temperature, the * temperature of the fluid flowing through the sensor. - * @details \b Inputs: fpgaSensorReadings.flowTempP16 + * @details \b Inputs: flowTempP16 * @details \b Outputs: none * @return P16 fluid temperature *************************************************************************/ U16 getFPGAFlowP16Temp( void ) { - return fpgaSensorReadings.flowTempP16; + return GET_FPGA_SENSOR_FIELD( flowTempP16 ); } /*********************************************************************//** * @brief * The getFPGAFlowP16InternalTemp function gets the P16 flow sensor * internal temperature. - * @details \b Inputs: fpgaSensorReadings.flowIntTempP16 + * @details \b Inputs: flowIntTempP16 * @details \b Outputs: none * @return P16 internal temperature *************************************************************************/ U16 getFPGAFlowP16InternalTemp( void ) { - return fpgaSensorReadings.flowIntTempP16; + return GET_FPGA_SENSOR_FIELD( flowIntTempP16 ); } /*********************************************************************//** * @brief * The getFPGAFlowP7 function gets the P7 flow rate (in mL/min). - * @details \b Inputs: fpgaSensorReadings.flowRateP7 + * @details \b Inputs: flowRateP7 * @details \b Outputs: none * @return P7 flow rate (in mL/min) *************************************************************************/ U16 getFPGAFlowP7( void ) { - return fpgaSensorReadings.flowRateP7; + return GET_FPGA_SENSOR_FIELD( flowRateP7 ); } /*********************************************************************//** * @brief * The getFPGAFlowP7Temp function gets the P7 flow sensor temperature, the * temperature of the fluid flowing through the sensor. - * @details \b Inputs: fpgaSensorReadings.flowTempP7 + * @details \b Inputs: flowTempP7 * @details \b Outputs: none * @return P7 fluid temperature *************************************************************************/ U16 getFPGAFlowP7Temp( void ) { - return fpgaSensorReadings.flowTempP7; + return GET_FPGA_SENSOR_FIELD( flowTempP7 ); } /*********************************************************************//** * @brief * The getFPGAFlowP7InternalTemp function gets the P7 flow sensor * internal temperature. - * @details \b Inputs: fpgaSensorReadings.flowIntTempP7 + * @details \b Inputs: flowIntTempP7 * @details \b Outputs: none * @return P7 internal temperature *************************************************************************/ U16 getFPGAFlowP7InternalTemp( void ) { - return fpgaSensorReadings.flowIntTempP7; + return GET_FPGA_SENSOR_FIELD( flowIntTempP7 ); } /*********************************************************************//** * @brief + * The getFPGAFlowP7ReadCount function gets the number of successful + * reads from the P7 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P7 flow sensor read counter + *************************************************************************/ +U08 getFPGAFlowP7ReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p7flowReadCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAFlowP7ErrorCount function gets the number of failed + * reads from the P7 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P7 flow sensor error counter + *************************************************************************/ +U08 getFPGAFlowP7ErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p7flowErrorCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAFlowP16ReadCount function gets the number of successful + * reads from the P16 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P16 flow sensor read counter + *************************************************************************/ +U08 getFPGAFlowP16ReadCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p16flowReadCount; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAFlowP16ErrorCount function gets the number of failed + * reads from the P16 flow sensor. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return P16 flow sensor error counter + *************************************************************************/ +U08 getFPGAFlowP16ErrorCount( void ) +{ + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.p16flowErrorCount; + } + + return result; +} + +/*********************************************************************//** + * @brief * The setFPGAP9Control function sets the FPGA P9 sensor control register * to perform a given action. * bit 4..7: unused @@ -3619,41 +4225,41 @@ * bit 1: Enable P9 initialization procedure * bit 0: reset P9 sensor * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @param control bits indicating control action to take * @return none *************************************************************************/ void setFPGAP9Control( U08 control ) { - fpgaActuatorSetPoints.conductivityP9Control = control; + SET_FPGA_ACTUATOR_FIELD( conductivityP9Control, control ); } /*********************************************************************//** * @brief * The setFPGAP9Address function sets the read/write address for a read/write * action on the P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Address + * @details \b Outputs: conductivityP9Address * @param address The P9 sensor address to read from or write to * @return none *************************************************************************/ void setFPGAP9Address( U16 address ) { - fpgaActuatorSetPoints.conductivityP9Address = address; + SET_FPGA_ACTUATOR_FIELD( conductivityP9Address, address ); } /*********************************************************************//** * @brief * The setFPGAP9Data function sets the write data for a write action on * the P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Data + * @details \b Outputs: conductivityP9Data * @param data The 32-bit data to write to the P9 sensor * @return none *************************************************************************/ void setFPGAP9Data( U32 data ) { - fpgaActuatorSetPoints.conductivityP9Data = data; + SET_FPGA_ACTUATOR_FIELD( conductivityP9Data, data ); } /*********************************************************************//** @@ -3666,382 +4272,382 @@ * bit 1: Enable P18 initialization procedure * bit 0: reset P18 sensor * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @param control bits indicating control action to take * @return none *************************************************************************/ void setFPGAP18Control( U08 control ) { - fpgaActuatorSetPoints.conductivityP18Control = control; + SET_FPGA_ACTUATOR_FIELD( conductivityP18Control, control ); } /*********************************************************************//** * @brief * The setFPGAP18Address function sets the read/write address for a read/write * action on the P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Address + * @details \b Outputs: conductivityP18Address * @param address The P18 sensor address to read from or write to * @return none *************************************************************************/ void setFPGAP18Address( U16 address ) { - fpgaActuatorSetPoints.conductivityP18Address = address; + SET_FPGA_ACTUATOR_FIELD( conductivityP18Address, address ); } /*********************************************************************//** * @brief * The setFPGAP18Data function sets the write data for a write action on * the P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Data + * @details \b Outputs: conductivityP18Data * @param data The 32-bit data to write to the P18 sensor * @return none *************************************************************************/ void setFPGAP18Data( U32 data ) { - fpgaActuatorSetPoints.conductivityP18Data = data; + SET_FPGA_ACTUATOR_FIELD( conductivityP18Data, data ); } /*********************************************************************//** * @brief * The setFPGAP9Reset function sets the reset command bit for P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9Reset( void ) { - fpgaActuatorSetPoints.conductivityP9Control |= FPGA_CONDUCTIVITY_RESET_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP9Control, FPGA_CONDUCTIVITY_RESET_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP9Reset function clears the reset command bit for P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9Reset( void ) { - fpgaActuatorSetPoints.conductivityP9Control &= ~FPGA_CONDUCTIVITY_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP9Control, ~FPGA_CONDUCTIVITY_RESET_BIT ); } /*********************************************************************//** * @brief * The setFPGAP9InitEnable function sets the initialize command bit for * P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9InitEnable( void ) { - fpgaActuatorSetPoints.conductivityP9Control |= FPGA_CONDUCTIVITY_INIT_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP9Control, FPGA_CONDUCTIVITY_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP9InitEnable function clears the initialize command bit for * P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9InitEnable( void ) { - fpgaActuatorSetPoints.conductivityP9Control &= ~FPGA_CONDUCTIVITY_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP9Control, ~FPGA_CONDUCTIVITY_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAP9WriteEnable function sets the write enable command bit for * P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9WriteEnable( void ) { - fpgaActuatorSetPoints.conductivityP9Control |= FPGA_CONDUCTIVITY_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP9Control, FPGA_CONDUCTIVITY_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP9WriteEnable function clears the write enable command bit * for P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9WriteEnable( void ) { - fpgaActuatorSetPoints.conductivityP9Control &= ~FPGA_CONDUCTIVITY_WR_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP9Control, ~FPGA_CONDUCTIVITY_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAP9ReadEnable function sets the read enable command bit for * P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9ReadEnable( void ) { - fpgaActuatorSetPoints.conductivityP9Control |= FPGA_CONDUCTIVITY_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP9Control, FPGA_CONDUCTIVITY_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP9ReadEnable function clears the read enable command bit * for P9 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP9Control + * @details \b Outputs: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9ReadEnable( void ) { - fpgaActuatorSetPoints.conductivityP9Control &= ~FPGA_CONDUCTIVITY_RD_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP9Control, ~FPGA_CONDUCTIVITY_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAP18Reset function sets the reset command bit for P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18Reset( void ) { - fpgaActuatorSetPoints.conductivityP18Control |= FPGA_CONDUCTIVITY_RESET_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP18Control, FPGA_CONDUCTIVITY_RESET_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP18Reset function clears the reset command bit for P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18Reset( void ) { - fpgaActuatorSetPoints.conductivityP18Control &= ~FPGA_CONDUCTIVITY_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP18Control, ~FPGA_CONDUCTIVITY_RESET_BIT ); } /*********************************************************************//** * @brief * The setFPGAP18InitEnable function sets the initialize command bit for * P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18InitEnable( void ) { - fpgaActuatorSetPoints.conductivityP18Control |= FPGA_CONDUCTIVITY_INIT_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP18Control, FPGA_CONDUCTIVITY_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP18InitEnable function clears the initialize command bit for * P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18InitEnable( void ) { - fpgaActuatorSetPoints.conductivityP18Control &= ~FPGA_CONDUCTIVITY_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP18Control, ~FPGA_CONDUCTIVITY_INIT_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAP18WriteEnable function sets the write enable command bit for * P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18WriteEnable( void ) { - fpgaActuatorSetPoints.conductivityP18Control |= FPGA_CONDUCTIVITY_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP18Control, FPGA_CONDUCTIVITY_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP18WriteEnable function clears the write enable command bit * for P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18WriteEnable( void ) { - fpgaActuatorSetPoints.conductivityP18Control &= ~FPGA_CONDUCTIVITY_WR_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP18Control, ~FPGA_CONDUCTIVITY_WR_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAP18ReadEnable function sets the read enable command bit for * P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18ReadEnable( void ) { - fpgaActuatorSetPoints.conductivityP18Control |= FPGA_CONDUCTIVITY_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( conductivityP18Control, FPGA_CONDUCTIVITY_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The clearFPGAP18ReadEnable function clears the read enable command bit * for P18 sensor. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.conductivityP18Control + * @details \b Outputs: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18ReadEnable( void ) { - fpgaActuatorSetPoints.conductivityP18Control &= ~FPGA_CONDUCTIVITY_RD_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( conductivityP18Control, ~FPGA_CONDUCTIVITY_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The getFPGAP9ReadCount function gets the latest P9 sensor read count. - * @details \b Inputs: fpgaSensorReadings.conductivityP9ReadCount + * @details \b Inputs: conductivityP9ReadCount * @details \b Outputs: none * @return Current read count for P9 sensor. *************************************************************************/ U08 getFPGAP9ReadCount( void ) { - return fpgaSensorReadings.conductivityP9ReadCount; + return GET_FPGA_SENSOR_FIELD( conductivityP9ReadCount ); } /*********************************************************************//** * @brief * The getFPGAP9ErrorCount function gets the latest P9 sensor error count. - * @details \b Inputs: fpgaSensorReadings.conductivityP9ErrorCount + * @details \b Inputs: conductivityP9ErrorCount * @details \b Outputs: none * @return Current error count for P9 sensor. *************************************************************************/ U08 getFPGAP9ErrorCount( void ) { - return fpgaSensorReadings.conductivityP9ErrorCount; + return GET_FPGA_SENSOR_FIELD( conductivityP9ErrorCount ); } /*********************************************************************//** * @brief * The getFPGAP9Conductivity function gets the latest P9 sensor conductivity * reading. - * @details \b Inputs: fpgaSensorReadings.conductivityP9Cond + * @details \b Inputs: conductivityP9Cond * @details \b Outputs: none * @return Current conductivity reading from P9 sensor. *************************************************************************/ U16 getFPGAP9Conductivity( void ) { - return fpgaSensorReadings.conductivityP9Cond; + return GET_FPGA_SENSOR_FIELD( conductivityP9Cond ); } /*********************************************************************//** * @brief * The getFPGAP9Temperature function gets the latest P9 sensor temperature. - * @details \b Inputs: fpgaSensorReadings.conductivityP9Temp + * @details \b Inputs: conductivityP9Temp * @details \b Outputs: none * @return Current temperature from P9 sensor. *************************************************************************/ U16 getFPGAP9Temperature( void ) { - return fpgaSensorReadings.conductivityP9Temp; + return GET_FPGA_SENSOR_FIELD( conductivityP9Temp ); } /*********************************************************************//** * @brief * The getFPGAP9Data function gets the latest P9 sensor data from a read * action. - * @details \b Inputs: fpgaSensorReadings.conductivityP9Data + * @details \b Inputs: conductivityP9Data * @details \b Outputs: none * @return Latest data read from P9 sensor. *************************************************************************/ U32 getFPGAP9Data( void ) { - return fpgaSensorReadings.conductivityP9Data; + return GET_FPGA_SENSOR_FIELD( conductivityP9Data ); } /*********************************************************************//** * @brief * The getFPGAP18ReadCount function gets the latest P18 sensor read count. - * @details \b Inputs: fpgaSensorReadings.conductivityP18ReadCount + * @details \b Inputs: conductivityP18ReadCount * @details \b Outputs: none * @return Current read count for P18 sensor. *************************************************************************/ U08 getFPGAP18ReadCount( void ) { - return fpgaSensorReadings.conductivityP18ReadCount; + return GET_FPGA_SENSOR_FIELD( conductivityP18ReadCount ); } /*********************************************************************//** * @brief * The getFPGAP18ErrorCount function gets the latest P18 sensor error count. - * @details \b Inputs: fpgaSensorReadings.conductivityP18ErrorCount + * @details \b Inputs: conductivityP18ErrorCount * @details \b Outputs: none * @return Current error count for P18 sensor. *************************************************************************/ U08 getFPGAP18ErrorCount( void ) { - return fpgaSensorReadings.conductivityP18ErrorCount; + return GET_FPGA_SENSOR_FIELD( conductivityP18ErrorCount ); } /*********************************************************************//** * @brief * The getFPGAP18Conductivity function gets the latest P18 sensor conductivity * reading. - * @details \b Inputs: fpgaSensorReadings.conductivityP18Cond + * @details \b Inputs: conductivityP18Cond * @details \b Outputs: none * @return Current conductivity reading from P18 sensor. *************************************************************************/ U16 getFPGAP18Conductivity( void ) { - return fpgaSensorReadings.conductivityP18Cond; + return GET_FPGA_SENSOR_FIELD( conductivityP18Cond ); } /*********************************************************************//** * @brief * The getFPGAP18Temperature function gets the latest P18 sensor temperature. - * @details \b Inputs: fpgaSensorReadings.conductivityP18Temp + * @details \b Inputs: conductivityP18Temp * @details \b Outputs: none * @return Current temperature from P18 sensor. *************************************************************************/ U16 getFPGAP18Temperature( void ) { - return fpgaSensorReadings.conductivityP18Temp; + return GET_FPGA_SENSOR_FIELD( conductivityP18Temp ); } /*********************************************************************//** * @brief * The getFPGAP18Data function gets the latest P18 sensor data from a read * action. - * @details \b Inputs: fpgaSensorReadings.conductivityP18Data + * @details \b Inputs: conductivityP18Data * @details \b Outputs: none * @return Latest data read from P18 sensor. *************************************************************************/ U32 getFPGAP18Data( void ) { - return fpgaSensorReadings.conductivityP18Data; + return GET_FPGA_SENSOR_FIELD( conductivityP18Data ); } /*********************************************************************//** * @brief * The setFPGAP40PumpEnable function enables or disables the P40 pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.p40PumpControl + * @details \b Outputs: p40PumpControl * @param enable flag indicating whether to enable or disable the P40 pump. * @return none *************************************************************************/ void setFPGAP40PumpEnable( BOOL enable ) { - fpgaActuatorSetPoints.p40PumpControl = ( TRUE == enable ? 0x1 : 0x0 ); + SET_FPGA_ACTUATOR_FIELD( p40PumpControl, ( TRUE == enable ? 0x1 : 0x0 ) ); } /*********************************************************************//** @@ -4051,39 +4657,39 @@ * @note PWM values < 5% or > 95% will cause pump to stop so effective * range is actually 25..475. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.p40PumpPWMDutyCyclePct + * @details \b Outputs: p40PumpPWMDutyCyclePct * @param pwm PWM duty cycle magnitude * @return none *************************************************************************/ void setFPGAP40PumpPWM( U16 pwm ) { - fpgaActuatorSetPoints.p40PumpPWMDutyCyclePct = pwm; + SET_FPGA_ACTUATOR_FIELD( p40PumpPWMDutyCyclePct, pwm ); } /*********************************************************************//** * @brief * The getFPGAP12PumpPWM function gets a read back from FPGA of RO pump PWM * duty cycle. - * @details \b Inputs: fpgaSensorReadings.p40PumpPWMReadback + * @details \b Inputs: p40PumpPWMReadback * @details \b Outputs: none * @return measured speed (RPM) of the P40 pump *************************************************************************/ U16 getFPGAP40PumpPWM( void ) { - return fpgaSensorReadings.p40PumpPWMReadback; + return GET_FPGA_SENSOR_FIELD( p40PumpPWMReadback ); } /*********************************************************************//** * @brief * The getFPGAP12PumpTachCount function gets the running 16-bit tachometer count * from the P40 pump hall sensor. - * @details \b Inputs: fpgaSensorReadings.p40PumpTachCount + * @details \b Inputs: p40PumpTachCount * @details \b Outputs: none * @return P40 pump tachometer count *************************************************************************/ U16 getFPGAP40PumpTachCount( void ) { - return fpgaSensorReadings.p40PumpTachCount; + return GET_FPGA_SENSOR_FIELD( p40PumpTachCount ); } /**@}*/ Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -rdcdc84e87fe5d67c15e83bc4e4a4bbacb0f4b63b -r8e93771bd0894bf1308747d1e520d620d7821fab --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision dcdc84e87fe5d67c15e83bc4e4a4bbacb0f4b63b) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 8e93771bd0894bf1308747d1e520d620d7821fab) @@ -7,8 +7,8 @@ * * @file FpgaDD.h * -* @author (last) Varshini Nagabooshanam -* @date (last) 27-Jan-2026 +* @author (last) Vinayakam Mani +* @date (last) 09-Feb-2026 * * @author (original) Vinayakam Mani * @date (original) 26-Aug-2024 @@ -160,9 +160,9 @@ U32 getFPGAD74CondData( void ); // Pumps (Dosing and Gear pumps ) -void setFPGAD11PumpSetStepSpeed( U16 stepSpeed ); -void setFPGAD10PumpSetStepSpeed( U16 stepSpeed ); -void setFPGAD76PumpSetStepSpeed( U16 stepSpeed ); +void setFPGAD11PumpSetStepSpeed( U32 stepSpeed ); +void setFPGAD10PumpSetStepSpeed( U32 stepSpeed ); +void setFPGAD76PumpSetStepSpeed( U32 stepSpeed ); void setFPGAD11PumpControl( U08 control ); void setFPGAD10PumpControl( U08 control ); void setFPGAD76PumpControl( U08 control ); @@ -184,9 +184,9 @@ BOOL getFPGAD10PumpIsParked( void ); BOOL getFPGAD11PumpParkFault( void ); BOOL getFPGAD10PumpParkFault( void ); -U16 getFPGAD11PumpHallSensePulseWidth( void ); -U16 getFPGAD10PumpHallSensePulseWidth( void ); -U16 getFPGAD76PumpHallSensePulseWidth( void ); +U32 getFPGAD11PumpHallSensePulseWidth( void ); +U32 getFPGAD10PumpHallSensePulseWidth( void ); +U32 getFPGAD76PumpHallSensePulseWidth( void ); U16 getFPGAD11PumpRevolutionCountStatus( void ); U16 getFPGAD10PumpRevolutionCountStatus( void ); U16 getFPGAD76PumpRevolutionCountStatus( void ); Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rc4fdfa017d6df768c5bf1223a5a69cafa47d6b42 -r8e93771bd0894bf1308747d1e520d620d7821fab --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision c4fdfa017d6df768c5bf1223a5a69cafa47d6b42) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 8e93771bd0894bf1308747d1e520d620d7821fab) @@ -7,8 +7,8 @@ * * @file Messaging.c * -* @author (last) Sameer Kalliadan Poyil -* @date (last) 03-Feb-2026 +* @author (last) Michael Garthwaite +* @date (last) 10-Feb-2026 * * @author (original) Vinayakam Mani * @date (original) 07-Aug-2024