Index: firmware/App/Controllers/ConcentratePumps.h =================================================================== diff -u -r3b84fc79b2fd6c7a447e54e4fe821447f613af59 -rc49f9ed931d60e5bd1d0a406fde6c9fe1437f73b --- firmware/App/Controllers/ConcentratePumps.h (.../ConcentratePumps.h) (revision 3b84fc79b2fd6c7a447e54e4fe821447f613af59) +++ firmware/App/Controllers/ConcentratePumps.h (.../ConcentratePumps.h) (revision c49f9ed931d60e5bd1d0a406fde6c9fe1437f73b) @@ -19,6 +19,7 @@ #define __CONCENTRATE_PUMPS_H__ #include "DDCommon.h" +#include "DDDefs.h" //#include "NVMgmt.h" /** @@ -43,16 +44,6 @@ #define PARK_CONC_PUMPS TRUE ///< For park parameter to requestConcentratePumpOff(). #define NO_PARK_CONC_PUMPS FALSE ///< For park parameter to requestConcentratePumpOff(). -/// Enumeration of concentrate pumps. -typedef enum ConcentratePumps -{ - D11_PUMP = 0, ///< Acid concentrate pump - CONCENTRATEPUMPS_FIRST = D11_PUMP, ///< First concentrate pump in list - D10_PUMP, ///< Bicarbonate concentrate pump - D76_PUMP, ///< ultrafiltration pump - NUM_OF_CONCENTRATE_PUMPS ///< Number of concentrate pumps -} CONCENTRATE_PUMPS_T; - /// Concentrate pump data struct. typedef struct { Index: firmware/App/Drivers/ConductivitySensors.c =================================================================== diff -u -r83bae6ae5f7f26a3511d1d6965310fd8ac9ad496 -rc49f9ed931d60e5bd1d0a406fde6c9fe1437f73b --- firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 83bae6ae5f7f26a3511d1d6965310fd8ac9ad496) +++ firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision c49f9ed931d60e5bd1d0a406fde6c9fe1437f73b) @@ -73,6 +73,11 @@ #define SIEMENS_TO_MICROSIEMENS_CONVERSION 1000000.0F ///< Siemens to microSiemens conversion factor. #define KOHMS_TO_OHMS 1000.0F ///< Kilo ohms to ohms conversion factor. +#define COND_SENS_CMD_SETCAL 0x1 ///< Bit 0 set to 1 to send command set calibration data to FPGA +#define COND_SENS_CMD_SET_SN_HW 0x2 ///< Bit 1 set to 1 to send command set hardware version and serial number to FPGA +#define COND_SENS_CMD_RESET 0x4 ///< Bit 2 set to 1 to send command reset sensor to FPGA + + /// Defined states for the conductivity write transaction. typedef enum Conductvity_States { @@ -343,48 +348,34 @@ conductivitySensorStatus[ P18_COND ].calMemCount = getFPGAP18CalMemCounter(); } + +/*********************************************************************//** + * @brief + * The writeConductivitySensorCalData function sets the calibration data of + * given conductivity sensor in the flash memory of the sensor. + * @details \b Inputs: conductivityCalRecord + * @details \b Outputs: none + * @param sensorId Sensor ID conductivity sensor + * @return none + *************************************************************************/ static void writeConductivitySensorCalData( CONDUCTIVITY_SENSORS_T sensorId ) { - // Update cal data and counter for each conductivity sensor - U32 calData = conductivitySensorStatus[ sensorId ].calData; - U08 command; - - switch ( sensorId ) - { - case D17_COND: - setFPGAD17CondCalData( calData ); - break; - - case D27_COND: - setFPGAD27CondCalData( calData ); - break; - - case D29_COND: - setFPGAD29CondCalData( calData ); - break; - - case D43_COND: - setFPGAD43CondCalData( calData ); - break; - - case D74_COND: - setFPGAD74CondCalData( calData ); - break; - - case P9_COND: - setFPGAP9CondCalData( calData ); - break; - - case P18_COND: - setFPGAP18CondCalData( calData ); - break; - - default: - break; - } - - setFPGAConductivitySensorId( (U08)sensorId ); - setFPGAConductivitySensorCommand( (U08) command ); + setFPGACondSensCalData1( conductivityCalRecord[ sensorId ].K_high ); + setFPGACondSensCalData2( conductivityCalRecord[ sensorId ].alpha_high ); + setFPGACondSensCalData3( conductivityCalRecord[ sensorId ].eta_high ); + setFPGACondSensCalData4( conductivityCalRecord[ sensorId ].zeta_high ); + setFPGACondSensCalData5( conductivityCalRecord[ sensorId ].K_low ); + setFPGACondSensCalData6( conductivityCalRecord[ sensorId ].alpha_low ); + setFPGACondSensCalData7( conductivityCalRecord[ sensorId ].eta_low ); + setFPGACondSensCalData8( conductivityCalRecord[ sensorId ].zeta_low ); + setFPGACondSensCalData9( conductivityCalRecord[ sensorId ].beta ); + setFPGACondSensCalData10( conductivityCalRecord[ sensorId ].delta ); + setFPGACondSensCalData11( conductivityCalRecord[ sensorId ].reserved1 ); + setFPGACondSensCalData12( conductivityCalRecord[ sensorId ].reserved2 ); + setFPGACondSensCalibrationTime( conductivityCalRecord[ sensorId ].calibrationTime ); + setFPGACondSensCalibrationCRC( conductivityCalRecord[ sensorId ].crc ); + setFPGACondSensorId( sensorId ); + setFPGACondSensorCommand( (U08)COND_SENS_CMD_SETCAL ); } /*********************************************************************//** Index: firmware/App/Drivers/PressureSensor.h =================================================================== diff -u -r50144ec3e96785cf76d5bfd22ee65029c82e732b -rc49f9ed931d60e5bd1d0a406fde6c9fe1437f73b --- firmware/App/Drivers/PressureSensor.h (.../PressureSensor.h) (revision 50144ec3e96785cf76d5bfd22ee65029c82e732b) +++ firmware/App/Drivers/PressureSensor.h (.../PressureSensor.h) (revision c49f9ed931d60e5bd1d0a406fde6c9fe1437f73b) @@ -32,29 +32,6 @@ // ********** public definitions ********** -/// Enumeration of pressure sensors monitored by this module. -typedef enum PressureSensors -{ - D9_PRES = 0, ///< Hydraulics outlet pressure (PHo/Pn) - FIRST_DD_PRESSURE_SENSOR = D9_PRES, ///< Start of DD pressure sensor group - D66_PRES, ///< Dry Bicarb pressure (PDB/PCb) - D51_PRES, ///< Spent Dialysate pressure (PDs) - D18_PRES, ///< Fresh Dialysate pressure (PDf) - D41_PRES, ///< Transmembrane pressure (Ptm) - D87_PRES, ///< Dialysate pressure - LAST_DD_PRESSURE_SENSOR = D87_PRES, ///< End of DD pressure sensor group - M3_PRES, ///< Water inlet pressure after regulator (PR0) - FIRST_IO_PRESSURE_SENSOR = M3_PRES, ///< Start of IO pressure sensor group - LAST_IO_PRESSURE_SENSOR = M3_PRES, ///< End of IO pressure sensor group - P8_PRES, ///< Water inlet pressure before conductivity sensor - FIRST_FP_PRESSURE_SENSOR = P8_PRES, ///< Start of FP pressure sensor group - P13_PRES, ///< Pressure before RO filter - P17_PRES, ///< Pressure after RO filter - P46_PRES, ///< Pressure after sediment filter - LAST_FP_PRESSURE_SENSOR = P46_PRES, ///< End of FP pressure sensor group - NUM_OF_PRESSURE_SENSORS ///< Number of pressure sensors -} PRESSURE_SENSORS_T; - // ********** public function prototypes ********** void initPressureSensor( void ); Index: firmware/App/Drivers/TemperatureSensors.h =================================================================== diff -u -r1fa38184526c2b0c072eb8745c653f772156a824 -rc49f9ed931d60e5bd1d0a406fde6c9fe1437f73b --- firmware/App/Drivers/TemperatureSensors.h (.../TemperatureSensors.h) (revision 1fa38184526c2b0c072eb8745c653f772156a824) +++ firmware/App/Drivers/TemperatureSensors.h (.../TemperatureSensors.h) (revision c49f9ed931d60e5bd1d0a406fde6c9fe1437f73b) @@ -32,19 +32,6 @@ // ********** public definitions ********** -/// Enumeration of temperature sensors. -typedef enum SENSORS_NAME -{ - D1_TEMP = 0, ///< First temp sensor to scan - TEMPSENSORS_FIRST = D1_TEMP, ///< Heat exchanger Inlet temperature sensor - D78_TEMP, ///< Heat exchanger Outlet temperature sensor - D4_TEMP, ///< Hydraulics primary heater temperature sensor - D50_TEMP, ///< Trimmer heater temperature sensor - D99_TEMP, ///< Temperature sensor - BRD_TEMP, ///< DD board temperature sensor ( thermistor ) - NUM_OF_TEMPERATURE_SENSORS ///< Number of temperature sensors -} TEMPERATURE_SENSORS_T; - // ********** public function prototypes ********** void initTemperatureSensors( void ); Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r83bae6ae5f7f26a3511d1d6965310fd8ac9ad496 -rc49f9ed931d60e5bd1d0a406fde6c9fe1437f73b --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 83bae6ae5f7f26a3511d1d6965310fd8ac9ad496) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision c49f9ed931d60e5bd1d0a406fde6c9fe1437f73b) @@ -626,6 +626,25 @@ U32 fpgaD76PumpSpeed; ///< Reg 134. UF Pump Speed/RPM Control U32 fpgaD92PumpSpeed; ///< Reg 138. HDF Pump Speed/RPM Control U32 fpgaD92PumpRevCount; ///< Reg 142. HDF pump revolution count + + U32 fpgaCondSensCalData1; ///< Reg 146 Conductivity Sensor Calibration Coefficient 1 + U32 fpgaCondSensCalData2; ///< Reg 150 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData3; ///< Reg 154 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData4; ///< Reg 158 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData5; ///< Reg 162 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData6; ///< Reg 166 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData7; ///< Reg 170 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData8; ///< Reg 174 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData9; ///< Reg 178 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData10; ///< Reg 182 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData11; ///< Reg 186 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalData12; ///< Reg 190 Conductivity Sensor Calibration Coefficient + U32 fpgaCondSensCalibrationTime; ///< Reg 194 Conductivity Sensor Calibration Time + U16 fpgaCondSensCalibrationCRC; ///< Reg 198 Conductivity Sensor Calibration Data CRC + U08 fpgaCondSensorID; ///< Reg 200 Conductivity Sensor Id + U08 fpgaCondSensorCmd; ///< Reg 201 Conductivity Sensor Command + U32 fpgaCondSensorHwVer; ///< Reg 202 Conductivity Sensor Hardware Version Number + U32 fpgaCondSensorSerialNum; ///< Reg 206 Conductivity Sensor Serial Number } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -2200,18 +2219,6 @@ /*********************************************************************//** * @brief - * The setFPGAD17CondData function sets the D17 cal data. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD17DataCal - * @return none - *************************************************************************/ -void setFPGAD17CondCalData( U32 data ) -{ -// fpgaActuatorSetPoints.fpgaD17DataCal = data; -} - -/*********************************************************************//** - * @brief * The getFPGAD27CondReadCount function gets D27 conductivity sensor read count. * @details \b Inputs: fpgaD27CondReadCnt * @details \b Outputs: none @@ -2308,18 +2315,6 @@ /*********************************************************************//** * @brief - * The setFPGAD27CondData function sets the D27 cal data. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD27DataCal - * @return none - *************************************************************************/ -void setFPGAD27CondCalData( U32 data ) -{ -// fpgaActuatorSetPoints.fpgaD27DataCal = data; -} - -/*********************************************************************//** - * @brief * The getFPGAD29CondReadCount function gets D29 conductivity sensor read count. * @details \b Inputs: fpgaD29CondReadCnt * @details \b Outputs: none @@ -2415,18 +2410,6 @@ /*********************************************************************//** * @brief - * The setFPGAD29CondData function sets the D29 cal data. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD29DataCal - * @return none - *************************************************************************/ -void setFPGAD29CondCalData( U32 data ) -{ -// fpgaActuatorSetPoints.fpgaD29DataCal = data; -} - -/*********************************************************************//** - * @brief * The getFPGAD43CondReadCount function gets D43 conductivity sensor read count. * @details \b Inputs: fpgaD43CondReadCnt * @details \b Outputs: none @@ -2523,18 +2506,6 @@ /*********************************************************************//** * @brief - * The setFPGAD43CondData function sets the D43 cal data. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD43DataCal - * @return none - *************************************************************************/ -void setFPGAD43CondCalData( U32 data ) -{ -// fpgaActuatorSetPoints.fpgaD43DataCal = data; -} - -/*********************************************************************//** - * @brief * The getFPGAD74CondReadCount function gets D74 conductivity sensor read count. * @details \b Inputs: fpgaD74CondReadCnt * @details \b Outputs: none @@ -2630,18 +2601,6 @@ /*********************************************************************//** * @brief - * The setFPGAD74CondData function sets the D74 cal data. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaD74DataCal - * @return none - *************************************************************************/ -void setFPGAD74CondCalData( U32 data ) -{ -// fpgaActuatorSetPoints.fpgaD74DataCal = data; -} - -/*********************************************************************//** - * @brief * The getFPGAD63LevelSensor function gets the latest FPGA D63 upper level * sensor reading. * @details \b Inputs: fpgaD63LevelSensor @@ -3974,18 +3933,6 @@ /*********************************************************************//** * @brief - * The setFPGAP9CondData function sets the P9 cal data. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaP9DataCal - * @return none - *************************************************************************/ -void setFPGAP9CondCalData( U32 data ) -{ -// fpgaActuatorSetPoints.fpgaP9DataCal = data; -} - -/*********************************************************************//** - * @brief * The getFPGAP18CondReadCount function gets the P18 conductivity read count. * @details \b Inputs: fpgaSensorReadings.fpgaP18CondReadCount * @details \b Outputs: none @@ -4082,18 +4029,6 @@ /*********************************************************************//** * @brief - * The setFPGAP18CondData function sets the P18 cal data. - * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints.fpgaP18DataCal - * @return none - *************************************************************************/ -void setFPGAP18CondCalData( U32 data ) -{ -// fpgaActuatorSetPoints.fpgaP18DataCal = data; -} - -/*********************************************************************//** - * @brief * The getFPGAD92PumpHallSenseCount function gets substitution pump, D92, * hall sensor speed counter. * @details \b Inputs: fpgaD92SpeedCnt @@ -4153,4 +4088,261 @@ return fpgaSensorReadings.fpgaACHeaterPMonVrms; } +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData1 function sets Calibration Data Coefficient 1 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData1 + * @param Value of the Calibration data Coefficient 1 + * @return none + *************************************************************************/ +void setFPGACondSensCalData1( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData1 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData2 function sets Calibration Data Coefficient 2 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData2 + * @param Value of the Calibration data Coefficient 2 + * @return none + *************************************************************************/ +void setFPGACondSensCalData2( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData2 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData3 function sets Calibration Data Coefficient 3 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData3 + * @param Value of the Calibration data Coefficient 3 + * @return none + *************************************************************************/ +void setFPGACondSensCalData3( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData3 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData4 function sets Calibration Data Coefficient 4 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData4 + * @param Value of the Calibration data Coefficient 4 + * @return none + *************************************************************************/ +void setFPGACondSensCalData4( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData4 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData5 function sets Calibration Data Coefficient 5 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData5 + * @param Value of the Calibration data Coefficient 5 + * @return none + *************************************************************************/ +void setFPGACondSensCalData5( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData5 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData6 function sets Calibration Data Coefficient 6 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData6 + * @param Value of the Calibration data Coefficient 6 + * @return none + *************************************************************************/ +void setFPGACondSensCalData6( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData6 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData7 function sets Calibration Data Coefficient 7 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData7 + * @param Value of the Calibration data Coefficient 7 + * @return none + *************************************************************************/ +void setFPGACondSensCalData7( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData7 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData8 function sets Calibration Data Coefficient 8 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData8 + * @param Value of the Calibration data Coefficient 8 + * @return none + *************************************************************************/ +void setFPGACondSensCalData8( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData8 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData9 function sets Calibration Data Coefficient + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData9 + * @param Value of the Calibration data Coefficient 9 + * @return none + *************************************************************************/ +void setFPGACondSensCalData9( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData9 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData10 function sets Calibration Data Coefficient 10 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData10 + * @param Value of the Calibration data Coefficient 10 + * @return none + *************************************************************************/ +void setFPGACondSensCalData10( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData10 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData11 function sets Calibration Data Coefficient 11 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData11 + * @param Value of the Calibration data Coefficient 11 + * @return none + *************************************************************************/ +void setFPGACondSensCalData11( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData11 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData12 function sets Calibration Data Coefficient 12 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData12 + * @param Value of the Calibration data Coefficient 12 + * @return none + *************************************************************************/ +void setFPGACondSensCalData12( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData12 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalibrationTime function sets the Conductivity Sensor + * Calibration Time + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalibrationTime + * @param Value of the Conductivity Sensor Calibration Time + * @return none + *************************************************************************/ +void setFPGACondSensCalibrationTime( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalibrationTime = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalibrationCRC function sets the Conductivity Sensor + * Calibration Data CRC + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalibrationCRC + * @param Value of the Conductivity Sensor Calibration Data CRC + * @return none + *************************************************************************/ +void setFPGACondSensCalibrationCRC( U16 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalibrationCRC = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorId function sets the Conductivity Sensor Id + * When 01 : Will send data to P9_P10 + * When 02 : Will send data to P18_P19 + * When 03 : Will send data to D16_D17 + * When 04 : Will send data to D74_D75 + * When 05 : Will send data to D27_D28 + * When 06 : Will send data to D29_D30 + * When 07 : Will send data to D43_D44 + * Any other value, the FPGA will not transmit data. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorID + * @param Value of the Conductivity Sensor Id + * @return none + *************************************************************************/ +void setFPGACondSensorId( U08 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorID = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorCommand function sets the Conductivity Sensor Command + * Use this command byte to inform FPGA that new Cal Coefficients are ready + * to be sent to conductive sensor + * Bit 0 : When a 0 to 1 transitions, the FPGA will send + * Calibration Coefficents (Command T) + * Bit 1 : When a 0 to 1 transitions, the FPGA will send + * Hardware Version and Serial Number (Command V) + * Bit 2 : When a 0 to 1 transitions, the FPGA will send + * reset to all conductivity sensors + * Any other bits will be ignored in this command. + * Please note only one command can be done at 1 time so + * do not toggle more than 1 bit at a time + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorCmd + * @param Value of the Conductivity Sensor Command + * @return none + *************************************************************************/ +void setFPGACondSensorCommand( U08 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorCmd = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorHwVer function sets the Conductivity Sensor + * Hardware Version Number + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorHwVer + * @param Value of the the Conductivity Sensor Hardware Version Number + * @return none + *************************************************************************/ +void setFPGACondSensorHwVer( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorHwVer = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorSerialNum function sets the Conductivity Sensor + * Serial Number + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorSerialNum + * @param Value of the Conductivity Sensor Serial Number + * @return none + *************************************************************************/ +void setFPGACondSensorSerialNum( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorSerialNum = value; +} + /**@}*/ Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r83bae6ae5f7f26a3511d1d6965310fd8ac9ad496 -rc49f9ed931d60e5bd1d0a406fde6c9fe1437f73b --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 83bae6ae5f7f26a3511d1d6965310fd8ac9ad496) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision c49f9ed931d60e5bd1d0a406fde6c9fe1437f73b) @@ -90,7 +90,6 @@ F32 getFPGAD17CondTemp( void ); U32 getFPGAD17CondCalData( void ); U08 getFPGAD17CalMemCounter( void ); -void setFPGAD17CondCalData( U32 data ); U08 getFPGAD27CondReadCount( void ); U08 getFPGAD27CondErrorCount( void ); @@ -100,7 +99,6 @@ F32 getFPGAD27CondTemp( void ); U32 getFPGAD27CondCalData( void ); U08 getFPGAD27CalMemCounter( void ); -void setFPGAD27CondCalData( U32 data ); U08 getFPGAD29CondReadCount( void ); U08 getFPGAD29CondErrorCount( void ); @@ -110,7 +108,6 @@ F32 getFPGAD29CondTemp( void ); U32 getFPGAD29CondCalData( void ); U08 getFPGAD29CalMemCounter( void ); -void setFPGAD29CondCalData( U32 data ); U08 getFPGAD43CondReadCount( void ); U08 getFPGAD43CondErrorCount( void ); @@ -120,7 +117,6 @@ F32 getFPGAD43CondTemp( void ); U32 getFPGAD43CondCalData( void ); U08 getFPGAD43CalMemCounter( void ); -void setFPGAD43CondCalData( U32 data ); U08 getFPGAD74CondReadCount( void ); U08 getFPGAD74CondErrorCount( void ); @@ -130,7 +126,6 @@ F32 getFPGAD74CondTemp( void ); U32 getFPGAD74CondCalData( void ); U08 getFPGAD74CalMemCounter( void ); -void setFPGAD74CondCalData( U32 data ); // Pumps ( Dosing and Gear pumps ) void setFPGAD11PumpSetStepSpeed( U32 stepSpeed ); @@ -318,7 +313,6 @@ F32 getFPGAP9CondTemp( void ); U32 getFPGAP9CondCalData( void ); U08 getFPGAP9CalMemCounter( void ); -void setFPGAP9CondCalData( U32 data ); U08 getFPGAP18CondReadCount( void ); U08 getFPGAP18CondErrorCount( void ); @@ -328,13 +322,31 @@ F32 getFPGAP18CondTemp( void ); U32 getFPGAP18CondCalData( void ); U08 getFPGAP18CalMemCounter( void ); -void setFPGAP18CondCalData( U32 data ); void setFPGAP40PumpEnable( BOOL enable ); void setFPGAP40PumpPWM( U16 pwm ); U16 getFPGAP40PumpPWM( void ); U16 getFPGAP40PumpTachCount( void ); +void setFPGACondSensCalData1( U32 value ); +void setFPGACondSensCalData2( U32 value ); +void setFPGACondSensCalData3( U32 value ); +void setFPGACondSensCalData4( U32 value ); +void setFPGACondSensCalData5( U32 value ); +void setFPGACondSensCalData6( U32 value ); +void setFPGACondSensCalData7( U32 value ); +void setFPGACondSensCalData8( U32 value ); +void setFPGACondSensCalData9( U32 value ); +void setFPGACondSensCalData10( U32 value ); +void setFPGACondSensCalData11( U32 value ); +void setFPGACondSensCalData12( U32 value ); +void setFPGACondSensCalibrationTime( U32 value ); +void setFPGACondSensCalibrationCRC( U16 value ); +void setFPGACondSensorId( U08 value ); +void setFPGACondSensorCommand( U08 value ); +void setFPGACondSensorHwVer( U32 value ); +void setFPGACondSensorSerialNum( U32 value ); + /**@}*/ #endif Index: firmware/App/Services/NVMessagingDD.c =================================================================== diff -u -r83bae6ae5f7f26a3511d1d6965310fd8ac9ad496 -rc49f9ed931d60e5bd1d0a406fde6c9fe1437f73b --- firmware/App/Services/NVMessagingDD.c (.../NVMessagingDD.c) (revision 83bae6ae5f7f26a3511d1d6965310fd8ac9ad496) +++ firmware/App/Services/NVMessagingDD.c (.../NVMessagingDD.c) (revision c49f9ed931d60e5bd1d0a406fde6c9fe1437f73b) @@ -2340,6 +2340,9 @@ if( idx < NUM_OF_CONDUCTIVITY_SENSORS ) { memcpy( &record, payloadPtr, recordSize ); + + // TODO: Update calibrationTime to current timestamp published by UI. + record.calibrationTime = 0; record.crc = crc16( (U08*)&record, recordSize ); setNVMMRecord( NV_DD_DATA_CAL_CONDUCTIVITY_SENSORS, (U08*)&record, idx ); result = enqueueEraseAndWriteSector( NVM_CALIBRATION_RECORD );