
//******************************************************************************
// DURA NV VARIABLES OCCUPY (0x00C9 - 0x00FF) IN THE 256 BYTE DS3234 SRAM                    
//******************************************************************************

//DURA UCHAR value and memory address in DS3234 SRAM (0x00C9 - 0x00CF)
#define DURA_LEDENABLE_PTR		0x00C9		
#define DURA_LEDENABLE_VAL		1         		// boolean for enabling LED status during AtoD sampling

//DURA USHORT value and memory address in DS3234 SRAM (0x00D0 - 0x00DF)
#define DURA_ATODREADINGS_PTR	0x00D0
#define DURA_ATODREADINGS_VAL	10        		// number of AtoD readings to average per sample reading
#define DURA_ATODDELAY_PTR		0x00D2
#define DURA_ATODDELAY_VAL		100       		// number of mSecs to delay from AtoD mux change to the starting of AtoD reading(s)

//DURA INT value and memory address in DS3234 SRAM (0x00D0 - 0x00DF)
#define DURA_LASTERROR_PTR		0x00D4
#define DURA_LASTERROR_VAL		0				// Clear any value

//DURA ULONG value and memory address in DS3234 SRAM (0x00E0 - 0x00FF)
#define DURA_ERRORCTR_PTR		0x00E0	
#define DURA_ERRORCTR_VAL		0         		// counter indicating number of DuraFET errors
#define DURA_LASTERRTIME_PTR	0x00E4
#define DURA_LASTERRTIME_VAL	0         		// time of the last error event
#define DURA_SAMPLECTR_PTR		0x00E8
#define DURA_SAMPLECTR_VAL		0         		// counter indicating total number of DuraFET samples
#define DURA_LASTSAMPTIME_PTR	0x00EC
#define DURA_LASTSAMPTIME_VAL	0         		// time of the last DuraFET sample
#define DURA_SAMPSPERCAL_PTR	0x00F0
#define DURA_SAMPSPERCAL_VAL	250       		// number of AtoD samples per AtoD (re)calibration


/******************************************************************************/
/* DURA Global Variables                                                      */
/******************************************************************************/

// UCHARs Stored in DS3234 NVRAM:
uchar  dura_led_enable;

// UCHARs NOT Stored in DS3234 NVRAM:
uchar  dura_reset_flag, dura_atod_pwr;

// USHORTs Stored in DS3234 NVRAM: 
ushort dura_atod_readings, dura_atod_delay;

// INTs Stored in DS3234 NVRAM
int    dura_last_error;

// ULONGs Stored in DS3234 NVRAM
ulong  dura_error_ctr, dura_error_time; 
ulong  dura_sample_ctr, dura_sample_time;
ulong  dura_samps_per_cal;


// Values from DuraFET III One-Wire EEPROM (not used in APF build)
//char   DURASN[32];         // DuraFET Sensor Serial Number
//float  K0;                 // Iso-Potential EMF which is the zero Kelvin Standard Potential (y intercept of K2 at zero Kelvin)
//float  K1;                 // Nerst Factor
//float  K2;                 // Standard Potenial TempCo of Sensor (non-pH dependent temperature coef of sensor)
//float  PTS;                // Percent Theoretical Slope
//float  IsopH;              // Iso-Potential pH which is the pH value where the EMF of the electrode pair is temperature invariant and occurs when Vrs and K0 are equal
//float  IsopH_2;            // Second (???) Iso-Potential pH Value

// Misc DuraFET III Variables (not used in APF build)
//int    Tcoefs, CalVals;
//char   CalDate[25];
double SHHCoefs[5];
//float  temp_cal_offset;    // temperature calibration offset
//float  pH_cal_offset;      // pH calibration offset
