#ifndef CRONIN_INC
#define CRONIN_INC			1

#include	<msc_config.h>

//External Vars
extern uchar isus_spec_pwr;
extern uchar sys_message_enable;
extern ulong isus_sample_time;
extern ulong isus_spec_period;
extern float DataMean, DataStdDev;
extern float sysTemperature, sysHumidity;

//External Prototypes
void 	DelayMilliSecs( ushort msecs );
int 	LogErrorMsg(char *emsg, int ecode, uchar outp);
void 	ShortVectorMeanStdDev(ushort end, ushort data[], float *mean, float *stdev);

#define DARKCURRENT_SCAN    0
#define INTENSITY_SCAN      1

#define SPEC_OK             0
#define SPEC_WR_TIMEOUT     (-1)
#define SPEC_RD_TIMEOUT     (-2)

#define SPEC_CTS_TIMEOUT 	500000     			// 500ms TIMEOUT FOR CTS ASSERTED LOW  (CF2 elapsed timer func uses us)
#define SPEC_INT_TIMEOUT 	15000000    		// 15secs TIMEOUT FOR CTS RELEASED HIGH (CF2 elapsed timer func uses us)
#define SPEC_DAT_TIMEOUT 	500     			// 500ms TIMEOUT FOR CTS ASSERTED LOW  (CF2 TPU UART func uses ms)

/* Zeiss MMS-UV Spectrometer w/Cronin 16bit electronics - function prototypes */

/* Spectrometer high level function prototypes */

/* Spectrometer low  level function prototypes */
int SpecPwrOn( TUPort **tup );
int SpecPwrOff( TUPort *tup );
int ScanSpectra( TUPort *tup, FILE *fptr, ushort scan_num, ushort *Data, uchar ScanType );
int SingleScanSpectra( TUPort *tup, ulong scan_period, ushort *Data );

int TUPuts(TUPort *tup, char *str);
int TUGetsTmout(TUPort *tup, char *buf, ushort buflen, ushort seconds);

#endif