Index: firmware/App/Drivers/ConductivityTeensy.h =================================================================== diff -u -r1768e1d302978a3748ab1e684576f208472e4a54 -rfea37ad4659d4162d43f3e343cd5b266c2757ea9 --- firmware/App/Drivers/ConductivityTeensy.h (.../ConductivityTeensy.h) (revision 1768e1d302978a3748ab1e684576f208472e4a54) +++ firmware/App/Drivers/ConductivityTeensy.h (.../ConductivityTeensy.h) (revision fea37ad4659d4162d43f3e343cd5b266c2757ea9) @@ -26,7 +26,7 @@ #define FLOAT_COUNT 16 ///< Number of float values in Teensy EEPROM data #define MAX_COND_MST_PARAM_IDX 7 ///< Total number of parameters in measurement settings CONDUCTIVITY_MEASUREMENT_SETTINGS_T -// Enumeration of conductivity sensors. +/// Enumeration of conductivity sensors. typedef enum ConductivitySensors { D17_COND = 0, ///< Bicarb only conductivity sensor - 1 @@ -43,7 +43,7 @@ NUM_OF_CONDUCTIVITY_SENSORS ///< Number of conductivity sensors } CONDUCTIVITY_SENSORS_T; -// Enumeration of Teensy Sensor Index values +/// Enumeration of Teensy Sensor Index values typedef enum TeensySensorIndex { TEENSY_SENSOR_0 = 0, ///< Maps to P9_COND @@ -55,7 +55,7 @@ MAX_TEENSY_SENSOR ///< Total number of mapped sensors } TEENSY_SENSOR_INDEX_T; -// Enumeration of Teensy Commands. Also used as TX and TX states. +/// Enumeration of Teensy Commands. Also used as TX and TX states. typedef enum TeensyCmdIndex { TEENSY_CMD_INIT_SENSOR = 0, ///< Maps to command "a" @@ -67,7 +67,6 @@ TEENSY_CMD_START_MEASUREMENT, ///< Maps to command "m" TEENSY_CMD_STOP_MEASUREMENT, ///< Maps to command "n" TEENSY_CMD_GET_ALL_MEASUREMENTS, ///< Maps to command "g" - TEENSY_CMD_SELECT_SENSOR, ///< Maps to command "j" TEENSY_CMD_GET_SINGLE_MEASUREMENT, ///< Maps to command "h" MAX_NUM_OF_TEENSY_CMDS ///< Total number of commands } TEENSY_CMD_INDEX_T; @@ -79,9 +78,9 @@ COND_INIT_STATUS_IN_PROGRESS, ///< The initialization process has started. COND_INIT_STATUS_INITIALIZED, ///< Initialization process completed and all the sensors were initialized successfully. COND_INIT_STATUS_FAILED ///< Initialization process completed but one or more sensor was not initialized properly. -}COND_INIT_STATUS_T; +} COND_INIT_STATUS_T; -// Enumeration of Parse status of received byte data +/// Enumeration of Parse status of received byte data typedef enum Conductivity_Parse_Status { COND_PARSE_NONE = 0, @@ -108,9 +107,9 @@ COND_UPDATE_EEPROMSTATUS_IN_PROGRESS, ///< The initialization process has started. COND_UPDATE_EEPROM_STATUS_INITIALIZED, ///< Initialization process completed and all the sensors were initialized successfully. COND_UPDATE_EEPROM_STATUS_FAILED ///< Initialization process completed but one or more sensor was not initialized properly. -}COND_UPDATE_EEPROM_STATUS_T; +} COND_UPDATE_EEPROM_STATUS_T; -// Enumeration of update measurement settings status +/// Enumeration of update measurement settings status typedef enum Update_mst_Status { COND_MST_STATUS_ERR_UNRECOGNIZED_PARAM = 0, ///< Invalid parameter was passed with the command @@ -119,9 +118,9 @@ COND_MST_STATUS_ERR_UPDATED_TO_DEFAULT_DFT_NUM, ///< Invalid value of "dftnum" was passed with the command. So it was updated to its default value. COND_MST_STATUS_ERR_UPDATED_TO_DEFAULT_AVG_NUM, ///< Invalid value of "avgnum" was passed with the command. So it was updated to its default value. COND_MST_STATUS_SUCCESS -}COND_UPDATE_MST_STATUS_T; +} COND_UPDATE_MST_STATUS_T; -// Coefficients to be applied with raw impedance and rtd values to calculate conductivity and temperature. +/// Coefficients to be applied with raw impedance and rtd values to calculate conductivity and temperature. typedef struct { F64 A0; @@ -130,7 +129,7 @@ F64 B1; F64 B2; F64 B3; -}COND_COEFF_T; +} COND_COEFF_T; /// Structure to receive Sensor Measurement data from Teensy #pragma pack(push, 1) @@ -161,24 +160,24 @@ #pragma pack(push, 1) typedef struct { - F32 SinFreq; - F32 DacVoltPP; - F32 BiasVolt; - U32 HstiaRtiaSel; - U32 AdcPgaGain; - U32 DftNum; - U32 ADCAvgNum; + F32 SinFreq; ///< SinFreq : Frequency of excitation signal + F32 DacVoltPP; ///< DacVoltPP : DAC output voltage in mV peak to peak. Maximum value is 800mVpp. Peak to peak voltage + F32 BiasVolt; ///< BiasVolt : The excitation signal is DC+AC. This parameter decides the DC value in mV unit. 0.0mV means no DC bias. + U32 HstiaRtiaSel; ///< HstiaRtiaSel : Valid param values ( 0, 1, 2, 3, 4, 5, 6, 7 ) + U32 AdcPgaGain; ///< AdcPgaGain : Valid param values ( 1, 1.5, 2, 4, 9 ) i.e interpreted as ( 0, 1, 2, 3, 4 ) respectively in Teensy. + U32 DftNum; ///< DftNum : DFT number Valid param values ( 4096, 2048, 1024, 512, 256 ) i.e interpreted as ( 10, 9, 8, 7, 6 ) respectively in Teensy. + U32 ADCAvgNum; ///< ADCAvgNum : Valid param values ( 2, 4, 8, 16 )i.e interpreted as ( 0, 1, 2, 3 ) respectively in Teensy. } COND_MEASUREMENT_SETTINGS_T; #pragma pack(pop) -// Structure to store calculated Conductivity and Temperature for each sensor. +/// Structure to store calculated Conductivity and Temperature for each sensor. typedef struct { F64 Conductivity; F64 Temperature; -}COND_CALCULATED_MEASUREMENTS_T; +} COND_CALCULATED_MEASUREMENTS_T; -// Structure to enqueue and dequeue commands in the command queue +/// Structure to enqueue and dequeue commands in the command queue typedef struct { TEENSY_CMD_INDEX_T cmdIdx;