/************************************************************************** * * Copyright (c) 2024-2026 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file FpgaDD.c * * @author (last) Varshini Nagabooshanam * @date (last) 27-Jan-2026 * * @author (original) Vinayakam Mani * @date (original) 26-Aug-2024 * ***************************************************************************/ #include "string.h" // for memset(), memcpy() #include "gio.h" // hal headers #include "sci.h" #include "sys_dma.h" #include "Comm.h" #include "Compatible.h" #include "FPGA.h" #include "Messaging.h" #include "OperationModes.h" #include "PersistentAlarm.h" #include "Timers.h" #include "Utilities.h" /** * @addtogroup FpgaDD * @{ */ // ********** 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 #define FPGA_ENABLE_VALVES_CONTROL 0x0000 ///< FPGA enable valves control. #define FPGA_ENABLE_BC_VALVES_CONTROL 0x00 ///< FPGA enable Balancing chamber valves control. #define FPGA_ENABLE_SPARE_VALVES_CNTRL 0x00 ///< FPGA enable spared valves control. #define FPGA_D17_RESET_BIT 0x01 ///< Conductivity Sensor D17 reset bit mask. #define FPGA_D17_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor D17 Initialization enable bit mask. #define FPGA_D17_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor D17 write enable bit mask. #define FPGA_D17_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor D17 read enable bit mask. #define FPGA_D74_RESET_BIT 0x10 ///< Conductivity Sensor D74 reset bit mask. #define FPGA_D74_INIT_ENABLE_BIT 0x20 ///< Conductivity Sensor D74 Initialization enable bit mask. #define FPGA_D74_WR_ENABLE_BIT 0x40 ///< Conductivity Sensor D74 write enable bit mask. #define FPGA_D74_RD_ENABLE_BIT 0x80 ///< Conductivity Sensor D74 read enable bit mask. #define FPGA_D27_RESET_BIT 0x01 ///< Conductivity Sensor D27 reset bit mask. #define FPGA_D27_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor D27 Initialization enable bit mask. #define FPGA_D27_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor D27 write enable bit mask. #define FPGA_D27_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor D27 read enable bit mask. #define FPGA_D29_RESET_BIT 0x10 ///< Conductivity Sensor D29 reset bit mask. #define FPGA_D29_INIT_ENABLE_BIT 0x20 ///< Conductivity Sensor D29 Initialization enable bit mask. #define FPGA_D29_WR_ENABLE_BIT 0x40 ///< Conductivity Sensor D29 write enable bit mask. #define FPGA_D29_RD_ENABLE_BIT 0x80 ///< Conductivity Sensor D29 read enable bit mask. #define FPGA_D43_RESET_BIT 0x01 ///< Conductivity Sensor D43 reset bit mask. #define FPGA_D43_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor D43 Initialization enable bit mask. #define FPGA_D43_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor D43 write enable bit mask. #define FPGA_D43_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor D43 read enable bit mask. // Assuming all valves are ON/OFF based control ( No PWM control used) #define FPGA_ENABLE_VALVES_PWM 0x0000 ///< FPGA enable valves PWM. #define FPGA_ENABLE_BC_VALVES_PWM 0x00 ///< FPGA enable Balancing chamber valves PWM. #define FPGA_ENABLE_UF_VALVES_PWM 0x00 ///< FPGA enable Ultrafiltration valves PWM. #define FPGA_ADC_AUTO_READ_ENABLE 0x11 ///< FPGA internal ADC auto read enable. #define CONCENTRATE_CAP_SWITCH_MASK 0x10 ///< Concentrate cap switch bit mask. #define FPGA_CONC_PUMP_FAULT_BITS 0x03 ///< Concentrate pump fault bits mask. #define UF_PUMP_FAULT_SHIFT 0x02 ///< Shift UF pump fault while reading, to account other dosing pumps fault. #define FPGA_UF_PUMP_FAULT_BIT 0x00 ///< UF pump fault bit mask. #define FPGA_UF_PUMP_PARKED_BIT 0x01 ///< UF pump parked status bit mask. #define FPGA_UF_PUMP_PARK_FAULT_BIT 0x02 ///< UF pump park fault status bit mask. #define FPGA_D11_PUMP_PARKED_BIT 0x04 ///< Acid Concentrate pump parked status bit mask. #define FPGA_D10_PUMP_PARKED_BIT 0x10 ///< Bicarb Concentrate pump parked status bit mask. #define FPGA_D11_PUMP_PARK_FAULT_BIT 0x08 ///< Acid Concentrate pump park fault status bit mask. #define FPGA_D10_PUMP_PARK_FAULT_BIT 0x20 ///< Bicarb Concentrate pump park fault status bit mask. #define FPGA_CONC_PUMP_PARK_COMMAND 0x80 ///< Park command bit for the concentrate pumps. #define FPGA_POWER_OUT_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< FPGA power out timeout in milliseconds. #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_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 #define PROCESSOR_FPGA_CLOCK_DIFF_TOLERANCE 1 ///< Tolerance for processor clock speed check against FPGA clock. #define MAX_FPGA_COMM_FAILURES_WINDOW_MS ( 1 * SEC_PER_MIN * MS_PER_SECOND ) ///< FPGA comm failures window #define MAX_FPGA_COMM_FAILURES 3 ///< FPGA maximum comm failures per MAX_FPGA_COMM_FAILURES_WINDOW_MS #define MIN_POWER_ON_TIME_FOR_COMM_FAILS ( 1 * MS_PER_SECOND ) ///< Allow FPGA comm errors for first second after power-up #define FPGA_CONDUCTIVITY_RESET_BIT 0x01 ///< Conductivity Sensor reset bit mask. #define FPGA_CONDUCTIVITY_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor initialization enable bit mask. #define FPGA_CONDUCTIVITY_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor write enable bit mask. #define FPGA_CONDUCTIVITY_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor read enable bit mask. #define FPGA_D42_BLOOD_LEAK_STATUS_MASK 0x04 ///< Bit mask for blood leak detector. #define FPGA_D42_BLOOD_LEAK_ST_BIT_INDEX 2 ///< Bit index for the blood leak self test status bit. #define MAX_PUMP_SPEED 3000.0F ///< Maxon controller pump maximum speed #define PUMP_SPEED_OFFSET 168.7F ///< Speed Scale adjustment intercept factor #define PUMP_SPEED_FULL_SCALE 3187.0F ///< Speed scale adjustment slope factor #pragma pack(push,1) /// FPGA header struct. typedef struct { U08 fpgaId; ///< Reg 0. FPGA ID code. Checked against expected value at power up to verify basic FPGA communication and operation U08 fpgaRevMinor; ///< Reg 1. FPGA revision (minor) being reported U08 fpgaRevMajor; ///< Reg 2. FPGA revision (major) being reported 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 { 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 U32 fpgaD17CondDataOut; ///< Reg 540. Data read from Conductivity Sensor D17 register U16 fpgaD17CondCond; ///< Reg 544. D17 conductivity U16 fpgaD17CondTemp; ///< Reg 546. D17 Temperature U08 fpgaD17CondReadCnt; ///< Reg 548. D17 successful read count U08 fpgaD17CondErrorCnt; ///< Reg 549. D17 error read count U32 fpgaD27CondDataOut; ///< Reg 550. Data read from Conductivity Sensor D27 register U16 fpgaD27CondCond; ///< Reg 554. D27 conductivity U16 fpgaD27CondTemp; ///< Reg 556. D27 Temperature U08 fpgaD27CondReadCnt; ///< Reg 558. D27 successful read count U08 fpgaD27CondErrorCnt; ///< Reg 559. D27 error read count U32 fpgaD29CondDataOut; ///< Reg 560. Data read from Conductivity Sensor D29 register U16 fpgaD29CondCond; ///< Reg 564. D29 conductivity U16 fpgaD29CondTemp; ///< Reg 566. D29 Temperature U08 fpgaD29CondReadCnt; ///< Reg 568. D29 successful read count U08 fpgaD29CondErrorCnt; ///< Reg 569. D29 error read count U32 fpgaD43CondDataOut; ///< Reg 570. Data read from Conductivity Sensor D43 register U16 fpgaD43CondCond; ///< Reg 574. D43 conductivity U16 fpgaD43CondTemp; ///< Reg 576. D43 Temperature U08 fpgaD43CondReadCnt; ///< Reg 578. D43 successful read count U08 fpgaD43CondErrorCnt; ///< Reg 579. D43 error read count U16 fpgaD63LevelSensor; ///< Reg 580. Upper level Sensor U16 fpgaD46LevelSensor; ///< Reg 582. Level Sensor 2 U08 fpgaHallSensInputs; ///< Reg 584. Hall sensor Inputs U08 fpgaD42TxFIFOCnt; ///< Reg 585. Blood leak sensor transmit FIFO count U16 fpgaD42RxErrorCnt; ///< Reg 586. Blood leak sensor Receive error count U16 fpgaD42RxFIFOCnt; ///< Reg 588. Blood leak sensor Receive FIFO count U08 fpgaD42RxFIFODataOut; ///< Reg 590. Blood leak sensor Receive data U08 fpgaD42PulseStatus; ///< Reg 591. Blood leak sensor status U16 fpgaValveStates; ///< Reg 592. Valve status read U16 fpgaValvePWMEnableStates; ///< Reg 594. Valve PWM Enable status read U08 fpgaValveBCStates; ///< Reg 596. Balancing chamber Valves states U08 fpgaValveBCPWMStates; ///< Reg 597. Balancing Chamber Valve PWM states U08 fpgaValveSpStates; ///< Reg 598. DD Spare Valves states U08 fpgaValveSpPWMStates; ///< Reg 599. Spare Valves PWM states U08 fpgaD11_D10_PumpFault; ///< Reg 600. Concentrate pump fault register for D11_Pump and D10_Pump U08 fpgaRTDCountErrorCycles; ///< Reg 601. Count of each incomplete seq of reads from RTD ADC. U16 fpgaD11PumpHallSense; ///< Reg 602. Concentrate pump D11_Pump hall sensor pulse width U16 fpgaD10PumpHallSense; ///< Reg 604. Concentrate pump D10_Pump hall sensor pulse width U32 fpgaD78Temp; ///< Reg 606. Outlet heat exchanger temperature U32 fpgaD1Temp; ///< Reg 610. Inlet heat exchanger temperature U32 fpgaD4Temp; ///< Reg 614. Hydraulics primary heater temperature U32 fpgaD50Temp; ///< Reg 618. Trimmer heater temperature U16 fpgaD98LevelSensor; ///< Reg 622. Lower level Sensor U16 fpgaD12MeasuredSpeed; ///< Reg 624. Fresh dialysate pump measured speed U16 fpgaD48MeasuredSpeed; ///< Reg 626. Spent dialysate pump measured speed U08 fpgaRTDReadCnt; ///< Reg 628. Read count for all RTD sensors U08 fpgaD12D48PumpStatus; ///< Reg 629. Dialysate pumps Error status U16 fpgaD12CurrentFeedback; ///< Reg 630. Fresh dialysate pump current feedback U16 fpgaD48CurrentFeedback; ///< Reg 632. Spent dialysate pump current feedback U08 fpgaD12HallStatus; ///< Reg 634. Fresh dialysate pump hall sensor direction status U08 fpgaD48HallStatus; ///< Reg 635. Spent dialysate pump hall sensor direction status U08 fpgaD6FloaterStatus; ///< Reg 636. Floater 1 level sensor status U08 fpgaFloater2Status; ///< Reg 637. Floater 2 level sensor status U16 fpgaD11PumpStepCountStatus; ///< Reg 638. Acid concentrate pump revolution down count status U16 fpgaD10PumpStepCountStatus; ///< Reg 640. Bicarb concentrate pump revolution down count status U16 fpgaAdcTemp; ///< Reg 642. TBD U16 fpgaAdcVccInt; ///< Reg 644. TBD U16 fpgaAdcVccAux; ///< Reg 646. TBD U16 fpgaAdcVpVn; ///< Reg 648. TBD U16 fpgaD12PumpSpeedFeedback; ///< Reg 650. D12 Pump speed feedback U16 fpgaD48PumpSpeedFeedback; ///< Reg 652. D48 Pump Speed feedback U16 fpgaD76PumpHallSense; ///< Reg 654. UF D76_Pump hall sensor pulse width U16 fpgaD76PumpStepCountStatus; ///< Reg 656. UF pump revolution down count status U08 fpgaD76PumpFault; ///< Reg 658: UF pump fault U08 fpga_UnUsed_3; ///< reg 659: Not used S16 pressureP46; ///< Reg 660. P46 pressure data. U16 temperatureP46; ///< Reg 662. P46 temperature data. S16 pressureM3; ///< Reg 664. M3 pressure data. U16 temperatureM3; ///< Reg 666. M3 temperature data. S16 pressureP8; ///< Reg 668. P8 pressure data. U16 temperatureP8; ///< Reg 670. P8 temperature data. S16 pressureP13; ///< Reg 672. P13 pressure data. U16 temperatureP13; ///< Reg 674. P13 temperature data. S16 pressureP17; ///< Reg 676. P17 pressure data. U16 temperatureP17; ///< Reg 678. P17 temperature data. U16 p40PumpTachCount; ///< Reg 680. P40 pump tachometer counter. U08 p25LevelSwitch; ///< Reg 682. P25 level switch. U08 reserved4; ///< Reg 683. Reserved. U32 conductivityP9Data; ///< Reg 684. P9 conductivity sensor data. U16 conductivityP9Cond; ///< Reg 688. P9 conductivity sensor conductivity. U16 conductivityP9Temp; ///< Reg 690. P9 conductivity sensor temperature. U08 conductivityP9ReadCount; ///< Reg 692. P9 conductivity sensor read counter. U08 conductivityP9ErrorCount; ///< Reg 693. P9 conductivity sensor error counter. U32 conductivityP18Data; ///< Reg 694. P18 conductivity sensor data. U16 conductivityP18Cond; ///< Reg 698. P18 conductivity sensor conductivity. U16 conductivityP18Temp; ///< Reg 700. P18 conductivity sensor temperature. U08 conductivityP18ReadCount; ///< Reg 702. P18 conductivity sensor read counter. U08 conductivityP18ErrorCount; ///< Reg 703. P18 conductivity sensor error counter. U16 flowRateP7; ///< Reg 704. P7 flow sensor rate. U16 flowTempP7; ///< Reg 706. P7 flow sensor temperature. U16 p12PumpTachCount; ///< Reg 708. P12 pump tachometer counter. U16 d79SpeedPulseWidth; ///< Reg 710. D79 pusle width feedback. U16 flowIntTempP7; ///< Reg 712. P7 flow sensor internal temperature. U08 valveIOControlReadback; ///< Reg 714. IO Valve control bits read back. U08 valveFPControlReadback; ///< Reg 715. FP Valve control enable read back. U08 valveIOPWMEnableReadback; ///< Reg 714. IO Valve PWM enable read back. U08 valveFPPWMEnableReadback; ///< Reg 715. FP Valve PWM enable read back. U16 p12PumpPWMReadback; ///< Reg 718. P12 pump PWM read back. U16 p40PumpPWMReadback; ///< Reg 720. P40 pump PWM read back. U08 p7flowReadCount; ///< Reg 722. P7 Flow sensor read counter. U08 p7flowErrorCount; ///< Reg 723. P7 Flow sensor error counter. U16 fpgaD87PresPressure; ///< Reg 724. D87 MPM pressure sensor RAW pressure data U16 fpgaD87PresTemp; ///< Reg 726. D87 MPM pressure sensor RAW temperature data U32 fpgaD99Temp; ///< Reg 728. D99 temperature sensor U32 tempTax1; ///< Reg 732. ( Tax1 ) temperature sensor reading. U32 tempRTD; ///< Reg 736. spare temperature sensor reading. U08 ad7124errcnt; ///< Reg 740. Counter which increments when an invalid transaction happen between FPGA and AD7124. U08 ad7124readcnt; ///< Reg 741. Counter which increments when a valid transaction happens between FPGA and AD7124. U16 flowRateP16; ///< Reg 742. P16 flow sensor rate. U16 flowTempP16; ///< Reg 744. P16 flow sensor temperature. U16 flowIntTempP16; ///< Reg 746. P16 flow sensor internal temperature. U08 p16flowReadCount; ///< Reg 748. P16 Flow sensor read counter. U08 p16flowErrorCount; ///< Reg 749. P16 Flow sensor error counter. U32 fpgaD74CondDataOut; ///< Reg 750. Data read from Conductivity Sensor D74 register U16 fpgaD74CondCond; ///< Reg 754. D74 conductivity U16 fpgaD74CondTemp; ///< Reg 756. D74 Temperature U08 fpgaD74CondReadCnt; ///< Reg 758. D74 successful read count U08 fpgaD74CondErrorCnt; ///< Reg 759. D74 error read count } DD_FPGA_SENSORS_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 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 fpgaD11PumpSpeed; ///< Reg 40. Acid Concentrate Pump Speed/RPM Control U08 fpgaD11PumpControl; ///< Reg 42. Acid Concentrate Pump Control U08 fpgaD10PumpControl; ///< Reg 43. BiCarb Concentrate Pump Control U16 fpgaD10PumpSpeed; ///< Reg 44. BiCarb Concentrate Pump Speed/RPM Control 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 fpgaD76PumpSpeed; ///< Reg 74. UF Pump Speed/RPM Control 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 } 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_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 ********** static U16 getFPGATimerCount( void ); /*********************************************************************//** * @brief * The initFPGADD function initializes the DD FPGA unit. * @details \b Inputs: none * @details \b Outputs: FPGA unit initialized. * @return none *************************************************************************/ void initFPGADD( void ) { // 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) ); // 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 ) ); // Set the valve control mode and default state of valve fpgaActuatorSetPoints.fpgaValveControl = FPGA_ENABLE_VALVES_CONTROL; fpgaActuatorSetPoints.fpgaValvePWMEnable = FPGA_ENABLE_VALVES_PWM; fpgaActuatorSetPoints.fpgaBCValveControl = FPGA_ENABLE_BC_VALVES_CONTROL; fpgaActuatorSetPoints.fpgaBCValvePWMControl = FPGA_ENABLE_BC_VALVES_PWM; fpgaActuatorSetPoints.fpgaDDSpareValveControl = FPGA_ENABLE_SPARE_VALVES_CNTRL; 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 * @details \b Alarm: ALARM_ID_DD_FPGA_POST_TEST_FAILED when FPGA compatibility failed and/or * wrong FPGA header seen. * @return passed, or failed *************************************************************************/ SELF_TEST_STATUS_T execFPGATest( void ) { SELF_TEST_STATUS_T result; // check FPGA reported correct ID if ( FPGA_EXPECTED_ID == fpgaHeader.fpgaId ) { // Check FPGA compatibility w/ firmware 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)GET_FPGA_SENSOR_FIELD( fpgaCompatibilityRev ) ) } } else { result = SELF_TEST_STATUS_FAILED; SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_FPGA_POST_TEST_FAILED, (U32)fpgaHeader.fpgaId ) } return result; } /*********************************************************************//** * @brief * The execFPGAClockSpeedTest function verifies the processor clock speed * against the FPGA clock. * @details \b Inputs: time windowed error count for FPGA clock speed alarm * @details \b Outputs: none * @details \b Alarm: ALARM_ID_DD_FPGA_CLOCK_SPEED_CHECK_FAILURE when clock speed * mismatch seen. * @warning: It may be necessary to comment out the following code to prevent * the alarm from occurring while debugging. * @return: none *************************************************************************/ void execFPGAClockSpeedTest( void ) { static U16 currentFPGATimerCount_ms = 0; static U32 currentTimerCount_ms = 0; U16 const newFPGATimerCount_ms = getFPGATimerCount(); U32 const newTimerCount_ms = getMSTimerCount(); U32 const diffFPGATimerCount = (U32)u16DiffWithWrap( currentFPGATimerCount_ms, newFPGATimerCount_ms ); U32 const diffTimerCount = u32DiffWithWrap( currentTimerCount_ms, newTimerCount_ms ); if ( getCurrentOperationMode() != DD_MODE_INIT ) { if ( abs( diffFPGATimerCount - diffTimerCount ) > PROCESSOR_FPGA_CLOCK_DIFF_TOLERANCE ) { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR ) ) { //TODO : Enable alarm later //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); } } } currentFPGATimerCount_ms = newFPGATimerCount_ms; currentTimerCount_ms = newTimerCount_ms; } /*********************************************************************//** * @brief * The setFPGADDValveStates function sets the DD valve states with a 16-bit * set of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: * 0 - D53Valve.\n * 1 - D52Valve.\n * 2 - D8Valve.\n * 3 - D54Valve.\n * 4 - D14Valve.\n * 5 - D65Valve.\n * 6 - D64Valve.\n * 7 - D31Valve.\n * 8 - D34Valve.\n * 9 - D35Valve.\n * 10 - D40Valve.\n * 11 - D47Valve.\n * 12 - D3Valve.\n * 13 - M4Valve.\n * 14..15 - reserved or unused. * @details \b Inputs: none * @details \b Outputs: fpgaValveControl * @param valveStates bit mask for the various valve states * @return none *************************************************************************/ void setFPGADDValveStates( U16 valveStates ) { SET_FPGA_ACTUATOR_FIELD( fpgaValveControl, valveStates ); } /*********************************************************************//** * @brief * The setFPGABCValveStates function sets the DD balancing chamber valve states with a * 8-bit set of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: * 0 - D23.\n * 1 - D19.\n * 2 - D25.\n * 3 - D21.\n * 4 - D24.\n * 5 - D20.\n * 6 - D26.\n * 7 - D22.\n * @details \b Inputs: none * @details \b Outputs: fpgaBCValveControl * @param valveStates bit mask for the balancing chamber valve states * @return none *************************************************************************/ void setFPGABCValveStates( U08 valveStates ) { SET_FPGA_ACTUATOR_FIELD( fpgaBCValveControl, valveStates ); } /*********************************************************************//** * @brief * The setFPGASpareValveStates function sets the DD spare valve states with a * 8-bit set of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: * 0 - Not used.\n * 1 - Not used.\n * 2 - Not used.\n * 3 - Not used.\n * 4..7 - Unused or reserved.\n * @details \b Inputs: none * @details \b Outputs: fpgaDDSpareValveControl * @param valveStates bit mask for the spare valve states * @return none *************************************************************************/ void setFPGASpareValveStates( U08 valveStates ) { SET_FPGA_ACTUATOR_FIELD( fpgaDDSpareValveControl, valveStates ); } /*********************************************************************//** * @brief * The setFPGAValveDDPWMEnable function sets the DD valve PWM states with * * 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: fpgaValvePWMEnable * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveDDPWMEnable( U16 valvePWMStates ) { SET_FPGA_ACTUATOR_FIELD( fpgaValvePWMEnable, valvePWMStates ); } /*********************************************************************//** * @brief * The getFPGAValveDDPWMEnable function gets the DD valve pwm states with * 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: fpgaValvePWMEnableStates * @return none *************************************************************************/ U16 getFPGAValveDDPWMEnable( void ) { 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: fpgaDDValvePWMPullin * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveDDPWMPullIn( U16 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: fpgaDDValvePWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveDDPWMLow( U16 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: fpgaDDValvePWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveDDPWMPeriod( U16 valvePWMPeriod ) { SET_FPGA_ACTUATOR_FIELD( fpgaDDValvePWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @brief * The setFPGAValveBCPWMEnable function sets the BC valve PWM states with * * 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: fpgaBCValvePWMControl * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveBCPWMEnable( U08 valvePWMStates ) { SET_FPGA_ACTUATOR_FIELD( fpgaBCValvePWMControl, valvePWMStates ); } /*********************************************************************//** * @brief * The getFPGAValveBCPWMEnable function gets the BC valve pwm states with * 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: fpgaValveBCPWMStates * @return none *************************************************************************/ U08 getFPGAValveBCPWMEnable( void ) { 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: fpgaVBCPWMPullin * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveBCPWMPullIn( U16 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: fpgaVBCPWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveBCPWMLow( U16 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: fpgaVBCPWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveBCPWMPeriod( U16 valvePWMPeriod ) { SET_FPGA_ACTUATOR_FIELD( fpgaVBCPWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @brief * The setFPGAValveSPPWMEnable function sets the Spare valve PWM states with * * 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: fpgaDDSpareValvePWMControl * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveSPPWMEnable( U08 valvePWMStates ) { SET_FPGA_ACTUATOR_FIELD( fpgaDDSpareValvePWMControl, valvePWMStates ); } /*********************************************************************//** * @brief * The getFPGAValveSPPWMEnable function gets the Spare valve pwm states with * 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: fpgaValveSpPWMStates * @return none *************************************************************************/ U08 getFPGAValveSPPWMEnable( void ) { 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: fpgaVSPPWMPullIn * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveSPPWMPullIn( U16 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: fpgaVSPPWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveSPPWMLow( U16 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: fpgaVSPPWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveSPPWMPeriod( U16 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: fpgaD48PumpSpeed * @param speed The spent dialysate pump speed * @return none *************************************************************************/ void setFPGAD48PumpSpeed( U16 speed ) { #ifdef __MAXON_SPEED_UPDATE__ { U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpSpeed, currentSpeed ); } #else { SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpSpeed, speed ); } #endif } /*********************************************************************//** * @brief * The setFPGAD12PumpSpeed function sets the speed for the * fresh dialysate pump (DGP). * @details \b Inputs: none * @details \b Outputs: fpgaD12PumpSpeed * @param speed The fresh dialysate pump speed * @return none *************************************************************************/ void setFPGAD12PumpSpeed( U16 speed ) { #ifdef __MAXON_SPEED_UPDATE__ { U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); SET_FPGA_ACTUATOR_FIELD( fpgaD12PumpSpeed, currentSpeed ); } #else { SET_FPGA_ACTUATOR_FIELD( fpgaD12PumpSpeed, speed ); } #endif } /*********************************************************************//** * @brief * The setFPGAD48PumpControl function sets the controls for * dialysate out pump (D48). * bit 7: Reserved * bit 6: Reserved * bit 5: Reserved * bit 4: Reserved * bit 3: Reserved * bit 1-2: Reserved * bit 0: Run (1), stop (0) * @details \b Inputs: none * @details \b Outputs: fpgaD48PumpControl * @param control The dialysate out pump controls * @return none *************************************************************************/ void setFPGAD48PumpControl( U08 control ) { SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpControl, control ); } /*********************************************************************//** * @brief * The setFPGAD12PumpControl function sets the controls for * De gassing pump (D12). * bit 7: Reserved * bit 6: Reserved * bit 5: Reserved * bit 4: Reserved * bit 3: Reserved * bit 1-2: Reserved * bit 0: Run (1), stop (0) * @details \b Inputs: none * @details \b Outputs: fpgaD12PumpControl * @param control The dialysate In pump controls * @return none *************************************************************************/ void setFPGAD12PumpControl( U08 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: fpgaD11PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ void setFPGAD11PumpSetStepSpeed( U16 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: fpgaD10PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ void setFPGAD10PumpSetStepSpeed( U16 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: fpgaD76PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ void setFPGAD76PumpSetStepSpeed( U16 stepSpeed ) { SET_FPGA_ACTUATOR_FIELD( fpgaD76PumpSpeed, stepSpeed ); } /*********************************************************************//** * @brief * The setFPGAD11PumpControl function sets the DVT concentrate pump 1 * (acid pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep * bit 5: nReset * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none * @details \b Outputs: fpgaD11PumpControl * @param control Concentrate pump control set * @return none *************************************************************************/ void setFPGAD11PumpControl( U08 control ) { CLEAR_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, FPGA_CONC_PUMP_PARK_COMMAND); // preserve msb (park command bit) SET_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, control); } /*********************************************************************//** * @brief * The setFPGAD10PumpControl function sets the DVT concentrate pump 2 * (bicarb pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep * bit 5: nReset * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none * @details \b Outputs: fpgaD10PumpControl * @param control Concentrate pump control set * @return none *************************************************************************/ void setFPGAD10PumpControl( U08 control ) { CLEAR_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // preserve msb (park command bit) SET_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, control ); } /*********************************************************************//** * @brief * The setFPGAD76PumpControl function sets the UF pump * (D76 pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep * bit 5: nReset * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none * @details \b Outputs: fpgaD76PumpControl * @param control UF pump control set * @return none *************************************************************************/ void setFPGAD76PumpControl( U08 control ) { CLEAR_FPGA_ACTUATOR_BITS( fpgaD76PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // preserve msb (park command bit) SET_FPGA_ACTUATOR_BITS( fpgaD76PumpControl, control ); } /*********************************************************************//** * @brief * The setFPGAD11PumpParkCmd function sets the DVT concentrate pump 1 * (acid pump) park command bit. * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details \b Inputs: none * @details \b Outputs: fpgaD11PumpControl * @param Park command bit set * @return none *************************************************************************/ void setFPGAD11PumpParkCmd( void ) { SET_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** * @brief * The setFPGAD10PumpParkCmd function sets the DVT concentrate pump 2 * (bicarb pump) park command bit. * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details \b Inputs: none * @details \b Outputs: fpgaD10PumpControl * @param Park command bit set * @return none *************************************************************************/ void setFPGAD10PumpParkCmd( void ) { SET_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** * @brief * The setFPGAD76PumpParkCmd function sets the Ultrafiltration pump * (D76 pump) park command bit. * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details \b Inputs: none * @details \b Outputs: fpgaD76PumpControl * @param Park command bit set * @return none *************************************************************************/ void setFPGAD76PumpParkCmd( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD17CondReset( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondReset( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD17CondInitEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondInitEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGAD17D74Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate * write transaction with the sensor. * @return none *************************************************************************/ void setFPGAD17CondWriteEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondWriteEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGAD17D74Address) register must be populated * before invoking this read enable function to initiate read transaction * with the sensor. * @return none *************************************************************************/ void setFPGAD17CondReadEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD17CondReadEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD27CondReset( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondReset( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD27CondInitEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondInitEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate * write transaction with the sensor. * @return none *************************************************************************/ void setFPGAD27CondWriteEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondWriteEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) register must be populated * before invoking this read enable function to initiate read transaction * with the sensor. * @return none *************************************************************************/ void setFPGAD27CondReadEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD27CondReadEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD29CondReset( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondReset( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void setFPGAD29CondInitEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondInitEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate * write transaction with the sensor. * @return none *************************************************************************/ void setFPGAD29CondWriteEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondWriteEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @warning: The address (setFPGACD12Address) register must be populated * before invoking this read enable function to initiate read transaction * with the sensor. * @return none *************************************************************************/ void setFPGAD29CondReadEnable( void ) { 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: fpgaConSensD27D29Control * @param none * @return none *************************************************************************/ void clearFPGAD29CondReadEnable( void ) { 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: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void setFPGAD43CondReset( void ) { 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: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondReset( void ) { 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: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void setFPGAD43CondInitEnable( void ) { 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: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondInitEnable( void ) { 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: fpgaConSensD43Control * @param none * @warning: The address (setFPGACD12Address) and data (setFPGACD12Data) register * must be populated before invoking this write enable function to initiate * write transaction with the sensor. * @return none *************************************************************************/ void setFPGAD43CondWriteEnable( void ) { 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: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondWriteEnable( void ) { 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: fpgaConSensD43Control * @param none * @warning: The address (setFPGACD12Address) register must be populated * before invoking this read enable function to initiate read transaction * with the sensor. * @return none *************************************************************************/ void setFPGAD43CondReadEnable( void ) { 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: fpgaConSensD43Control * @param none * @return none *************************************************************************/ void clearFPGAD43CondReadEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD74CondReset( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondReset( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void setFPGAD74CondInitEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondInitEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGACD74Address) and data (setFPGACD74Data) register * must be populated before invoking this write enable function to initiate * write transaction with the sensor. * @return none *************************************************************************/ void setFPGAD74CondWriteEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondWriteEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @warning: The address (setFPGACD74Address) register must be populated * before invoking this read enable function to initiate read transaction * with the sensor. * @return none *************************************************************************/ void setFPGAD74CondReadEnable( void ) { 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: fpgaConSensD17D74Control * @param none * @return none *************************************************************************/ void clearFPGAD74CondReadEnable( void ) { CLEAR_FPGA_ACTUATOR_BITS( fpgaConSensD17D74Control, ~FPGA_D74_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The setFPGAD17D74Control function sets the FPGA Conductivity * Sensor control register for D17 and D74. * bit 7: Enables D74 read transaction (1), address needed * bit 6: Enables D74 write transaction (1), address and data needs to be set * bit 5: Enable D74 Init procedure (1) * bit 4: reset D74 Conduct sensor (1) * bit 3: Enables D17 read transaction (1), address needed * bit 2: Enables D17 write transaction (1), address and data needs to be set * bit 1: Enable D17 Init procedure (1) * bit 0: reset D17 Conduct sensor (1) * @details \b Inputs: none * @details \b Outputs: fpgaConSensD17D74Control * @param control Conductivity Sensor control set * @return none *************************************************************************/ void setFPGAD17D74Control( U08 control ) { SET_FPGA_ACTUATOR_FIELD( fpgaConSensD17D74Control, control ); } /*********************************************************************//** * @brief * The setFpgaCD34Control function sets the FPGA Conductivity * Sensor control register for D27 and D29. * bit 7: Enables D29 read transaction (1), address needed * bit 6: Enables D29 write transaction (1), address and data needs to be set * bit 5: Enable D29 Init procedure (1) * bit 4: reset D29 Conduct sensor (1) * bit 3: Enables D27 read transaction (1), address needed * bit 2: Enables D27 write transaction (1), address and data needs to be set * bit 1: Enable D27 Init procedure (1) * bit 0: reset D27 Conduct sensor (1) * @details \b Inputs: none * @details \b Outputs: fpgaConSensTD34Control * @param control Conductivity sensor control set * @return none *************************************************************************/ void setFPGAD27D29Control( U08 control ) { SET_FPGA_ACTUATOR_FIELD( fpgaConSensD27D29Control, control ); } /*********************************************************************//** * @brief * The setFpgaCD5Control function sets the FPGA Conductivity * Sensor control register for D43. * bit 4- 7: Reserved. * bit 3: Enables D43 read transaction (1), address needed * bit 2: Enables D43 write transaction (1), address and data needs to be set * bit 1: Enable D43 Init procedure (1) * bit 0: reset D43 Conduct sensor (1) * @details \b Inputs: none * @details \b Outputs: fpgaConSensD74Control * @param control Conductivity sensor control set * @return none *************************************************************************/ void setFPGAD43Control( U08 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: fpgaConSensD17D74_Addrs * @param address The conductivity sensor D17 and D74 address * @return none *************************************************************************/ void setFPGAD17D74Address( U16 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: fpgaConSensD27D29_Addrs * @param address The conductivity sensor CD34 address * @return none *************************************************************************/ void setFPGAD27D29Address( U16 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: fpgaConSensD43_Addrs * @param address The conductivity sensor D43 address * @return none *************************************************************************/ void setFPGAD43Address( U16 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: fpgaConSensD17D74_Data_In * @param data The conductivity sensor D17 and D74 Data * @return none *************************************************************************/ void setFPGAD17D74Data( U32 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: fpgaConSensD27D29_Data_In * @param data The conductivity sensor D27 and D29 Data * @return none *************************************************************************/ void setFPGAD27D29Data( U32 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: fpgaConSensD43_Data_In * @param data The conductivity sensor D43 Data * @return none *************************************************************************/ void setFPGAD43Data( U32 data ) { SET_FPGA_ACTUATOR_FIELD( fpgaConSensD43_Data_In, data ); } /*********************************************************************//** * @brief * The setFPGAD5HeaterPWMControl function sets the primary heater * PWM input. * @details \b Inputs: none * @details \b Outputs: fpgaD5HeaterPWMControl * @param control the PWM dutycycle to control the heater * @return none *************************************************************************/ void setFPGAD5HeaterPWMControl( U08 control ) { SET_FPGA_ACTUATOR_FIELD( fpgaD5HeaterPWMControl, control ); } /*********************************************************************//** * @brief * The setFPGAD45HeaterPWMControl function sets the trimmer heater * PWM input. * @details \b Inputs: none * @details \b Outputs: fpgaD45HeaterPWMControl * @param control the PWM dutycycle to control the heater * @return none *************************************************************************/ void setFPGAD45HeaterPWMControl( U08 control ) { SET_FPGA_ACTUATOR_FIELD( fpgaD45HeaterPWMControl, control ); } /*********************************************************************//** * @brief * The setFPGAD11PumpRevolutionCount function sets the Acid concentrate * pump revolution count. * @details \b Inputs: none * @details \b Outputs: fpgaD11PumpRevCount * @param count the number of revolution to be rotated for the pump. * @return none *************************************************************************/ void setFPGAD11PumpRevolutionCount( U16 count ) { SET_FPGA_ACTUATOR_FIELD( fpgaD11PumpRevCount, count ); } /*********************************************************************//** * @brief * The setFPGAD10PumpRevolutionCount function sets the Bicarb concentrate * pump revolution count. * @details \b Inputs: none * @details \b Outputs: fpgaD10PumpRevCount * @param count the number of revolution to be rotated for the pump. * @return none *************************************************************************/ void setFPGAD10PumpRevolutionCount( U16 count ) { SET_FPGA_ACTUATOR_FIELD( fpgaD10PumpRevCount, count ); } /*********************************************************************//** * @brief * The setFPGAD76PumpRevolutionCount function sets the UltraFilteration * pump revolution count. * @details \b Inputs: none * @details \b Outputs: fpgaD76PumpRevCount * @param count the number of revolution to be rotated for the pump. * @return none *************************************************************************/ void setFPGAD76PumpRevolutionCount( U16 count ) { SET_FPGA_ACTUATOR_FIELD( fpgaD76PumpRevCount, count ); } /*********************************************************************//** * @brief * The setFPGAD5HeaterOnOffControl function sets the primary heater * On/Off control. * @details \b Inputs: none * @details \b Outputs: fpgaGPIOControl * @param flag Turn heater ON when true, otherwise not. * @return none *************************************************************************/ void setFPGAD5HeaterOnOffControl( BOOL flag ) { if ( TRUE == flag) { SET_FPGA_ACTUATOR_BITS( fpgaGPIOControl, FPGA_D5_HEATER_CNTRL_BIT ); } else { CLEAR_FPGA_ACTUATOR_BITS( fpgaGPIOControl, ~FPGA_D5_HEATER_CNTRL_BIT ); } } /*********************************************************************//** * @brief * The setFPGAD5HeaterPWMEnableControl function sets whether the primary heater * control based out of On/OFF (0) or PWM based control (1). * @details \b Inputs: none * @details \b Outputs: fpgaGPIOControl * @param enable PWM based heater control when true, otherwise On/Off Control. * @return none *************************************************************************/ void setFPGAD5HeaterPWMEnableControl( BOOL enable ) { if ( TRUE == enable) { SET_FPGA_ACTUATOR_BITS( fpgaGPIOControl, FPGA_D5_HEATER_PWM_ENABLE_BIT ); } else { CLEAR_FPGA_ACTUATOR_BITS( fpgaGPIOControl, ~FPGA_D5_HEATER_PWM_ENABLE_BIT ); } } /*********************************************************************//** * @brief * The setFPGAD5HeaterPWMLowState function sets the PWM low period( Off time) * for AC heater. * @details \b Inputs: none * @details \b Outputs: fpgaACRelayPWMLow * @param count the number of count that PWM stays low for the AC relay/heater. * @return none *************************************************************************/ void setFPGAD5HeaterPWMLowState( U16 count ) { SET_FPGA_ACTUATOR_FIELD( fpgaACRelayPWMLow, count ); } /*********************************************************************//** * @brief * The setFPGAD5HeaterPWMPeriod function sets the PWM period( On and Off time) * for AC heater. * @details \b Inputs: none * @details \b Outputs: fpgaACRelayPWMPeriod * @param period the total period of PWM cycle ( On and Off time). * @return none *************************************************************************/ void setFPGAD5HeaterPWMPeriod( U16 period ) { SET_FPGA_ACTUATOR_FIELD( fpgaACRelayPWMPeriod, period ); } /*********************************************************************//** * @brief * The getFPGAVersions function gets the FPGA version numbers. * @details \b Inputs: fpgaHeader * @details \b Outputs: none * @return none *************************************************************************/ void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ) { *Id = fpgaHeader.fpgaId; *Maj = fpgaHeader.fpgaRevMajor; *Min = fpgaHeader.fpgaRevMinor; *Lab = fpgaHeader.fpgaRevLab; } /*********************************************************************//** * @brief * The getFPGAD48PumpControl function gets the status of the * dialysate out pump control status bits. * bit 7: TBD * bit 6: TBD * bit 5: TBD * bit 4: TBD * bit 3: TBD * bit 1-2: TBD * bit 0: Run (1), stop (0) * @details \b Inputs: none * @details \b Outputs: fpgaD48PumpControl * @return Dialysate Out pump control status bit *************************************************************************/ U08 getFPGAD48PumpControl( void ) { return GET_FPGA_ACTUATOR_FIELD( fpgaD48PumpControl ); } /*********************************************************************//** * @brief * The getFPGAD12PumpControl function gets the status of the * dialysate Inlet pump control status bits. * bit 7: TBD * bit 6: TBD * bit 5: TBD * bit 4: TBD * bit 3: TBD * bit 1-2: TBD * bit 0: Run (1), stop (0) * @details \b Inputs: none * @details \b Outputs: fpgaD12PumpControl * @return Dialysate Inlet pump control status bit *************************************************************************/ U08 getFPGAD12PumpControl( void ) { return GET_FPGA_ACTUATOR_FIELD( fpgaD12PumpControl ); } /*********************************************************************//** * @brief * The getFPGAD48PumpSpeed function gets the spent dialysate * pump speed. * @details \b Inputs: none * @details \b Outputs: fpgaD48MeasuredSpeed * @return Spent dialysate pump measured speed. *************************************************************************/ U16 getFPGAD48PumpSpeed( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD48MeasuredSpeed ); } /*********************************************************************//** * @brief * The getFPGAD12PumpSpeed function gets the fresh dialysate * pump speed. * @details \b Inputs: none * @details \b Outputs: fpgaD12MeasuredSpeed * @return fresh dialysate pump measured speed. *************************************************************************/ U16 getFPGAD12PumpSpeed( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD12MeasuredSpeed ); } /*********************************************************************//** * @brief * The getFPGAD12PumpErrorStatus function gets the fresh dialysate * pump error status. * bit 7-2: TBD * 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: fpgaD12D48PumpStatus * @return fresh dialysate pump error status. *************************************************************************/ BOOL getFPGAD12PumpErrorStatus( void ) { U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD12D48PumpStatus ) & FPGA_D12_PUMP_ERROR_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAD48PumpErrorStatus function gets the spent dialysate * pump error status. * bit 7-2: TBD * 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: fpgaD12D48PumpStatus * @return spent dialysate pump error status. *************************************************************************/ BOOL getFPGAD48PumpErrorStatus( void ) { U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD12D48PumpStatus ) & FPGA_D48_PUMP_ERROR_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAD12PumpCurrentFeedback function gets the fresh dialysate * pump current consumption. * @details \b Inputs: none * @details \b Outputs: fpgaD12CurrentFeedback * @return fresh dialysate pump measured current. *************************************************************************/ U16 getFPGAD12PumpCurrentFeedback( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD12CurrentFeedback ); } /*********************************************************************//** * @brief * The getFPGAD48PumpCurrentFeedback function gets the spent dialysate * pump current consumption. * @details \b Inputs: none * @details \b Outputs: fpgaD48CurrentFeedback * @return spent dialysate pump measured current. *************************************************************************/ U16 getFPGAD48PumpCurrentFeedback( void ) { 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: fpgaD12HallStatus * @return fresh dialysate pump hall sensor based direction status. *************************************************************************/ U08 getFPGAD12PumpHallDirectionStatus( void ) { 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: fpgaD48HallStatus * @return spent dialysate pump hall sensor based direction status. *************************************************************************/ U08 getFPGAD48PumpHallDirectionStatus( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD48HallStatus ); } /*********************************************************************//** * @brief * The getFPGAD11PumpControlStatus function gets the status of the * acid pump control status bits. * bit 7: Park (set in different function) * bit 6: nSleep * bit 5: nReset * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none * @details \b Outputs: fpgaD11PumpControl * @return Acid pump control status bit *************************************************************************/ U08 getFPGAD11PumpControlStatus( void ) { return GET_FPGA_ACTUATOR_FIELD( fpgaD11PumpControl ); } /*********************************************************************//** * @brief * The getFPGAD10PumpControlStatus function gets the DVT concentrate pump 2 * (bicarb pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep * bit 5: nReset * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none * @details \b Outputs: fpgaD10PumpControl * @return Bicarb pump control status bit *************************************************************************/ U08 getFPGAD10PumpControlStatus( void ) { return GET_FPGA_ACTUATOR_FIELD( fpgaD10PumpControl ); } /*********************************************************************//** * @brief * The getFPGAD76PumpControlStatus function gets the Ultrafilteration pump * (D76 pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep * bit 5: nReset * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none * @details \b Outputs: fpgaD76PumpControl * @return UF pump control status bit *************************************************************************/ U08 getFPGAD76PumpControlStatus( void ) { return GET_FPGA_ACTUATOR_FIELD( fpgaD76PumpControl ); } /*********************************************************************//** * @brief * The getFPGAUFPumpFault function gets UF pumps fault * reported by FGPA. * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return Latest UF pumps fault value *************************************************************************/ U08 getFPGAUFPumpFault( void ) { 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: fpgaD76PumpFault * @details \b Outputs: none * @return TRUE if UF pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD76PumpIsParked( void ) { U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD76PumpFault ) & FPGA_UF_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAD76PumpParkFault function gets whether the UF pump park command * has faulted. * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return TRUE if UF pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAD76PumpParkFault( void ) { U08 mask = ( GET_FPGA_SENSOR_FIELD ( fpgaD76PumpFault ) & FPGA_UF_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAConcentratePumpsFault function gets concentrate pumps fault * reported by FGPA. * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return Latest concentrate pumps fault value *************************************************************************/ U08 getFPGAConcentratePumpsFault( void ) { 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: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if acid pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD11PumpIsParked( void ) { U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D11_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAD10PumpIsParked function gets whether the bicarb pump is currently * parked. * @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 = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D10_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAD11PumpParkFault function gets whether the acid pump park command * has faulted. * @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 = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D11_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAD10PumpParkFault function gets whether the bicarb pump park command * has faulted. * @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 = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D10_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; } /*********************************************************************//** * @brief * The getFPGAD11PumpHallSensePulseWidth function gets concentrate pump D11_Pump * hall sense pulse width. * @details \b Inputs: fpgaD11PumpHallSense * @details \b Outputs: none * @return concentrate pump D11_Pump hall sense pulse width *************************************************************************/ U16 getFPGAD11PumpHallSensePulseWidth( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD11PumpHallSense ); } /*********************************************************************//** * @brief * The getFPGAD10PumpHallSensePulseWidth function gets concentrate pump D10_Pump * hall sense pulse width. * @details \b Inputs: fpgaD10PumpHallSense * @details \b Outputs: none * @return concentrate pump D10_Pump hall sense pulse width *************************************************************************/ U16 getFPGAD10PumpHallSensePulseWidth( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD10PumpHallSense ); } /*********************************************************************//** * @brief * The getFPGAD76PumpHallSensePulseWidth function gets UF pump D76_Pump * hall sense pulse width. * @details \b Inputs: fpgaD76PumpHallSense * @details \b Outputs: none * @return ultrafiltration pump D76_Pump hall sense pulse width *************************************************************************/ U16 getFPGAD76PumpHallSensePulseWidth( void ) { 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: fpgaValveStates * @details \b Outputs: none * @return last valve states reading *************************************************************************/ U16 getFPGADDValveStates( void ) { 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: fpgaValveBCStates * @details \b Outputs: none * @return last balancing chamber valve states reading *************************************************************************/ U08 getFPGAValveBCStates( void ) { 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: fpgaValveSpStates * @details \b Outputs: none * @return last spare valve states reading *************************************************************************/ U08 getFPGAValveSpStates( void ) { return GET_FPGA_SENSOR_FIELD( fpgaValveSpStates ); } /*********************************************************************//** * @brief * The getFPGAD9PresRawPressure function gets hydraulics outlet pressure sensor raw * pressure value. * @details \b Inputs: fpgaD9PresPressure * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD9PresRawPressure( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD9PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD9PresRawTemperature function gets hydraulics outlet pressure sensor raw * temperature value. * @details \b Inputs: fpgaD9PresTemp * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD9PresRawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD9PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD66PresRawPressure function gets Bibag pressure sensor raw * pressure value. * @details \b Inputs: fpgaD66PresPressure * @details \b Outputs: none * @return Latest Bibag pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD66PresRawPressure( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD66PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD66PresRawTemperature function gets Bibag pressure sensor raw * temperature value. * @details \b Inputs: fpgaD66PresTemp * @details \b Outputs: none * @return Latest Bibag pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD66PresRawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD66PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD51PresRawPressure function gets spent dialysate pressure sensor raw * pressure value. * @details \b Inputs: fpgaD51PresPressure * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD51PresRawPressure( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD51PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD51PresRawTemperature function gets spent dialysate pressure sensor raw * temperature value. * @details \b Inputs: fpgaD51PresTemp * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD51PresRawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD51PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD18PresRawPressure function gets fresh dialysate pressure sensor raw * pressure value. * @details \b Inputs: fpgaD18PresPressure * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD18PresRawPressure( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD18PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD18PresRawTemperature function gets fresh dialysate pressure sensor raw * temperature value. * @details \b Inputs: fpgaD18PresTemp * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD18PresRawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD18PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD41PresRawPressure function gets transmembrane pressure sensor raw * pressure value. * @details \b Inputs: fpgaD41PresPressure * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD41PresRawPressure( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD41PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD41PresRawTemperature function gets transmembrane pressure sensor raw * temperature value. * @details \b Inputs: fpgaD41PresTemp * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD41PresRawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD41PresTemp ); } /*********************************************************************//** * @brief * The getFPGAD87PresRawPressure function gets fresh dialysate post ultrafilter * pressure sensor raw pressure value. * @details \b Inputs: fpgaD87PresPressure * @details \b Outputs: none * @return Fresh dialysate post ultrafilter pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD87PresRawPressure( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD87PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD87PresRawTemperature function gets fresh dialysate post ultrafilter * pressure sensor raw temperature value. * @details \b Inputs: fpgaD87PresTemp * @details \b Outputs: none * @return Fresh dialysate post ultrafilter pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD87PresRawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD87PresTemp ); } /*********************************************************************//** * @brief * The getFPGACD1ReadCount function gets D17 conductivity sensor read count. * @details \b Inputs: fpgaD17CondReadCnt * @details \b Outputs: none * @return Latest D17 conductivity sensor read count *************************************************************************/ U08 getFPGAD17CondReadCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD17CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD17CondErrorCount function gets D17 conductivity sensor error count. * @details \b Inputs: fpgaD17CondErrorCnt * @details \b Outputs: none * @return Latest D17 conductivity sensor read error count *************************************************************************/ U08 getFPGAD17CondErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD17CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD17Cond function gets D17 conductivity sensor value. * @details \b Inputs: fpgaCD1 * @details \b Outputs: none * @return Latest D17 conductivity sensor value *************************************************************************/ U16 getFPGAD17Cond( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD17CondCond ); } /*********************************************************************//** * @brief * The getFPGAD17CondTemp function gets D17 conductivity sensor temperature value. * @details \b Inputs: fpgaCD1Temp * @details \b Outputs: none * @return Latest D17 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD17CondTemp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD17CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD17CondData function gets D17 conductivity sensor register value. * @details \b Inputs: fpgaD17CondDataOut * @details \b Outputs: none * @return Latest D17 conductivity sensor register data value *************************************************************************/ U32 getFPGAD17CondData( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD17CondCond ); } /*********************************************************************//** * @brief * The getFPGAD27CondReadCount function gets D27 conductivity sensor read count. * @details \b Inputs: fpgaD27CondReadCnt * @details \b Outputs: none * @return Latest D27 conductivity sensor read count *************************************************************************/ U08 getFPGAD27CondReadCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD27CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD27CondErrorCount function gets D27 conductivity sensor error count. * @details \b Inputs: fpgaD27CondErrorCnt * @details \b Outputs: none * @return Latest D27 conductivity sensor read error count *************************************************************************/ U08 getFPGAD27CondErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD27CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD27Cond function gets D27 conductivity sensor value. * @details \b Inputs: fpgaD27Cond * @details \b Outputs: none * @return Latest D27 conductivity sensor value *************************************************************************/ U16 getFPGAD27Cond( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD27CondCond ); } /*********************************************************************//** * @brief * The getFPGAD27CondTemp function gets D27 conductivity sensor temperature value. * @details \b Inputs: fpgaD27CondTemp * @details \b Outputs: none * @return Latest D27 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD27CondTemp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD27CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD27CondData function gets D27 conductivity sensor register value. * @details \b Inputs: fpgaD27CondDataOut * @details \b Outputs: none * @return Latest D27 conductivity sensor register data value *************************************************************************/ U32 getFPGAD27CondData( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD27CondCond ); } /*********************************************************************//** * @brief * The getFPGAD29CondReadCount function gets D29 conductivity sensor read count. * @details \b Inputs: fpgaD29CondReadCnt * @details \b Outputs: none * @return Latest D29 conductivity sensor read count *************************************************************************/ U08 getFPGAD29CondReadCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD29CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD29CondErrorCount function gets D29 conductivity sensor error count. * @details \b Inputs: fpgaD29CondErrorCnt * @details \b Outputs: none * @return Latest D29 conductivity sensor read error count *************************************************************************/ U08 getFPGAD29CondErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD29CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD29Cond function gets D29 conductivity sensor value. * @details \b Inputs: fpgaD29Cond * @details \b Outputs: none * @return Latest D29 conductivity sensor value *************************************************************************/ U16 getFPGAD29Cond( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD29CondCond ); } /*********************************************************************//** * @brief * The getFPGAD29CondTemp function gets D29 conductivity sensor temperature value. * @details \b Inputs: fpgaD29CondTemp * @details \b Outputs: none * @return Latest D29 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD29CondTemp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD29CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD29CondData function gets D29 conductivity sensor register value. * @details \b Inputs: fpgaD29CondDataOut * @details \b Outputs: none * @return Latest D29 conductivity sensor register data value *************************************************************************/ U32 getFPGAD29CondData( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD29CondCond ); } /*********************************************************************//** * @brief * The getFPGAD43CondReadCount function gets D43 conductivity sensor read count. * @details \b Inputs: fpgaD43CondReadCnt * @details \b Outputs: none * @return Latest D43 conductivity sensor read count *************************************************************************/ U08 getFPGAD43CondReadCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD43CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD43CondErrorCount function gets D43 conductivity sensor error count. * @details \b Inputs: fpgaD43CondErrorCnt * @details \b Outputs: none * @return Latest D43 conductivity sensor read error count *************************************************************************/ U08 getFPGAD43CondErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD43CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD43Cond function gets D43 conductivity sensor value. * @details \b Inputs: fpgaD43Cond * @details \b Outputs: none * @return Latest D43 conductivity sensor value *************************************************************************/ U16 getFPGAD43Cond( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD43CondCond ); } /*********************************************************************//** * @brief * The getFPGAD43CondTemp function gets D43 conductivity sensor temperature value. * @details \b Inputs: fpgaD43CondTemp * @details \b Outputs: none * @return Latest D43 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD43CondTemp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD43CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD43CondData function gets D43 conductivity sensor register value. * @details \b Inputs: fpgaD43CondDataOut * @details \b Outputs: none * @return Latest D43 conductivity sensor register data value *************************************************************************/ U32 getFPGAD43CondData( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD43CondCond ); } /*********************************************************************//** * @brief * The getFPGAD74CondReadCount function gets D74 conductivity sensor read count. * @details \b Inputs: fpgaD74CondReadCnt * @details \b Outputs: none * @return Latest D74 conductivity sensor read count *************************************************************************/ U08 getFPGAD74CondReadCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD74CondReadCnt ); } /*********************************************************************//** * @brief * The getFPGAD74CondErrorCount function gets D74 conductivity sensor error count. * @details \b Inputs: fpgaD74CondErrorCnt * @details \b Outputs: none * @return Latest D74 conductivity sensor read error count *************************************************************************/ U08 getFPGAD74CondErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD74CondErrorCnt ); } /*********************************************************************//** * @brief * The getFPGAD74Cond function gets D74 conductivity sensor value. * @details \b Inputs: fpgaD74Cond * @details \b Outputs: none * @return Latest D74 conductivity sensor value *************************************************************************/ U16 getFPGAD74Cond( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD74CondCond ); } /*********************************************************************//** * @brief * The getFPGAD74CondTemp function gets D74 conductivity sensor temperature value. * @details \b Inputs: fpgaD74CondTemp * @details \b Outputs: none * @return Latest D74 conductivity sensor temperature value *************************************************************************/ U16 getFPGAD74CondTemp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD74CondTemp ); } /*********************************************************************//** * @brief * The getFPGAD74CondData function gets D74 conductivity sensor register value. * @details \b Inputs: fpgaD74CondDataOut * @details \b Outputs: none * @return Latest D74 conductivity sensor register data value *************************************************************************/ U32 getFPGAD74CondData( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD74CondCond ); } /*********************************************************************//** * @brief * The getFPGAD63LevelSensor function gets the latest FPGA D63 upper level * sensor reading. * @details \b Inputs: fpgaD63LevelSensor * @details \b Outputs: none * @return last FPGA D63 upper level sensor reading *************************************************************************/ U16 getFPGAD63LevelSensor( void ) { #if 1 // Remove when Beta 1.9 is obsolete if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { return ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D63_LEVEL_BIT ); } else { return fpgaBeta19SensorReadings.fpgaD63LevelSensor; } #else return GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); #endif } /*********************************************************************//** * @brief * The getFPGAD98LevelSensor function gets the latest FPGA D98 lower level * sensor reading. * @details \b Inputs: fpgaD98LevelSensor * @details \b Outputs: none * @return last FPGA D98 lower level sensor reading *************************************************************************/ U16 getFPGAD98LevelSensor( void ) { #if 1 // Remove when Beta 1.9 is obsolete if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { return ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D98_LEVEL_BIT ); } else { return fpgaBeta19SensorReadings.fpgaD98LevelSensor; } #else return GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); #endif } /*********************************************************************//** * @brief * The getFPGAD46LevelSensor function gets the latest FPGA level sensor 2 * reading. * @details \b Inputs: fpgaD46LevelSensor * @details \b Outputs: none * @return last FPGA level sensor2 reading *************************************************************************/ U16 getFPGAD46LevelSensor( void ) { #if 1 // Remove when Beta 1.9 is obsolete if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { return ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D46_LEVEL_BIT ); } else { return fpgaBeta19SensorReadings.fpgaD46LevelSensor; } #else return GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); #endif } /*********************************************************************//** * @brief * The getFPGAD6LevelStatus function gets the latest FPGA floater D6 level * reading. * @details \b Inputs: fpgaD6FloaterStatus * @details \b Outputs: none * @return last FPGA floater D6 level reading *************************************************************************/ U08 getFPGAD6LevelStatus( void ) { 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: fpgaFloater2Status * @details \b Outputs: none * @return last FPGA floater 2 level reading *************************************************************************/ U08 getFPGAFloater2Status( void ) { #if 1 // Remove when Beta 1.9 is obsolete if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { return fpgaSensorReadings.fpgaConductiveLevelStatus; } else { return fpgaBeta19SensorReadings.fpgaFloater2Status; } #else return GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); #endif } /*********************************************************************//** * @brief * The getFPGATimerCount function gets the latest FPGA timer millisecond count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return last FPGA timer count *************************************************************************/ static U16 getFPGATimerCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaTimerCountMS ); } /*********************************************************************//** * @brief * The getFPGAD1Temp function gets the inlet heat exchanger * temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return inlet heat exchanger temperature *************************************************************************/ U32 getFPGAD1Temp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD1Temp ); } /*********************************************************************//** * @brief * The getFPGAD78Temp function gets the outlet heat exchanger * temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return outlet heat exchanger temperature *************************************************************************/ U32 getFPGAD78Temp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD78Temp ); } /*********************************************************************//** * @brief * The getFPGAD4Temp function gets the hydraulics primary * heater temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return hydraulics primary heater temperature *************************************************************************/ U32 getFPGAD4Temp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD4Temp ); } /*********************************************************************//** * @brief * The getFPGAD50Temp function gets the trimmer heater temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return trimmer heater temperature *************************************************************************/ U32 getFPGAD50Temp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD50Temp ); } /*********************************************************************//** * @brief * The getFPGAD99Temp function gets the fresh dialysate temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return Fresh dialysate temperature *************************************************************************/ U32 getFPGAD99Temp( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD99Temp ); } /*********************************************************************//** * @brief * The getFPGARTDReadCount function gets the RTD sensors group read count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return RTD read count *************************************************************************/ U08 getFPGARTDReadCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaRTDReadCnt ); } /*********************************************************************//** * @brief * The getFPGARTDCountErrorCycles function gets the FPGA incomplete sequences * of reads from RTD ADC. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return count of in-complete sequences of reads from RTD ADC. *************************************************************************/ U08 getFPGARTDCountErrorCycles( void ) { 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. * @details \b Inputs: none * @details \b Outputs: none * @return TRUE if windowed count exceeded, else false. *************************************************************************/ void checkFPGACommFailure( void ) { if ( getMSTimerCount() > MIN_POWER_ON_TIME_FOR_COMM_FAILS ) { 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)GET_FPGA_SENSOR_FIELD( fpgaIOErrorCntProcessor ) ) } } } /*********************************************************************//** * @brief * The getFPGAD11PumpRevolutionCountStatus function gets the current revolution of * acid concentrate pump (down counter). * @details \b Inputs: fpgaD11PumpStepCountStatus * @details \b Outputs: none * @return the current revolution of the acid concentrate pump *************************************************************************/ U16 getFPGAD11PumpRevolutionCountStatus( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD11PumpStepCountStatus ); } /*********************************************************************//** * @brief * The getFPGAD10PumpRevolutionCountStatus function gets the current revolution of * bicarb concentrate pump (down counter). * @details \b Inputs: fpgaD10PumpStepCountStatus * @details \b Outputs: none * @return the current revolution of the bicarb concentrate pump *************************************************************************/ U16 getFPGAD10PumpRevolutionCountStatus( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD10PumpStepCountStatus ); } /*********************************************************************//** * @brief * The getFPGAD76PumpRevolutionCountStatus function gets the current revolution of * UF pump (down counter) status. * @details \b Inputs: fpgaD76PumpStepCountStatus * @details \b Outputs: none * @return the current revolution of the UF pump *************************************************************************/ U16 getFPGAD76PumpRevolutionCountStatus( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD76PumpStepCountStatus ); } /*********************************************************************//** * @brief * The checkFPGAAFEOEFailure function increments the FPGA comm failure * windowed timer if an FE or OE error has occurred and returns whether * or not the number of failures in * the window have been reached. * @details \b Inputs: none * @details \b Outputs: none * @details \b Alarm: ALARM_ID_DD_FPGA_COMM_TIMEOUT when FPGA communication is * lost with the processor. * @return TRUE if windowed count exceeded, else false. *************************************************************************/ BOOL checkFPGAFEOEFailure( void ) { BOOL status = FALSE; BOOL FPGAFEOEError = getSci2FEOEError(); if ( TRUE == FPGAFEOEError) { if ( getMSTimerCount() > MIN_POWER_ON_TIME_FOR_COMM_FAILS ) { 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)GET_FPGA_SENSOR_FIELD( fpgaIOErrorCntProcessor ) ) status = TRUE; } } } return status; } // Blood leak functions /*********************************************************************//** * @brief * The getFPGABloodLeakStatus function returns the blood leak sensor's * blood detection status bit. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return blood leak sensor self test status bit *************************************************************************/ U08 getFPGABloodLeakStatus( void ) { U08 selfTestStatus = ( ( GET_FPGA_SENSOR_FIELD( fpgaD42PulseStatus ) & FPGA_D42_BLOOD_LEAK_STATUS_MASK ) >> FPGA_D42_BLOOD_LEAK_ST_BIT_INDEX ); return selfTestStatus; } /*********************************************************************//** * @brief * The setFPGABloodLeakUARTControl function sets the blood leak sensor UART * control value. * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints * @return none *************************************************************************/ void setFPGABloodLeakUARTControl( U08 value ) { SET_FPGA_ACTUATOR_FIELD( fpgaD42UARTControl, value ); } /*********************************************************************//** * @brief * The setFPGABloodLeakUARTTransmit function sets the blood leak sensor UART * transmit value. * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints * @return none *************************************************************************/ void setFPGABloodLeakUARTTransmit( U08 value ) { SET_FPGA_ACTUATOR_FIELD( fpgaD42FIFOTx, value ); } /*********************************************************************//** * @brief * The getFPGABloodLeakTxFIFOCount function returns the blood leak transmit * FIFO count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return fpgaD42TxFIFOCnt *************************************************************************/ U08 getFPGABloodLeakTxFIFOCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD42TxFIFOCnt ); } /*********************************************************************//** * @brief * The getFPGABloodLeakRxFIFOCount function returns the blood leak receive * FIFO count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return fpgaD42RxFIFOCnt *************************************************************************/ U16 getFPGABloodLeakRxFIFOCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD42RxFIFOCnt ); } /*********************************************************************//** * @brief * The getFPGABloodLeakRxErrorCount function returns the blood leak receive * error count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return fpgaD42RxErrorCnt *************************************************************************/ U08 getFPGABloodLeakRxErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( fpgaD42RxErrorCnt ); } /*********************************************************************//** * @brief * The getFPGABloodLeakRxFIFODataOut function returns the blood leak receive * FIFO data out. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return fpgaD42RxFIFODataOut *************************************************************************/ U08 getFPGABloodLeakRxFIFODataOut( void ) { 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: fpgaDDSpareValveControl * @return none *************************************************************************/ void setFPGAD79RinsePumpControl( U08 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: fpgaD79PWMPumpCtl * @return none *************************************************************************/ void setFPGAD79RinsePumpPWMControl( U08 value ) { SET_FPGA_ACTUATOR_FIELD( fpgaD79PWMPumpCtl, value ); } /*********************************************************************//** * @brief * The getFPGAD79RinsePumpPulseWidth function returns the 4-wire rinse pump * pulse width. * @details \b Inputs: d79SpeedPulseWidth * @details \b Outputs: none * @return d79SpeedPulseWidth *************************************************************************/ U16 getFPGAD79RinsePumpPulseWidth( void ) { return GET_FPGA_SENSOR_FIELD( d79SpeedPulseWidth ); } /*********************************************************************//** * @brief * The setFPGAFPValveStates function sets the FP valve states with an 8-bit * mask of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: * 0 - P11.\n * 1 - P33.\n * 2 - P34.\n * 3 - P37.\n * 4 - P39.\n * 5 - P6.\n * 6:8 - Not used. \n * @details \b Inputs: none * @details \b Outputs: valveFPControl * @param valveStates bit mask for requested valve states * @return none *************************************************************************/ void setFPGAFPValveStates( U08 valveStates ) { SET_FPGA_ACTUATOR_FIELD( valveFPControl, valveStates ); } /*********************************************************************//** * @brief * The getFPGAFPValveStates function gets the FP valve commanded states with * 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: valveFPControlReadback * @return none *************************************************************************/ U08 getFPGAFPValveStates( void ) { return GET_FPGA_SENSOR_FIELD( valveFPControlReadback ); } /*********************************************************************//** * @brief * The setFPGAIOValveStates function sets the IO valve states with an 8-bit * mask of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: * 0 - M4_VALV.\n * 1 - M12_VALV.\n * 2:8 - Not used. \n * @details \b Inputs: none * @details \b Outputs: valveIOControl * @param valveStates bit mask for requested valve states * @return none *************************************************************************/ void setFPGAIOValveStates( U08 valveStates ) { SET_FPGA_ACTUATOR_FIELD( valveIOControl, valveStates ); } /*********************************************************************//** * @brief * The getFPGAIOValveStates function gets the IO valve commanded states with * 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: valveIOControlReadback * @return none *************************************************************************/ U08 getFPGAIOValveStates( void ) { return GET_FPGA_SENSOR_FIELD( valveIOControlReadback ); } /*********************************************************************//** * @brief * The setFPGAValveIOPWMEnable function sets the IO valve PWM states with * * 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: valveIOPWMEnable * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveIOPWMEnable( U08 valvePWMStates ) { SET_FPGA_ACTUATOR_FIELD( valveIOPWMEnable, valvePWMStates ); } /*********************************************************************//** * @brief * The getFPGAValveIOPWMEnable function gets the IO valve pwm states with * 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: valveIOPWMEnableReadback * @return none *************************************************************************/ U08 getFPGAValveIOPWMEnable( void ) { return GET_FPGA_SENSOR_FIELD( valveIOPWMEnableReadback ); } /*********************************************************************//** * @brief * The setFPGAValveFPPWMEnable function sets the FP valve PWM states with * * 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: valveFPPWMEnable * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ void setFPGAValveFPPWMEnable( U08 valvePWMStates ) { SET_FPGA_ACTUATOR_FIELD( valveFPPWMEnable, valvePWMStates ); } /*********************************************************************//** * @brief * The getFPGAValveFPPWMEnable function gets the FP valve pwm states with * 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: valveFPPWMEnableReadback * @return none *************************************************************************/ U08 getFPGAValveFPPWMEnable( void ) { 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: valveIOFPPWMPullIn * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ void setFPGAValveIOFPPWMPullIn( U16 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: valveIOFPPWMLow * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveIOFPPWMLow( U16 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: valveIOFPPWMPeriod * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ void setFPGAValveIOFPPWMPeriod( U16 valvePWMPeriod ) { SET_FPGA_ACTUATOR_FIELD( valveIOFPPWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @brief * The setFPGAP12PumpEnable function enables or disables the P12 pump. * @details \b Inputs: none * @details \b Outputs: p12PumpControl * @param enable flag indicating whether to enable or disable the P12 pump. * @return none *************************************************************************/ void setFPGAP12PumpEnable( BOOL enable ) { SET_FPGA_ACTUATOR_FIELD( p12PumpControl, ( TRUE == enable ? 0x1 : 0x0 ) ); } /*********************************************************************//** * @brief * The setFPGAP12PumpPWM function sets the P12 pump PWM duty cycle. * The higher the PWM duty cycle (0..500), the faster the pump will go. * @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: p12PumpPWMDutyCyclePct * @param pwm PWM duty cycle magnitude * @return none *************************************************************************/ void setFPGAP12PumpPWM( U16 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: roPumpPWMReadback * @details \b Outputs: none * @return measured speed (RPM) of the RO pump *************************************************************************/ U16 getFPGAP12PumpPWM( void ) { 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: p12PumpTachCount * @details \b Outputs: none * @return P12 pump tachometer count *************************************************************************/ U16 getFPGAP12PumpTachCount( void ) { return GET_FPGA_SENSOR_FIELD( p12PumpTachCount ); } /*********************************************************************//** * @brief * The setFPGAP24Enabled function sets the heater enable on or off. * @details \b Inputs: none * @details \b Outputs: p24Control * @param enable Flag indicating whether to enable or disable the P24 heater. * @return none *************************************************************************/ void setFPGAP24Enabled( BOOL enable ) { return; } /*********************************************************************//** * @brief * The setFPGAP24PWM function sets the P24 heater PWM duty cycle. * The higher the PWM duty cycle (0..500), the faster the pump will go. * @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: p24PWMDutyCyclePct * @param pwm PWM duty cycle magnitude * @return none *************************************************************************/ void setFPGAP24PWM( U16 pwm ) { return; } /*********************************************************************//** * @brief * The getFPGAP46RawPressure function gets the P46 pressure reading. * @details \b Inputs: pressureP46 * @details \b Outputs: none * @return P46 pressure *************************************************************************/ S16 getFPGAP46RawPressure( void ) { return GET_FPGA_SENSOR_FIELD( pressureP46 ); } /*********************************************************************//** * @brief * The getFPGAP46RawTemperature function gets the P46 sensor temperature reading. * @details \b Inputs: temperatureP46 * @details \b Outputs: none * @return P46 sensor temperature *************************************************************************/ S16 getFPGAP46RawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( temperatureP46 ); } /*********************************************************************//** * @brief * The getFPGAM3RawPressure function gets the M3 pressure reading. * @details \b Inputs: pressureM3 * @details \b Outputs: none * @return M3 pressure *************************************************************************/ S16 getFPGAM3RawPressure( void ) { return GET_FPGA_SENSOR_FIELD( pressureM3 ); } /*********************************************************************//** * @brief * The getFPGAM3RawTemperature function gets the M3 sensor temperature. * @details \b Inputs: temperatureM3 * @details \b Outputs: none * @return M3 sensor temperature *************************************************************************/ S16 getFPGAM3RawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( temperatureM3 ); } /*********************************************************************//** * @brief * The getFPGAP8RawPressure function gets the P8 pressure reading. * @details \b Inputs: pressureP8 * @details \b Outputs: none * @return P8 pressure *************************************************************************/ S16 getFPGAP8RawPressure( void ) { return GET_FPGA_SENSOR_FIELD( pressureP8 ); } /*********************************************************************//** * @brief * The getFPGAP8RawTemperature function gets the P8 sensor temperature. * @details \b Inputs: temperatureP8 * @details \b Outputs: none * @return P8 sensor temperature *************************************************************************/ S16 getFPGAP8RawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( temperatureP8 ); } /*********************************************************************//** * @brief * The getFPGAP13RawPressure function gets the P13 pressure reading. * @details \b Inputs: pressureP13 * @details \b Outputs: none * @return P13 pressure *************************************************************************/ S16 getFPGAP13RawPressure( void ) { return GET_FPGA_SENSOR_FIELD( pressureP13 ); } /*********************************************************************//** * @brief * The getFPGAP13RawTemperature function gets the P13 sensor temperature. * @details \b Inputs: temperatureP13 * @details \b Outputs: none * @return P13 sensor temperature *************************************************************************/ S16 getFPGAP13RawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( temperatureP13 ); } /*********************************************************************//** * @brief * The getFPGAP17RawPressure function gets the P17 pressure reading. * @details \b Inputs: pressureP17 * @details \b Outputs: none * @return P17 pressure *************************************************************************/ S16 getFPGAP17RawPressure( void ) { return GET_FPGA_SENSOR_FIELD( pressureP17 ); } /*********************************************************************//** * @brief * The getFPGAP17RawTemperature function gets the P17 sensor temperature. * @details \b Inputs: temperatureP17 * @details \b Outputs: none * @return P17 sensor temperature *************************************************************************/ S16 getFPGAP17RawTemperature( void ) { return GET_FPGA_SENSOR_FIELD( temperatureP17 ); } /*********************************************************************//** * @brief * The getFPGAP25FloaterState function gets the P25 floater level state. * @details \b Inputs: levelSwitch * @details \b Outputs: none * @return P25 floater level state *************************************************************************/ U08 getFPGAP25FloaterState( void ) { 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: flowRateP16 * @details \b Outputs: none * @return P16 flow rate (in mL/min) *************************************************************************/ U16 getFPGAFlowP16( void ) { 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: flowTempP16 * @details \b Outputs: none * @return P16 fluid temperature *************************************************************************/ U16 getFPGAFlowP16Temp( void ) { return GET_FPGA_SENSOR_FIELD( flowTempP16 ); } /*********************************************************************//** * @brief * The getFPGAFlowP16InternalTemp function gets the P16 flow sensor * internal temperature. * @details \b Inputs: flowIntTempP16 * @details \b Outputs: none * @return P16 internal temperature *************************************************************************/ U16 getFPGAFlowP16InternalTemp( void ) { return GET_FPGA_SENSOR_FIELD( flowIntTempP16 ); } /*********************************************************************//** * @brief * The getFPGAFlowP7 function gets the P7 flow rate (in mL/min). * @details \b Inputs: flowRateP7 * @details \b Outputs: none * @return P7 flow rate (in mL/min) *************************************************************************/ U16 getFPGAFlowP7( void ) { 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: flowTempP7 * @details \b Outputs: none * @return P7 fluid temperature *************************************************************************/ U16 getFPGAFlowP7Temp( void ) { return GET_FPGA_SENSOR_FIELD( flowTempP7 ); } /*********************************************************************//** * @brief * The getFPGAFlowP7InternalTemp function gets the P7 flow sensor * internal temperature. * @details \b Inputs: flowIntTempP7 * @details \b Outputs: none * @return P7 internal temperature *************************************************************************/ U16 getFPGAFlowP7InternalTemp( void ) { 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 * bit 3: Enable P9 read transaction; address needed * bit 2: Enable P9 write transaction; address and data needs to be set * bit 1: Enable P9 initialization procedure * bit 0: reset P9 sensor * @details \b Inputs: none * @details \b Outputs: conductivityP9Control * @param control bits indicating control action to take * @return none *************************************************************************/ void setFPGAP9Control( U08 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: conductivityP9Address * @param address The P9 sensor address to read from or write to * @return none *************************************************************************/ void setFPGAP9Address( U16 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: conductivityP9Data * @param data The 32-bit data to write to the P9 sensor * @return none *************************************************************************/ void setFPGAP9Data( U32 data ) { SET_FPGA_ACTUATOR_FIELD( conductivityP9Data, data ); } /*********************************************************************//** * @brief * The setFPGAP18Control function sets the FPGA P18 sensor control register * to perform a given action. * bit 4..7: unused * bit 3: Enable P18 read transaction; address needed * bit 2: Enable P18 write transaction; address and data needs to be set * bit 1: Enable P18 initialization procedure * bit 0: reset P18 sensor * @details \b Inputs: none * @details \b Outputs: conductivityP18Control * @param control bits indicating control action to take * @return none *************************************************************************/ void setFPGAP18Control( U08 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: conductivityP18Address * @param address The P18 sensor address to read from or write to * @return none *************************************************************************/ void setFPGAP18Address( U16 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: conductivityP18Data * @param data The 32-bit data to write to the P18 sensor * @return none *************************************************************************/ void setFPGAP18Data( U32 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: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9Reset( void ) { 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: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9Reset( void ) { 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: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9InitEnable( void ) { 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: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9InitEnable( void ) { 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: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9WriteEnable( void ) { 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: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9WriteEnable( void ) { 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: conductivityP9Control * @return none *************************************************************************/ void setFPGAP9ReadEnable( void ) { 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: conductivityP9Control * @return none *************************************************************************/ void clearFPGAP9ReadEnable( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18Reset( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18Reset( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18InitEnable( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18InitEnable( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18WriteEnable( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18WriteEnable( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void setFPGAP18ReadEnable( void ) { 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: conductivityP18Control * @return none *************************************************************************/ void clearFPGAP18ReadEnable( void ) { CLEAR_FPGA_ACTUATOR_BITS( conductivityP18Control, ~FPGA_CONDUCTIVITY_RD_ENABLE_BIT ); } /*********************************************************************//** * @brief * The getFPGAP9ReadCount function gets the latest P9 sensor read count. * @details \b Inputs: conductivityP9ReadCount * @details \b Outputs: none * @return Current read count for P9 sensor. *************************************************************************/ U08 getFPGAP9ReadCount( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP9ReadCount ); } /*********************************************************************//** * @brief * The getFPGAP9ErrorCount function gets the latest P9 sensor error count. * @details \b Inputs: conductivityP9ErrorCount * @details \b Outputs: none * @return Current error count for P9 sensor. *************************************************************************/ U08 getFPGAP9ErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP9ErrorCount ); } /*********************************************************************//** * @brief * The getFPGAP9Conductivity function gets the latest P9 sensor conductivity * reading. * @details \b Inputs: conductivityP9Cond * @details \b Outputs: none * @return Current conductivity reading from P9 sensor. *************************************************************************/ U16 getFPGAP9Conductivity( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP9Cond ); } /*********************************************************************//** * @brief * The getFPGAP9Temperature function gets the latest P9 sensor temperature. * @details \b Inputs: conductivityP9Temp * @details \b Outputs: none * @return Current temperature from P9 sensor. *************************************************************************/ U16 getFPGAP9Temperature( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP9Temp ); } /*********************************************************************//** * @brief * The getFPGAP9Data function gets the latest P9 sensor data from a read * action. * @details \b Inputs: conductivityP9Data * @details \b Outputs: none * @return Latest data read from P9 sensor. *************************************************************************/ U32 getFPGAP9Data( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP9Data ); } /*********************************************************************//** * @brief * The getFPGAP18ReadCount function gets the latest P18 sensor read count. * @details \b Inputs: conductivityP18ReadCount * @details \b Outputs: none * @return Current read count for P18 sensor. *************************************************************************/ U08 getFPGAP18ReadCount( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP18ReadCount ); } /*********************************************************************//** * @brief * The getFPGAP18ErrorCount function gets the latest P18 sensor error count. * @details \b Inputs: conductivityP18ErrorCount * @details \b Outputs: none * @return Current error count for P18 sensor. *************************************************************************/ U08 getFPGAP18ErrorCount( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP18ErrorCount ); } /*********************************************************************//** * @brief * The getFPGAP18Conductivity function gets the latest P18 sensor conductivity * reading. * @details \b Inputs: conductivityP18Cond * @details \b Outputs: none * @return Current conductivity reading from P18 sensor. *************************************************************************/ U16 getFPGAP18Conductivity( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP18Cond ); } /*********************************************************************//** * @brief * The getFPGAP18Temperature function gets the latest P18 sensor temperature. * @details \b Inputs: conductivityP18Temp * @details \b Outputs: none * @return Current temperature from P18 sensor. *************************************************************************/ U16 getFPGAP18Temperature( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP18Temp ); } /*********************************************************************//** * @brief * The getFPGAP18Data function gets the latest P18 sensor data from a read * action. * @details \b Inputs: conductivityP18Data * @details \b Outputs: none * @return Latest data read from P18 sensor. *************************************************************************/ U32 getFPGAP18Data( void ) { return GET_FPGA_SENSOR_FIELD( conductivityP18Data ); } /*********************************************************************//** * @brief * The setFPGAP40PumpEnable function enables or disables the P40 pump. * @details \b Inputs: none * @details \b Outputs: p40PumpControl * @param enable flag indicating whether to enable or disable the P40 pump. * @return none *************************************************************************/ void setFPGAP40PumpEnable( BOOL enable ) { SET_FPGA_ACTUATOR_FIELD( p40PumpControl, ( TRUE == enable ? 0x1 : 0x0 ) ); } /*********************************************************************//** * @brief * The setFPGAP40PumpPWM function sets the P40 pump PWM duty cycle. * The higher the PWM duty cycle (0..500), the faster the pump will go. * @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: p40PumpPWMDutyCyclePct * @param pwm PWM duty cycle magnitude * @return none *************************************************************************/ void setFPGAP40PumpPWM( U16 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: p40PumpPWMReadback * @details \b Outputs: none * @return measured speed (RPM) of the P40 pump *************************************************************************/ U16 getFPGAP40PumpPWM( void ) { 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: p40PumpTachCount * @details \b Outputs: none * @return P40 pump tachometer count *************************************************************************/ U16 getFPGAP40PumpTachCount( void ) { return GET_FPGA_SENSOR_FIELD( p40PumpTachCount ); } /**@}*/