Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r119a861592835f560bc3fb41bad2a1b1299d8e5d -r333e2d0c0462dcb4343a279420949cce716ebab7 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 119a861592835f560bc3fb41bad2a1b1299d8e5d) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 333e2d0c0462dcb4343a279420949cce716ebab7) @@ -42,37 +42,62 @@ #define MAX_COMM_ERROR_RETRIES 5 ///< Maximum number of communication error retries -#define DRAIN_PUMP_DAC_SHIFT_BITS 4 ///< Drain pump DAC shift bits. - -#define FPGA_FLUIDLEAK_STATE_MASK 0x0004 ///< Bit mask for fluid leak detector. - //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_VBF_PWM_PULL_IN_MS ( 3 * MS_PER_SECOND ) ///< FPGA VBf PWM pull in in milliseconds. -#define FPGA_VBF_PWM_LOW 9999 ///< FPGA VBf PWM low. -#define FPGA_VBF_PWM_PERIOD 16666 ///< FPGA VBf PWM period. +#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_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_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. + // Assuming all valves are ON/OFF based control ( No PWM control used) #define FPGA_ENABLE_VALVES_PWM 0x0000 ///< FPGA enable valves PWM. #define FPGA_ENABLE_BC_VALVES_PWM 0x00 ///< FPGA enable Balancing chamber valves PWM. #define FPGA_ENABLE_UF_VALVES_PWM 0x00 ///< FPGA enable Ultrafiltration valves PWM. +#define FPGA_ADC_AUTO_READ_ENABLE 0x11 ///< FPGA internal ADC auto read enable. + #define CONCENTRATE_CAP_SWITCH_MASK 0x10 ///< Concentrate cap switch bit mask. #define FPGA_CONC_PUMP_FAULT_BITS 0x03 ///< Concentrate pump fault bits mask. -#define FPGA_CP1_PARKED_BIT 0x04 ///< Concentrate pump 1 parked status bit mask. -#define FPGA_CP2_PARKED_BIT 0x10 ///< Concentrate pump 2 parked status bit mask. -#define FPGA_CP1_PARK_FAULT_BIT 0x08 ///< Concentrate pump 1 park fault status bit mask. -#define FPGA_CP2_PARK_FAULT_BIT 0x20 ///< Concentrate pump 2 park fault status bit mask. +#define FPGA_D11_PUMP_PARKED_BIT 0x04 ///< Acid Concentrate pump parked status bit mask. +#define FPGA_D10_PUMP_PARKED_BIT 0x10 ///< Bicarb Concentrate pump parked status bit mask. +#define FPGA_D11_PUMP_PARK_FAULT_BIT 0x08 ///< Acid Concentrate pump park fault status bit mask. +#define FPGA_D10_PUMP_PARK_FAULT_BIT 0x20 ///< Bicarb Concentrate pump park fault status bit mask. #define FPGA_CONC_PUMP_PARK_COMMAND 0x80 ///< Park command bit for the concentrate pumps. #define FPGA_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_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 ) @@ -102,147 +127,233 @@ U08 fpgaIOErrorCntProcessor; ///< Reg 262. Number of errors in Microprocessor UART interface U08 fpgaIOErrorCntPC; ///< Reg 263. Number of errors in PC UART interface - U32 fpgaPnPressure; ///< Reg 264. Pn/PHo MPM pressure sensor RAW pressure data - U32 fpgaPnTemp; ///< Reg 268. Pn/PHo MPM pressure sensor RAW temperature data - U08 fpgaPnReadCnt; ///< Reg 272. Pn/PHo Counter for good I2C transmission b/w FPGA and sensor - U08 fpgaPnErrorCnt; ///< Reg 273. Pn/PHo Counter for bad I2C transmission b/w FPGA and sensor + 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 fpgaPCbPressure; ///< Reg 274. PCb/PDB MPM pressure sensor RAW pressure data - U32 fpgaPCbTemp; ///< Reg 278. PCb/PDB MPM pressure sensor RAW temperature data - U08 fpgaPCbReadCnt; ///< Reg 282. PCb/PDB Counter for good I2C transmission b/w FPGA and sensor - U08 fpgaPCbErrorCnt; ///< Reg 283. PCb/PDB Counter for bad I2C transmission b/w FPGA and sensor + 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 - U32 fpgaPDsPressure; ///< Reg 284. PDs MPM pressure sensor RAW pressure data - U32 fpgaPDsTemp; ///< Reg 288. PDs MPM pressure sensor RAW temperature data - U08 fpgaPDsReadCnt; ///< Reg 292. PDs Counter for good I2C transmission b/w FPGA and sensor - U08 fpgaPDsErrorCnt; ///< Reg 293. PDs Counter for bad I2C transmission b/w FPGA and sensor + 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 - U32 fpgaPDfPressure; ///< Reg 294. PDf MPM pressure sensor RAW pressure data - U32 fpgaPDfTemp; ///< Reg 298. PDf MPM pressure sensor RAW temperature data - U08 fpgaPDfReadCnt; ///< Reg 302. PDf Counter for good I2C transmission b/w FPGA and sensor - U08 fpgaPDfErrorCnt; ///< Reg 303. PDf Counter for bad I2C 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 - U32 fpgaPtmPressure; ///< Reg 304. Ptm MPM pressure sensor RAW pressure data - U32 fpgaPtmTemp; ///< Reg 308. Ptm MPM pressure sensor RAW temperature data - U08 fpgaPtmReadCnt; ///< Reg 312. Ptm Counter for good I2C transmission b/w FPGA and sensor - U08 fpgaPtmErrorCnt; ///< Reg 313. Ptm Counter for bad I2C 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 fpgaCD1DataOut; ///< Reg 314. Data read from Conductivity Sensor 1 register - U16 fpgaCD1Cond; ///< Reg 316. CD1 conductivity - U16 fpgaCD1Temp; ///< Reg 318. CD1 Temperature - U08 fpgaCD1ReadCnt; ///< Reg 320. CD1 successful read count - U08 fpgaCD1ErrorCnt; ///< Reg 321. CD1 error read count + 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 fpgaCD2DataOut; ///< Reg 322. Data read from Conductivity Sensor 2 register - U16 fpgaCD2Cond; ///< Reg 324. CD2 conductivity - U16 fpgaCD2Temp; ///< Reg 326. CD2 Temperature - U08 fpgaCD2ReadCnt; ///< Reg 328. CD2 successful read count - U08 fpgaCD2ErrorCnt; ///< Reg 329. CD2 error read count + 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 - U16 fpgaCD3DataOut; ///< Reg 330. Data read from Conductivity Sensor 3 register - U16 fpgaCD3Cond; ///< Reg 332. CD3 conductivity - U16 fpgaCD3Temp; ///< Reg 334. CD3 Temperature - U08 fpgaCD3ReadCnt; ///< Reg 336. CD3 successful read count - U08 fpgaCD3ErrorCnt; ///< Reg 337. CD3 error read count + 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 - U16 fpgaCD4DataOut; ///< Reg 338. Data read from Conductivity Sensor 4 register - U16 fpgaCD4Cond; ///< Reg 340. CD4 conductivity - U16 fpgaCD4Temp; ///< Reg 342. CD4 Temperature - U08 fpgaCD4ReadCnt; ///< Reg 344. CD4 successful read count - U08 fpgaCD4ErrorCnt; ///< Reg 345. CD4 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 - U16 fpgaLevelSensor1; ///< Reg 346. Level Sensor 1 - U16 fpgaLevelSensor2; ///< Reg 348. Level Sensor 2 + 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 fpgaBldTxFIFOCnt; ///< Reg 351. Blood leak sensor transmit FIFO count - U16 fpgaBldRxErrorCnt; ///< Reg 352. Blood leak sensor Receive error count - U16 fpgaBldRxFIFOCnt; ///< Reg 354. Blood leak sensor Receive FIFO count - U08 fpgaBldRxFIFODataOut; ///< Reg 356. Blood leak sensor Receive data - U08 fpgaBldPulseStatus; ///< Reg 357. Blood leak sensor status + 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 + + U32 fpgaD74CondDataOut; ///< Reg 448. Data read from Conductivity Sensor D74 register + U16 fpgaD74CondCond; ///< Reg 452. D74 conductivity + U16 fpgaD74CondTemp; ///< Reg 454. D74 Temperature + U08 fpgaD74CondReadCnt; ///< Reg 456. D74 successful read count + U08 fpgaD74CondErrorCnt; ///< Reg 457. D74 error read count } DD_FPGA_SENSORS_T; typedef struct { U16 fpgaValveControl; ///< Reg 04. Valve control register U16 fpgaValvePWMEnable; ///< Reg 06. Valve PWM enable - U16 fpgaVDrPWMLow; ///< Reg 08. VDr PWM low. VDo-> VDr. - U16 fpgaVDrPWMPeriod; ///< Reg 10. VDr PWM period - U16 fpgaVDrPWMPullin; ///< Reg 12. VDr PWM pull in - U16 fpgaVTDWMLow; ///< Reg 14. VTD PWM low - U16 fpgaVTDPWMPeriod; ///< Reg 16. VTD PWM period - U16 fpgaVTDPWMPullin; ///< Reg 18. VTD PWM pull in - U16 fpgaVHBPWMLow; ///< Reg 20. VHB PWM low - U16 fpgaVHBPWMPeriod; ///< Reg 22. VHB PWM period - U16 fpgaVHBPWMPullin; ///< Reg 24. VHB PWM pull in - U16 fpgaVrpPWMLow; ///< Reg 26. Vrp PWM low - U16 fpgaVrpPWMPeriod; ///< Reg 28. Vrp PWM period - U16 fpgaVrpPWMPullin; ///< Reg 30. Vrp PWM pull in + 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) - U16 fpgaVHoPWMLow; ///< Reg 32. VHo PWM low - U16 fpgaVHoPWMPeriod; ///< Reg 34. VHo PWM period - U16 fpgaVHoPWMPullin; ///< Reg 36. VHo PWM pull in - U16 fpgaVDB1PWMLow; ///< Reg 38. VDB1 PWM low - U16 fpgaVDB1PWMPeriod; ///< Reg 40. VDB1 PWM period - U16 fpgaVDB1PWMPullin; ///< Reg 42. VDB1 PWM pull in - U16 fpgaVP1PWMLow; ///< Reg 44. VP1 PWM low - U16 fpgaVP1PWMPeriod; ///< Reg 46. VP1 PWM period - U16 fpgaVP1PWMPullin; ///< Reg 48. VP1 PWM pull in - U16 fpgaVPTPWMLow; ///< Reg 50. VPT PWM Low - U16 fpgaVPTPWMPeriod; ///< Reg 52. VPT PWM period - U16 fpgaVPTPWMPullin; ///< Reg 54. VPT PWM pull in + 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 - U16 fpgaVDB2PWMLow; ///< Reg 56. VDB2 PWM low - U16 fpgaVDB2PWMPeriod; ///< Reg 58. VDB2 PWM period - U16 fpgaVDB2PWMPullin; ///< Reg 60. VDB2 PWM pull in - U16 fpgaVDiPWMLow; ///< Reg 62. VDi PWM low - U16 fpgaVDiPWMPeriod; ///< Reg 64. VDi PWM period - U16 fpgaVDiPWMPullin; ///< Reg 66. VDi PWM pull in - U16 fpgaVDoPWMLow; ///< Reg 68. VDo PWM low - U16 fpgaVDoPWMPeriod; ///< Reg 70. VDo PWM period - U16 fpgaVDoPWMPullin; ///< Reg 72. VDo PWM pull in - U16 fpgaVP2PWMLow; ///< Reg 74. VP2 PWM low - U16 fpgaVP2PWMPeriod; ///< Reg 76. VP2 PWM period - U16 fpgaVP2PWMPullin; ///< Reg 78. VP2 PWM pull in - U16 fpgaVHiPWMLow; ///< Reg 80. VHi PWM low - U16 fpgaVHiPWMPeriod; ///< Reg 82. VHi PWM period - U16 fpgaVHiPWMPullin; ///< Reg 84. VHi PWM pull in + 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 - U08 fpgaBCValveControl; ///< Reg 86. Balancing Chamber Valves Control Registers - U08 fpgaBCValvePWMControl; ///< Reg 87. Balancing Chamber Valves PWM control - U08 fpgaUFValveControl; ///< Reg 88. Ultra filtration Valves Control Registers - U08 fpgaUFValvePWMControl; ///< Reg 89. Ultra filtration Valves PWM 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 fpgaConSensTD12Control; ///< Reg 90. Conductivity/Temperature Sensors 1 & 2 Control registers - U08 fpgaConSensTD34Control; ///< Reg 91. Conductivity/Temperature Sensors 3 & 4 Control registers - U16 fpgaConSensTD12_Addrs; ///< Reg 92. CDTD 1&2 Initialization Address register - U16 fpgaConSensTD12_Data_In; ///< Reg 94. CDTD 1&2 Initialization data register - U16 fpgaConSensTD34_Addrs; ///< Reg 96. CDTD 3&4 Initialization Address register - U16 fpgaConSensTD34_Data_In; ///< Reg 98. CDTD 3&4 Initialization data 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 100.Register for Remote update used by SW. + U16 fpgaRemoteUpdate_Write; ///< Reg 110.Register for Remote update used by SW. - U16 fpgaDGPSpeed; ///< Reg 102. DGP Speed/RPM Control - U08 fpgaDGPControl; ///< Reg 104. DGP Control - U08 fpgaSDPControl; ///< Reg 105. SDP Control - U16 fpgaSDPSpeed; ///< Reg 106. SDP Speed/RPM Control - U16 fpgaCPASpeed; ///< Reg 108. Acid Concentrate Pump Speed/RPM Control - U08 fpgaCPAControl; ///< Reg 110. Acid Concentrate Pump Control - U08 fpgaCPBControl; ///< Reg 111. BiCarb Concentrate Pump Control - U16 fpgaCPBSpeed; ///< Reg 112. BiCarb Concentrate Pump Speed/RPM Control + 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 fpgaBloodLeakSensorTest; ///< Reg 114. Blood leak sensor test - U08 fpgaBloodLeakUARTControl; ///< Reg 115. Blood leak sensor UART control - U08 fpgaBloodLeakFIFOTx; ///< Reg 116. Blood leak sensor FIFO transmit 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 } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -284,6 +395,7 @@ 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; // 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); @@ -353,7 +465,8 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR ) ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); + //TODO : Enable alarm later + //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); } } } @@ -367,20 +480,21 @@ * The setFPGAValveStates 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 - VDr/VDo.\n - * 1 - VTD.\n - * 2 - VHB.\n - * 3 - Vrp.\n - * 4 - VHo.\n - * 5 - VDB1.\n - * 6 - VP1.\n - * 7 - VPT.\n - * 8 - VDB2.\n - * 9 - VDi.\n - * 10 - VDo.\n - * 11 - VP2.\n - * 12 - VHi.\n - * 13..15 - reserved or unused. + * 0 - D53Valve.\n + * 1 - D52Valve.\n + * 2 - D8Valve.\n + * 3 - D54Valve.\n + * 4 - D14Valve.\n + * 5 - D65Valve.\n + * 6 - D64Valve.\n + * 7 - D31Valve.\n + * 8 - D34Valve.\n + * 9 - D35Valve.\n + * 10 - D40Valve.\n + * 11 - D47Valve.\n + * 12 - D3Valve.\n + * 13 - M4Valve.\n + * 14..15 - reserved or unused. * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints.fpgaValveControl * @param valveStates bit mask for the various valve states @@ -396,14 +510,14 @@ * The setFPGABCValveStates function sets the DD balancing chamber valve states with a * 8-bit set of states - one bit per valve, with a 1 meaning "energized" and a 0 * meaning "de-energized". The bit positions for these bit states are as follows: - * 0 - V1.\n - * 1 - V2.\n - * 2 - V3.\n - * 3 - V4.\n - * 4 - V5.\n - * 5 - V6.\n - * 6 - V7.\n - * 7 - V8.\n + * 0 - D23.\n + * 1 - D19.\n + * 2 - D25.\n + * 3 - D21.\n + * 4 - D24.\n + * 5 - D20.\n + * 6 - D26.\n + * 7 - D22.\n * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints.fpgaBCValveControl * @param valveStates bit mask for the balancing chamber valve states @@ -436,91 +550,119 @@ /*********************************************************************//** * @brief - * The setFPGADialysateOutPumpSpeed function sets the speed period for - * dialysate out pump (SDP). + * The setFPGAD48PumpSpeed function sets the speed for the + * spent dialysate pump (SDP). * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaSDPSpeed - * @param speed The dialysate out pump speed period + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpSpeed + * @param speed The spent dialysate pump speed * @return none *************************************************************************/ -void setFPGADialysateOutPumpSpeed( U16 speed ) +void setFPGAD48PumpSpeed( U16 speed ) { - fpgaActuatorSetPoints.fpgaSDPSpeed = speed; + fpgaActuatorSetPoints.fpgaD48PumpSpeed = speed; } /*********************************************************************//** * @brief - * The setFPGADialysateInPumpSpeed function sets the speed period for - * dialysate In pump (DGP). + * The setFPGAD12PumpSpeed function sets the speed for the + * fresh dialysate pump (DGP). * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDGPSpeed - * @param speed The dialysate In pump speed period + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpSpeed + * @param speed The fresh dialysate pump speed * @return none *************************************************************************/ -void setFPGADialysateInPumpSpeed( U16 speed ) +void setFPGAD12PumpSpeed( U16 speed ) { - fpgaActuatorSetPoints.fpgaDGPSpeed = speed; + fpgaActuatorSetPoints.fpgaD12PumpSpeed = speed; } /*********************************************************************//** * @brief - * The setFPGADialysateOutPumpControl function sets the controls for - * dialysate out pump (SDP). bit definitions To be defined(TBD) + * 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.fpgaSDPControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpControl * @param control The dialysate out pump controls * @return none *************************************************************************/ -void setFPGADialysateOutPumpControl( U08 control ) +void setFPGAD48PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaSDPControl = control; + fpgaActuatorSetPoints.fpgaD48PumpControl = control; } /*********************************************************************//** * @brief - * The setFPGADialysateInPumpControl function sets the controls for - * dialysate In pump (DGP). bit definitions To be defined(TBD) + * 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.fpgaDGPControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpControl * @param control The dialysate In pump controls * @return none *************************************************************************/ -void setFPGADialysateInPumpControl( U08 control ) +void setFPGAD12PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaDGPControl = control; + fpgaActuatorSetPoints.fpgaD12PumpControl = control; } /*********************************************************************//** * @brief - * The setFPGAAcidPumpSetStepSpeed function sets the step speed period for - * concentrate pump CPA. + * The setFPGAD11PumpSetStepSpeed function sets the step speed period for + * concentrate pump D11_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPASpeed + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ -void setFPGAAcidPumpSetStepSpeed( U16 stepSpeed ) +void setFPGAD11PumpSetStepSpeed( U16 stepSpeed ) { - fpgaActuatorSetPoints.fpgaCPASpeed = stepSpeed; + fpgaActuatorSetPoints.fpgaD11PumpSpeed = stepSpeed; } /*********************************************************************//** * @brief - * The setFPGABicarbSetStepSpeed function sets the step speed period for - * concentrate pump CP2. + * The setFPGAD10PumpSetStepSpeed function sets the step speed period for + * concentrate pump D10_Pump. * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPBSpeed + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ -void setFPGABicarbSetStepSpeed( U16 stepSpeed ) +void setFPGAD10PumpSetStepSpeed( U16 stepSpeed ) { - fpgaActuatorSetPoints.fpgaCPBSpeed = stepSpeed; + fpgaActuatorSetPoints.fpgaD10PumpSpeed = stepSpeed; } /*********************************************************************//** * @brief - * The setFPGAAcidPumpControl function sets the DVT concentrate pump 1 + * The setFPGAD76PumpSetStepSpeed function sets the step speed period for + * UF D76_Pump. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpSpeed + * @param stepSpeed The concentrate pump step speed period + * @return none + *************************************************************************/ +void setFPGAD76PumpSetStepSpeed( U16 stepSpeed ) +{ + fpgaActuatorSetPoints.fpgaD76PumpSpeed = stepSpeed; +} + +/*********************************************************************//** + * @brief + * The setFPGAD11PumpControl function sets the DVT concentrate pump 1 * (acid pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep @@ -529,19 +671,19 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPAControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl * @param control Concentrate pump control set * @return none *************************************************************************/ -void setFPGAAcidPumpControl( U08 control ) +void setFPGAD11PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaCPAControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaCPAControl |= control; + fpgaActuatorSetPoints.fpgaD11PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) + fpgaActuatorSetPoints.fpgaD11PumpControl |= control; } /*********************************************************************//** * @brief - * The setFPGABicarbPumpControl function sets the DVT concentrate pump 2 + * The setFPGAD10PumpControl function sets the DVT concentrate pump 2 * (bicarb pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep @@ -550,60 +692,688 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPBControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl * @param control Concentrate pump control set * @return none *************************************************************************/ -void setFPGABicarbPumpControl( U08 control ) +void setFPGAD10PumpControl( U08 control ) { - fpgaActuatorSetPoints.fpgaCPBControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaCPBControl |= control; + fpgaActuatorSetPoints.fpgaD10PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) + fpgaActuatorSetPoints.fpgaD10PumpControl |= control; } /*********************************************************************//** * @brief - * The setFPGAAcidPumpParkCmd function sets the DVT concentrate pump 1 + * 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.fpgaD76PumpControl + * @param control UF pump control set + * @return none + *************************************************************************/ +void setFPGAD76PumpControl( U08 control ) +{ + fpgaActuatorSetPoints.fpgaD76PumpControl &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) + fpgaActuatorSetPoints.fpgaD76PumpControl |= control; +} + +/*********************************************************************//** + * @brief + * The setFPGAD11PumpParkCmd function sets the DVT concentrate pump 1 * (acid pump) park command bit. * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPAControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl * @param Park command bit set * @return none *************************************************************************/ -void setFPGAAcidPumpParkCmd( void ) +void setFPGAD11PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaCPAControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + fpgaActuatorSetPoints.fpgaD11PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** * @brief - * The setFPGABicarbPumpParkCmd function sets the DVT concentrate pump 2 + * 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.fpgaCPBControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl * @param Park command bit set * @return none *************************************************************************/ -void setFPGABicarbPumpParkCmd( void ) +void setFPGAD10PumpParkCmd( void ) { - fpgaActuatorSetPoints.fpgaCPBControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + fpgaActuatorSetPoints.fpgaD10PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** * @brief + * The setFPGAD76PumpParkCmd function sets the Ultrafiltration pump + * (D76 pump) park command bit. + * bit 7: Park command bit + * bit 0-6: Other pump control bits (set in different function) + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl + * @param Park command bit set + * @return none + *************************************************************************/ +void setFPGAD76PumpParkCmd( void ) +{ + fpgaActuatorSetPoints.fpgaD76PumpControl |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands +} + +/*********************************************************************//** + * @brief + * The setFPGAD17CondReset function resets the FPGA Conductivity + * Sensor D17. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGAD17CondReset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD17CondReset function clears the reset of FPGA Conductivity + * Sensor D17. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGAD17CondReset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGAD17CondInitEnable function enables the FPGA Conductivity + * Sensor D17 initialzation procedure. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGAD17CondInitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD17CondInitEnable function clears the init process of FPGA Conductivity + * Sensor D17. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGAD17CondInitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGAD17CondWriteEnable function enables the FPGA Conductivity + * Sensor D17 write transaction. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.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. + * @return none + *************************************************************************/ +void setFPGAD17CondWriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD17CondWriteEnable function clears the write enable of FPGA Conductivity + * Sensor D17. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGAD17CondWriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGAD17CondReadEnable function enables the FPGA Conductivity + * Sensor D17 read transaction. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @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 setFPGAD17CondReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D17_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD17CondReadEnable function clears the read enable of FPGA Conductivity + * Sensor D17. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGAD17CondReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D17_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGAD27CondReset function resets the FPGA Conductivity + * Sensor D27. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGAD27CondReset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD27CondReset function clears the reset of FPGA Conductivity + * Sensor D27. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGAD27CondReset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D27_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGAD27CondInitEnable function enables the FPGA Conductivity + * Sensor D27 initialzation procedure. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGAD27CondInitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD27CondInitEnable function clears the init process of FPGA Conductivity + * Sensor D27. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGAD27CondInitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D27_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGAD27CondWriteEnable function enables the FPGA Conductivity + * Sensor D27 write transaction. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.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. + * @return none + *************************************************************************/ +void setFPGAD27CondWriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD27CondWriteEnable function clears the write enable of FPGA Conductivity + * Sensor D27. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGAD27CondWriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_D27_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGAD27CondReadEnable function enables the FPGA Conductivity + * Sensor D27 read transaction. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @warning: The address (setFPGACD12Address) register must be populated + * before invoking this read enable function to initiate read transaction + * with the sensor. + * @return none + *************************************************************************/ +void setFPGAD27CondReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_D27_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGAD27CondReadEnable function clears the read enable of FPGA Conductivity + * Sensor D27. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.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 TD2 read transaction (1), address needed - * bit 6: Enables TD2 write transaction (1), address and data needs to be set - * bit 5: Enable TD2 Init procedure (1) - * bit 4: reset TD2 Conduct sensor (1) - * bit 3: Enables TD1 read transaction (1), address needed - * bit 2: Enables TD1 write transaction (1), address and data needs to be set - * bit 1: Enable TD1 Init procedure (1) - * bit 0: reset TD1 Conduct sensor (1) + * 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 @@ -618,14 +1388,14 @@ * @brief * The setFpgaCD34Control function sets the FPGA Conductivity * Sensor control register for CD3&4. - * bit 7: Enables TD4 read transaction (1), address needed - * bit 6: Enables TD4 write transaction (1), address and data needs to be set - * bit 5: Enable TD4 Init procedure (1) - * bit 4: reset TD4 Conduct sensor (1) - * bit 3: Enables TD3 read transaction (1), address needed - * bit 2: Enables TD3 write transaction (1), address and data needs to be set - * bit 1: Enable TD3 Init procedure (1) - * bit 0: reset TD3 Conduct sensor (1) + * 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 @@ -638,6 +1408,25 @@ /*********************************************************************//** * @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 @@ -666,34 +1455,202 @@ /*********************************************************************//** * @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 input for write operations. + * 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( U16 data ) +void setFPGACD12Data( U32 data ) { fpgaActuatorSetPoints.fpgaConSensTD12_Data_In = data; } /*********************************************************************//** * @brief * The setFPGACD34Data function sets the conductivity sensor - * CD34 data input for write operations. + * 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( U16 data ) +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 + * @details \b Outputs: fpgaD5HeaterPWMControl + * @param control the PWM dutycycle to control the heater + * @return none + *************************************************************************/ +void setFPGAD5HeaterPWMControl( U08 control ) +{ + fpgaActuatorSetPoints.fpgaD5HeaterPWMControl = control; +} + +/*********************************************************************//** + * @brief + * The setFPGAD45HeaterPWMControl function sets the trimmer heater + * PWM input. + * @details \b Inputs: none + * @details \b Outputs: fpgaD45HeaterPWMControl + * @param control the PWM dutycycle to control the heater + * @return none + *************************************************************************/ +void setFPGAD45HeaterPWMControl( U08 control ) +{ + fpgaActuatorSetPoints.fpgaD45HeaterPWMControl = control; +} + +/*********************************************************************//** + * @brief + * The setFPGAD11PumpRevolutionCount function sets the Acid concentrate + * pump revolution count. + * @details \b Inputs: none + * @details \b Outputs: fpgaD11PumpRevCount + * @param count the number of revolution to be rotated for the pump. + * @return none + *************************************************************************/ +void setFPGAD11PumpRevolutionCount( U16 count ) +{ + fpgaActuatorSetPoints.fpgaD11PumpRevCount = count; +} + +/*********************************************************************//** + * @brief + * The setFPGAD10PumpRevolutionCount function sets the Bicarb concentrate + * pump revolution count. + * @details \b Inputs: none + * @details \b Outputs: fpgaD10PumpRevCount + * @param count the number of revolution to be rotated for the pump. + * @return none + *************************************************************************/ +void setFPGAD10PumpRevolutionCount( U16 count ) +{ + fpgaActuatorSetPoints.fpgaD10PumpRevCount = count; +} + +/*********************************************************************//** + * @brief + * The setFPGAD76PumpRevolutionCount function sets the UltraFilteration + * pump revolution count. + * @details \b Inputs: none + * @details \b Outputs: fpgaD76PumpRevCount + * @param count the number of revolution to be rotated for the pump. + * @return none + *************************************************************************/ +void setFPGAD76PumpRevolutionCount( U16 count ) +{ + fpgaActuatorSetPoints.fpgaD76PumpRevCount = count; +} + +/*********************************************************************//** + * @brief + * The setFPGAD5HeaterOnOffControl function sets the primary heater + * On/Off control. + * @details \b Inputs: none + * @details \b Outputs: fpgaGPIOControl + * @param flag Turn heater ON when true, otherwise not. + * @return none + *************************************************************************/ +void setFPGAD5HeaterOnOffControl( BOOL flag ) +{ + if ( TRUE == flag) + { + fpgaActuatorSetPoints.fpgaGPIOControl |= FPGA_D5_HEATER_CNTRL_BIT; + } + else + { + fpgaActuatorSetPoints.fpgaGPIOControl &= ~FPGA_D5_HEATER_CNTRL_BIT; + } +} + +/*********************************************************************//** + * @brief + * The setFPGAD5HeaterPWMEnableControl function sets whether the primary heater + * control based out of On/OFF (0) or PWM based control (1). + * @details \b Inputs: none + * @details \b Outputs: fpgaGPIOControl + * @param enable PWM based heater control when true, otherwise On/Off Control. + * @return none + *************************************************************************/ +void setFPGAD5HeaterPWMEnableControl( BOOL enable ) +{ + if ( TRUE == enable) + { + fpgaActuatorSetPoints.fpgaGPIOControl |= FPGA_D5_HEATER_PWM_ENABLE_BIT; + } + else + { + fpgaActuatorSetPoints.fpgaGPIOControl &= ~FPGA_D5_HEATER_PWM_ENABLE_BIT; + } +} + +/*********************************************************************//** + * @brief + * The setFPGAD5HeaterPWMLowState function sets the PWM low period( Off time) + * for AC heater. + * @details \b Inputs: none + * @details \b Outputs: fpgaACRelayPWMLow + * @param count the number of count that PWM stays low for the AC relay/heater. + * @return none + *************************************************************************/ +void setFPGAD5HeaterPWMLowState( U16 count ) +{ + fpgaActuatorSetPoints.fpgaACRelayPWMLow = count; +} + +/*********************************************************************//** + * @brief + * The setFPGAD5HeaterPWMPeriod function sets the PWM period( On and Off time) + * for AC heater. + * @details \b Inputs: none + * @details \b Outputs: fpgaACRelayPWMPeriod + * @param period the total period of PWM cycle ( On and Off time). + * @return none + *************************************************************************/ +void setFPGAD5HeaterPWMPeriod( U16 period ) +{ + fpgaActuatorSetPoints.fpgaACRelayPWMPeriod = period; +} + +/*********************************************************************//** + * @brief * The getFPGAVersions function gets the FPGA version numbers. * @details \b Inputs: fpgaHeader * @details \b Outputs: none @@ -709,45 +1666,163 @@ /*********************************************************************//** * @brief - * The getFPGADialysateOutPumpControl function gets the status of the + * The getFPGAD48PumpControl function gets the status of the * dialysate out pump control status bits. * bit 7: TBD * bit 6: TBD * bit 5: TBD * bit 4: TBD * bit 3: TBD - * bit 0-2: TBD + * bit 1-2: TBD + * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaSDPControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD48PumpControl * @return Dialysate Out pump control status bit *************************************************************************/ -U08 getFPGADialysateOutPumpControl( void ) +U08 getFPGAD48PumpControl( void ) { - return fpgaActuatorSetPoints.fpgaSDPControl; + return fpgaActuatorSetPoints.fpgaD48PumpControl; } /*********************************************************************//** * @brief - * The getFPGADialysateInPumpControl function gets the status of the + * The getFPGAD12PumpControl function gets the status of the * dialysate Inlet pump control status bits. * bit 7: TBD * bit 6: TBD * bit 5: TBD * bit 4: TBD * bit 3: TBD - * bit 0-2: TBD + * bit 1-2: TBD + * bit 0: Run (1), stop (0) * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaDGPControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD12PumpControl * @return Dialysate Inlet pump control status bit *************************************************************************/ -U08 getFPGADialysateInPumpControl( void ) +U08 getFPGAD12PumpControl( void ) { - return fpgaActuatorSetPoints.fpgaDGPControl; + return fpgaActuatorSetPoints.fpgaD12PumpControl; } /*********************************************************************//** * @brief - * The getFPGAAcidPumpControlStatus function gets the status of the + * The getFPGAD48PumpSpeed function gets the spent dialysate + * pump speed. + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaD48MeasuredSpeed + * @return Spent dialysate pump measured speed. + *************************************************************************/ +U16 getFPGAD48PumpSpeed( void ) +{ + return fpgaSensorReadings.fpgaD48MeasuredSpeed; +} + +/*********************************************************************//** + * @brief + * The getFPGAD12PumpSpeed function gets the fresh dialysate + * pump speed. + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaD12MeasuredSpeed + * @return fresh dialysate pump measured speed. + *************************************************************************/ +U16 getFPGAD12PumpSpeed( void ) +{ + return fpgaSensorReadings.fpgaD12MeasuredSpeed; +} + +/*********************************************************************//** + * @brief + * The getFPGAD12PumpErrorStatus function gets the fresh dialysate + * pump error status. + * bit 7-2: TBD + * bit 1 : spent dialysate pump error (1), no error(0) + * bit 0 : fresh dialysate pump error (1), no error(0) + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaD12D48PumpStatus + * @return fresh dialysate pump error status. + *************************************************************************/ +BOOL getFPGAD12PumpErrorStatus( void ) +{ + U08 mask = fpgaSensorReadings.fpgaD12D48PumpStatus & FPGA_D12_PUMP_ERROR_BIT; + BOOL result = ( mask > 0 ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAD48PumpErrorStatus function gets the spent dialysate + * pump error status. + * bit 7-2: TBD + * bit 1 : spent dialysate pump error (1), no error(0) + * bit 0 : fresh dialysate pump error (1), no error(0) + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaD12D48PumpStatus + * @return spent dialysate pump error status. + *************************************************************************/ +BOOL getFPGAD48PumpErrorStatus( void ) +{ + U08 mask = fpgaSensorReadings.fpgaD12D48PumpStatus & FPGA_D48_PUMP_ERROR_BIT; + BOOL result = ( mask > 0 ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAD12PumpCurrentFeedback function gets the fresh dialysate + * pump current consumption. + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaD12CurrentFeedback + * @return fresh dialysate pump measured current. + *************************************************************************/ +U16 getFPGAD12PumpCurrentFeedback( void ) +{ + return fpgaSensorReadings.fpgaD12CurrentFeedback; +} + +/*********************************************************************//** + * @brief + * The getFPGAD48PumpCurrentFeedback function gets the spent dialysate + * pump current consumption. + * @details \b Inputs: none + * @details \b Outputs: fpgaSensorReadings.fpgaD48CurrentFeedback + * @return spent dialysate pump measured current. + *************************************************************************/ +U16 getFPGAD48PumpCurrentFeedback( void ) +{ + return fpgaSensorReadings.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 + * @return fresh dialysate pump hall sensor based direction status. + *************************************************************************/ +U08 getFPGAD12PumpHallDirectionStatus( void ) +{ + return fpgaSensorReadings.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 + * @return spent dialysate pump hall sensor based direction status. + *************************************************************************/ +U08 getFPGAD48PumpHallDirectionStatus( void ) +{ + return fpgaSensorReadings.fpgaD48HallStatus; +} + +/*********************************************************************//** + * @brief + * The getFPGAD11PumpControlStatus function gets the status of the * acid pump control status bits. * bit 7: Park (set in different function) * bit 6: nSleep @@ -756,17 +1831,17 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPAControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD11PumpControl * @return Acid pump control status bit *************************************************************************/ -U08 getFPGAAcidPumpControlStatus( void ) +U08 getFPGAD11PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaCPAControl; + return fpgaActuatorSetPoints.fpgaD11PumpControl; } /*********************************************************************//** * @brief - * The getFPGABicarbPumpControlStatus function gets the DVT concentrate pump 2 + * The getFPGAD10PumpControlStatus function gets the DVT concentrate pump 2 * (bicarb pump) control mode. * bit 7: Park (set in different function) * bit 6: nSleep @@ -775,16 +1850,151 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPBControl + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD10PumpControl * @return Bicarb pump control status bit *************************************************************************/ -U08 getFPGABicarbPumpControlStatus( void ) +U08 getFPGAD10PumpControlStatus( void ) { - return fpgaActuatorSetPoints.fpgaCPBControl; + return fpgaActuatorSetPoints.fpgaD10PumpControl; } /*********************************************************************//** * @brief + * The getFPGAD76PumpControlStatus function gets the Ultrafilteration pump + * (D76 pump) control mode. + * bit 7: Park (set in different function) + * bit 6: nSleep + * bit 5: nReset + * bit 4: nEnable + * bit 3: Direction (1=Fwd, 0=Rev) + * bit 0-2: Microstepping resolution + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaD76PumpControl + * @return UF pump control status bit + *************************************************************************/ +U08 getFPGAD76PumpControlStatus( void ) +{ + return fpgaActuatorSetPoints.fpgaD76PumpControl; +} + +/*********************************************************************//** + * @brief + * The getFPGAConcentratePumpsFault function gets concentrate pumps fault + * reported by FGPA. + * @details \b Inputs: fpgaSensorReadings.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; +} + +/*********************************************************************//** + * @brief + * The getFPGAD11PumpIsParked function gets whether the acid pump is currently + * parked. + * @details \b Inputs: fpgaSensorReadings.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; + BOOL result = ( mask > 0 ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAD10PumpIsParked function gets whether the bicarb pump is currently + * parked. + * @details \b Inputs: fpgaSensorReadings.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; + BOOL result = ( mask > 0 ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAD11PumpParkFault function gets whether the acid pump park command + * has faulted. + * @details \b Inputs: fpgaSensorReadings.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; + BOOL result = ( mask > 0 ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAD10PumpParkFault function gets whether the bicarb pump park command + * has faulted. + * @details \b Inputs: fpgaSensorReadings.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; + BOOL result = ( mask > 0 ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getFPGAD11PumpHallSensePulseWidth function gets concentrate pump D11_Pump + * hall sense pulse width. + * @details \b Inputs: fpgaSensorReadings.fpgaD11PumpHallSense + * @details \b Outputs: none + * @return concentrate pump D11_Pump hall sense pulse width + *************************************************************************/ +U16 getFPGAD11PumpHallSensePulseWidth( void ) +{ + return fpgaSensorReadings.fpgaD11PumpHallSense; +} + +/*********************************************************************//** + * @brief + * The getFPGAD10PumpHallSensePulseWidth function gets concentrate pump D10_Pump + * hall sense pulse width. + * @details \b Inputs: fpgaSensorReadings.fpgaD10PumpHallSense + * @details \b Outputs: none + * @return concentrate pump D10_Pump hall sense pulse width + *************************************************************************/ +U16 getFPGAD10PumpHallSensePulseWidth( void ) +{ + return fpgaSensorReadings.fpgaD10PumpHallSense; +} + +/*********************************************************************//** + * @brief + * The getFPGAD76PumpHallSensePulseWidth function gets UF pump D76_Pump + * hall sense pulse width. + * @details \b Inputs: fpgaSensorReadings.fpgaD76PumpHallSense + * @details \b Outputs: none + * @return ultrafiltration pump D76_Pump hall sense pulse width + *************************************************************************/ +U16 getFPGAD76PumpHallSensePulseWidth( void ) +{ + return fpgaSensorReadings.fpgaD76PumpHallSense; +} + +/*********************************************************************//** + * @brief * The getFPGAValveStates function gets the latest sensed valve states. * See setFPGAValveStates for valve state bit positions. * @details \b Inputs: fpgaSensorReadings.fpgaValveStates @@ -826,527 +2036,717 @@ /*********************************************************************//** * @brief - * The getFPGAPnReadCount function gets hydraulics outlet pressure sensor counter of - * good I2C transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaPnReadCnt + * 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 getFPGAPnReadCount( void ) +U08 getFPGAD9PresReadCount( void ) { - return fpgaSensorReadings.fpgaPnReadCnt; + return fpgaSensorReadings.fpgaD9PresReadCnt; } /*********************************************************************//** * @brief - * The getFPGAPnErrorCount function gets hydraulics outlet pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaPnErrorCnt + * 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 getFPGAPnErrorCount( void ) +U08 getFPGAD9PresErrorCount( void ) { - return fpgaSensorReadings.fpgaPnErrorCnt; + return fpgaSensorReadings.fpgaD9PresErrorCnt; } /*********************************************************************//** * @brief - * The getFPGAPnRawPressure function gets hydraulics outlet pressure sensor raw + * The getFPGAD9PresRawPressure function gets hydraulics outlet pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaPnPressure + * @details \b Inputs: fpgaSensorReadings.fpgaD9PresPressure * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPnRawPressure( void ) +U16 getFPGAD9PresRawPressure( void ) { - return fpgaSensorReadings.fpgaPnPressure; + return fpgaSensorReadings.fpgaD9PresPressure; } /*********************************************************************//** * @brief - * The getFPGAPnRawTemperature function gets hydraulics outlet pressure sensor raw + * The getFPGAD9PresRawTemperature function gets hydraulics outlet pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaPnTemp + * @details \b Inputs: fpgaSensorReadings.fpgaD9PresTemp * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPnRawTemperature( void ) +U16 getFPGAD9PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaPnTemp; + return fpgaSensorReadings.fpgaD9PresTemp; } /*********************************************************************//** * @brief - * The getFPGAPCbReadCount function gets Bibag pressure sensor counter of - * good I2C transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaPCbReadCnt + * 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 getFPGAPCbReadCount( void ) +U08 getFPGAD66PresReadCount( void ) { - return fpgaSensorReadings.fpgaPCbReadCnt; + return fpgaSensorReadings.fpgaD66PresReadCnt; } /*********************************************************************//** * @brief - * The getFPGAPCbErrorCount function gets Bibag pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaPCbErrorCnt + * 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 getFPGAPCbErrorCount( void ) +U08 getFPGAD66PresErrorCount( void ) { - return fpgaSensorReadings.fpgaPCbErrorCnt; + return fpgaSensorReadings.fpgaD66PresErrorCnt; } /*********************************************************************//** * @brief - * The getFPGAPCbRawPressure function gets Bibag pressure sensor raw + * The getFPGAD66PresRawPressure function gets Bibag pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaPCbPressure + * @details \b Inputs: fpgaSensorReadings.fpgaD66PresPressure * @details \b Outputs: none * @return Latest Bibag pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPCbRawPressure( void ) +U16 getFPGAD66PresRawPressure( void ) { - return fpgaSensorReadings.fpgaPCbPressure; + return fpgaSensorReadings.fpgaD66PresPressure; } /*********************************************************************//** * @brief - * The getFPGAPCbRawTemperature function gets Bibag pressure sensor raw + * The getFPGAD66PresRawTemperature function gets Bibag pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaPCbTemp + * @details \b Inputs: fpgaSensorReadings.fpgaD66PresTemp * @details \b Outputs: none * @return Latest Bibag pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPCbRawTemperature( void ) +U16 getFPGAD66PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaPCbTemp; + return fpgaSensorReadings.fpgaD66PresTemp; } /*********************************************************************//** * @brief - * The getFPGAPDsReadCount function gets spent dialysate pressure sensor counter of - * good I2C transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaPDsReadCnt + * 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 getFPGAPDsReadCount( void ) +U08 getFPGAD51PresReadCount( void ) { - return fpgaSensorReadings.fpgaPDsReadCnt; + return fpgaSensorReadings.fpgaD51PresReadCnt; } /*********************************************************************//** * @brief - * The getFPGAPDsErrorCount function gets spent dialysate pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaPDsErrorCnt + * 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 getFPGAPDsErrorCount( void ) +U08 getFPGAD51PresErrorCount( void ) { - return fpgaSensorReadings.fpgaPDsErrorCnt; + return fpgaSensorReadings.fpgaD51PresErrorCnt; } /*********************************************************************//** * @brief - * The getFPGAPDsRawPressure function gets spent dialysate pressure sensor raw + * The getFPGAD51PresRawPressure function gets spent dialysate pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaPDsPressure + * @details \b Inputs: fpgaSensorReadings.fpgaD51PresPressure * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPDsRawPressure( void ) +U16 getFPGAD51PresRawPressure( void ) { - return fpgaSensorReadings.fpgaPDsPressure; + return fpgaSensorReadings.fpgaD51PresPressure; } /*********************************************************************//** * @brief - * The getFPGAPDsRawTemperature function gets spent dialysate pressure sensor raw + * The getFPGAD51PresRawTemperature function gets spent dialysate pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaPDsTemp + * @details \b Inputs: fpgaSensorReadings.fpgaD51PresTemp * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPDsRawTemperature( void ) +U16 getFPGAD51PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaPDsTemp; + return fpgaSensorReadings.fpgaD51PresTemp; } /*********************************************************************//** * @brief - * The getFPGAPDfReadCount function gets fresh dialysate pressure sensor counter of - * good I2C transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaPDfReadCnt + * 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 getFPGAPDfReadCount( void ) +U08 getFPGAD18PresReadCount( void ) { - return fpgaSensorReadings.fpgaPDfReadCnt; + return fpgaSensorReadings.fpgaD18PresReadCnt; } /*********************************************************************//** * @brief - * The getFPGAPDfErrorCount function gets fresh dialysate pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaPDfErrorCnt + * 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 getFPGAPDfErrorCount( void ) +U08 getFPGAD18PresErrorCount( void ) { - return fpgaSensorReadings.fpgaPDfErrorCnt; + return fpgaSensorReadings.fpgaD18PresErrorCnt; } /*********************************************************************//** * @brief - * The getFPGAPDfRawPressure function gets fresh dialysate pressure sensor raw + * The getFPGAD18PresRawPressure function gets fresh dialysate pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaPDfPressure + * @details \b Inputs: fpgaSensorReadings.fpgaD18PresPressure * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPDfRawPressure( void ) +U16 getFPGAD18PresRawPressure( void ) { - return fpgaSensorReadings.fpgaPDfPressure; + return fpgaSensorReadings.fpgaD18PresPressure; } /*********************************************************************//** * @brief - * The getFPGAPDfRawTemperature function gets fresh dialysate pressure sensor raw + * The getFPGAD18PresRawTemperature function gets fresh dialysate pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaPDfTemp + * @details \b Inputs: fpgaSensorReadings.fpgaD18PresTemp * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPDfRawTemperature( void ) +U16 getFPGAD18PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaPDfTemp; + return fpgaSensorReadings.fpgaD18PresTemp; } /*********************************************************************//** * @brief - * The getFPGAPtmReadCount function gets transmembrane pressure sensor counter of - * good I2C transmissions between FPGA and Sensor. - * @details \b Inputs: fpgaSensorReadings.fpgaPtmReadCnt + * 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 getFPGAPtmReadCount( void ) +U08 getFPGAD41PresReadCount( void ) { - return fpgaSensorReadings.fpgaPtmReadCnt; + return fpgaSensorReadings.fpgaD41PresReadCnt; } /*********************************************************************//** * @brief - * The getFPGAPtmErrorCount function gets transmembrane pressure sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaPtmErrorCnt + * 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 getFPGAPtmErrorCount( void ) +U08 getFPGAD41PresErrorCount( void ) { - return fpgaSensorReadings.fpgaPtmErrorCnt; + return fpgaSensorReadings.fpgaD41PresErrorCnt; } /*********************************************************************//** * @brief - * The getFPGAPtmRawPressure function gets transmembrane pressure sensor raw + * The getFPGAD41PresRawPressure function gets transmembrane pressure sensor raw * pressure value. - * @details \b Inputs: fpgaSensorReadings.fpgaPtmPressure + * @details \b Inputs: fpgaSensorReadings.fpgaD41PresPressure * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPtmRawPressure( void ) +U16 getFPGAD41PresRawPressure( void ) { - return fpgaSensorReadings.fpgaPtmPressure; + return fpgaSensorReadings.fpgaD41PresPressure; } /*********************************************************************//** * @brief - * The getFPGAPtmRawTemperature function gets transmembrane pressure sensor raw + * The getFPGAD41PresRawTemperature function gets transmembrane pressure sensor raw * temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaPtmTemp + * @details \b Inputs: fpgaSensorReadings.fpgaD41PresTemp * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPtmRawTemperature( void ) +U16 getFPGAD41PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaPtmTemp; + return fpgaSensorReadings.fpgaD41PresTemp; } /*********************************************************************//** * @brief - * The getFPGACD1ReadCount function gets CD1 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD1ReadCnt + * The getFPGAM1PresRawPressure function gets water inlet input pressure sensor + * raw pressure value. + * @details \b Inputs: fpgaSensorReadings.fpgaM1PresPressure * @details \b Outputs: none - * @return Latest CD1 conductivity sensor read count + * @return Latest water inlet input pressure sensor raw pressure data *************************************************************************/ -U08 getFPGACD1ReadCount( void ) +U16 getFPGAM1PresRawPressure( void ) { - return fpgaSensorReadings.fpgaCD1ReadCnt; + return fpgaSensorReadings.fpgaM1PresPressure; } /*********************************************************************//** * @brief - * The getFPGACD1ErrorCount function gets CD1 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD1ErrorCnt + * The getFPGAM1RawTemperature function gets water inlet input pressure sensor + * raw temperature value. + * @details \b Inputs: fpgaSensorReadings.fpgaM1PresTemp * @details \b Outputs: none - * @return Latest CD1 conductivity sensor read error count + * @return Latest water inlet input pressure sensor raw temperature data *************************************************************************/ -U08 getFPGACD1ErrorCount( void ) +U16 getFPGAM1PresRawTemperature( void ) { - return fpgaSensorReadings.fpgaCD1ErrorCnt; + return fpgaSensorReadings.fpgaM1PresTemp; } /*********************************************************************//** * @brief - * The getFPGACD1 function gets CD1 conductivity sensor value. + * The getFPGAM1PresReadCount function gets water inlet input pressure sensor + * counter of good SPI transmissions between FPGA and Sensor. + * @details \b Inputs: fpgaSensorReadings.fpgaM1PresReadCnt + * @details \b Outputs: none + * @return Latest water inlet input pressure sensor read count + *************************************************************************/ +U08 getFPGAM1PresReadCount( void ) +{ + return fpgaSensorReadings.fpgaM1PresReadCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGAM1PresErrorCount function gets water inlet input pressure + * sensor error count. + * @details \b Inputs: fpgaSensorReadings.fpgaM1PresErrorCnt + * @details \b Outputs: none + * @return Latest water inlet input pressure sensor read error count + *************************************************************************/ +U08 getFPGAM1PresErrorCount( void ) +{ + return fpgaSensorReadings.fpgaM1PresErrorCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGAM3PresRawPressure function gets water inlet output pressure sensor + * raw pressure value. + * @details \b Inputs: fpgaSensorReadings.fpgaM3PresPressure + * @details \b Outputs: none + * @return Latest water inlet output pressure sensor raw pressure data + *************************************************************************/ +U16 getFPGAM3PresRawPressure( void ) +{ + return fpgaSensorReadings.fpgaM3PresPressure; +} + +/*********************************************************************//** + * @brief + * The getFPGAM3PresRawTemperature function gets water inlet output pressure sensor + * raw temperature value. + * @details \b Inputs: fpgaSensorReadings.fpgaM3PresTemp + * @details \b Outputs: none + * @return Latest water inlet output pressure sensor raw temperature data + *************************************************************************/ +U16 getFPGAM3PresRawTemperature( void ) +{ + return fpgaSensorReadings.fpgaM3PresTemp; +} + +/*********************************************************************//** + * @brief + * The getFPGAM3PresReadCount function gets water inlet output pressure sensor + * counter of good SPI transmissions between FPGA and Sensor. + * @details \b Inputs: fpgaSensorReadings.fpgaM3PresReadCnt + * @details \b Outputs: none + * @return Latest water inlet output pressure sensor read count + *************************************************************************/ +U08 getFPGAM3PresReadCount( void ) +{ + return fpgaSensorReadings.fpgaM3PresReadCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGAM3PresErrorCount function gets water inlet output pressure + * sensor error count. + * @details \b Inputs: fpgaSensorReadings.fpgaM3PresErrorCnt + * @details \b Outputs: none + * @return Latest water inlet output pressure sensor read error count + *************************************************************************/ +U08 getFPGAM3PresErrorCount( void ) +{ + return fpgaSensorReadings.fpgaM3PresErrorCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGACD1ReadCount function gets D17 conductivity sensor read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD17CondReadCnt + * @details \b Outputs: none + * @return Latest D17 conductivity sensor read count + *************************************************************************/ +U08 getFPGAD17CondReadCount( void ) +{ + return fpgaSensorReadings.fpgaD17CondReadCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGAD17CondErrorCount function gets D17 conductivity sensor error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD17CondErrorCnt + * @details \b Outputs: none + * @return Latest D17 conductivity sensor read error count + *************************************************************************/ +U08 getFPGAD17CondErrorCount( void ) +{ + return fpgaSensorReadings.fpgaD17CondErrorCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGAD17Cond function gets D17 conductivity sensor value. * @details \b Inputs: fpgaSensorReadings.fpgaCD1 * @details \b Outputs: none - * @return Latest CD1 conductivity sensor value + * @return Latest D17 conductivity sensor value *************************************************************************/ -U16 getFPGACD1( void ) +U16 getFPGAD17Cond( void ) { - return fpgaSensorReadings.fpgaCD1Cond; + return fpgaSensorReadings.fpgaD17CondCond; } /*********************************************************************//** * @brief - * The getFPGACD1Temp function gets CD1 conductivity sensor temperature value. + * The getFPGAD17CondTemp function gets D17 conductivity sensor temperature value. * @details \b Inputs: fpgaSensorReadings.fpgaCD1Temp * @details \b Outputs: none - * @return Latest CD1 conductivity sensor temperature value + * @return Latest D17 conductivity sensor temperature value *************************************************************************/ -U16 getFPGACD1Temp( void ) +U16 getFPGAD17CondTemp( void ) { - return fpgaSensorReadings.fpgaCD1Temp; + return fpgaSensorReadings.fpgaD17CondTemp; } /*********************************************************************//** * @brief - * The getFPGACD1Data function gets CD1 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD1DataOut + * The getFPGAD17CondData function gets D17 conductivity sensor register value. + * @details \b Inputs: fpgaSensorReadings.fpgaD17CondDataOut * @details \b Outputs: none - * @return Latest CD1 conductivity sensor register data value + * @return Latest D17 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD1Data( void ) +U32 getFPGAD17CondData( void ) { - return fpgaSensorReadings.fpgaCD1DataOut; + return fpgaSensorReadings.fpgaD17CondDataOut; } /*********************************************************************//** * @brief - * The getFPGACD2ReadCount function gets CD2 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD2ReadCnt + * The getFPGAD27CondReadCount function gets D27 conductivity sensor read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD27CondReadCnt * @details \b Outputs: none - * @return Latest CD2 conductivity sensor read count + * @return Latest D27 conductivity sensor read count *************************************************************************/ -U08 getFPGACD2ReadCount( void ) +U08 getFPGAD27CondReadCount( void ) { - return fpgaSensorReadings.fpgaCD2ReadCnt; + return fpgaSensorReadings.fpgaD27CondReadCnt; } /*********************************************************************//** * @brief - * The getFPGACD2ErrorCount function gets CD2 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD2ErrorCnt + * The getFPGAD27CondErrorCount function gets D27 conductivity sensor error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD27CondErrorCnt * @details \b Outputs: none - * @return Latest CD2 conductivity sensor read error count + * @return Latest D27 conductivity sensor read error count *************************************************************************/ -U08 getFPGACD2ErrorCount( void ) +U08 getFPGAD27CondErrorCount( void ) { - return fpgaSensorReadings.fpgaCD2ErrorCnt; + return fpgaSensorReadings.fpgaD27CondErrorCnt; } /*********************************************************************//** * @brief - * The getFPGACD2 function gets CD2 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD2 + * The getFPGAD27Cond function gets D27 conductivity sensor value. + * @details \b Inputs: fpgaSensorReadings.fpgaD27Cond * @details \b Outputs: none - * @return Latest CD2 conductivity sensor value + * @return Latest D27 conductivity sensor value *************************************************************************/ -U16 getFPGACD2( void ) +U16 getFPGAD27Cond( void ) { - return fpgaSensorReadings.fpgaCD2Cond; + return fpgaSensorReadings.fpgaD27CondCond; } /*********************************************************************//** * @brief - * The getFPGACD2Temp function gets CD2 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD2Temp + * The getFPGAD27CondTemp function gets D27 conductivity sensor temperature value. + * @details \b Inputs: fpgaSensorReadings.fpgaD27CondTemp * @details \b Outputs: none - * @return Latest CD2 conductivity sensor temperature value + * @return Latest D27 conductivity sensor temperature value *************************************************************************/ -U16 getFPGACD2Temp( void ) +U16 getFPGAD27CondTemp( void ) { - return fpgaSensorReadings.fpgaCD2Temp; + return fpgaSensorReadings.fpgaD27CondTemp; } /*********************************************************************//** * @brief - * The getFPGACD2Data function gets CD2 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD2DataOut + * The getFPGAD27CondData function gets D27 conductivity sensor register value. + * @details \b Inputs: fpgaSensorReadings.fpgaD27CondDataOut * @details \b Outputs: none - * @return Latest CD2 conductivity sensor register data value + * @return Latest D27 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD2Data( void ) +U32 getFPGAD27CondData( void ) { - return fpgaSensorReadings.fpgaCD2DataOut; + return fpgaSensorReadings.fpgaD27CondDataOut; } /*********************************************************************//** * @brief - * The getFPGACD3ReadCount function gets CD3 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD3ReadCnt + * The getFPGAD29CondReadCount function gets D29 conductivity sensor read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD29CondReadCnt * @details \b Outputs: none - * @return Latest CD3 conductivity sensor read count + * @return Latest D29 conductivity sensor read count *************************************************************************/ -U08 getFPGACD3ReadCount( void ) +U08 getFPGAD29CondReadCount( void ) { - return fpgaSensorReadings.fpgaCD3ReadCnt; + return fpgaSensorReadings.fpgaD29CondReadCnt; } /*********************************************************************//** * @brief - * The getFPGACD3ErrorCount function gets CD3 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD3ErrorCnt + * The getFPGAD29CondErrorCount function gets D29 conductivity sensor error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD29CondErrorCnt * @details \b Outputs: none - * @return Latest CD3 conductivity sensor read error count + * @return Latest D29 conductivity sensor read error count *************************************************************************/ -U08 getFPGACD3ErrorCount( void ) +U08 getFPGAD29CondErrorCount( void ) { - return fpgaSensorReadings.fpgaCD3ErrorCnt; + return fpgaSensorReadings.fpgaD29CondErrorCnt; } /*********************************************************************//** * @brief - * The getFPGACD3 function gets CD3 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD3 + * The getFPGAD29Cond function gets D29 conductivity sensor value. + * @details \b Inputs: fpgaSensorReadings.fpgaD29Cond * @details \b Outputs: none - * @return Latest CD3 conductivity sensor value + * @return Latest D29 conductivity sensor value *************************************************************************/ -U16 getFPGACD3( void ) +U16 getFPGAD29Cond( void ) { - return fpgaSensorReadings.fpgaCD3Cond; + return fpgaSensorReadings.fpgaD29CondCond; } /*********************************************************************//** * @brief - * The getFPGACD3Temp function gets CD3 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD3Temp + * The getFPGAD29CondTemp function gets D29 conductivity sensor temperature value. + * @details \b Inputs: fpgaSensorReadings.fpgaD29CondTemp * @details \b Outputs: none - * @return Latest CD3 conductivity sensor temperature value + * @return Latest D29 conductivity sensor temperature value *************************************************************************/ -U16 getFPGACD3Temp( void ) +U16 getFPGAD29CondTemp( void ) { - return fpgaSensorReadings.fpgaCD3Temp; + return fpgaSensorReadings.fpgaD29CondTemp; } /*********************************************************************//** * @brief - * The getFPGACD3Data function gets CD3 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD3DataOut + * The getFPGAD29CondData function gets D29 conductivity sensor register value. + * @details \b Inputs: fpgaSensorReadings.fpgaD29CondDataOut * @details \b Outputs: none - * @return Latest CD3 conductivity sensor register data value + * @return Latest D29 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD3Data( void ) +U32 getFPGAD29CondData( void ) { - return fpgaSensorReadings.fpgaCD3DataOut; + return fpgaSensorReadings.fpgaD29CondDataOut; } /*********************************************************************//** * @brief - * The getFPGACD4ReadCount function gets CD4 conductivity sensor read count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD4ReadCnt + * The getFPGAD43CondReadCount function gets D43 conductivity sensor read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD43CondReadCnt * @details \b Outputs: none - * @return Latest CD4 conductivity sensor read count + * @return Latest D43 conductivity sensor read count *************************************************************************/ -U08 getFPGACD4ReadCount( void ) +U08 getFPGAD43CondReadCount( void ) { - return fpgaSensorReadings.fpgaCD4ReadCnt; + return fpgaSensorReadings.fpgaD43CondReadCnt; } /*********************************************************************//** * @brief - * The getFPGACD4ErrorCount function gets CD4 conductivity sensor error count. - * @details \b Inputs: fpgaSensorReadings.fpgaCD4ErrorCnt + * The getFPGAD43CondErrorCount function gets D43 conductivity sensor error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD43CondErrorCnt * @details \b Outputs: none - * @return Latest CD4 conductivity sensor read error count + * @return Latest D43 conductivity sensor read error count *************************************************************************/ -U08 getFPGACD4ErrorCount( void ) +U08 getFPGAD43CondErrorCount( void ) { - return fpgaSensorReadings.fpgaCD4ErrorCnt; + return fpgaSensorReadings.fpgaD43CondErrorCnt; } /*********************************************************************//** * @brief - * The getFPGACD4 function gets CD4 conductivity sensor value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD4 + * The getFPGAD43Cond function gets D43 conductivity sensor value. + * @details \b Inputs: fpgaSensorReadings.fpgaD43Cond * @details \b Outputs: none - * @return Latest CD4 conductivity sensor value + * @return Latest D43 conductivity sensor value *************************************************************************/ -U16 getFPGACD4( void ) +U16 getFPGAD43Cond( void ) { - return fpgaSensorReadings.fpgaCD4Cond; + return fpgaSensorReadings.fpgaD43CondCond; } /*********************************************************************//** * @brief - * The getFPGACD4Temp function gets CD4 conductivity sensor temperature value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD4Temp + * The getFPGAD43CondTemp function gets D43 conductivity sensor temperature value. + * @details \b Inputs: fpgaSensorReadings.fpgaD43CondTemp * @details \b Outputs: none - * @return Latest CD4 conductivity sensor temperature value + * @return Latest D43 conductivity sensor temperature value *************************************************************************/ -U16 getFPGACD4Temp( void ) +U16 getFPGAD43CondTemp( void ) { - return fpgaSensorReadings.fpgaCD4Temp; + return fpgaSensorReadings.fpgaD43CondTemp; } /*********************************************************************//** * @brief - * The getFPGACD4Data function gets CD4 conductivity sensor register value. - * @details \b Inputs: fpgaSensorReadings.fpgaCD4DataOut + * The getFPGAD43CondData function gets D43 conductivity sensor register value. + * @details \b Inputs: fpgaSensorReadings.fpgaD43CondDataOut * @details \b Outputs: none - * @return Latest CD4 conductivity sensor register data value + * @return Latest D43 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD4Data( void ) +U32 getFPGAD43CondData( void ) { - return fpgaSensorReadings.fpgaCD4DataOut; + return fpgaSensorReadings.fpgaD43CondDataOut; } /*********************************************************************//** * @brief - * The getFPGALevelSensor1 function gets the latest FPGA level sensor 1 + * The getFPGAD74CondReadCount function gets D74 conductivity sensor read count. + * @details \b Inputs: fpgaSensorReadings.fpgaD74CondReadCnt + * @details \b Outputs: none + * @return Latest D74 conductivity sensor read count + *************************************************************************/ +U08 getFPGAD74CondReadCount( void ) +{ + return fpgaSensorReadings.fpgaD74CondReadCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGAD74CondErrorCount function gets D74 conductivity sensor error count. + * @details \b Inputs: fpgaSensorReadings.fpgaD74CondErrorCnt + * @details \b Outputs: none + * @return Latest D74 conductivity sensor read error count + *************************************************************************/ +U08 getFPGAD74CondErrorCount( void ) +{ + return fpgaSensorReadings.fpgaD74CondErrorCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGAD74Cond function gets D74 conductivity sensor value. + * @details \b Inputs: fpgaSensorReadings.fpgaD74Cond + * @details \b Outputs: none + * @return Latest D74 conductivity sensor value + *************************************************************************/ +U16 getFPGAD74Cond( void ) +{ + return fpgaSensorReadings.fpgaD74CondCond; +} + +/*********************************************************************//** + * @brief + * The getFPGAD74CondTemp function gets D74 conductivity sensor temperature value. + * @details \b Inputs: fpgaSensorReadings.fpgaD74CondTemp + * @details \b Outputs: none + * @return Latest D74 conductivity sensor temperature value + *************************************************************************/ +U16 getFPGAD74CondTemp( void ) +{ + return fpgaSensorReadings.fpgaD74CondTemp; +} + +/*********************************************************************//** + * @brief + * The getFPGAD74CondData function gets D74 conductivity sensor register value. + * @details \b Inputs: fpgaSensorReadings.fpgaD74CondDataOut + * @details \b Outputs: none + * @return Latest D74 conductivity sensor register data value + *************************************************************************/ +U32 getFPGAD74CondData( void ) +{ + return fpgaSensorReadings.fpgaD74CondDataOut; +} + +/*********************************************************************//** + * @brief + * The getFPGAD63LevelSensor function gets the latest FPGA D63 level sensor * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaLevelSensor1 + * @details \b Inputs: fpgaSensorReadings.fpgaD63LevelSensor * @details \b Outputs: none - * @return last FPGA level sensor1 reading + * @return last FPGA D63 level sensor reading *************************************************************************/ -U16 getFPGALevelSensor1( void ) +U16 getFPGAD63LevelSensor( void ) { - return fpgaSensorReadings.fpgaLevelSensor1; + return fpgaSensorReadings.fpgaD63LevelSensor; } /*********************************************************************//** * @brief - * The getFPGALevelSensor2 function gets the latest FPGA level sensor 2 + * The getFPGAD46LevelSensor function gets the latest FPGA level sensor 2 * reading. - * @details \b Inputs: fpgaSensorReadings.fpgaLevelSensor2 + * @details \b Inputs: fpgaSensorReadings.fpgaD46LevelSensor * @details \b Outputs: none * @return last FPGA level sensor2 reading *************************************************************************/ -U16 getFPGALevelSensor2( void ) +U16 getFPGAD46LevelSensor( void ) { - return fpgaSensorReadings.fpgaLevelSensor2; + return fpgaSensorReadings.fpgaD46LevelSensor; } /*********************************************************************//** * @brief + * The getFPGAD6LevelStatus function gets the latest FPGA floater D6 level + * reading. + * @details \b Inputs: fpgaSensorReadings.fpgaD6FloaterStatus + * @details \b Outputs: none + * @return last FPGA floater D6 level reading + *************************************************************************/ +U08 getFPGAD6LevelStatus( void ) +{ + return ( fpgaSensorReadings.fpgaD6FloaterStatus & FPGA_D6_FLOATER_LEVEL_BIT ); +} + +/*********************************************************************//** + * @brief + * The getFPGAFloater2Status function gets the latest FPGA floater 2 level + * reading. + * @details \b Inputs: fpgaSensorReadings.fpgaFloater2Status + * @details \b Outputs: none + * @return last FPGA floater 2 level reading + *************************************************************************/ +U08 getFPGAFloater2Status( void ) +{ + return fpgaSensorReadings.fpgaFloater2Status; +} + +/*********************************************************************//** + * @brief * The getFPGATimerCount function gets the latest FPGA timer millisecond count. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none @@ -1359,6 +2759,236 @@ /*********************************************************************//** * @brief + * The getFPGAD1Temp function gets the inlet heat exchanger + * temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return inlet heat exchanger temperature + *************************************************************************/ +U32 getFPGAD1Temp( void ) +{ + return fpgaSensorReadings.fpgaD1Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGAX6Temp function gets the outlet heat exchanger + * temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return outlet heat exchanger temperature + *************************************************************************/ +U32 getFPGAX6Temp( void ) +{ + return fpgaSensorReadings.fpgaX6Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGAD4Temp function gets the hydraulics primary + * heater temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return hydraulics primary heater temperature + *************************************************************************/ +U32 getFPGAD4Temp( void ) +{ + return fpgaSensorReadings.fpgaD4Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGAD50Temp function gets the trimmer heater temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return trimmer heater temperature + *************************************************************************/ +U32 getFPGAD50Temp( void ) +{ + return fpgaSensorReadings.fpgaD50Temp; +} + +/*********************************************************************//** + * @brief + * The getFPGARTDReadCount function gets the RTD sensors group read count. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return RTD read count + *************************************************************************/ +U08 getFPGARTDReadCount( void ) +{ + return fpgaSensorReadings.fpgaRTDReadCnt; +} + +/*********************************************************************//** + * @brief + * The getFPGARTDCountErrorCycles function gets the FPGA incomplete sequences + * of reads from RTD ADC. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return count of in-complete sequences of reads from RTD ADC. + *************************************************************************/ +U08 getFPGARTDCountErrorCycles( void ) +{ + return fpgaSensorReadings.fpgaRTDCountErrorCycles; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroReadCount function gets the FPGA barometric sensor read count. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor read count + *************************************************************************/ +U08 getFPGABaroReadCount( void ) +{ + return fpgaSensorReadings.fpgaBaroReadCount; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroErrorCount function gets the FPGA barometric sensor error count. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor error count + *************************************************************************/ +U08 getFPGABaroErrorCount( void ) +{ + return fpgaSensorReadings.fpgaBaroErrorCount; +} + +/*********************************************************************//** + * @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; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressureSensitivity function gets the FPGA barometric pressure + * sensor sensitivity. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor sensitivity + *************************************************************************/ +U16 getFPGABaroPressureSensitivity( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff1; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressureOffset function gets the FPGA barometric pressure + * sensor offset. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor offset + *************************************************************************/ +U16 getFPGABaroPressureOffset( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff2; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTempCoeffOfPressSensitvity function gets the FPGA barometric + * pressure sensor temperature coefficient of pressure sensitivity. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficient of pressure sensitivity + *************************************************************************/ +U16 getFPGABaroTempCoeffOfPressSensitvity( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff3; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTempCoeffOfPressOffset function gets the FPGA barometric + * pressure sensor temperature coefficient of pressure offset. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficient of pressure offset + *************************************************************************/ +U16 getFPGABaroTempCoeffOfPressOffset( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff4; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroReferenceTemperature function gets the FPGA barometric pressure + * sensor reference temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor reference temperature + *************************************************************************/ +U16 getFPGABaroReferenceTemperature( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff5; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTempCoeffOfTemperature function gets the FPGA barometric pressure + * sensor temperature coefficient of temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficient of temperature + *************************************************************************/ +U16 getFPGABaroTempCoeffOfTemperature( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCoeff6; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroCoeffsCRC function gets the FPGA barometric pressure + * sensor temperature coefficients' CRC. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature coefficients' CRC + *************************************************************************/ +U16 getFPGABaroCoeffsCRC( void ) +{ + return fpgaSensorReadings.fpgaBaroPROMCRC; +} + +/*********************************************************************//** + * @brief + * The getFPGABaroPressure function gets the FPGA barometric pressure sensor + * pressure. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor pressure + *************************************************************************/ +U32 getFPGABaroPressure( void ) +{ + return ( fpgaSensorReadings.fpgaBaroPressure & MASK_OFF_U32_MSB ); +} + +/*********************************************************************//** + * @brief + * The getFPGABaroTemperature function gets the FPGA barometric pressure sensor + * temperature. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return barometric pressure sensor temperature + *************************************************************************/ +U32 getFPGABaroTemperature( void ) +{ + return ( fpgaSensorReadings.fpgaBaroTemperature & MASK_OFF_U32_MSB ); +} + +/*********************************************************************//** + * @brief * The checkFPGACommFailure function increments the FPGA comm failure * windowed timer and returns whether or not the number of failures in * the window have been reached. @@ -1372,13 +3002,53 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + //TODO : Enable alarm later + //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) } } } /*********************************************************************//** * @brief + * The getFPGAD11PumpRevolutionCountStatus function gets the current revolution of + * acid concentrate pump (down counter). + * @details \b Inputs: fpgaD11PumpStepCountStatus + * @details \b Outputs: none + * @return the current revolution of the acid concentrate pump + *************************************************************************/ +U16 getFPGAD11PumpRevolutionCountStatus( void ) +{ + return fpgaSensorReadings.fpgaD11PumpStepCountStatus; +} + +/*********************************************************************//** + * @brief + * The getFPGAD10PumpRevolutionCountStatus function gets the current revolution of + * bicarb concentrate pump (down counter). + * @details \b Inputs: fpgaD10PumpStepCountStatus + * @details \b Outputs: none + * @return the current revolution of the bicarb concentrate pump + *************************************************************************/ +U16 getFPGAD10PumpRevolutionCountStatus( void ) +{ + return fpgaSensorReadings.fpgaD10PumpStepCountStatus; +} + +/*********************************************************************//** + * @brief + * The getFPGAD76PumpRevolutionCountStatus function gets the current revolution of + * UF pump (down counter) status. + * @details \b Inputs: fpgaD76PumpStepCountStatus + * @details \b Outputs: none + * @return the current revolution of the UF pump + *************************************************************************/ +U16 getFPGAD76PumpRevolutionCountStatus( void ) +{ + return fpgaSensorReadings.fpgaD76PumpStepCountStatus; +} + +/*********************************************************************//** + * @brief * The checkFPGAAFEOEFailure function increments the FPGA comm failure * windowed timer if an FE or OE error has occurred and returns whether * or not the number of failures in @@ -1400,7 +3070,8 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + //TODO : Enable alarm later + //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) status = TRUE; } }