Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r498757853c009a4e25dec98461be91fcadd8057d -rae31b4c999dccae70fb40fb9d98a4380ce2c7415 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 498757853c009a4e25dec98461be91fcadd8057d) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision ae31b4c999dccae70fb40fb9d98a4380ce2c7415) @@ -1,18 +1,18 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* 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) Vinayakam Mani -* @date (last) 05-Aug-2024 +* @author (last) Jashwant Gantyada +* @date (last) 12-Mar-2026 * * @author (original) Vinayakam Mani -* @date (original) 05-Aug-2024 +* @date (original) 26-Aug-2024 * ***************************************************************************/ @@ -25,6 +25,7 @@ #include "Comm.h" #include "Compatible.h" #include "FPGA.h" +#include "FpgaDD.h" #include "Messaging.h" #include "OperationModes.h" #include "PersistentAlarm.h" @@ -38,37 +39,59 @@ // ********** private definitions ********** -#define FPGA_EXPECTED_ID 0x02 ///< FPGA expected ID. +/// 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 0x06 ///< FPGA expected ID for Beta 2 systems. +//TODO: Remove once Beta 1.9 is obsolete +#define FPGA_BETA_1_9_EXPECTED_ID 0X08 ///< FPGA expected ID for Beta 1.9 systems. +#define FPGA_BETA_1_0_EXPECTED_ID 0x04 ///< FPGA expected ID for Beta 1.0 systems. + #define MAX_COMM_ERROR_RETRIES 5 ///< Maximum number of communication error retries -//TODO : Define the default values for the Valves ( 0: Deenergized, 1 : Energized) on power up. #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_UF_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_D27_RESET_BIT 0x10 ///< Conductivity Sensor D27 reset bit mask. -#define FPGA_D27_INIT_ENABLE_BIT 0x20 ///< Conductivity Sensor D27 Initialization enable bit mask. -#define FPGA_D27_WR_ENABLE_BIT 0x40 ///< Conductivity Sensor D27 write enable bit mask. -#define FPGA_D27_RD_ENABLE_BIT 0x80 ///< Conductivity Sensor D27 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_D29_RESET_BIT 0x01 ///< Conductivity Sensor D29 reset bit mask. -#define FPGA_D29_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor D29 Initialization enable bit mask. -#define FPGA_D29_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor D29 write enable bit mask. -#define FPGA_D29_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor D29 read enable bit mask. -#define FPGA_D43_RESET_BIT 0x10 ///< Conductivity Sensor D43 reset bit mask. -#define FPGA_D43_INIT_ENABLE_BIT 0x20 ///< Conductivity Sensor D43 Initialization enable bit mask. -#define FPGA_D43_WR_ENABLE_BIT 0x40 ///< Conductivity Sensor D43 write enable bit mask. -#define FPGA_D43_RD_ENABLE_BIT 0x80 ///< Conductivity Sensor D43 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_D74_RESET_BIT 0x01 ///< Conductivity Sensor D74 reset bit mask. -#define FPGA_D74_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor D74 Initialization enable bit mask. -#define FPGA_D74_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor D74 write enable bit mask. -#define FPGA_D74_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor D74 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. @@ -88,285 +111,524 @@ #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_THD_CONTROL_COMMAND 0X01 ///< FPGA THd control command. #define FPGA_POWER_OUT_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< FPGA power out timeout in milliseconds. -#define FPGA_GPIO_POWER_STATUS_PIN 7 ///< FPGA GPIO power status pin. -#define FPGA_READ_V3_START_BYTE_NUM 256 ///< FPGA V3 read sensors start byte number. -#define FPGA_READ_V3_END_BYTE_NUM 430 ///< FPGA V3 read sensors end byte number. #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_D6_FLOATER_LEVEL_BIT 0x03 ///< Floater level 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 -/// FPGA size of V3 read bytes. -#define FPGA_SIZE_OF_V3_READ_BYTES ( FPGA_READ_V3_END_BYTE_NUM - FPGA_READ_V3_START_BYTE_NUM ) - #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 GPIO_AC_SWITCH_MASK 0x01U ///< AC switch status bit mask. +#define FPGA_GPIO_LEAK_SENSOR_MASK 0x02U ///< GPIO_Status Bit 1 per HDD. + +#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 + +#define DIENER_1000_PUMP_SLOPE 0.000296F ///< Speed adjustment slope factor (Diener 1000 pump) +#define DIENER_1000_PUMP_INTERCEPT 0.07040F ///< Speed adjustment intercept factor (Diener 1000 pump) +#define DIENER_1000_PUMP_SPEED_FULL_SCALE 3150 ///< Maximum speed factor (Diener 1000 pump) + #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 + 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 +// TODO: Remove when Beta 1.9 is obsolete /// FPGA sensor readings struct. typedef struct { - U16 fpgaCompatibilityRev; ///< Reg 256. Compatibility revision - U16 fpgaTimerCountMS; ///< Reg 258. Internal FPGA timer count in milliseconds - U16 fpgaRemoteUpdateRead; ///< Reg 260. FPGA Remote Update Read ( copy contents from remote update write) + 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. + U32 fpgaD10PumpStepCountStatus; ///< Reg 602. Bicarb concentrate pump revolution down count status + 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 + U32 fpgaD11PumpStepCountStatus; ///< Reg 638. Acid 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 + U32 fpgaD76PumpStepCountStatus; ///< Reg 654. UF pump revolution down count status + U08 fpgaD76PumpFault; ///< Reg 658: UF pump fault + U08 fpga_UnUsed_3; ///< Reg 659: Not used - U08 fpgaIOErrorCntProcessor; ///< Reg 262. Number of errors in Microprocessor UART interface - U08 fpgaIOErrorCntPC; ///< Reg 263. Number of errors in PC UART interface + //TODO: Change the variable names to start with fpga as the prefix. + 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. - U16 fpgaD9PresPressure; ///< Reg 264. D9 MPM pressure sensor RAW pressure data - U16 fpgaD9PresTemp; ///< Reg 266. D9 MPM pressure sensor RAW temperature data - U08 fpgaD9PresReadCnt; ///< Reg 268. D9 Counter for good SPI transmission b/w FPGA and sensor - U08 fpgaD9PresErrorCnt; ///< Reg 269. D9 Counter for bad SPI transmission b/w FPGA and sensor + 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 + U32 fpgaD11PumpHallSense; ///< Reg 760. Concentrate pump D11_Pump hall sensor pulse width + U32 fpgaD10PumpHallSense; ///< Reg 764. Concentrate pump D10_Pump hall sensor pulse width + U32 fpgaD76PumpHallSense; ///< Reg 768. UF D76_Pump hall sensor pulse width + U32 fpgaTestBytes; ///< Reg 772. FPGA Test 4 bytes +} DD_FPGA_SENSORS_BETA_1_9_T; - U16 fpgaD66PresPressure; ///< Reg 270. D66 MPM pressure sensor RAW pressure data - U16 fpgaD66PresTemp; ///< Reg 272. D66 MPM pressure sensor RAW temperature data - U08 fpgaD66PresReadCnt; ///< Reg 274. D66 Counter for good SPI transmission b/w FPGA and sensor - U08 fpgaD66PresErrorCnt; ///< Reg 275. D66 Counter for bad SPI transmission b/w FPGA and sensor +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 fpgaAvailableRegister1; ///< Reg 540. Available register 1 + 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. + U32 fpgaD10PumpStepCountStatus; ///< Reg 562. Bicarb concentrate pump revolution down count status + 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 + U32 fpgaD11PumpStepCountStatus; ///< Reg 598. Acid 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 + U32 fpgaD76PumpStepCountStatus; ///< Reg 614. UF pump revolution down count status + U08 fpgaD76PumpFault; ///< Reg 618: UF pump fault + U08 fpgaHallSensorStatus; ///< Reg 619: HDF Hall sensor status - U16 fpgaD51PresPressure; ///< Reg 276. D51 MPM pressure sensor RAW pressure data - U16 fpgaD51PresTemp; ///< Reg 278. D51 MPM pressure sensor RAW temperature data - U08 fpgaD51PresReadCnt; ///< Reg 280. D51 Counter for good SPI transmission b/w FPGA and sensor - U08 fpgaD51PresErrorCnt; ///< Reg 281. D51 Counter for bad SPI transmission b/w FPGA and sensor - - U16 fpgaD18PresPressure; ///< Reg 282. D18 MPM pressure sensor RAW pressure data - U16 fpgaD18PresTemp; ///< Reg 284. D18 MPM pressure sensor RAW temperature data - U08 fpgaD18PresReadCnt; ///< Reg 286. D18 Counter for good SPI transmission b/w FPGA and sensor - U08 fpgaD18PresErrorCnt; ///< Reg 287. D18 Counter for bad SPI transmission b/w FPGA and sensor - - U16 fpgaD41PresPressure; ///< Reg 288. D41 MPM pressure sensor RAW pressure data - U16 fpgaD41PresTemp; ///< Reg 290. D41 MPM pressure sensor RAW temperature data - U08 fpgaD41PresReadCnt; ///< Reg 292. D41 Counter for good SPI transmission b/w FPGA and sensor - U08 fpgaD41PresErrorCnt; ///< Reg 293. D41 Counter for bad SPI transmission b/w FPGA and sensor - - U16 fpgaM1PresPressure; ///< Reg 294. M1 MPM pressure sensor RAW pressure data - U16 fpgaM1PresTemp; ///< Reg 296. M1 MPM pressure sensor RAW temperature data - U08 fpgaM1PresReadCnt; ///< Reg 298. M1 Counter for good SPI transmission b/w FPGA and sensor - U08 fpgaM1PresErrorCnt; ///< Reg 299. M1 Counter for bad SPI transmission b/w FPGA and sensor - - U16 fpgaM3PresPressure; ///< Reg 300. M3 MPM pressure sensor RAW pressure data - U16 fpgaM3PresTemp; ///< Reg 302. M3 MPM pressure sensor RAW temperature data - U08 fpgaM3PresReadCnt; ///< Reg 304. M3 Counter for good SPI transmission b/w FPGA and sensor - U08 fpgaM3PresErrorCnt; ///< Reg 305. M3 Counter for bad SPI transmission b/w FPGA and sensor - - U32 fpgaD17CondDataOut; ///< Reg 306. Data read from Conductivity Sensor 1 register - U16 fpgaD17CondCond; ///< Reg 310. D17 conductivity - U16 fpgaD17CondTemp; ///< Reg 312. D17 Temperature - U08 fpgaD17CondReadCnt; ///< Reg 314. D17 successful read count - U08 fpgaD17CondErrorCnt; ///< Reg 315. D17 error read count - - U32 fpgaD27CondDataOut; ///< Reg 316. Data read from Conductivity Sensor 2 register - U16 fpgaD27CondCond; ///< Reg 320. D27 conductivity - U16 fpgaD27CondTemp; ///< Reg 322. D27 Temperature - U08 fpgaD27CondReadCnt; ///< Reg 324. D27 successful read count - U08 fpgaD27CondErrorCnt; ///< Reg 325. D27 error read count - - U32 fpgaD29CondDataOut; ///< Reg 326. Data read from Conductivity Sensor 3 register - U16 fpgaD29CondCond; ///< Reg 330. D29 conductivity - U16 fpgaD29CondTemp; ///< Reg 332. D29 Temperature - U08 fpgaD29CondReadCnt; ///< Reg 334. D29 successful read count - U08 fpgaD29CondErrorCnt; ///< Reg 335. D29 error read count - - U32 fpgaD43CondDataOut; ///< Reg 336. Data read from Conductivity Sensor 4 register - U16 fpgaD43CondCond; ///< Reg 340. D43 conductivity - U16 fpgaD43CondTemp; ///< Reg 342. D43 Temperature - U08 fpgaD43CondReadCnt; ///< Reg 344. D43 successful read count - U08 fpgaD43CondErrorCnt; ///< Reg 345. D43 error read count - - U16 fpgaD63LevelSensor; ///< Reg 346. Level Sensor 1 - U16 fpgaD46LevelSensor; ///< Reg 348. Level Sensor 2 - - U08 fpgaHallSensInputs; ///< Reg 350. Hall sensor Inputs - - U08 fpgaD42TxFIFOCnt; ///< Reg 351. Blood leak sensor transmit FIFO count - U16 fpgaD42RxErrorCnt; ///< Reg 352. Blood leak sensor Receive error count - U16 fpgaD42RxFIFOCnt; ///< Reg 354. Blood leak sensor Receive FIFO count - U08 fpgaD42RxFIFODataOut; ///< Reg 356. Blood leak sensor Receive data - U08 fpgaD42PulseStatus; ///< Reg 357. Blood leak sensor status - - U16 fpgaValveStates; ///< Reg 358. Valve status read - U16 fpgaValvePWMEnableStates; ///< Reg 360. Valve PWM Enable status read - U08 fpgaValveBCStates; ///< Reg 362. Balancing chamber Valves states - U08 fpgaValveBCPWMStates; ///< Reg 363. Balancing Chamber Valve PWM states - U08 fpgaValveUFStates; ///< Reg 364. Ultrafiltration Valves states - U08 fpgaValveUFPWMStates; ///< Reg 365. Ultrafiltration Valves PWM states - U08 fpgaD11_D10_PumpFault; ///< Reg 366. Concentrate pump fault register for D11_Pump and D10_Pump - U08 fpgaRTDCountErrorCycles; ///< Reg 367. Count of each incomplete seq of reads from RTD ADC. - U16 fpgaD11PumpHallSense; ///< Reg 368. Concentrate pump D11_Pump hall sensor pulse width - U16 fpgaD10PumpHallSense; ///< Reg 370. Concentrate pump D10_Pump hall sensor pulse width - - U32 fpgaD1Temp; ///< Reg 372. Inlet heat exchanger temperature - U32 fpgaX6Temp; ///< Reg 376. Outlet heat exchanger temperature - U32 fpgaD4Temp; ///< Reg 380. Hydraulics primary heater temperature - U32 fpgaD50Temp; ///< Reg 384. Trimmer heater temperature - U08 fpgaRTDReadCnt; ///< Reg 388. Read count for all RTD sensors - - U08 fpgaBaroReadCount; ///< Reg 389. Barometric sensor read count - U16 fpgaBaroManufacInfo; ///< Reg 390. Barometric sensor manufacturing information - U16 fpgaBaroPROMCoeff1; ///< Reg 392. Barometric sensor PROM coefficient 1 - U16 fpgaBaroPROMCoeff2; ///< Reg 394. Barometric sensor PROM coefficient 2 - U16 fpgaBaroPROMCoeff3; ///< Reg 396. Barometric sensor PROM coefficient 3 - U16 fpgaBaroPROMCoeff4; ///< Reg 398. Barometric sensor PROM coefficient 4 - U16 fpgaBaroPROMCoeff5; ///< Reg 400. Barometric sensor PROM coefficient 5 - U16 fpgaBaroPROMCoeff6; ///< Reg 402. Barometric sensor PROM coefficient 6 - U16 fpgaBaroPROMCRC; ///< Reg 404. Barometric sensor PROM CRC - U32 fpgaBaroPressure; ///< Reg 406. Barometric sensor pressure value - U32 fpgaBaroTemperature; ///< Reg 410. Barometric sensor temperature sensor - - U16 fpgaD12MeasuredSpeed; ///< Reg 414. Fresh dialysate pump measured speed - U16 fpgaD48MeasuredSpeed; ///< Reg 416. Spent dialysate pump measured speed - U08 fpgaBaroErrorCount; ///< Reg 418. Barometric sensor Error count - U08 fpgaD12D48PumpStatus; ///< Reg 419. Dialysate pumps Error status - U16 fpgaD12CurrentFeedback; ///< Reg 420. Fresh dialysate pump current feedback - U16 fpgaD48CurrentFeedback; ///< Reg 422. Spent dialysate pump current feedback - U08 fpgaD12HallStatus; ///< Reg 424. Fresh dialysate pump hall sensor direction status - U08 fpgaD48HallStatus; ///< Reg 425. Spent dialysate pump hall sensor direction status - U08 fpgaD6FloaterStatus; ///< Reg 426. Floater 1 level sensor status - U08 fpgaFloater2Status; ///< Reg 427. Floater 2 level sensor status - U16 fpgaD11PumpStepCountStatus; ///< Reg 428. Acid concentrate pump revolution down count status - U16 fpgaD10PumpStepCountStatus; ///< Reg 430. Bicarb concentrate pump revolution down count status - - U16 fpgaAdcTemp; ///< Reg 432. TBD - U16 fpgaAdcVccInt; ///< Reg 434. TBD - U16 fpgaAdcVccAux; ///< Reg 436. TBD - U16 fpgaAdcVpVn; ///< Reg 438. TBD - U16 fpgaD12PumpSpeedFeedback; ///< Reg 440. D12 Pump speed feedback - U16 fpgaD48PumpSpeedFeedback; ///< Reg 442. D48 Pump Speed feedback - U16 fpgaD76PumpHallSense; ///< Reg 444. UF D76_Pump hall sensor pulse width - U16 fpgaD76PumpStepCountStatus; ///< Reg 446. UF pump revolution down count status - U08 fpgaD76PumpFault; ///< Reg 448: UF pump fault - - U32 fpgaD74CondDataOut; ///< Reg 449. Data read from Conductivity Sensor D74 register - U16 fpgaD74CondCond; ///< Reg 453. D74 conductivity - U16 fpgaD74CondTemp; ///< Reg 455. D74 Temperature - U08 fpgaD74CondReadCnt; ///< Reg 457. D74 successful read count - U08 fpgaD74CondErrorCnt; ///< Reg 458. D74 error read count + 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 fpgaD17DataCal; ///< Reg 702. D17 CAL word update + F32 fpgaD17CondResistance; ///< Reg 706. D17 conductivity resistance + F32 fpgaD17TempResistance; ///< Reg 710. D17 Temperature resistance + 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. D17 CAL counter + U08 fpgaD74CalMemCounter; ///< Reg 719. D74 CAL counter + U32 fpgaD74DataCal; ///< Reg 720. D74 CAL word update + F32 fpgaD74CondResistance; ///< Reg 724. D74 conductivity resistance + F32 fpgaD74TempResistance; ///< Reg 728. D74 Temperature resistance + U08 fpgaD74CondReadCnt; ///< Reg 732. D74 successful read count + U08 fpgaD74CondErrorCnt; ///< Reg 733. D74 error read count + U08 fpgaD74TempReadCount; ///< Reg 734. D74 temperature successful read count + U08 fpgaD74TempErrorCount; ///< Reg 735. D74 Temperature error read count + U32 fpgaD27DataCal; ///< Reg 736. D27 CAL word update + F32 fpgaD27CondResistance; ///< Reg 740. D27 conductivity resistance + F32 fpgaD27TempResistance; ///< Reg 744. D27 Temperature reistance + U08 fpgaD27CondReadCnt; ///< Reg 748. D27 successful read count + U08 fpgaD27CondErrorCnt; ///< Reg 749. D27 error read count + U08 fpgaD27TempReadCount; ///< Reg 750. D27 temperature successful read count + U08 fpgaD27TempErrorCount; ///< Reg 751. D27 Temperature error read count + U08 fpgaD27CalMemCounter; ///< Reg 752. D27 CAL counter + U08 fpgaD29CalMemCounter; ///< Reg 753. D29 CAL counter + U32 fpgaD29DataCal; ///< Reg 754. D29 CAL word update + F32 fpgaD29CondResistance; ///< Reg 758. D29 conductivity resistance + F32 fpgaD29TempResistance; ///< Reg 762. D29 Temperature resistance + U08 fpgaD29CondReadCnt; ///< Reg 766. D29 successful read count + U08 fpgaD29CondErrorCnt; ///< Reg 767. D29 error read count + U08 fpgaD29TempReadCount; ///< Reg 768. D29 temperature successful read count + U08 fpgaD29TempErrorCount; ///< Reg 769. D29 Temperature error read count + U32 fpgaD43DataCal; ///< Reg 770. D43 CAL word update + F32 fpgaD43CondResistance; ///< Reg 774. D43 conductivity resistance + F32 fpgaD43TempResistance; ///< Reg 778. D43 Temperature resistance + U08 fpgaD43CondReadCnt; ///< Reg 782. D43 successful read count + U08 fpgaD43CondErrorCnt; ///< Reg 783. D43 error read count + U08 fpgaD43TempReadCount; ///< Reg 784. D43 temperature successful read count + U08 fpgaD43TempErrorCount; ///< Reg 785. D43 Temperature error read count + U08 fpgaD43CalMemCounter; ///< Reg 786. D43 CAL counter + U08 fpgaP9CalMemCounter; ///< Reg 787. P9 CAL counter + U32 fpgaP9CalData; ///< Reg 788. P9 CAL word update + F32 fpgaP9CondResistance; ///< Reg 792. P9 Conductivity resistance + F32 fpgaP9TempResistance; ///< Reg 796. P9 Temperature resistance + U08 fpgaP9CondReadCount; ///< Reg 800. P9 successful read count + U08 fpgaP9CondErrorCount; ///< Reg 801. P9 error read count + U08 fpgaP9TempReadCount; ///< Reg 802. P9 temperature successful read count + U08 fpgaP9TempErrorCount; ///< Reg 803. P9 Temperature error read count + U32 fpgaP18CalData; ///< Reg 804. P18 CAL word update + F32 fpgaP18CondResistance; ///< Reg 808. P18 Conductivity resistance + F32 fpgaP18TempReistance; ///< Reg 812. P18 Temperature resistance + U08 fpgaP18CondReadCount; ///< Reg 816. P18 successful read count + U08 fpgaP18CondErrorCount; ///< Reg 817. P18 error read count + U08 fpgaP18TempReadCount; ///< Reg 818. P18 temperature successful read count + U08 fpgaP18TempErrorCount; ///< Reg 819. P18 Temperature error read count + U08 fpgaP18CalMemCounter; ///< Reg 820. P18 CAL counter } DD_FPGA_SENSORS_T; +// TODO: Remove when Beta 1.9 is obsolete typedef struct { - U16 fpgaValveControl; ///< Reg 04. Valve control register - U16 fpgaValvePWMEnable; ///< Reg 06. Valve PWM enable + 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 + U32 fpgaD10PumpRevCount; ///< Reg 40. Bicarb Concentrate pump revolution count + U08 fpgaD11PumpControl; ///< Reg 44. Acid Concentrate Pump Control + U08 fpgaD10PumpControl; ///< Reg 45. BiCarb Concentrate Pump 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 + U32 fpgaD11PumpRevCount; ///< Reg 64. Acid 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. + U32 fpgaD76PumpRevCount; ///< Reg 74. UF pump revolution count + U08 fpgaD76PumpControl; ///< Reg 78. UF Pump Control - U16 fpgaD53ValvePWMLow; ///< Reg 08. D53 PWM low. (VDR) - U16 fpgaD53ValvePWMPeriod; ///< Reg 10. D53 PWM period (VDR) - U16 fpgaD53ValvePWMPullin; ///< Reg 12. D53 PWM pull in (VDR) - U16 fpgaD52ValvePWMLow; ///< Reg 14. D52 PWM low (VTD) - U16 fpgaD52ValvePWMPeriod; ///< Reg 16. D52 PWM period (VTD) - U16 fpgaD52ValvePWMPullin; ///< Reg 18. D52 PWM pull in (VTD) - U16 fpgaD8ValvePWMLow; ///< Reg 20. D8 PWM low (VHB) - U16 fpgaD8ValvePWMPeriod; ///< Reg 22. D8 PWM period (VHB) - U16 fpgaD8ValvePWMPullin; ///< Reg 24. D8 PWM pull in (VHB) - U16 fpgaD54ValvePWMLow; ///< Reg 26. D54 PWM low (VRP) - U16 fpgaD54ValvePWMPeriod; ///< Reg 28. D54 PWM period (VRP) - U16 fpgaD54ValvePWMPullin; ///< Reg 30. D54 PWM pull in (VRP) + 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. - U16 fpgaD14ValvePWMLow; ///< Reg 32. D14 PWM low (VHo) - U16 fpgaD14ValvePWMPeriod; ///< Reg 34. D14 PWM period (VHo) - U16 fpgaD14ValvePWMPullin; ///< Reg 36. D14 PWM pull in (VHo) - U16 fpgaD65ValvePWMLow; ///< Reg 38. D65 PWM low - U16 fpgaD65ValvePWMPeriod; ///< Reg 40. D65 PWM period - U16 fpgaD65ValvePWMPullin; ///< Reg 42. D65 PWM pull in - U16 fpgaD64ValvePWMLow; ///< Reg 44. D64 PWM low ( VP1 : Bicarb purge) - U16 fpgaD64ValvePWMPeriod; ///< Reg 46. D64 PWM period - U16 fpgaD64ValvePWMPullin; ///< Reg 48. D64 PWM pull in - U16 fpgaD31ValvePWMLow; ///< Reg 50. D31 PWM Low (Pressure test) - U16 fpgaD31ValvePWMPeriod; ///< Reg 52. D31 PWM period - U16 fpgaD31ValvePWMPullin; ///< Reg 54. D31 PWM pull in + 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 unusedRegister3; ///< Reg 125. Unused register 3 + U32 fpgaD11PumpSpeed; ///< Reg 126. Acid Concentrate Pump Speed/RPM Control + U32 fpgaD10PumpSpeed; ///< Reg 130. BiCarb Concentrate Pump Speed/RPM Control + U32 fpgaD76PumpSpeed; ///< Reg 134. UF Pump Speed/RPM Control +} FPGA_ACTUATORS_BETA_1_9_T; - U16 fpgaD34ValvePWMLow; ///< Reg 56. D34 PWM low - U16 fpgaD34ValvePWMPeriod; ///< Reg 58. D34 PWM period - U16 fpgaD34ValvePWMPullin; ///< Reg 60. D34 PWM pull in - U16 fpgaD35ValvePWMLow; ///< Reg 62. D35 PWM low - U16 fpgaD35ValvePWMPeriod; ///< Reg 64. D35 PWM period - U16 fpgaD35ValvePWMPullin; ///< Reg 66. D35 PWM pull in - U16 fpgaD40ValvePWMLow; ///< Reg 68. D40 PWM low - U16 fpgaD40ValvePWMPeriod; ///< Reg 70. D40 PWM period - U16 fpgaD40ValvePWMPullin; ///< Reg 72. D40 PWM pull in - U16 fpgaD47ValvePWMLow; ///< Reg 74. D47 PWM low - U16 fpgaD47ValvePWMPeriod; ///< Reg 76. D47 PWM period - U16 fpgaD47ValvePWMPullin; ///< Reg 78. D47 PWM pull in - U16 fpgaD3ValvePWMLow; ///< Reg 80. D3 PWM low - U16 fpgaD3ValvePWMPeriod; ///< Reg 82. D3 PWM period - U16 fpgaD3ValvePWMPullin; ///< Reg 84. D3 PWM pull in - U16 fpgaM4ValvePWMLow; ///< Reg 86. M4 PWM low - U16 fpgaM4ValvePWMPeriod; ///< Reg 88. M4 PWM period - U16 fpgaM4ValvePWMPullin; ///< Reg 90. M4 PWM pull in +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 + U32 fpgaD10PumpRevCount; ///< Reg 40. Bicarb Concentrate pump revolution count + U08 fpgaD11PumpControl; ///< Reg 44. Acid Concentrate Pump Control + U08 fpgaD10PumpControl; ///< Reg 45. BiCarb Concentrate Pump 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 + U32 fpgaD11PumpRevCount; ///< Reg 64. Acid 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. + U32 fpgaD76PumpRevCount; ///< Reg 74. UF pump revolution count + U08 fpgaD76PumpControl; ///< Reg 78. UF Pump Control - U08 fpgaBCValveControl; ///< Reg 92. Balancing Chamber Valves Control Registers - U08 fpgaBCValvePWMControl; ///< Reg 93. Balancing Chamber Valves PWM control - U08 fpgaUFValveControl; ///< Reg 94. Ultra filtration Valves Control Registers - U08 fpgaUFValvePWMControl; ///< Reg 95. Ultra filtration Valves PWM 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 fpgaConSensTD12Control; ///< Reg 96. Conductivity/Temperature Sensors 1 & 2 Control registers - U08 fpgaConSensTD34Control; ///< Reg 97. Conductivity/Temperature Sensors 3 & 4 Control registers - U16 fpgaConSensTD12_Addrs; ///< Reg 98. CDTD 1&2 Initialization Address register - U32 fpgaConSensTD12_Data_In; ///< Reg 100. CDTD 1&2 Initialization data register - U16 fpgaConSensTD34_Addrs; ///< Reg 104. CDTD 3&4 Initialization Address register - U32 fpgaConSensTD34_Data_In; ///< Reg 106. CDTD 3&4 Initialization data register - - U16 fpgaRemoteUpdate_Write; ///< Reg 110.Register for Remote update used by SW. - - U16 fpgaD12PumpSpeed; ///< Reg 112. D48 Speed/RPM Control - U08 fpgaD12PumpControl; ///< Reg 114. DGP Control - U08 fpgaD48PumpControl; ///< Reg 115. SDP Control - U16 fpgaD48PumpSpeed; ///< Reg 116. SDP Speed/RPM Control - U16 fpgaD11PumpSpeed; ///< Reg 118. Acid Concentrate Pump Speed/RPM Control - U08 fpgaD11PumpControl; ///< Reg 120. Acid Concentrate Pump Control - U08 fpgaD10PumpControl; ///< Reg 121. BiCarb Concentrate Pump Control - U16 fpgaD10PumpSpeed; ///< Reg 122. BiCarb Concentrate Pump Speed/RPM Control - - U08 fpgaD42SensorTest; ///< Reg 124. Blood leak sensor test - U08 fpgaD42UARTControl; ///< Reg 125. Blood leak sensor UART control - U08 fpgaD42FIFOTx; ///< Reg 126. Blood leak sensor FIFO transmit control - U08 fpgaD5HeaterPWMControl; ///< Reg 127. Primary heater PWM control - U08 fpgaD45HeaterPWMControl; ///< Reg 128. Trimmer heater PWM control - U08 fpgaNotUsed; ///< Reg 129. Not used - - U16 fpgaVBCPWMLow; ///< Reg 130. VBC PWM low ( Balancing chamber valves) - U16 fpgaVBCPWMPeriod; ///< Reg 132. VBC PWM period - U16 fpgaVBCPWMPullin; ///< Reg 134. VBC PWM pull in - U16 fpgaVUFPWMLow; ///< Reg 136. VUF PWM low ( Ultra filteration valves ) - U16 fpgaVUFPWMPeriod; ///< Reg 138. VUF PWM period - U16 fpgaVUFPWMPullin; ///< Reg 140. VUF PWM pull in - U16 fpgaD11PumpRevCount; ///< Reg 142. Acid Concentrate pump revolution count - U16 fpgaD10PumpRevCount; ///< Reg 144. Bicarb Concentrate pump revolution count - U08 fpgaADCControl; ///< Reg 146. FPGA internal ADC Control register for debugging - U08 fpgaGPIOControl; ///< Reg 147. FPGA GPIO control interface - U16 fpgaACRelayPWMLow; ///< Reg 148. Length of time in 10us resoultion that PWM output stays low. - U16 fpgaACRelayPWMPeriod; ///< Reg 150. PWM period for AC relay/heater. - - U16 fpgaD76PumpSpeed; ///< Reg 152. UF Pump Speed/RPM Control - U16 fpgaD76PumpRevCount; ///< Reg 154. UF pump revolution count - U08 fpgaD76PumpControl; ///< Reg 156. UF Pump Control - U08 fpgaConSensD74Control; ///< Reg 157. Conductivity/Temperature Sensors D74 Control registers - U16 fpgaConSensD74_Addrs; ///< Reg 158. D74 Initialization Address register - U32 fpgaConSensD74_Data_In; ///< Reg 160. D74 Initialization data 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 unusedRegister3; ///< Reg 125. Unused register 3 + U32 fpgaD11PumpSpeed; ///< Reg 126. Acid Concentrate Pump Speed/RPM Control + U32 fpgaD10PumpSpeed; ///< Reg 130. BiCarb Concentrate Pump Speed/RPM Control + U32 fpgaD76PumpSpeed; ///< Reg 134. UF Pump Speed/RPM Control } FPGA_ACTUATORS_T; #pragma pack(pop) // ********** private data ********** -static FPGA_HEADER_T fpgaHeader; ///< FPGA header structure. -static DD_FPGA_SENSORS_T fpgaSensorReadings; ///< DD FPGA sensors structure. -static FPGA_ACTUATORS_T fpgaActuatorSetPoints; ///< FPGA actuator set points structure. +static FPGA_HEADER_T fpgaHeader; ///< FPGA header structure. +static DD_FPGA_SENSORS_BETA_1_9_T fpgaBeta19SensorReadings; ///< DD FPGA sensors structure. +static FPGA_ACTUATORS_BETA_1_9_T fpgaBeta19ActuatorSetPoints; ///< FPGA actuator set points structure. +static DD_FPGA_SENSORS_T fpgaSensorReadings; ///< DD FPGA sensors structure for beta 2. +static FPGA_ACTUATORS_T fpgaActuatorSetPoints; ///< FPGA actuator set points structure for beta 2. // ********** private function prototypes ********** @@ -382,32 +644,67 @@ void initFPGADD( void ) { // Initialize fpga driver - initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, - sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_T), sizeof(FPGA_ACTUATORS_T) ); + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaBeta19SensorReadings, (U08*)&fpgaBeta19ActuatorSetPoints, + sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_BETA_1_9_T), sizeof(FPGA_ACTUATORS_BETA_1_9_T) ); // initialize fpga data structures memset( &fpgaHeader, 0, sizeof( FPGA_HEADER_T ) ); + memset( &fpgaBeta19SensorReadings, 0, sizeof( DD_FPGA_SENSORS_BETA_1_9_T ) ); + memset( &fpgaBeta19ActuatorSetPoints, 0, sizeof( FPGA_ACTUATORS_BETA_1_9_T ) ); + + // initialize FPGA data structure for beta 2 HW memset( &fpgaSensorReadings, 0, sizeof( DD_FPGA_SENSORS_T ) ); memset( &fpgaActuatorSetPoints, 0, sizeof( FPGA_ACTUATORS_T ) ); - // Set the THd control register to 0x1 to make sure its ADC is running - //fpgaActuatorSetPoints.fpgaTHdControlReg = FPGA_THD_CONTROL_COMMAND; - // 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.fpgaUFValveControl = FPGA_ENABLE_UF_VALVES_CONTROL; - fpgaActuatorSetPoints.fpgaUFValvePWMControl = FPGA_ENABLE_UF_VALVES_PWM; - fpgaActuatorSetPoints.fpgaADCControl = FPGA_ADC_AUTO_READ_ENABLE; + 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; + // TODO: 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; + // 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 @@ -420,17 +717,19 @@ SELF_TEST_STATUS_T result; // check FPGA reported correct ID - if ( FPGA_EXPECTED_ID == fpgaHeader.fpgaId ) + // TODO: Remove beta 1.9 expected ID once Beta 1.9 is obsolete + if ( ( FPGA_EXPECTED_ID == fpgaHeader.fpgaId ) || ( FPGA_BETA_1_9_EXPECTED_ID == fpgaHeader.fpgaId ) || + ( FPGA_BETA_1_0_EXPECTED_ID == fpgaHeader.fpgaId ) ) { // Check FPGA compatibility w/ firmware - if ( DD_FPGA_COMPATIBILITY_REV == fpgaSensorReadings.fpgaCompatibilityRev ) + if ( DD_FPGA_COMPATIBILITY_REV == GET_FPGA_SENSOR_FIELD( fpgaCompatibilityRev ) ) { result = SELF_TEST_STATUS_PASSED; } else { result = SELF_TEST_STATUS_FAILED; - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_POST_TEST_FAILED, (U32)DD_FPGA_COMPATIBILITY_REV, (U32)fpgaSensorReadings.fpgaCompatibilityRev ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_POST_TEST_FAILED, (U32)DD_FPGA_COMPATIBILITY_REV, (U32)GET_FPGA_SENSOR_FIELD( fpgaCompatibilityRev ) ) } } else @@ -482,32 +781,33 @@ /*********************************************************************//** * @brief - * The setFPGAValveStates function sets the DD valve states with a 16-bit + * 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 + * 0 - D14Valve.\n * 1 - D52Valve.\n * 2 - D8Valve.\n * 3 - D54Valve.\n - * 4 - D14Valve.\n - * 5 - D65Valve.\n + * 4 - Unused.\n + * 5 - D34Valve.\n * 6 - D64Valve.\n * 7 - D31Valve.\n - * 8 - D34Valve.\n + * 8 - D65Valve.\n * 9 - D35Valve.\n * 10 - D40Valve.\n * 11 - D47Valve.\n * 12 - D3Valve.\n - * 13 - M4Valve.\n - * 14..15 - reserved or unused. + * 13 - D80Valve.\n + * 14 - D81Valve.\n + * 15 - D85Valve.\n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaValveControl + * @details \b Outputs: fpgaValveControl * @param valveStates bit mask for the various valve states * @return none *************************************************************************/ -void setFPGAValveStates( U16 valveStates ) +void setFPGADDValveStates( U16 valveStates ) { - fpgaActuatorSetPoints.fpgaValveControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( fpgaValveControl, valveStates ); } /*********************************************************************//** @@ -524,998 +824,486 @@ * 6 - D26.\n * 7 - D22.\n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaBCValveControl + * @details \b Outputs: fpgaBCValveControl * @param valveStates bit mask for the balancing chamber valve states * @return none *************************************************************************/ void setFPGABCValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.fpgaBCValveControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( fpgaBCValveControl, valveStates ); } /*********************************************************************//** * @brief - * The setFPGAUFValveStates function sets the DD ultrafiltration valve states with a + * 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 - UFi1.\n - * 1 - UFi2.\n - * 2 - UFo1.\n - * 3 - UFo2.\n - * 4..7 - Unused or reserved.\n + * meaning "de-energized". Bit positions per HDD (2.0 valves - beta 1/1.9 to be deprecated): + * 0 - D88 valve.\n + * 1 - D83 valve.\n + * 2 - D91 valve.\n + * 3 - D104 valve.\n + * 4 - D95 valve.\n + * 5 - Spare valve 5.\n + * 6 - D100 valve.\n + * 7 - Spare valve 7.\n * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaUFValveControl - * @param valveStates bit mask for the balancing chamber valve states + * @details \b Outputs: fpgaDDSpareValveControl + * @param valveStates bit mask for the spare valve states * @return none *************************************************************************/ -void setFPGAUFValveStates( U08 valveStates ) +void setFPGASpareValveStates( U08 valveStates ) { - fpgaActuatorSetPoints.fpgaUFValveControl = valveStates; + SET_FPGA_ACTUATOR_FIELD( fpgaDDSpareValveControl, valveStates ); } /*********************************************************************//** * @brief - * The setFPGAD48PumpSpeed function sets the speed for the - * spent dialysate pump (SDP). + * 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: fpgaActuatorSetPoints.fpgaD48PumpSpeed - * @param speed The spent dialysate pump speed + * @details \b Outputs: fpgaValvePWMEnable + * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ -void setFPGAD48PumpSpeed( U16 speed ) +void setFPGAValveDDPWMEnable( U16 valvePWMStates ) { - fpgaActuatorSetPoints.fpgaD48PumpSpeed = speed; + SET_FPGA_ACTUATOR_FIELD( fpgaValvePWMEnable, valvePWMStates ); } /*********************************************************************//** * @brief - * The setFPGAD12PumpSpeed function sets the speed for the - * fresh dialysate pump (DGP). + * 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: fpgaActuatorSetPoints.fpgaD12PumpSpeed - * @param speed The fresh dialysate pump speed + * @details \b Outputs: fpgaValvePWMEnableStates * @return none *************************************************************************/ -void setFPGAD12PumpSpeed( U16 speed ) +U16 getFPGAValveDDPWMEnable( void ) { - fpgaActuatorSetPoints.fpgaD12PumpSpeed = speed; + return GET_FPGA_SENSOR_FIELD( fpgaValvePWMEnableStates ); } /*********************************************************************//** * @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) + * The setFPGAValveDDPWMPullIn function sets the DD valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpControl - * @param control The dialysate out pump controls + * @details \b Outputs: fpgaDDValvePWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ -void setFPGAD48PumpControl( U08 control ) +void setFPGAValveDDPWMPullIn( U16 valvePWMPullIn ) { - fpgaActuatorSetPoints.fpgaD48PumpControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaDDValvePWMPullin, valvePWMPullIn ); } /*********************************************************************//** * @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) + * The setFPGAValveDDPWMLow function sets the DD valves "low" + * period where PWM is at 0% in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpControl - * @param control The dialysate In pump controls + * @details \b Outputs: fpgaDDValvePWMLow + * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ -void setFPGAD12PumpControl( U08 control ) +void setFPGAValveDDPWMLow( U16 valvePWMLow ) { - fpgaActuatorSetPoints.fpgaD12PumpControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaDDValvePWMLow, valvePWMLow ); } /*********************************************************************//** * @brief - * The setFPGAD11PumpSetStepSpeed function sets the step speed period for - * concentrate pump D11_Pump. + * The setFPGAValveDDPWMPeriod function sets the DD valves pwm + * period in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpSpeed - * @param stepSpeed The concentrate pump step speed period + * @details \b Outputs: fpgaDDValvePWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ -void setFPGAD11PumpSetStepSpeed( U16 stepSpeed ) +void setFPGAValveDDPWMPeriod( U16 valvePWMPeriod ) { - fpgaActuatorSetPoints.fpgaD11PumpSpeed = stepSpeed; + SET_FPGA_ACTUATOR_FIELD( fpgaDDValvePWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @brief - * The setFPGAD10PumpSetStepSpeed function sets the step speed period for - * concentrate pump D10_Pump. + * 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: fpgaActuatorSetPoints.fpgaD10PumpSpeed - * @param stepSpeed The concentrate pump step speed period + * @details \b Outputs: fpgaBCValvePWMControl + * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ -void setFPGAD10PumpSetStepSpeed( U16 stepSpeed ) +void setFPGAValveBCPWMEnable( U08 valvePWMStates ) { - fpgaActuatorSetPoints.fpgaD10PumpSpeed = stepSpeed; + SET_FPGA_ACTUATOR_FIELD( fpgaBCValvePWMControl, valvePWMStates ); } /*********************************************************************//** * @brief - * The setFPGAD76PumpSetStepSpeed function sets the step speed period for - * UF D76_Pump. + * 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: fpgaActuatorSetPoints.fpgaD76PumpSpeed - * @param stepSpeed The concentrate pump step speed period + * @details \b Outputs: fpgaValveBCPWMStates * @return none *************************************************************************/ -void setFPGAD76PumpSetStepSpeed( U16 stepSpeed ) +U08 getFPGAValveBCPWMEnable( void ) { - fpgaActuatorSetPoints.fpgaD76PumpSpeed = stepSpeed; + return GET_FPGA_SENSOR_FIELD( fpgaValveBCPWMStates ); } /*********************************************************************//** * @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 + * The setFPGAValveBCPWMPullIn function sets the BC valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl - * @param control Concentrate pump control set + * @details \b Outputs: fpgaVBCPWMPullin + * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ -void setFPGAD11PumpControl( U08 control ) +void setFPGAValveBCPWMPullIn( U16 valvePWMPullIn ) { - fpgaActuatorSetPoints.fpgaD11PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaD11PumpControl |= control; + SET_FPGA_ACTUATOR_FIELD( fpgaVBCPWMPullIn, valvePWMPullIn ); } /*********************************************************************//** * @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 + * The setFPGAValveBCPWMLow function sets the BC valves "low" + * period where PWM is at 0% in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl - * @param control Concentrate pump control set + * @details \b Outputs: fpgaVBCPWMLow + * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ -void setFPGAD10PumpControl( U08 control ) +void setFPGAValveBCPWMLow( U16 valvePWMLow ) { - fpgaActuatorSetPoints.fpgaD10PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaD10PumpControl |= control; + SET_FPGA_ACTUATOR_FIELD( fpgaVBCPWMLow, valvePWMLow ); } /*********************************************************************//** * @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 + * The setFPGAValveBCPWMPeriod function sets the BC valves pwm + * period in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl - * @param control UF pump control set + * @details \b Outputs: fpgaVBCPWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ -void setFPGAD76PumpControl( U08 control ) +void setFPGAValveBCPWMPeriod( U16 valvePWMPeriod ) { - fpgaActuatorSetPoints.fpgaD76PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaD76PumpControl |= control; + SET_FPGA_ACTUATOR_FIELD( fpgaVBCPWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @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) + * 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: fpgaActuatorSetPoints.fpgaD11PumpControl - * @param Park command bit set + * @details \b Outputs: fpgaDDSpareValvePWMControl + * @param valvePWMStates bit mask for requested valve states. * @return none *************************************************************************/ -void setFPGAD11PumpParkCmd( void ) +void setFPGAValveSPPWMEnable( U08 valvePWMStates ) { - fpgaActuatorSetPoints.fpgaD11PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + SET_FPGA_ACTUATOR_FIELD( fpgaDDSpareValvePWMControl, valvePWMStates ); } /*********************************************************************//** * @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) + * 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: fpgaActuatorSetPoints.fpgaD10PumpControl - * @param Park command bit set + * @details \b Outputs: fpgaValveSpPWMStates * @return none *************************************************************************/ -void setFPGAD10PumpParkCmd( void ) +U08 getFPGAValveSPPWMEnable( void ) { - fpgaActuatorSetPoints.fpgaD10PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + return GET_FPGA_SENSOR_FIELD( fpgaValveSpPWMStates ); } /*********************************************************************//** * @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) + * The setFPGAValveSPPWMPullIn function sets the Spare valves Pull-in "strike" + * period where PWM is at 100% in 1ms resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl - * @param Park command bit set + * @details \b Outputs: fpgaVSPPWMPullIn + * @param valvePWMPullIn Pull-in period in 1ms resolution. * @return none *************************************************************************/ -void setFPGAD76PumpParkCmd( void ) +void setFPGAValveSPPWMPullIn( U16 valvePWMPullIn ) { - fpgaActuatorSetPoints.fpgaD76PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + SET_FPGA_ACTUATOR_FIELD( fpgaVSPPWMPullIn, valvePWMPullIn ); } /*********************************************************************//** * @brief - * The setFPGAD17CondReset function resets the FPGA Conductivity - * Sensor D17. + * The setFPGAValveSPPWMLow function sets the Spare valves "low" + * period where PWM is at 0% in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaVSPPWMLow + * @param valvePWMLow low period in 0.1us resolution. * @return none *************************************************************************/ -void setFPGAD17CondReset( void ) +void setFPGAValveSPPWMLow( U16 valvePWMLow ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_RESET_BIT; + SET_FPGA_ACTUATOR_FIELD( fpgaVSPPWMLow, valvePWMLow ); } /*********************************************************************//** * @brief - * The clearFPGAD17CondReset function clears the reset of FPGA Conductivity - * Sensor D17. + * The setFPGAValveSPPWMPeriod function sets the Spare valves pwm + * period in 0.1us resolution. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaVSPPWMPeriod + * @param valvePWMPeriod period in 0.1us resolution. * @return none *************************************************************************/ -void clearFPGAD17CondReset( void ) +void setFPGAValveSPPWMPeriod( U16 valvePWMPeriod ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_RESET_BIT; + SET_FPGA_ACTUATOR_FIELD( fpgaVSPPWMPeriod, valvePWMPeriod ); } /*********************************************************************//** * @brief - * The setFPGAD17CondInitEnable function enables the FPGA Conductivity - * Sensor D17 initialzation procedure. + * The setFPGAD48PumpSpeed function sets the speed for the + * spent dialysate pump (SDP). * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD48PumpSpeed + * @param speed The spent dialysate pump speed * @return none *************************************************************************/ -void setFPGAD17CondInitEnable( void ) +void setFPGAD48PumpSpeed( U16 speed ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_INIT_ENABLE_BIT; + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DIENER_2000_PUMP )) + { + U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); + SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpSpeed, currentSpeed ); + } + else + { + U16 currentSpeed = (U16)( ( ( DIENER_1000_PUMP_SLOPE * speed ) + DIENER_1000_PUMP_INTERCEPT) * DIENER_1000_PUMP_SPEED_FULL_SCALE ); + SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpSpeed, currentSpeed ); + } } /*********************************************************************//** * @brief - * The clearFPGAD17CondInitEnable function clears the init process of FPGA Conductivity - * Sensor D17. + * The setFPGAD12PumpSpeed function sets the speed for the + * fresh dialysate pump (DGP). * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD12PumpSpeed + * @param speed The fresh dialysate pump speed * @return none *************************************************************************/ -void clearFPGAD17CondInitEnable( void ) +void setFPGAD12PumpSpeed( U16 speed ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_INIT_ENABLE_BIT; + U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); + SET_FPGA_ACTUATOR_FIELD( fpgaD12PumpSpeed, currentSpeed ); } /*********************************************************************//** * @brief - * The setFPGAD17CondWriteEnable function enables the FPGA Conductivity - * Sensor D17 write transaction. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @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. + * @details \b Outputs: fpgaD48PumpControl + * @param control The dialysate out pump controls * @return none *************************************************************************/ -void setFPGAD17CondWriteEnable( void ) +void setFPGAD48PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_FIELD( fpgaD48PumpControl, control ); } /*********************************************************************//** * @brief - * The clearFPGAD17CondWriteEnable function clears the write enable of FPGA Conductivity - * Sensor D17. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD12PumpControl + * @param control The dialysate In pump controls * @return none *************************************************************************/ -void clearFPGAD17CondWriteEnable( void ) +void setFPGAD12PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_WR_ENABLE_BIT; + SET_FPGA_ACTUATOR_FIELD( fpgaD12PumpControl, control ); } /*********************************************************************//** * @brief - * The setFPGAD17CondReadEnable function enables the FPGA Conductivity - * Sensor D17 read transaction. + * The setFPGAD11PumpSetStepSpeed function sets the step speed period for + * concentrate pump D11_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none - * @warning: The address (setFPGACD12Address) register must be populated - * before invoking this read enable function to initiate read transaction - * with the sensor. + * @details \b Outputs: fpgaD11PumpSpeed + * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ -void setFPGAD17CondReadEnable( void ) +void setFPGAD11PumpSetStepSpeed( U32 stepSpeed ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_FIELD( fpgaD11PumpSpeed, stepSpeed ); } /*********************************************************************//** * @brief - * The clearFPGAD17CondReadEnable function clears the read enable of FPGA Conductivity - * Sensor D17. + * The setFPGAD10PumpSetStepSpeed function sets the step speed period for + * concentrate pump D10_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD10PumpSpeed + * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ -void clearFPGAD17CondReadEnable( void ) +void setFPGAD10PumpSetStepSpeed( U32 stepSpeed ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_RD_ENABLE_BIT; + SET_FPGA_ACTUATOR_FIELD( fpgaD10PumpSpeed, stepSpeed ); } /*********************************************************************//** * @brief - * The setFPGAD27CondReset function resets the FPGA Conductivity - * Sensor D27. + * The setFPGAD76PumpSetStepSpeed function sets the step speed period for + * UF D76_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD76PumpSpeed + * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ -void setFPGAD27CondReset( void ) +void setFPGAD76PumpSetStepSpeed( U32 stepSpeed ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_RESET_BIT; + SET_FPGA_ACTUATOR_FIELD( fpgaD76PumpSpeed, stepSpeed ); } /*********************************************************************//** * @brief - * The clearFPGAD27CondReset function clears the reset of FPGA Conductivity - * Sensor D27. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD11PumpControl + * @param control Concentrate pump control set * @return none *************************************************************************/ -void clearFPGAD27CondReset( void ) +void setFPGAD11PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D27_RESET_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, FPGA_CONC_PUMP_PARK_COMMAND); // preserve msb (park command bit) + SET_FPGA_ACTUATOR_BITS( fpgaD11PumpControl, control); } /*********************************************************************//** * @brief - * The setFPGAD27CondInitEnable function enables the FPGA Conductivity - * Sensor D27 initialzation procedure. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD10PumpControl + * @param control Concentrate pump control set * @return none *************************************************************************/ -void setFPGAD27CondInitEnable( void ) +void setFPGAD10PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // preserve msb (park command bit) + SET_FPGA_ACTUATOR_BITS( fpgaD10PumpControl, control ); } /*********************************************************************//** * @brief - * The clearFPGAD27CondInitEnable function clears the init process of FPGA Conductivity - * Sensor D27. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD76PumpControl + * @param control UF pump control set * @return none *************************************************************************/ -void clearFPGAD27CondInitEnable( void ) +void setFPGAD76PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D27_INIT_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaD76PumpControl, FPGA_CONC_PUMP_PARK_COMMAND ); // preserve msb (park command bit) + SET_FPGA_ACTUATOR_BITS( fpgaD76PumpControl, control ); } /*********************************************************************//** * @brief - * The setFPGAD27CondWriteEnable function enables the FPGA Conductivity - * Sensor D27 write transaction. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @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. + * @details \b Outputs: fpgaD11PumpControl + * @param Park command bit set * @return none *************************************************************************/ -void setFPGAD27CondWriteEnable( void ) +void setFPGAD11PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_WR_ENABLE_BIT; + 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 clearFPGAD27CondWriteEnable function clears the write enable of FPGA Conductivity - * Sensor D27. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none + * @details \b Outputs: fpgaD10PumpControl + * @param Park command bit set * @return none *************************************************************************/ -void clearFPGAD27CondWriteEnable( void ) +void setFPGAD10PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D27_WR_ENABLE_BIT; + 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 setFPGAD27CondReadEnable function enables the FPGA Conductivity - * Sensor D27 read transaction. + * 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none - * @warning: The address (setFPGACD12Address) register must be populated - * before invoking this read enable function to initiate read transaction - * with the sensor. + * @details \b Outputs: fpgaD76PumpControl + * @param Park command bit set * @return none *************************************************************************/ -void setFPGAD27CondReadEnable( void ) +void setFPGAD76PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_RD_ENABLE_BIT; + 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 clearFPGAD27CondReadEnable function clears the read enable of FPGA Conductivity - * Sensor D27. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD27CondReadEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D27_RD_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGD29CondReset function resets the FPGA Conductivity - * Sensor D29. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void setFPGAD29CondReset( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D29_RESET_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD29CondReset function clears the reset of FPGA Conductivity - * Sensor D29. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD29CondReset( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D29_RESET_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD29CondInitEnable function enables the FPGA Conductivity - * Sensor D29 initialzation procedure. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void setFPGAD29CondInitEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D29_INIT_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD29CondInitEnable function clears the init process of FPGA Conductivity - * Sensor D29. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD29CondInitEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D29_INIT_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD29CondWriteEnable function enables the FPGA Conductivity - * Sensor D29 write transaction. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @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 ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D29_WR_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD29CondWriteEnable function clears the write enable of FPGA Conductivity - * Sensor D29. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD29CondWriteEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D29_WR_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD29CondReadEnable function enables the FPGA Conductivity - * Sensor D29 read transaction. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @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 ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D29_RD_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD29CondReadEnable function clears the read enable of FPGA Conductivity - * Sensor D29. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD29CondReadEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D29_RD_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD43CondReset function resets the FPGA Conductivity - * Sensor D43. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void setFPGAD43CondReset( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D43_RESET_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD43CondReset function clears the reset of FPGA Conductivity - * Sensor D43. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD43CondReset( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D43_RESET_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD43CondInitEnable function enables the FPGA Conductivity - * Sensor D43 initialzation procedure. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void setFPGAD43CondInitEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D43_INIT_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD43CondInitEnable function clears the init process of FPGA Conductivity - * Sensor D43. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD43CondInitEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D43_INIT_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD43CondWriteEnable function enables the FPGA Conductivity - * Sensor D43 write transaction. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @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 ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D43_WR_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD43CondWriteEnable function clears the write enable of FPGA Conductivity - * Sensor D43. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD43CondWriteEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D43_WR_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD43CondReadEnable function enables the FPGA Conductivity - * Sensor D43 read transaction. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @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 ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_D43_RD_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD43CondReadEnable function clears the read enable of FPGA Conductivity - * Sensor D43. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD43CondReadEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_D43_RD_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD74CondReset function resets the FPGA Conductivity - * Sensor D74. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @param none - * @return none - *************************************************************************/ -void setFPGAD74CondReset( void ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control |= FPGA_D74_RESET_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD74CondReset function clears the reset of FPGA Conductivity - * Sensor D74. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD74CondReset( void ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control &= ~FPGA_D74_RESET_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD74CondInitEnable function enables the FPGA Conductivity - * Sensor D74 initialzation procedure. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @param none - * @return none - *************************************************************************/ -void setFPGAD74CondInitEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control |= FPGA_D74_INIT_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD74CondInitEnable function clears the init process of FPGA Conductivity - * Sensor D74. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD74CondInitEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control &= ~FPGA_D74_INIT_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD74CondWriteEnable function enables the FPGA Conductivity - * Sensor D74 write transaction. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @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 ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control |= FPGA_D74_WR_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD74CondWriteEnable function clears the write enable of FPGA Conductivity - * Sensor D74. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD74CondWriteEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control &= ~FPGA_D74_WR_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The setFPGAD74CondReadEnable function enables the FPGA Conductivity - * Sensor D74 read transaction. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @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 ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control |= FPGA_D74_RD_ENABLE_BIT; -} - -/*********************************************************************//** - * @brief - * The clearFPGAD74CondReadEnable function clears the read enable of FPGA Conductivity - * Sensor D74. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @param none - * @return none - *************************************************************************/ -void clearFPGAD74CondReadEnable( void ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control &= ~FPGA_D74_RD_ENABLE_BIT; -} - - -/*********************************************************************//** - * @brief - * The setFpgaCD12Control function sets the FPGA Conductivity - * Sensor control register for CD1&2. - * bit 7: Enables D27 read transaction (1), address needed - * bit 6: Enables D27 write transaction (1), address and data needs to be set - * bit 5: Enable D27 Init procedure (1) - * bit 4: reset D27 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: fpgaActuatorSetPoints.fpgaConSensTD12Control - * @param control Conductivity Sensor control set - * @return none - *************************************************************************/ -void setFPGACD12Control( U08 control ) -{ - fpgaActuatorSetPoints.fpgaConSensTD12Control = control; -} - -/*********************************************************************//** - * @brief - * The setFpgaCD34Control function sets the FPGA Conductivity - * Sensor control register for CD3&4. - * bit 7: Enables D43 read transaction (1), address needed - * bit 6: Enables D43 write transaction (1), address and data needs to be set - * bit 5: Enable D43 Init procedure (1) - * bit 4: reset D43 Conduct sensor (1) - * bit 3: Enables D29 read transaction (1), address needed - * bit 2: Enables D29 write transaction (1), address and data needs to be set - * bit 1: Enable D29 Init procedure (1) - * bit 0: reset D29 Conduct sensor (1) - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control - * @param control Conductivity sensor control set - * @return none - *************************************************************************/ -void setFPGACD34Control( U08 control ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34Control = control; -} - -/*********************************************************************//** - * @brief - * The setFpgaCD5Control function sets the FPGA Conductivity - * Sensor control register for CD5. - * bit 4- 7: Reserved. - * bit 3: Enables D74 read transaction (1), address needed - * bit 2: Enables D74 write transaction (1), address and data needs to be set - * bit 1: Enable D74 Init procedure (1) - * bit 0: reset D74 Conduct sensor (1) - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74Control - * @param control Conductivity sensor control set - * @return none - *************************************************************************/ -void setFPGACD5Control( U08 control ) -{ - fpgaActuatorSetPoints.fpgaConSensD74Control = control; -} - -/*********************************************************************//** - * @brief - * The setFPGACD12Address function sets the conductivity sensor - * CD12 address register to perform read and write operations. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12_Addrs - * @param address The conductivity sensor CD12 address - * @return none - *************************************************************************/ -void setFPGACD12Address( U16 address ) -{ - fpgaActuatorSetPoints.fpgaConSensTD12_Addrs = address; -} - -/*********************************************************************//** - * @brief - * The setFPGACD34Address function sets the conductivity sensor - * CD34 address register to perform read and write operations. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34_Addrs - * @param address The conductivity sensor CD34 address - * @return none - *************************************************************************/ -void setFPGACD34Address( U16 address ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34_Addrs = address; -} - -/*********************************************************************//** - * @brief - * The setFPGACD5Address function sets the conductivity sensor - * D74 address register to perform read and write operations. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74_Addrs - * @param address The conductivity sensor CD74 address - * @return none - *************************************************************************/ -void setFPGACD5Address( U16 address ) -{ - fpgaActuatorSetPoints.fpgaConSensD74_Addrs = address; -} - -/*********************************************************************//** - * @brief - * The setFPGACD12Data function sets the conductivity sensor - * CD12 data outputfor write operations. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12_Data_In - * @param data The conductivity sensor CD12 Data - * @return none - *************************************************************************/ -void setFPGACD12Data( U32 data ) -{ - fpgaActuatorSetPoints.fpgaConSensTD12_Data_In = data; -} - -/*********************************************************************//** - * @brief - * The setFPGACD34Data function sets the conductivity sensor - * CD34 data outputfor write operations. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34_Data_In - * @param data The conductivity sensor CD34 Data - * @return none - *************************************************************************/ -void setFPGACD34Data( U32 data ) -{ - fpgaActuatorSetPoints.fpgaConSensTD34_Data_In = data; -} - -/*********************************************************************//** - * @brief - * The setFPGACD5Data function sets the conductivity sensor - * CD5 data outputfor write operations. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensD74_Data_In - * @param data The conductivity sensor CD74 Data - * @return none - *************************************************************************/ -void setFPGACD5Data( U32 data ) -{ - fpgaActuatorSetPoints.fpgaConSensD74_Data_In = data; -} - -/*********************************************************************//** - * @brief * The setFPGAD5HeaterPWMControl function sets the primary heater * PWM input. * @details \b Inputs: none @@ -1525,7 +1313,7 @@ *************************************************************************/ void setFPGAD5HeaterPWMControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD5HeaterPWMControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaD5HeaterPWMControl, control ); } /*********************************************************************//** @@ -1539,7 +1327,7 @@ *************************************************************************/ void setFPGAD45HeaterPWMControl( U08 control ) { - fpgaActuatorSetPoints.fpgaD45HeaterPWMControl = control; + SET_FPGA_ACTUATOR_FIELD( fpgaD45HeaterPWMControl, control ); } /*********************************************************************//** @@ -1551,9 +1339,9 @@ * @param count the number of revolution to be rotated for the pump. * @return none *************************************************************************/ -void setFPGAD11PumpRevolutionCount( U16 count ) +void setFPGAD11PumpRevolutionCount( U32 count ) { - fpgaActuatorSetPoints.fpgaD11PumpRevCount = count; + SET_FPGA_ACTUATOR_FIELD( fpgaD11PumpRevCount, count ); } /*********************************************************************//** @@ -1565,9 +1353,9 @@ * @param count the number of revolution to be rotated for the pump. * @return none *************************************************************************/ -void setFPGAD10PumpRevolutionCount( U16 count ) +void setFPGAD10PumpRevolutionCount( U32 count ) { - fpgaActuatorSetPoints.fpgaD10PumpRevCount = count; + SET_FPGA_ACTUATOR_FIELD( fpgaD10PumpRevCount, count ); } /*********************************************************************//** @@ -1579,9 +1367,9 @@ * @param count the number of revolution to be rotated for the pump. * @return none *************************************************************************/ -void setFPGAD76PumpRevolutionCount( U16 count ) +void setFPGAD76PumpRevolutionCount( U32 count ) { - fpgaActuatorSetPoints.fpgaD76PumpRevCount = count; + SET_FPGA_ACTUATOR_FIELD( fpgaD76PumpRevCount, count ); } /*********************************************************************//** @@ -1597,11 +1385,11 @@ { if ( TRUE == flag) { - fpgaActuatorSetPoints.fpgaGPIOControl |= FPGA_D5_HEATER_CNTRL_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaGPIOControl, FPGA_D5_HEATER_CNTRL_BIT ); } else { - fpgaActuatorSetPoints.fpgaGPIOControl &= ~FPGA_D5_HEATER_CNTRL_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaGPIOControl, ~FPGA_D5_HEATER_CNTRL_BIT ); } } @@ -1618,11 +1406,11 @@ { if ( TRUE == enable) { - fpgaActuatorSetPoints.fpgaGPIOControl |= FPGA_D5_HEATER_PWM_ENABLE_BIT; + SET_FPGA_ACTUATOR_BITS( fpgaGPIOControl, FPGA_D5_HEATER_PWM_ENABLE_BIT ); } else { - fpgaActuatorSetPoints.fpgaGPIOControl &= ~FPGA_D5_HEATER_PWM_ENABLE_BIT; + CLEAR_FPGA_ACTUATOR_BITS( fpgaGPIOControl, ~FPGA_D5_HEATER_PWM_ENABLE_BIT ); } } @@ -1637,7 +1425,7 @@ *************************************************************************/ void setFPGAD5HeaterPWMLowState( U16 count ) { - fpgaActuatorSetPoints.fpgaACRelayPWMLow = count; + SET_FPGA_ACTUATOR_FIELD( fpgaACRelayPWMLow, count ); } /*********************************************************************//** @@ -1651,7 +1439,7 @@ *************************************************************************/ void setFPGAD5HeaterPWMPeriod( U16 period ) { - fpgaActuatorSetPoints.fpgaACRelayPWMPeriod = period; + SET_FPGA_ACTUATOR_FIELD( fpgaACRelayPWMPeriod, period ); } /*********************************************************************//** @@ -1681,12 +1469,12 @@ * bit 1-2: TBD * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpControl + * @details \b Outputs: fpgaD48PumpControl * @return Dialysate Out pump control status bit *************************************************************************/ U08 getFPGAD48PumpControl( void ) { - return fpgaActuatorSetPoints.fpgaD48PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD48PumpControl ); } /*********************************************************************//** @@ -1701,38 +1489,38 @@ * bit 1-2: TBD * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpControl + * @details \b Outputs: fpgaD12PumpControl * @return Dialysate Inlet pump control status bit *************************************************************************/ U08 getFPGAD12PumpControl( void ) { - return fpgaActuatorSetPoints.fpgaD12PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD12PumpControl ); } /*********************************************************************//** * @brief * The getFPGAD48PumpSpeed function gets the spent dialysate * pump speed. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD48MeasuredSpeed + * @details \b Outputs: fpgaD48MeasuredSpeed * @return Spent dialysate pump measured speed. *************************************************************************/ U16 getFPGAD48PumpSpeed( void ) { - return fpgaSensorReadings.fpgaD48MeasuredSpeed; + return GET_FPGA_SENSOR_FIELD( fpgaD48MeasuredSpeed ); } /*********************************************************************//** * @brief * The getFPGAD12PumpSpeed function gets the fresh dialysate * pump speed. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12MeasuredSpeed + * @details \b Outputs: fpgaD12MeasuredSpeed * @return fresh dialysate pump measured speed. *************************************************************************/ U16 getFPGAD12PumpSpeed( void ) { - return fpgaSensorReadings.fpgaD12MeasuredSpeed; + return GET_FPGA_SENSOR_FIELD( fpgaD12MeasuredSpeed ); } /*********************************************************************//** @@ -1743,12 +1531,12 @@ * bit 1 : spent dialysate pump error (1), no error(0) * bit 0 : fresh dialysate pump error (1), no error(0) * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12D48PumpStatus + * @details \b Outputs: fpgaD12D48PumpStatus * @return fresh dialysate pump error status. *************************************************************************/ BOOL getFPGAD12PumpErrorStatus( void ) { - U08 mask = fpgaSensorReadings.fpgaD12D48PumpStatus & FPGA_D12_PUMP_ERROR_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD12D48PumpStatus ) & FPGA_D12_PUMP_ERROR_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1762,12 +1550,12 @@ * bit 1 : spent dialysate pump error (1), no error(0) * bit 0 : fresh dialysate pump error (1), no error(0) * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12D48PumpStatus + * @details \b Outputs: fpgaD12D48PumpStatus * @return spent dialysate pump error status. *************************************************************************/ BOOL getFPGAD48PumpErrorStatus( void ) { - U08 mask = fpgaSensorReadings.fpgaD12D48PumpStatus & FPGA_D48_PUMP_ERROR_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD12D48PumpStatus ) & FPGA_D48_PUMP_ERROR_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1778,51 +1566,51 @@ * The getFPGAD12PumpCurrentFeedback function gets the fresh dialysate * pump current consumption. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12CurrentFeedback + * @details \b Outputs: fpgaD12CurrentFeedback * @return fresh dialysate pump measured current. *************************************************************************/ U16 getFPGAD12PumpCurrentFeedback( void ) { - return fpgaSensorReadings.fpgaD12CurrentFeedback; + return GET_FPGA_SENSOR_FIELD( fpgaD12CurrentFeedback ); } /*********************************************************************//** * @brief * The getFPGAD48PumpCurrentFeedback function gets the spent dialysate * pump current consumption. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD48CurrentFeedback + * @details \b Outputs: fpgaD48CurrentFeedback * @return spent dialysate pump measured current. *************************************************************************/ U16 getFPGAD48PumpCurrentFeedback( void ) { - return fpgaSensorReadings.fpgaD48CurrentFeedback; + return GET_FPGA_SENSOR_FIELD( fpgaD48CurrentFeedback ); } /*********************************************************************//** * @brief * The getFPGAD12PumpHallDirectionStatus function gets the fresh dialysate * pump hall sensor based direction error status. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD12HallStatus + * @details \b Outputs: fpgaD12HallStatus * @return fresh dialysate pump hall sensor based direction status. *************************************************************************/ U08 getFPGAD12PumpHallDirectionStatus( void ) { - return fpgaSensorReadings.fpgaD12HallStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD12HallStatus ); } /*********************************************************************//** * @brief * The getFPGAD48PumpHallDirectionStatus function gets the spent dialysate * pump hall sensor based direction error status. * @details \b Inputs: none - * @details \b Outputs: fpgaSensorReadings.fpgaD48HallStatus + * @details \b Outputs: fpgaD48HallStatus * @return spent dialysate pump hall sensor based direction status. *************************************************************************/ U08 getFPGAD48PumpHallDirectionStatus( void ) { - return fpgaSensorReadings.fpgaD48HallStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD48HallStatus ); } /*********************************************************************//** @@ -1836,12 +1624,12 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl + * @details \b Outputs: fpgaD11PumpControl * @return Acid pump control status bit *************************************************************************/ U08 getFPGAD11PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaD11PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD11PumpControl ); } /*********************************************************************//** @@ -1855,12 +1643,12 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl + * @details \b Outputs: fpgaD10PumpControl * @return Bicarb pump control status bit *************************************************************************/ U08 getFPGAD10PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaD10PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD10PumpControl ); } /*********************************************************************//** @@ -1874,38 +1662,38 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl + * @details \b Outputs: fpgaD76PumpControl * @return UF pump control status bit *************************************************************************/ U08 getFPGAD76PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaD76PumpControl; + return GET_FPGA_ACTUATOR_FIELD( fpgaD76PumpControl ); } /*********************************************************************//** * @brief * The getFPGAUFPumpFault function gets UF pumps fault * reported by FGPA. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpFault + * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return Latest UF pumps fault value *************************************************************************/ U08 getFPGAUFPumpFault( void ) { - return ( ( fpgaSensorReadings.fpgaD76PumpFault & FPGA_UF_PUMP_FAULT_BIT ) << UF_PUMP_FAULT_SHIFT ); + return ( ( GET_FPGA_SENSOR_FIELD( fpgaD76PumpFault ) & FPGA_UF_PUMP_FAULT_BIT ) << UF_PUMP_FAULT_SHIFT ); } /*********************************************************************//** * @brief * The getFPGAD76PumpIsParked function gets whether the UF pump is currently * parked. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpFault + * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return TRUE if UF pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD76PumpIsParked( void ) { - U08 mask = fpgaSensorReadings.fpgaD76PumpFault & FPGA_UF_PUMP_PARKED_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD76PumpFault ) & FPGA_UF_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1915,13 +1703,13 @@ * @brief * The getFPGAD76PumpParkFault function gets whether the UF pump park command * has faulted. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpFault + * @details \b Inputs: fpgaD76PumpFault * @details \b Outputs: none * @return TRUE if UF pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAD76PumpParkFault( void ) { - U08 mask = fpgaSensorReadings.fpgaD76PumpFault & FPGA_UF_PUMP_PARK_FAULT_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD ( fpgaD76PumpFault ) & FPGA_UF_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1931,26 +1719,26 @@ * @brief * The getFPGAConcentratePumpsFault function gets concentrate pumps fault * reported by FGPA. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return Latest concentrate pumps fault value *************************************************************************/ U08 getFPGAConcentratePumpsFault( void ) { - return fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_CONC_PUMP_FAULT_BITS; + return ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_CONC_PUMP_FAULT_BITS ); } /*********************************************************************//** * @brief * The getFPGAD11PumpIsParked function gets whether the acid pump is currently * parked. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if acid pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD11PumpIsParked( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D11_PUMP_PARKED_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D11_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1960,13 +1748,13 @@ * @brief * The getFPGAD10PumpIsParked function gets whether the bicarb pump is currently * parked. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if bicarb pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAD10PumpIsParked( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D10_PUMP_PARKED_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D10_PUMP_PARKED_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1976,13 +1764,13 @@ * @brief * The getFPGAD11PumpParkFault function gets whether the acid pump park command * has faulted. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if acid pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAD11PumpParkFault( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D11_PUMP_PARK_FAULT_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D11_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -1992,13 +1780,13 @@ * @brief * The getFPGAD10PumpParkFault function gets whether the bicarb pump park command * has faulted. - * @details \b Inputs: fpgaSensorReadings.fpgaD11_D10_PumpFault + * @details \b Inputs: fpgaD11_D10_PumpFault * @details \b Outputs: none * @return TRUE if bicarb pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAD10PumpParkFault( void ) { - U08 mask = fpgaSensorReadings.fpgaD11_D10_PumpFault & FPGA_D10_PUMP_PARK_FAULT_BIT; + U08 mask = ( GET_FPGA_SENSOR_FIELD( fpgaD11_D10_PumpFault ) & FPGA_D10_PUMP_PARK_FAULT_BIT ); BOOL result = ( mask > 0 ? TRUE : FALSE ); return result; @@ -2008,565 +1796,433 @@ * @brief * The getFPGAD11PumpHallSensePulseWidth function gets concentrate pump D11_Pump * hall sense pulse width. - * @details \b Inputs: fpgaSensorReadings.fpgaD11PumpHallSense + * @details \b Inputs: fpgaD11PumpHallSense * @details \b Outputs: none * @return concentrate pump D11_Pump hall sense pulse width *************************************************************************/ -U16 getFPGAD11PumpHallSensePulseWidth( void ) +U32 getFPGAD11PumpHallSensePulseWidth( void ) { - return fpgaSensorReadings.fpgaD11PumpHallSense; + return GET_FPGA_SENSOR_FIELD( fpgaD11PumpHallSense ); } /*********************************************************************//** * @brief * The getFPGAD10PumpHallSensePulseWidth function gets concentrate pump D10_Pump * hall sense pulse width. - * @details \b Inputs: fpgaSensorReadings.fpgaD10PumpHallSense + * @details \b Inputs: fpgaD10PumpHallSense * @details \b Outputs: none * @return concentrate pump D10_Pump hall sense pulse width *************************************************************************/ -U16 getFPGAD10PumpHallSensePulseWidth( void ) +U32 getFPGAD10PumpHallSensePulseWidth( void ) { - return fpgaSensorReadings.fpgaD10PumpHallSense; + return GET_FPGA_SENSOR_FIELD( fpgaD10PumpHallSense ); } /*********************************************************************//** * @brief * The getFPGAD76PumpHallSensePulseWidth function gets UF pump D76_Pump * hall sense pulse width. - * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpHallSense + * @details \b Inputs: fpgaD76PumpHallSense * @details \b Outputs: none * @return ultrafiltration pump D76_Pump hall sense pulse width *************************************************************************/ -U16 getFPGAD76PumpHallSensePulseWidth( void ) +U32 getFPGAD76PumpHallSensePulseWidth( void ) { - return fpgaSensorReadings.fpgaD76PumpHallSense; + return GET_FPGA_SENSOR_FIELD( fpgaD76PumpHallSense ); } /*********************************************************************//** * @brief - * The getFPGAValveStates function gets the latest sensed valve states. - * See setFPGAValveStates for valve state bit positions. - * @details \b Inputs: fpgaSensorReadings.fpgaValveStates + * 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 getFPGAValveStates( void ) +U16 getFPGADDValveStates( void ) { - return fpgaSensorReadings.fpgaValveStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveStates ); } /*********************************************************************//** * @brief * The getFPGAValveBCStates function gets the latest sensed balancing * chamber valve states. * See setFPGABCValveStates for BC valve state bit positions. - * @details \b Inputs: fpgaSensorReadings.fpgaValveBCStates + * @details \b Inputs: fpgaValveBCStates * @details \b Outputs: none * @return last balancing chamber valve states reading *************************************************************************/ U08 getFPGAValveBCStates( void ) { - return fpgaSensorReadings.fpgaValveBCStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveBCStates ); } /*********************************************************************//** * @brief - * The getFPGAValveUFStates function gets the latest sensed ultrafiltration + * The getFPGAValveSpStates function gets the latest sensed spare * valve states. - * See setFPGAUFValveStates for UF valve state bit positions. - * @details \b Inputs: fpgaSensorReadings.fpgaValveUFStates + * See setFPGAUFValveStates for Spare valve state bit positions. + * @details \b Inputs: fpgaValveSpStates * @details \b Outputs: none - * @return last ultrafiltration valve states reading + * @return last spare valve states reading *************************************************************************/ -U08 getFPGAValveUFStates( void ) +U08 getFPGAValveSpStates( void ) { - return fpgaSensorReadings.fpgaValveUFStates; + return GET_FPGA_SENSOR_FIELD( fpgaValveSpStates ); } /*********************************************************************//** * @brief - * The getFPGAD9PresReadCount function gets hydraulics outlet pressure sensor counter of - * good SPI transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaD9PresReadCnt - * @details \b Outputs: none - * @return Latest hydraulics outlet Pressure sensor read count - *************************************************************************/ -U08 getFPGAD9PresReadCount( void ) -{ - return fpgaSensorReadings.fpgaD9PresReadCnt; -} - -/*********************************************************************//** - * @brief - * The getFPGAD9PresErrorCount function gets hydraulics outlet pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD9PresErrorCnt - * @details \b Outputs: none - * @return Latest hydraulics outlet pressure sensor read error count - *************************************************************************/ -U08 getFPGAD9PresErrorCount( void ) -{ - return fpgaSensorReadings.fpgaD9PresErrorCnt; -} - -/*********************************************************************//** - * @brief * The getFPGAD9PresRawPressure function gets hydraulics outlet pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD9PresPressure + * @details \b Inputs: fpgaD9PresPressure * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD9PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD9PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD9PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD9PresRawTemperature function gets hydraulics outlet pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD9PresTemp + * @details \b Inputs: fpgaD9PresTemp * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD9PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD9PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD9PresTemp ); } /*********************************************************************//** * @brief - * The getFPGAD66PresReadCount function gets Bibag pressure sensor counter of - * good SPI transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaD66PresReadCnt - * @details \b Outputs: none - * @return Latest Bibag Pressure sensor read count - *************************************************************************/ -U08 getFPGAD66PresReadCount( void ) -{ - return fpgaSensorReadings.fpgaD66PresReadCnt; -} - -/*********************************************************************//** - * @brief - * The getFPGAD66PresErrorCount function gets Bibag pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD66PresErrorCnt - * @details \b Outputs: none - * @return Latest Bibag pressure sensor read error count - *************************************************************************/ -U08 getFPGAD66PresErrorCount( void ) -{ - return fpgaSensorReadings.fpgaD66PresErrorCnt; -} - -/*********************************************************************//** - * @brief * The getFPGAD66PresRawPressure function gets Bibag pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD66PresPressure + * @details \b Inputs: fpgaD66PresPressure * @details \b Outputs: none * @return Latest Bibag pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD66PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD66PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD66PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD66PresRawTemperature function gets Bibag pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD66PresTemp + * @details \b Inputs: fpgaD66PresTemp * @details \b Outputs: none * @return Latest Bibag pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD66PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD66PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD66PresTemp ); } /*********************************************************************//** * @brief - * The getFPGAD51PresReadCount function gets spent dialysate pressure sensor counter of - * good SPI transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaD51PresReadCnt - * @details \b Outputs: none - * @return Latest spent dialysate Pressure sensor read count - *************************************************************************/ -U08 getFPGAD51PresReadCount( void ) -{ - return fpgaSensorReadings.fpgaD51PresReadCnt; -} - -/*********************************************************************//** - * @brief - * The getFPGAD51PresErrorCount function gets spent dialysate pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD51PresErrorCnt - * @details \b Outputs: none - * @return Latest spent dialysate pressure sensor read error count - *************************************************************************/ -U08 getFPGAD51PresErrorCount( void ) -{ - return fpgaSensorReadings.fpgaD51PresErrorCnt; -} - -/*********************************************************************//** - * @brief * The getFPGAD51PresRawPressure function gets spent dialysate pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD51PresPressure + * @details \b Inputs: fpgaD51PresPressure * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD51PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD51PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD51PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD51PresRawTemperature function gets spent dialysate pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD51PresTemp + * @details \b Inputs: fpgaD51PresTemp * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD51PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD51PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD51PresTemp ); } /*********************************************************************//** * @brief - * The getFPGAD18PresReadCount function gets fresh dialysate pressure sensor counter of - * good SPI transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaD18PresReadCnt - * @details \b Outputs: none - * @return Latest fresh dialysate Pressure sensor read count - *************************************************************************/ -U08 getFPGAD18PresReadCount( void ) -{ - return fpgaSensorReadings.fpgaD18PresReadCnt; -} - -/*********************************************************************//** - * @brief - * The getFPGAD18PresErrorCount function gets fresh dialysate pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD18PresErrorCnt - * @details \b Outputs: none - * @return Latest fresh dialysate pressure sensor read error count - *************************************************************************/ -U08 getFPGAD18PresErrorCount( void ) -{ - return fpgaSensorReadings.fpgaD18PresErrorCnt; -} - -/*********************************************************************//** - * @brief * The getFPGAD18PresRawPressure function gets fresh dialysate pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD18PresPressure + * @details \b Inputs: fpgaD18PresPressure * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD18PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD18PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD18PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD18PresRawTemperature function gets fresh dialysate pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD18PresTemp + * @details \b Inputs: fpgaD18PresTemp * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD18PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD18PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD18PresTemp ); } /*********************************************************************//** * @brief - * The getFPGAD41PresReadCount function gets transmembrane pressure sensor counter of - * good SPI transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaD41PresReadCnt - * @details \b Outputs: none - * @return Latest transmembrane Pressure sensor read count - *************************************************************************/ -U08 getFPGAD41PresReadCount( void ) -{ - return fpgaSensorReadings.fpgaD41PresReadCnt; -} - -/*********************************************************************//** - * @brief - * The getFPGAD41PresErrorCount function gets transmembrane pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD41PresErrorCnt - * @details \b Outputs: none - * @return Latest transmembrane pressure sensor read error count - *************************************************************************/ -U08 getFPGAD41PresErrorCount( void ) -{ - return fpgaSensorReadings.fpgaD41PresErrorCnt; -} - -/*********************************************************************//** - * @brief * The getFPGAD41PresRawPressure function gets transmembrane pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaD41PresPressure + * @details \b Inputs: fpgaD41PresPressure * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw pressure data *************************************************************************/ U16 getFPGAD41PresRawPressure( void ) { - return fpgaSensorReadings.fpgaD41PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD41PresPressure ); } /*********************************************************************//** * @brief * The getFPGAD41PresRawTemperature function gets transmembrane pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD41PresTemp + * @details \b Inputs: fpgaD41PresTemp * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw temperature data *************************************************************************/ U16 getFPGAD41PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaD41PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD41PresTemp ); } /*********************************************************************//** * @brief - * The getFPGAM1PresRawPressure function gets water inlet input pressure sensor - * raw pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaM1PresPressure + * The getFPGAD87PresRawPressure function gets fresh dialysate post ultrafilter + * pressure sensor raw pressure value. + * @details \b Inputs: fpgaD87PresPressure * @details \b Outputs: none - * @return Latest water inlet input pressure sensor raw pressure data + * @return Fresh dialysate post ultrafilter pressure sensor raw pressure data *************************************************************************/ -U16 getFPGAM1PresRawPressure( void ) +U16 getFPGAD87PresRawPressure( void ) { - return fpgaSensorReadings.fpgaM1PresPressure; + return GET_FPGA_SENSOR_FIELD( fpgaD87PresPressure ); } /*********************************************************************//** * @brief - * The getFPGAM1RawTemperature function gets water inlet input pressure sensor - * raw temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaM1PresTemp + * The getFPGAD87PresRawTemperature function gets fresh dialysate post ultrafilter + * pressure sensor raw temperature value. + * @details \b Inputs: fpgaD87PresTemp * @details \b Outputs: none - * @return Latest water inlet input pressure sensor raw temperature data + * @return Fresh dialysate post ultrafilter pressure sensor raw temperature data *************************************************************************/ -U16 getFPGAM1PresRawTemperature( void ) +U16 getFPGAD87PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaM1PresTemp; + return GET_FPGA_SENSOR_FIELD( fpgaD87PresTemp ); } /*********************************************************************//** * @brief - * The getFPGAM1PresReadCount function gets water inlet input pressure sensor - * counter of good SPI transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaM1PresReadCnt + * The getFPGACD1ReadCount function gets D17 conductivity sensor read count. + * @details \b Inputs: fpgaD17CondReadCnt * @details \b Outputs: none - * @return Latest water inlet input pressure sensor read count + * @return Latest D17 conductivity sensor read count *************************************************************************/ -U08 getFPGAM1PresReadCount( void ) +U08 getFPGAD17CondReadCount( void ) { - return fpgaSensorReadings.fpgaM1PresReadCnt; + return fpgaSensorReadings.fpgaD17CondReadCnt; } /*********************************************************************//** * @brief - * The getFPGAM1PresErrorCount function gets water inlet input pressure - * sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaM1PresErrorCnt + * The getFPGAD17CondErrorCount function gets D17 conductivity sensor error count. + * @details \b Inputs: fpgaD17CondErrorCnt * @details \b Outputs: none - * @return Latest water inlet input pressure sensor read error count + * @return Latest D17 conductivity sensor read error count *************************************************************************/ -U08 getFPGAM1PresErrorCount( void ) +U08 getFPGAD17CondErrorCount( void ) { - return fpgaSensorReadings.fpgaM1PresErrorCnt; + return fpgaSensorReadings.fpgaD17CondErrorCnt; } /*********************************************************************//** * @brief - * The getFPGAM3PresRawPressure function gets water inlet output pressure sensor - * raw pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaM3PresPressure + * The getFPGAD17TempReadCount function gets the D17 (D16) temperature read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD17TempReadCount * @details \b Outputs: none - * @return Latest water inlet output pressure sensor raw pressure data + * @return D17 (D16) Temperature sensor read count *************************************************************************/ -U16 getFPGAM3PresRawPressure( void ) +U08 getFPGAD17TempReadCount( void ) { - return fpgaSensorReadings.fpgaM3PresPressure; + return fpgaSensorReadings.fpgaD17TempReadCount; } /*********************************************************************//** * @brief - * The getFPGAM3PresRawTemperature function gets water inlet output pressure sensor - * raw temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaM3PresTemp + * The getFPGAD17TempErrorCount function gets the D17 (D16) temperature error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD17TempErrorCount * @details \b Outputs: none - * @return Latest water inlet output pressure sensor raw temperature data + * @return D17 (D16) Temperature sensor error count *************************************************************************/ -U16 getFPGAM3PresRawTemperature( void ) +U08 getFPGAD17TempErrorCount( void ) { - return fpgaSensorReadings.fpgaM3PresTemp; + return fpgaSensorReadings.fpgaD17TempErrorCount; } /*********************************************************************//** * @brief - * The getFPGAM3PresReadCount function gets water inlet output pressure sensor - * counter of good SPI transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaM3PresReadCnt + * The getFPGAD17CondTemp function gets D17 conductivity sensor temperature value. + * @details \b Inputs: fpgaCD1Temp * @details \b Outputs: none - * @return Latest water inlet output pressure sensor read count + * @return Latest D17 conductivity sensor temperature value *************************************************************************/ -U08 getFPGAM3PresReadCount( void ) +F32 getFPGAD17CondTemp( void ) { - return fpgaSensorReadings.fpgaM3PresReadCnt; + return fpgaSensorReadings.fpgaD17TempResistance; } /*********************************************************************//** * @brief - * The getFPGAM3PresErrorCount function gets water inlet output pressure - * sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaM3PresErrorCnt + * The getFPGAD17CondData function gets D17 conductivity sensor register value. + * @details \b Inputs: fpgaD17CondDataOut * @details \b Outputs: none - * @return Latest water inlet output pressure sensor read error count + * @return Latest D17 conductivity sensor register data value *************************************************************************/ -U08 getFPGAM3PresErrorCount( void ) +F32 getFPGAD17CondData( void ) { - return fpgaSensorReadings.fpgaM3PresErrorCnt; + return fpgaSensorReadings.fpgaD17CondResistance; } /*********************************************************************//** * @brief - * The getFPGACD1ReadCount function gets D17 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD17CondReadCnt + * The getFPGAD17CondData function gets the D17 cal data. + * @details \b Inputs: fpgaSensorReadings.fpgaD17DataCal * @details \b Outputs: none - * @return Latest D17 conductivity sensor read count + * @return D17 calibration data *************************************************************************/ -U08 getFPGAD17CondReadCount( void ) +U32 getFPGAD17CondCalData( void ) { - return fpgaSensorReadings.fpgaD17CondReadCnt; + return fpgaSensorReadings.fpgaD17DataCal; } /*********************************************************************//** * @brief - * The getFPGAD17CondErrorCount function gets D17 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD17CondErrorCnt + * The getFPGAD17CalMemCounter function gets the D17 memory count. + * @details \b Inputs: fpgaSensorReadings.fpgaD17CalMemCounter * @details \b Outputs: none - * @return Latest D17 conductivity sensor read error count + * @return D17 memory count *************************************************************************/ -U08 getFPGAD17CondErrorCount( void ) +U08 getFPGAD17CalMemCounter( void ) { - return fpgaSensorReadings.fpgaD17CondErrorCnt; + return fpgaSensorReadings.fpgaD17CalMemCounter; } - /*********************************************************************//** * @brief - * The getFPGAD17Cond function gets D17 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD1 + * The getFPGAD27CondReadCount function gets D27 conductivity sensor read count. + * @details \b Inputs: fpgaD27CondReadCnt * @details \b Outputs: none - * @return Latest D17 conductivity sensor value + * @return Latest D27 conductivity sensor read count *************************************************************************/ -U16 getFPGAD17Cond( void ) +U08 getFPGAD27CondReadCount( void ) { - return fpgaSensorReadings.fpgaD17CondCond; + return fpgaSensorReadings.fpgaD27CondReadCnt; } /*********************************************************************//** * @brief - * The getFPGAD17CondTemp function gets D17 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD1Temp + * The getFPGAD27CondErrorCount function gets D27 conductivity sensor error count. + * @details \b Inputs: fpgaD27CondErrorCnt * @details \b Outputs: none - * @return Latest D17 conductivity sensor temperature value + * @return Latest D27 conductivity sensor read error count *************************************************************************/ -U16 getFPGAD17CondTemp( void ) +U08 getFPGAD27CondErrorCount( void ) { - return fpgaSensorReadings.fpgaD17CondTemp; + return fpgaSensorReadings.fpgaD27CondErrorCnt; } /*********************************************************************//** * @brief - * The getFPGAD17CondData function gets D17 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD17CondDataOut + * The getFPGAD27TempReadCount function gets the D27 (D28) temperature read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD27TempReadCount * @details \b Outputs: none - * @return Latest D17 conductivity sensor register data value + * @return D27 (D28) Temperature sensor read count *************************************************************************/ -U32 getFPGAD17CondData( void ) +U08 getFPGAD27TempReadCount( void ) { - return fpgaSensorReadings.fpgaD17CondDataOut; + return fpgaSensorReadings.fpgaD27TempReadCount; } /*********************************************************************//** * @brief - * The getFPGAD27CondReadCount function gets D27 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondReadCnt + * The getFPGAD27TempErrorCount function gets the D27 (D28) temperature error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD27TempErrorCount * @details \b Outputs: none - * @return Latest D27 conductivity sensor read count + * @return D27 (D28) Temperature sensor error count *************************************************************************/ -U08 getFPGAD27CondReadCount( void ) +U08 getFPGAD27TempErrorCount( void ) { - return fpgaSensorReadings.fpgaD27CondReadCnt; + return fpgaSensorReadings.fpgaD27TempErrorCount; } /*********************************************************************//** * @brief - * The getFPGAD27CondErrorCount function gets D27 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondErrorCnt + * The getFPGAD27CondData function gets D27 conductivity sensor value. + * @details \b Inputs: fpgaD27CondResistance * @details \b Outputs: none - * @return Latest D27 conductivity sensor read error count + * @return Latest D27 conductivity sensor value *************************************************************************/ -U08 getFPGAD27CondErrorCount( void ) +F32 getFPGAD27CondData( void ) { - return fpgaSensorReadings.fpgaD27CondErrorCnt; + return fpgaSensorReadings.fpgaD27CondResistance; } /*********************************************************************//** * @brief - * The getFPGAD27Cond function gets D27 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD27Cond + * The getFPGAD27CondTemp function gets D27 conductivity sensor temperature value. + * @details \b Inputs: fpgaD27CondTemp * @details \b Outputs: none - * @return Latest D27 conductivity sensor value + * @return Latest D27 conductivity sensor temperature value *************************************************************************/ -U16 getFPGAD27Cond( void ) +F32 getFPGAD27CondTemp( void ) { - return fpgaSensorReadings.fpgaD27CondCond; + return fpgaSensorReadings.fpgaD27TempResistance; } /*********************************************************************//** * @brief - * The getFPGAD27CondTemp function gets D27 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondTemp + * The getFPGAD27CondCalData function gets the D27 cal data. + * @details \b Inputs: fpgaSensorReadings.fpgaD27DataCal * @details \b Outputs: none - * @return Latest D27 conductivity sensor temperature value + * @return D27 calibration data *************************************************************************/ -U16 getFPGAD27CondTemp( void ) +U32 getFPGAD27CondCalData( void ) { - return fpgaSensorReadings.fpgaD27CondTemp; + return fpgaSensorReadings.fpgaD27DataCal; } /*********************************************************************//** * @brief - * The getFPGAD27CondData function gets D27 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD27CondDataOut + * The getFPGAD27CalMemCounter function gets the D27 memory count. + * @details \b Inputs: fpgaSensorReadings.fpgaD27CalMemCounter * @details \b Outputs: none - * @return Latest D27 conductivity sensor register data value + * @return D27 memory count *************************************************************************/ -U32 getFPGAD27CondData( void ) +U08 getFPGAD27CalMemCounter( void ) { - return fpgaSensorReadings.fpgaD27CondDataOut; + return fpgaSensorReadings.fpgaD27CalMemCounter; } /*********************************************************************//** * @brief * The getFPGAD29CondReadCount function gets D29 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondReadCnt + * @details \b Inputs: fpgaD29CondReadCnt * @details \b Outputs: none * @return Latest D29 conductivity sensor read count *************************************************************************/ @@ -2578,7 +2234,7 @@ /*********************************************************************//** * @brief * The getFPGAD29CondErrorCount function gets D29 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondErrorCnt + * @details \b Inputs: fpgaD29CondErrorCnt * @details \b Outputs: none * @return Latest D29 conductivity sensor read error count *************************************************************************/ @@ -2589,44 +2245,79 @@ /*********************************************************************//** * @brief - * The getFPGAD29Cond function gets D29 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD29Cond + * The getFPGAD29TempReadCount function gets the D29 (D28) temperature read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD29TempReadCount * @details \b Outputs: none - * @return Latest D29 conductivity sensor value + * @return D29 (D28) Temperature sensor read count *************************************************************************/ -U16 getFPGAD29Cond( void ) +U08 getFPGAD29TempReadCount( void ) { - return fpgaSensorReadings.fpgaD29CondCond; + return fpgaSensorReadings.fpgaD29TempReadCount; } /*********************************************************************//** * @brief + * The getFPGAD29TempErrorCount function gets the D29 (D28) temperature error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD29TempErrorCount + * @details \b Outputs: none + * @return D29 (D28) Temperature sensor error count + *************************************************************************/ +U08 getFPGAD29TempErrorCount( void ) +{ + return fpgaSensorReadings.fpgaD29TempErrorCount; +} +/*********************************************************************//** + * @brief * The getFPGAD29CondTemp function gets D29 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondTemp + * @details \b Inputs: fpgaD29TempResistance * @details \b Outputs: none * @return Latest D29 conductivity sensor temperature value *************************************************************************/ -U16 getFPGAD29CondTemp( void ) +F32 getFPGAD29CondTemp( void ) { - return fpgaSensorReadings.fpgaD29CondTemp; + return fpgaSensorReadings.fpgaD29TempResistance; } /*********************************************************************//** * @brief * The getFPGAD29CondData function gets D29 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD29CondDataOut + * @details \b Inputs: fpgaD29CondResistance * @details \b Outputs: none * @return Latest D29 conductivity sensor register data value *************************************************************************/ -U32 getFPGAD29CondData( void ) +F32 getFPGAD29CondData( void ) { - return fpgaSensorReadings.fpgaD29CondDataOut; + return fpgaSensorReadings.fpgaD29CondResistance; } /*********************************************************************//** * @brief + * The getFPGAD29CondCalData function gets the D29 cal data. + * @details \b Inputs: fpgaSensorReadings.fpgaD29DataCal + * @details \b Outputs: none + * @return D29 calibration data + *************************************************************************/ +U32 getFPGAD29CondCalData( void ) +{ + return fpgaSensorReadings.fpgaD29DataCal; +} + +/*********************************************************************//** + * @brief + * The getFPGAD29CalMemCounter function gets the D29 memory count. + * @details \b Inputs: fpgaSensorReadings.fpgaD29CalMemCounter + * @details \b Outputs: none + * @return D29 memory count + *************************************************************************/ +U08 getFPGAD29CalMemCounter( void ) +{ + return fpgaSensorReadings.fpgaD29CalMemCounter; +} + +/*********************************************************************//** + * @brief * The getFPGAD43CondReadCount function gets D43 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondReadCnt + * @details \b Inputs: fpgaD43CondReadCnt * @details \b Outputs: none * @return Latest D43 conductivity sensor read count *************************************************************************/ @@ -2638,7 +2329,7 @@ /*********************************************************************//** * @brief * The getFPGAD43CondErrorCount function gets D43 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondErrorCnt + * @details \b Inputs: fpgaD43CondErrorCnt * @details \b Outputs: none * @return Latest D43 conductivity sensor read error count *************************************************************************/ @@ -2649,44 +2340,80 @@ /*********************************************************************//** * @brief - * The getFPGAD43Cond function gets D43 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD43Cond + * The getFPGAD43TempReadCount function gets the D43 (D44) temperature read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD43TempReadCount * @details \b Outputs: none - * @return Latest D43 conductivity sensor value + * @return D43 (D44) Temperature sensor read count *************************************************************************/ -U16 getFPGAD43Cond( void ) +U08 getFPGAD43TempReadCount( void ) { - return fpgaSensorReadings.fpgaD43CondCond; + return fpgaSensorReadings.fpgaD43TempReadCount; } /*********************************************************************//** * @brief + * The getFPGAD43TempErrorCount function gets the D43 (D44) temperature error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD43TempErrorCount + * @details \b Outputs: none + * @return D43 (D44) Temperature sensor error count + *************************************************************************/ +U08 getFPGAD43TempErrorCount( void ) +{ + return fpgaSensorReadings.fpgaD43TempErrorCount; +} + +/*********************************************************************//** + * @brief * The getFPGAD43CondTemp function gets D43 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondTemp + * @details \b Inputs: fpgaD43CondTemp * @details \b Outputs: none * @return Latest D43 conductivity sensor temperature value *************************************************************************/ -U16 getFPGAD43CondTemp( void ) +F32 getFPGAD43CondTemp( void ) { - return fpgaSensorReadings.fpgaD43CondTemp; + return fpgaSensorReadings.fpgaD43TempResistance; } /*********************************************************************//** * @brief * The getFPGAD43CondData function gets D43 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD43CondDataOut + * @details \b Inputs: fpgaD43CondDataOut * @details \b Outputs: none * @return Latest D43 conductivity sensor register data value *************************************************************************/ -U32 getFPGAD43CondData( void ) +F32 getFPGAD43CondData( void ) { - return fpgaSensorReadings.fpgaD43CondDataOut; + return fpgaSensorReadings.fpgaD43CondResistance; } /*********************************************************************//** * @brief + * The getFPGAD43CondCalData function gets the D43 cal data. + * @details \b Inputs: fpgaSensorReadings.fpgaD43DataCal + * @details \b Outputs: none + * @return D43 calibration data + *************************************************************************/ +U32 getFPGAD43CondCalData( void ) +{ + return fpgaSensorReadings.fpgaD43DataCal; +} + +/*********************************************************************//** + * @brief + * The getFPGAD43CalMemCounter function gets the D43 memory count. + * @details \b Inputs: fpgaSensorReadings.fpgaD43CalMemCounter + * @details \b Outputs: none + * @return D43 memory count + *************************************************************************/ +U08 getFPGAD43CalMemCounter( void ) +{ + return fpgaSensorReadings.fpgaD43CalMemCounter; +} + +/*********************************************************************//** + * @brief * The getFPGAD74CondReadCount function gets D74 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondReadCnt + * @details \b Inputs: fpgaD74CondReadCnt * @details \b Outputs: none * @return Latest D74 conductivity sensor read count *************************************************************************/ @@ -2698,7 +2425,7 @@ /*********************************************************************//** * @brief * The getFPGAD74CondErrorCount function gets D74 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondErrorCnt + * @details \b Inputs: fpgaD74CondErrorCnt * @details \b Outputs: none * @return Latest D74 conductivity sensor read error count *************************************************************************/ @@ -2709,90 +2436,197 @@ /*********************************************************************//** * @brief - * The getFPGAD74Cond function gets D74 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaD74Cond + * The getFPGAD74TempReadCount function gets the D74 (D75) temperature read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD74TempReadCount * @details \b Outputs: none - * @return Latest D74 conductivity sensor value + * @return D74 (D75) Temperature sensor read count *************************************************************************/ -U16 getFPGAD74Cond( void ) +U08 getFPGAD74TempReadCount( void ) { - return fpgaSensorReadings.fpgaD74CondCond; + return fpgaSensorReadings.fpgaD74TempReadCount; } /*********************************************************************//** * @brief + * The getFPGAD74TempErrorCount function gets the D74 (D75) temperature error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD74TempErrorCount + * @details \b Outputs: none + * @return D74 (D75) Temperature sensor error count + *************************************************************************/ +U08 getFPGAD74TempErrorCount( void ) +{ + return fpgaSensorReadings.fpgaD74TempErrorCount; +} + +/*********************************************************************//** + * @brief * The getFPGAD74CondTemp function gets D74 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondTemp + * @details \b Inputs: fpgaD74CondTemp * @details \b Outputs: none * @return Latest D74 conductivity sensor temperature value *************************************************************************/ -U16 getFPGAD74CondTemp( void ) +F32 getFPGAD74CondTemp( void ) { - return fpgaSensorReadings.fpgaD74CondTemp; + return fpgaSensorReadings.fpgaD74TempResistance; } /*********************************************************************//** * @brief * The getFPGAD74CondData function gets D74 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaD74CondDataOut + * @details \b Inputs: fpgaD74CondDataOut * @details \b Outputs: none * @return Latest D74 conductivity sensor register data value *************************************************************************/ -U32 getFPGAD74CondData( void ) +F32 getFPGAD74CondData( void ) { - return fpgaSensorReadings.fpgaD74CondDataOut; + return fpgaSensorReadings.fpgaD74CondResistance; } +/*********************************************************************//** + * @brief + * The getFPGAD74CondCalData function gets the D74 cal data. + * @details \b Inputs: fpgaSensorReadings.fpgaD74DataCal + * @details \b Outputs: none + * @return D74 calibration data + *************************************************************************/ +U32 getFPGAD74CondCalData( void ) +{ + return fpgaSensorReadings.fpgaD74DataCal; +} /*********************************************************************//** * @brief - * The getFPGAD63LevelSensor function gets the latest FPGA D63 level sensor - * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaD63LevelSensor + * The getFPGAD74CalMemCounter function gets the D74 memory count. + * @details \b Inputs: fpgaSensorReadings.fpgaD74CalMemCounter * @details \b Outputs: none - * @return last FPGA D63 level sensor reading + * @return D74 memory count *************************************************************************/ +U08 getFPGAD74CalMemCounter( void ) +{ + return fpgaSensorReadings.fpgaD74CalMemCounter; +} + +/*********************************************************************//** + * @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 ) { - return fpgaSensorReadings.fpgaD63LevelSensor; + U16 result; + +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D63_LEVEL_BIT ); + } + else + { + result = fpgaBeta19SensorReadings.fpgaD63LevelSensor; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; } /*********************************************************************//** * @brief + * The getFPGAD98LevelSensor function gets the latest FPGA D98 lower level + * sensor reading. + * @details \b Inputs: fpgaD98LevelSensor + * @details \b Outputs: none + * @return last FPGA D98 lower level sensor reading + *************************************************************************/ +U16 getFPGAD98LevelSensor( void ) +{ + U16 result; + +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D98_LEVEL_BIT ); + } + else + { + result = fpgaBeta19SensorReadings.fpgaD98LevelSensor; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; +} + +/*********************************************************************//** + * @brief * The getFPGAD46LevelSensor function gets the latest FPGA level sensor 2 * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaD46LevelSensor + * @details \b Inputs: fpgaD46LevelSensor * @details \b Outputs: none * @return last FPGA level sensor2 reading *************************************************************************/ U16 getFPGAD46LevelSensor( void ) { - return fpgaSensorReadings.fpgaD46LevelSensor; + U16 result; + +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & FPGA_D46_LEVEL_BIT ); + } + else + { + result = fpgaBeta19SensorReadings.fpgaD46LevelSensor; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; } /*********************************************************************//** * @brief * The getFPGAD6LevelStatus function gets the latest FPGA floater D6 level * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaD6FloaterStatus + * @details \b Inputs: fpgaD6FloaterStatus * @details \b Outputs: none * @return last FPGA floater D6 level reading *************************************************************************/ U08 getFPGAD6LevelStatus( void ) { - return ( fpgaSensorReadings.fpgaD6FloaterStatus & FPGA_D6_FLOATER_LEVEL_BIT ); + return ( GET_FPGA_SENSOR_FIELD( fpgaD6FloaterStatus ) & FPGA_FLOATER_LEVEL_BIT ); } /*********************************************************************//** * @brief * The getFPGAFloater2Status function gets the latest FPGA floater 2 level * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaFloater2Status + * @details \b Inputs: fpgaFloater2Status * @details \b Outputs: none * @return last FPGA floater 2 level reading *************************************************************************/ U08 getFPGAFloater2Status( void ) { - return fpgaSensorReadings.fpgaFloater2Status; + U08 result; +#if 1 // Remove when Beta 1.9 is obsolete + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaConductiveLevelStatus; + } + else + { + result = fpgaBeta19SensorReadings.fpgaFloater2Status; + } +#else + result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); +#endif + + return result; } /*********************************************************************//** @@ -2804,7 +2638,7 @@ *************************************************************************/ static U16 getFPGATimerCount( void ) { - return fpgaSensorReadings.fpgaTimerCountMS; + return GET_FPGA_SENSOR_FIELD( fpgaTimerCountMS ); } /*********************************************************************//** @@ -2817,20 +2651,20 @@ *************************************************************************/ U32 getFPGAD1Temp( void ) { - return fpgaSensorReadings.fpgaD1Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD1Temp ); } /*********************************************************************//** * @brief - * The getFPGAX6Temp function gets the outlet heat exchanger + * The getFPGAD78Temp function gets the outlet heat exchanger * temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return outlet heat exchanger temperature *************************************************************************/ -U32 getFPGAX6Temp( void ) +U32 getFPGAD78Temp( void ) { - return fpgaSensorReadings.fpgaX6Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD78Temp ); } /*********************************************************************//** @@ -2843,7 +2677,7 @@ *************************************************************************/ U32 getFPGAD4Temp( void ) { - return fpgaSensorReadings.fpgaD4Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD4Temp ); } /*********************************************************************//** @@ -2855,186 +2689,233 @@ *************************************************************************/ U32 getFPGAD50Temp( void ) { - return fpgaSensorReadings.fpgaD50Temp; + return GET_FPGA_SENSOR_FIELD( fpgaD50Temp ); } /*********************************************************************//** * @brief - * The getFPGARTDReadCount function gets the RTD sensors group read count. + * The getFPGAD99Temp function gets the fresh dialysate temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return RTD read count + * @return Fresh dialysate temperature *************************************************************************/ -U08 getFPGARTDReadCount( void ) +U32 getFPGAD99Temp( void ) { - return fpgaSensorReadings.fpgaRTDReadCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD99Temp ); } /*********************************************************************//** * @brief - * The getFPGARTDCountErrorCycles function gets the FPGA incomplete sequences - * of reads from RTD ADC. + * The getFPGARTDReadCount function gets the RTD sensors group read count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return count of in-complete sequences of reads from RTD ADC. + * @return RTD read count *************************************************************************/ -U08 getFPGARTDCountErrorCycles( void ) +U08 getFPGARTDReadCount( void ) { - return fpgaSensorReadings.fpgaRTDCountErrorCycles; + return GET_FPGA_SENSOR_FIELD( fpgaRTDReadCnt ); } /*********************************************************************//** * @brief - * The getFPGABaroReadCount function gets the FPGA barometric sensor read count. + * The getFPGARTDCountErrorCycles function gets the FPGA incomplete sequences + * of reads from RTD ADC. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor read count + * @return count of in-complete sequences of reads from RTD ADC. *************************************************************************/ -U08 getFPGABaroReadCount( void ) +U08 getFPGARTDCountErrorCycles( void ) { - return fpgaSensorReadings.fpgaBaroReadCount; + return GET_FPGA_SENSOR_FIELD( fpgaRTDCountErrorCycles ); } /*********************************************************************//** * @brief - * The getFPGABaroErrorCount function gets the FPGA barometric sensor error count. + * The getFPGAIOExpanderReadCount function gets the number of successful + * I2C transactions with the IO expander. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor error count + * @return IO expander successful transaction count *************************************************************************/ -U08 getFPGABaroErrorCount( void ) +U08 getFPGAIOExpanderReadCount( void ) { - return fpgaSensorReadings.fpgaBaroErrorCount; -} + U08 result = 0U; -/*********************************************************************//** - * @brief - * The getFPGABaroMfgInfo function gets the FPGA barometric pressure - * sensor manufacturing information. - * @details \b Inputs: fpgaSensorReadings - * @details \b Outputs: none - * @return barometric pressure sensor manufacturing information - *************************************************************************/ -U16 getFPGABaroMfgInfo( void ) -{ - return fpgaSensorReadings.fpgaBaroManufacInfo; + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaIOExpReadCount; + } + + return result; } /*********************************************************************//** * @brief - * The getFPGABaroPressureSensitivity function gets the FPGA barometric pressure - * sensor sensitivity. + * The getFPGAIOExpanderErrorCount function gets the number of unsuccessful + * I2C transactions with the IO expander. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor sensitivity + * @return IO expander error transaction count *************************************************************************/ -U16 getFPGABaroPressureSensitivity( void ) +U08 getFPGAIOExpanderErrorCount( void ) { - return fpgaSensorReadings.fpgaBaroPROMCoeff1; + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaIOExpERrorCount; + } + + return result; } /*********************************************************************//** * @brief - * The getFPGABaroPressureOffset function gets the FPGA barometric pressure - * sensor offset. + * The getFPGAHallSensorStatus function gets the aggregated hall sensor status. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor offset + * @return hall sensor status bits *************************************************************************/ -U16 getFPGABaroPressureOffset( void ) +U08 getFPGAHallSensorStatus( void ) { - return fpgaSensorReadings.fpgaBaroPROMCoeff2; + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaHallSensorStatus; + } + + return result; } /*********************************************************************//** * @brief - * The getFPGABaroTempCoeffOfPressSensitvity function gets the FPGA barometric - * pressure sensor temperature coefficient of pressure sensitivity. + * The getFPGAGPIOStatus function gets the GPIO status register value. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor temperature coefficient of pressure sensitivity + * @return GPIO status register *************************************************************************/ -U16 getFPGABaroTempCoeffOfPressSensitvity( void ) +U08 getFPGAGPIOStatus( void ) { - return fpgaSensorReadings.fpgaBaroPROMCoeff3; + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.fpgaGPIOStatus; + } + + return result; } /*********************************************************************//** * @brief - * The getFPGABaroTempCoeffOfPressOffset function gets the FPGA barometric - * pressure sensor temperature coefficient of pressure offset. - * @details \b Inputs: fpgaSensorReadings + * The getACSwitchStatus function returns the AC switch (concentrate cap + * switch) status from the FPGA GPIO register. + * @details \b Inputs: fpgaSensorReadings.fpgaGPIOStatus (via getGPIOStatusFromFPGA) * @details \b Outputs: none - * @return barometric pressure sensor temperature coefficient of pressure offset + * @return TRUE if AC switch is asserted, FALSE otherwise *************************************************************************/ -U16 getFPGABaroTempCoeffOfPressOffset( void ) +BOOL getACSwitchStatus( void ) { - return fpgaSensorReadings.fpgaBaroPROMCoeff4; + U08 gpioStatus = getFPGAGPIOStatus(); + BOOL isAsserted = ( ( gpioStatus & GPIO_AC_SWITCH_MASK ) == 0U ) ? TRUE : FALSE; + + return isAsserted; } /*********************************************************************//** * @brief - * The getFPGABaroReferenceTemperature function gets the FPGA barometric pressure - * sensor reference temperature. - * @details \b Inputs: fpgaSensorReadings + * The getFPGALeakSensorStatus function returns the leak sensor status from + * the FPGA GPIO_Status register (Bit 1 per HDD). Application should trigger + * an alarm when LEAK_SENSOR_DETECTED is returned. + * @details \b Inputs: fpgaSensorReadings.fpgaGPIOStatus * @details \b Outputs: none - * @return barometric pressure sensor reference temperature + * @return FPGA_GPIO_LEAK_SENSOR_NOT_DETECTED or FPGA_GPIO_LEAK_SENSOR_DETECTED *************************************************************************/ -U16 getFPGABaroReferenceTemperature( void ) +FPGA_GPIO_LEAK_SENSOR_STATUS_T getFPGALeakSensorStatus( void ) { - return fpgaSensorReadings.fpgaBaroPROMCoeff5; + U08 gpioStatus = getFPGAGPIOStatus(); + FPGA_GPIO_LEAK_SENSOR_STATUS_T status = ( ( gpioStatus & FPGA_GPIO_LEAK_SENSOR_MASK ) != 0U ) ? FPGA_GPIO_LEAK_SENSOR_NOT_DETECTED : FPGA_GPIO_LEAK_SENSOR_DETECTED; + + return status; } /*********************************************************************//** * @brief - * The getFPGABaroTempCoeffOfTemperature function gets the FPGA barometric pressure - * sensor temperature coefficient of temperature. + * The getFPGATempTax1 function gets the Tax1 temperature sensor reading. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor temperature coefficient of temperature + * @return Tax1 temperature *************************************************************************/ -U16 getFPGABaroTempCoeffOfTemperature( void ) +U32 getFPGATempTax1( void ) { - return fpgaSensorReadings.fpgaBaroPROMCoeff6; + U32 result = 0UL; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.tempTax1; + } + + return result; } /*********************************************************************//** * @brief - * The getFPGABaroCoeffsCRC function gets the FPGA barometric pressure - * sensor temperature coefficients' CRC. + * The getFPGATempRTD function gets the spare RTD temperature sensor reading. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor temperature coefficients' CRC + * @return spare RTD temperature *************************************************************************/ -U16 getFPGABaroCoeffsCRC( void ) +U32 getFPGATempRTD( void ) { - return fpgaSensorReadings.fpgaBaroPROMCRC; + U32 result = 0UL; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.tempRTD; + } + + return result; } /*********************************************************************//** * @brief - * The getFPGABaroPressure function gets the FPGA barometric pressure sensor - * pressure. + * The getFPGAAD7124ReadCount function gets the number of valid AD7124 + * transactions. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor pressure + * @return AD7124 valid transaction count *************************************************************************/ -U32 getFPGABaroPressure( void ) +U08 getFPGAAD7124ReadCount( void ) { - return ( fpgaSensorReadings.fpgaBaroPressure & MASK_OFF_U32_MSB ); + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.ad7124readcnt; + } + + return result; } /*********************************************************************//** * @brief - * The getFPGABaroTemperature function gets the FPGA barometric pressure sensor - * temperature. + * The getFPGAAD7124ErrorCount function gets the number of invalid AD7124 + * transactions. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return barometric pressure sensor temperature + * @return AD7124 error transaction count *************************************************************************/ -U32 getFPGABaroTemperature( void ) +U08 getFPGAAD7124ErrorCount( void ) { - return ( fpgaSensorReadings.fpgaBaroTemperature & MASK_OFF_U32_MSB ); + U08 result = 0U; + + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + result = fpgaSensorReadings.ad7124errcnt; + } + + return result; } /*********************************************************************//** @@ -3053,7 +2934,7 @@ if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { //TODO : Enable alarm later - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)GET_FPGA_SENSOR_FIELD( fpgaIOErrorCntProcessor ) ) } } } @@ -3066,9 +2947,9 @@ * @details \b Outputs: none * @return the current revolution of the acid concentrate pump *************************************************************************/ -U16 getFPGAD11PumpRevolutionCountStatus( void ) +U32 getFPGAD11PumpRevolutionCountStatus( void ) { - return fpgaSensorReadings.fpgaD11PumpStepCountStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD11PumpStepCountStatus ); } /*********************************************************************//** @@ -3079,9 +2960,9 @@ * @details \b Outputs: none * @return the current revolution of the bicarb concentrate pump *************************************************************************/ -U16 getFPGAD10PumpRevolutionCountStatus( void ) +U32 getFPGAD10PumpRevolutionCountStatus( void ) { - return fpgaSensorReadings.fpgaD10PumpStepCountStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD10PumpStepCountStatus ); } /*********************************************************************//** @@ -3092,9 +2973,9 @@ * @details \b Outputs: none * @return the current revolution of the UF pump *************************************************************************/ -U16 getFPGAD76PumpRevolutionCountStatus( void ) +U32 getFPGAD76PumpRevolutionCountStatus( void ) { - return fpgaSensorReadings.fpgaD76PumpStepCountStatus; + return GET_FPGA_SENSOR_FIELD( fpgaD76PumpStepCountStatus ); } /*********************************************************************//** @@ -3121,7 +3002,7 @@ if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { //TODO : Enable alarm later - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)GET_FPGA_SENSOR_FIELD( fpgaIOErrorCntProcessor ) ) status = TRUE; } } @@ -3141,7 +3022,7 @@ *************************************************************************/ U08 getFPGABloodLeakStatus( void ) { - U08 selfTestStatus = fpgaSensorReadings.fpgaD42PulseStatus; + U08 selfTestStatus = ( ( GET_FPGA_SENSOR_FIELD( fpgaD42PulseStatus ) & FPGA_D42_BLOOD_LEAK_STATUS_MASK ) >> FPGA_D42_BLOOD_LEAK_ST_BIT_INDEX ); return selfTestStatus; } @@ -3156,7 +3037,7 @@ *************************************************************************/ void setFPGABloodLeakUARTControl( U08 value ) { - fpgaActuatorSetPoints.fpgaD42UARTControl = value; + SET_FPGA_ACTUATOR_FIELD( fpgaD42UARTControl, value ); } /*********************************************************************//** @@ -3169,7 +3050,7 @@ *************************************************************************/ void setFPGABloodLeakUARTTransmit( U08 value ) { - fpgaActuatorSetPoints.fpgaD42FIFOTx = value; + SET_FPGA_ACTUATOR_FIELD( fpgaD42FIFOTx, value ); } /*********************************************************************//** @@ -3178,11 +3059,11 @@ * FIFO count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42TxFIFOCnt + * @return fpgaD42TxFIFOCnt *************************************************************************/ U08 getFPGABloodLeakTxFIFOCount( void ) { - return fpgaSensorReadings.fpgaD42TxFIFOCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD42TxFIFOCnt ); } /*********************************************************************//** @@ -3191,11 +3072,11 @@ * FIFO count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42RxFIFOCnt + * @return fpgaD42RxFIFOCnt *************************************************************************/ U16 getFPGABloodLeakRxFIFOCount( void ) { - return fpgaSensorReadings.fpgaD42RxFIFOCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD42RxFIFOCnt ); } /*********************************************************************//** @@ -3204,11 +3085,11 @@ * error count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42RxErrorCnt + * @return fpgaD42RxErrorCnt *************************************************************************/ U08 getFPGABloodLeakRxErrorCount( void ) { - return fpgaSensorReadings.fpgaD42RxErrorCnt; + return GET_FPGA_SENSOR_FIELD( fpgaD42RxErrorCnt ); } /*********************************************************************//** @@ -3217,11 +3098,838 @@ * FIFO data out. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return fpgaSensorReadings.fpgaD42RxFIFODataOut + * @return fpgaD42RxFIFODataOut *************************************************************************/ U08 getFPGABloodLeakRxFIFODataOut( void ) { - return fpgaSensorReadings.fpgaD42RxFIFODataOut; + return GET_FPGA_SENSOR_FIELD( fpgaD42RxFIFODataOut ); } +/*********************************************************************//** + * @brief + * The setFPGAD79RinsePumpControl function sets the control bit of the rinse + * pump to turn it on or off. + * @details \b Inputs: none + * @details \b Outputs: 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 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 ); +} + +/*********************************************************************//** + * @brief + * The getFPGAP9CondReadCount function gets the P9 conductivity read count. + * @details \b Inputs: fpgaSensorReadings.fpgaP9CondReadCount + * @details \b Outputs: none + * @return P9 Conductivity sensor read count + *************************************************************************/ +U08 getFPGAP9CondReadCount( void ) +{ + return fpgaSensorReadings.fpgaP9CondReadCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP9CondErrorCount function gets the P9 conductivity error count. + * @details \b Inputs: fpgaSensorReadings.fpgaP9CondErrorCount + * @details \b Outputs: none + * @return P9 Conductivity sensor error count + *************************************************************************/ +U08 getFPGAP9CondErrorCount( void ) +{ + return fpgaSensorReadings.fpgaP9CondErrorCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP9TempReadCount function gets the P9 (P10) temperature read count. + * @details \b Inputs: fpgaSensorReadings.fpgaP9TempReadCount + * @details \b Outputs: none + * @return P9 (P10) Temperature sensor read count + *************************************************************************/ +U08 getFPGAP9TempReadCount( void ) +{ + return fpgaSensorReadings.fpgaP9TempReadCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP9TempErrorCount function gets the P9 (P10) temperature error count. + * @details \b Inputs: fpgaSensorReadings.fpgaP9TempErrorCount + * @details \b Outputs: none + * @return P9 (P10) Temperature sensor error count + *************************************************************************/ +U08 getFPGAP9TempErrorCount( void ) +{ + return fpgaSensorReadings.fpgaP9TempErrorCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP9CondData function gets the P9 conductivity data. + * @details \b Inputs: fpgaSensorReadings.fpgaP9CondResistance + * @details \b Outputs: none + * @return P9 Conductivity data + *************************************************************************/ +F32 getFPGAP9CondData( void ) +{ + return fpgaSensorReadings.fpgaP9CondResistance; +} + +/*********************************************************************//** + * @brief + * The getFPGAP9CondTemp function gets the P9 (P10) temperature data. + * @details \b Inputs: fpgaSensorReadings.fpgaP9TempResistance + * @details \b Outputs: none + * @return P9 (P10) Temperature data + *************************************************************************/ +F32 getFPGAP9CondTemp( void ) +{ + return fpgaSensorReadings.fpgaP9TempResistance; +} + +/*********************************************************************//** + * @brief + * The getFPGAP9CondCalData function gets the P9 cal data. + * @details \b Inputs: fpgaSensorReadings.fpgaP9CalData + * @details \b Outputs: none + * @return P9 calibration data + *************************************************************************/ +U32 getFPGAP9CondCalData( void ) +{ + return fpgaSensorReadings.fpgaP9CalData; +} + +/*********************************************************************//** + * @brief + * The getFPGAP9CalMemCounter function gets the P9 memory count. + * @details \b Inputs: fpgaSensorReadings.fpgaP9CalMemCounter + * @details \b Outputs: none + * @return P9 memory count + *************************************************************************/ +U08 getFPGAP9CalMemCounter( void ) +{ + return fpgaSensorReadings.fpgaP9CalMemCounter; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18CondReadCount function gets the P18 conductivity read count. + * @details \b Inputs: fpgaSensorReadings.fpgaP18CondReadCount + * @details \b Outputs: none + * @return P18 Conductivity sensor read count + *************************************************************************/ +U08 getFPGAP18CondReadCount( void ) +{ + return fpgaSensorReadings.fpgaP18CondReadCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18CondErrorCount function gets the P18 conductivity error count. + * @details \b Inputs: fpgaSensorReadings.fpgaP18CondErrorCount + * @details \b Outputs: none + * @return P18 Conductivity sensor error count + *************************************************************************/ +U08 getFPGAP18CondErrorCount( void ) +{ + return fpgaSensorReadings.fpgaP18CondErrorCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18TempReadCount function gets the P18 (P19) temperature read count. + * @details \b Inputs: fpgaSensorReadings.fpgaP18TempReadCount + * @details \b Outputs: none + * @return P18 (P19) Temperature sensor read count + *************************************************************************/ +U08 getFPGAP18TempReadCount( void ) +{ + return fpgaSensorReadings.fpgaP18TempReadCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18TempErrorCount function gets the P18 (P19) temperature error count. + * @details \b Inputs: fpgaSensorReadings.fpgaP18TempErrorCount + * @details \b Outputs: none + * @return P18 (P19) Temperature sensor error count + *************************************************************************/ +U08 getFPGAP18TempErrorCount( void ) +{ + return fpgaSensorReadings.fpgaP18TempErrorCount; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18CondData function gets the P18 conductivity data. + * @details \b Inputs: fpgaSensorReadings.fpgaP18CondResistance + * @details \b Outputs: none + * @return P18 Conductivity data + *************************************************************************/ +F32 getFPGAP18CondData( void ) +{ + return fpgaSensorReadings.fpgaP18CondResistance; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18CondTemp function gets the P18 (P19) temperature data. + * @details \b Inputs: fpgaSensorReadings.fpgaP18TempReistance + * @details \b Outputs: none + * @return P18 (P19) Temperature data + *************************************************************************/ +F32 getFPGAP18CondTemp( void ) +{ + return fpgaSensorReadings.fpgaP18TempReistance; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18CondCalData function gets the P18 cal data. + * @details \b Inputs: fpgaSensorReadings.fpgaP18CalData + * @details \b Outputs: none + * @return P18 calibration data + *************************************************************************/ +U32 getFPGAP18CondCalData( void ) +{ + return fpgaSensorReadings.fpgaP18CalData; +} + +/*********************************************************************//** + * @brief + * The getFPGAP18CalMemCounter function gets the P18 memory count. + * @details \b Inputs: fpgaSensorReadings.fpgaP18CalMemCounter + * @details \b Outputs: none + * @return P18 memory count + *************************************************************************/ +U08 getFPGAP18CalMemCounter( void ) +{ + return fpgaSensorReadings.fpgaP18CalMemCounter; +} /**@}*/