Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r119a861592835f560bc3fb41bad2a1b1299d8e5d -r8d390efa9309c8a0f430ba4652528fdbdbb6e2b8 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 119a861592835f560bc3fb41bad2a1b1299d8e5d) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 8d390efa9309c8a0f430ba4652528fdbdbb6e2b8) @@ -51,10 +51,24 @@ #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_CD1_RESET_BIT 0x01 ///< Conductivity Sensor CD1 reset bit mask. +#define FPGA_CD1_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor CD1 Initialization enable bit mask. +#define FPGA_CD1_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor CD1 write enable bit mask. +#define FPGA_CD1_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor CD1 read enable bit mask. +#define FPGA_CD2_RESET_BIT 0x10 ///< Conductivity Sensor CD2 reset bit mask. +#define FPGA_CD2_INIT_ENABLE_BIT 0x20 ///< Conductivity Sensor CD2 Initialization enable bit mask. +#define FPGA_CD2_WR_ENABLE_BIT 0x40 ///< Conductivity Sensor CD2 write enable bit mask. +#define FPGA_CD2_RD_ENABLE_BIT 0x80 ///< Conductivity Sensor CD2 read enable bit mask. +#define FPGA_CD3_RESET_BIT 0x01 ///< Conductivity Sensor CD3 reset bit mask. +#define FPGA_CD3_INIT_ENABLE_BIT 0x02 ///< Conductivity Sensor CD3 Initialization enable bit mask. +#define FPGA_CD3_WR_ENABLE_BIT 0x04 ///< Conductivity Sensor CD3 write enable bit mask. +#define FPGA_CD3_RD_ENABLE_BIT 0x08 ///< Conductivity Sensor CD3 read enable bit mask. +#define FPGA_CD4_RESET_BIT 0x10 ///< Conductivity Sensor CD4 reset bit mask. +#define FPGA_CD4_INIT_ENABLE_BIT 0x20 ///< Conductivity Sensor CD4 Initialization enable bit mask. +#define FPGA_CD4_WR_ENABLE_BIT 0x40 ///< Conductivity Sensor CD4 write enable bit mask. +#define FPGA_CD4_RD_ENABLE_BIT 0x80 ///< Conductivity Sensor CD4 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. @@ -102,72 +116,72 @@ 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 fpgaPnPressure; ///< Reg 264. Pn/PHo MPM pressure sensor RAW pressure data + U16 fpgaPnTemp; ///< Reg 266. Pn/PHo MPM pressure sensor RAW temperature data + U08 fpgaPnReadCnt; ///< Reg 268. Pn/PHo Counter for good I2C transmission b/w FPGA and sensor + U08 fpgaPnErrorCnt; ///< Reg 229. Pn/PHo Counter for bad I2C 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 fpgaPCbPressure; ///< Reg 270. PCb/PDB MPM pressure sensor RAW pressure data + U16 fpgaPCbTemp; ///< Reg 272. PCb/PDB MPM pressure sensor RAW temperature data + U08 fpgaPCbReadCnt; ///< Reg 274. PCb/PDB Counter for good I2C transmission b/w FPGA and sensor + U08 fpgaPCbErrorCnt; ///< Reg 275. PCb/PDB Counter for bad I2C 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 fpgaPDsPressure; ///< Reg 276. PDs MPM pressure sensor RAW pressure data + U16 fpgaPDsTemp; ///< Reg 278. PDs MPM pressure sensor RAW temperature data + U08 fpgaPDsReadCnt; ///< Reg 280. PDs Counter for good I2C transmission b/w FPGA and sensor + U08 fpgaPDsErrorCnt; ///< Reg 281. PDs Counter for bad I2C 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 fpgaPDfPressure; ///< Reg 282. PDf MPM pressure sensor RAW pressure data + U16 fpgaPDfTemp; ///< Reg 284. PDf MPM pressure sensor RAW temperature data + U08 fpgaPDfReadCnt; ///< Reg 286. PDf Counter for good I2C transmission b/w FPGA and sensor + U08 fpgaPDfErrorCnt; ///< Reg 287. PDf Counter for bad I2C 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 fpgaPtmPressure; ///< Reg 288. Ptm MPM pressure sensor RAW pressure data + U16 fpgaPtmTemp; ///< Reg 290. Ptm MPM pressure sensor RAW temperature data + U08 fpgaPtmReadCnt; ///< Reg 292. Ptm Counter for good I2C transmission b/w FPGA and sensor + U08 fpgaPtmErrorCnt; ///< Reg 293. Ptm Counter for bad I2C 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 + U32 fpgaCD1DataOut; ///< Reg 294. Data read from Conductivity Sensor 1 register + U16 fpgaCD1Cond; ///< Reg 298. CD1 conductivity + U16 fpgaCD1Temp; ///< Reg 300. CD1 Temperature + U08 fpgaCD1ReadCnt; ///< Reg 302. CD1 successful read count + U08 fpgaCD1ErrorCnt; ///< Reg 303. CD1 error read count - 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 + U32 fpgaCD2DataOut; ///< Reg 304. Data read from Conductivity Sensor 2 register + U16 fpgaCD2Cond; ///< Reg 308. CD2 conductivity + U16 fpgaCD2Temp; ///< Reg 310. CD2 Temperature + U08 fpgaCD2ReadCnt; ///< Reg 312. CD2 successful read count + U08 fpgaCD2ErrorCnt; ///< Reg 313. CD2 error read count - 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 fpgaCD3DataOut; ///< Reg 314. Data read from Conductivity Sensor 3 register + U16 fpgaCD3Cond; ///< Reg 318. CD3 conductivity + U16 fpgaCD3Temp; ///< Reg 320. CD3 Temperature + U08 fpgaCD3ReadCnt; ///< Reg 322. CD3 successful read count + U08 fpgaCD3ErrorCnt; ///< Reg 323. CD3 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 fpgaCD4DataOut; ///< Reg 324. Data read from Conductivity Sensor 4 register + U16 fpgaCD4Cond; ///< Reg 328. CD4 conductivity + U16 fpgaCD4Temp; ///< Reg 330. CD4 Temperature + U08 fpgaCD4ReadCnt; ///< Reg 332. CD4 successful read count + U08 fpgaCD4ErrorCnt; ///< Reg 333. CD4 error read count - U16 fpgaLevelSensor1; ///< Reg 346. Level Sensor 1 - U16 fpgaLevelSensor2; ///< Reg 348. Level Sensor 2 + U16 fpgaLevelSensor1; ///< Reg 334. Level Sensor 1 + U16 fpgaLevelSensor2; ///< Reg 336. Level Sensor 2 - U08 fpgaHallSensInputs; ///< Reg 350. Hall sensor Inputs + U08 fpgaHallSensInputs; ///< Reg 338. 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 fpgaBldTxFIFOCnt; ///< Reg 339. Blood leak sensor transmit FIFO count + U16 fpgaBldRxErrorCnt; ///< Reg 340. Blood leak sensor Receive error count + U16 fpgaBldRxFIFOCnt; ///< Reg 342. Blood leak sensor Receive FIFO count + U08 fpgaBldRxFIFODataOut; ///< Reg 344. Blood leak sensor Receive data + U08 fpgaBldPulseStatus; ///< Reg 345. 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 + U16 fpgaValveStates; ///< Reg 346. Valve status read + U16 fpgaValvePWMEnableStates; ///< Reg 348. Valve PWM Enable status read + U08 fpgaValveBCStates; ///< Reg 350. Balancing chamber Valves states + U08 fpgaValveBCPWMStates; ///< Reg 351. Balancing Chamber Valve PWM states + U08 fpgaValveUFStates; ///< Reg 352. Ultrafiltration Valves states + U08 fpgaValveUFPWMStates; ///< Reg 353. Ultrafiltration Valves PWM states } DD_FPGA_SENSORS_T; typedef struct @@ -225,24 +239,24 @@ 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 + U32 fpgaConSensTD12_Data_In; ///< Reg 94. CDTD 1&2 Initialization data register + U16 fpgaConSensTD34_Addrs; ///< Reg 98. CDTD 3&4 Initialization Address register + U32 fpgaConSensTD34_Data_In; ///< Reg 100. CDTD 3&4 Initialization data register - U16 fpgaRemoteUpdate_Write; ///< Reg 100.Register for Remote update used by SW. + U16 fpgaRemoteUpdate_Write; ///< Reg 104.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 fpgaDGPSpeed; ///< Reg 106. DGP Speed/RPM Control + U08 fpgaDGPControl; ///< Reg 108. DGP Control + U08 fpgaSDPControl; ///< Reg 109. SDP Control + U16 fpgaSDPSpeed; ///< Reg 110. SDP Speed/RPM Control + U16 fpgaCPASpeed; ///< Reg 112. Acid Concentrate Pump Speed/RPM Control + U08 fpgaCPAControl; ///< Reg 114. Acid Concentrate Pump Control + U08 fpgaCPBControl; ///< Reg 115. BiCarb Concentrate Pump Control + U16 fpgaCPBSpeed; ///< Reg 116. 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 fpgaBloodLeakSensorTest; ///< Reg 118. Blood leak sensor test + U08 fpgaBloodLeakUARTControl; ///< Reg 119. Blood leak sensor UART control + U08 fpgaBloodLeakFIFOTx; ///< Reg 120. Blood leak sensor FIFO transmit control } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -594,6 +608,478 @@ /*********************************************************************//** * @brief + * The setFPGACD1Reset function resets the FPGA Conductivity + * Sensor CD1. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD1Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD1_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD1Reset function clears the reset of FPGA Conductivity + * Sensor CD1. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD1Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD1_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD1InitEnable function enables the FPGA Conductivity + * Sensor CD1 initialzation procedure. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD1InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD1_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD1InitEnable function clears the init process of FPGA Conductivity + * Sensor CD1. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD1InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD1_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD1WriteEnable function enables the FPGA Conductivity + * Sensor CD1 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 setFPGACD1WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD1_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD1WriteEnable function clears the write enable of FPGA Conductivity + * Sensor CD1. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD1WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD1_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD1ReadEnable function enables the FPGA Conductivity + * Sensor CD1 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 setFPGACD1ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD1_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD1ReadEnable function clears the read enable of FPGA Conductivity + * Sensor CD1. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD1ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD1_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD2Reset function resets the FPGA Conductivity + * Sensor CD2. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD2Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD2_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD2Reset function clears the reset of FPGA Conductivity + * Sensor CD2. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD2Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD2_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD2InitEnable function enables the FPGA Conductivity + * Sensor CD2 initialzation procedure. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD2InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD2_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD2InitEnable function clears the init process of FPGA Conductivity + * Sensor CD2. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD2InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD2_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD2WriteEnable function enables the FPGA Conductivity + * Sensor CD2 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 setFPGACD2WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD2_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD2WriteEnable function clears the write enable of FPGA Conductivity + * Sensor CD2. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD2WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD2_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD2ReadEnable function enables the FPGA Conductivity + * Sensor CD2 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 setFPGACD2ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control |= FPGA_CD2_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD2ReadEnable function clears the read enable of FPGA Conductivity + * Sensor CD2. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD12Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD2ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD12Control &= ~FPGA_CD2_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGCD3Reset function resets the FPGA Conductivity + * Sensor CD3. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD3Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD3_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD3Reset function clears the reset of FPGA Conductivity + * Sensor CD3. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD3Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD3_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD3InitEnable function enables the FPGA Conductivity + * Sensor CD3 initialzation procedure. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD3InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD3_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD3InitEnable function clears the init process of FPGA Conductivity + * Sensor CD3. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD3InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD3_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD3WriteEnable function enables the FPGA Conductivity + * Sensor CD3 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 setFPGACD3WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD3_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD3WriteEnable function clears the write enable of FPGA Conductivity + * Sensor CD3. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD3WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD3_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD3ReadEnable function enables the FPGA Conductivity + * Sensor CD3 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 setFPGACD3ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD3_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD3ReadEnable function clears the read enable of FPGA Conductivity + * Sensor CD3. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD3ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD3_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD4Reset function resets the FPGA Conductivity + * Sensor CD4. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD4Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD4_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD4Reset function clears the reset of FPGA Conductivity + * Sensor CD4. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD4Reset( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD4_RESET_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD4InitEnable function enables the FPGA Conductivity + * Sensor CD4 initialzation procedure. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void setFPGACD4InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD4_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD4InitEnable function clears the init process of FPGA Conductivity + * Sensor CD4. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD4InitEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD4_INIT_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD4WriteEnable function enables the FPGA Conductivity + * Sensor CD4 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 setFPGACD4WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD4_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD4WriteEnable function clears the write enable of FPGA Conductivity + * Sensor CD4. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD4WriteEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD4_WR_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The setFPGACD4ReadEnable function enables the FPGA Conductivity + * Sensor CD4 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 setFPGACD4ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control |= FPGA_CD4_RD_ENABLE_BIT; +} + +/*********************************************************************//** + * @brief + * The clearFPGACD4ReadEnable function clears the read enable of FPGA Conductivity + * Sensor CD4. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaConSensTD34Control + * @param none + * @return none + *************************************************************************/ +void clearFPGACD4ReadEnable( void ) +{ + fpgaActuatorSetPoints.fpgaConSensTD34Control &= ~FPGA_CD4_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 @@ -673,7 +1159,7 @@ * @param data The conductivity sensor CD12 Data * @return none *************************************************************************/ -void setFPGACD12Data( U16 data ) +void setFPGACD12Data( U32 data ) { fpgaActuatorSetPoints.fpgaConSensTD12_Data_In = data; } @@ -687,7 +1173,7 @@ * @param data The conductivity sensor CD34 Data * @return none *************************************************************************/ -void setFPGACD34Data( U16 data ) +void setFPGACD34Data( U32 data ) { fpgaActuatorSetPoints.fpgaConSensTD34_Data_In = data; } @@ -857,7 +1343,7 @@ * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPnRawPressure( void ) +U16 getFPGAPnRawPressure( void ) { return fpgaSensorReadings.fpgaPnPressure; } @@ -870,7 +1356,7 @@ * @details \b Outputs: none * @return Latest hydraulics outlet pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPnRawTemperature( void ) +U16 getFPGAPnRawTemperature( void ) { return fpgaSensorReadings.fpgaPnTemp; } @@ -908,7 +1394,7 @@ * @details \b Outputs: none * @return Latest Bibag pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPCbRawPressure( void ) +U16 getFPGAPCbRawPressure( void ) { return fpgaSensorReadings.fpgaPCbPressure; } @@ -921,7 +1407,7 @@ * @details \b Outputs: none * @return Latest Bibag pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPCbRawTemperature( void ) +U16 getFPGAPCbRawTemperature( void ) { return fpgaSensorReadings.fpgaPCbTemp; } @@ -959,7 +1445,7 @@ * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPDsRawPressure( void ) +U16 getFPGAPDsRawPressure( void ) { return fpgaSensorReadings.fpgaPDsPressure; } @@ -972,7 +1458,7 @@ * @details \b Outputs: none * @return Latest spent dialysate pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPDsRawTemperature( void ) +U16 getFPGAPDsRawTemperature( void ) { return fpgaSensorReadings.fpgaPDsTemp; } @@ -1010,7 +1496,7 @@ * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPDfRawPressure( void ) +U16 getFPGAPDfRawPressure( void ) { return fpgaSensorReadings.fpgaPDfPressure; } @@ -1023,7 +1509,7 @@ * @details \b Outputs: none * @return Latest fresh dialysate pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPDfRawTemperature( void ) +U16 getFPGAPDfRawTemperature( void ) { return fpgaSensorReadings.fpgaPDfTemp; } @@ -1061,7 +1547,7 @@ * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw pressure data *************************************************************************/ -U32 getFPGAPtmRawPressure( void ) +U16 getFPGAPtmRawPressure( void ) { return fpgaSensorReadings.fpgaPtmPressure; } @@ -1074,7 +1560,7 @@ * @details \b Outputs: none * @return Latest transmembrane pressure sensor raw temperature data *************************************************************************/ -U32 getFPGAPtmRawTemperature( void ) +U16 getFPGAPtmRawTemperature( void ) { return fpgaSensorReadings.fpgaPtmTemp; } @@ -1134,7 +1620,7 @@ * @details \b Outputs: none * @return Latest CD1 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD1Data( void ) +U32 getFPGACD1Data( void ) { return fpgaSensorReadings.fpgaCD1DataOut; } @@ -1194,7 +1680,7 @@ * @details \b Outputs: none * @return Latest CD2 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD2Data( void ) +U32 getFPGACD2Data( void ) { return fpgaSensorReadings.fpgaCD2DataOut; } @@ -1254,7 +1740,7 @@ * @details \b Outputs: none * @return Latest CD3 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD3Data( void ) +U32 getFPGACD3Data( void ) { return fpgaSensorReadings.fpgaCD3DataOut; } @@ -1314,7 +1800,7 @@ * @details \b Outputs: none * @return Latest CD4 conductivity sensor register data value *************************************************************************/ -U16 getFPGACD4Data( void ) +U32 getFPGACD4Data( void ) { return fpgaSensorReadings.fpgaCD4DataOut; }