/****************************************************************************/
/* Copyright 1991 - 2003 MBARI											*/
/****************************************************************************/
/* $Header: /home/cvs/oasis4/src/controller/system/drvTbl.h,v 1.3 2015/01/22 18:31:49 bobh Exp $					   */
/* Summary	: Default Driver Table for OASIS3 Mooring Controller			*/
/* Filename : drvTbl.h														*/
/* Author	: Robert Herlien (rah)											*/
/* Project	: OASIS Mooring													*/
/* $Revision: 1.3 $															*/
/* Created	: 01/30/2003												*/
/************************************************************************/
/* Modification History:												*/
/* 30jan2003 rah - created from OASIS drvr.h							*/
/************************************************************************/

#ifndef INCdrvTblh
#define INCdrvTblh		  1

#include <oasis.h>
#include <serial.h>

#define NUM_DRVRS		(sizeof(drv_default)/sizeof(DrvDesc))

/********************************/
/*		External Functions		*/
/********************************/

Extern Void		analog_drv();			/* A/D driver					*/
Extern Void		ctd_drv();				/* Seabird CTD driver			*/
Extern Void		freewave_drv();			/* Freewave Radio driver		*/
Extern Void		gf_drv();				/* Ground Fault Driver			*/
Extern Void		log_drv();				/* Dummy data logger			*/
Extern Void		microcat_drv();			/* microCat CTD driver			*/
Extern Void		onoff_drv();			/* Simple drvr to turn on/off	*/
Extern Void		pswitch_drv();			/* Simple drvr to turn on/off	*/
Extern Void		tnc_drv();				/* TNC Radio driver				*/
Extern Void		usr_drv();				/* User I/F driver routine		*/
Extern MBool	null_func();			/* Null function, rtns TRUE		*/
Extern Void		optrode_drv();			/* Optrode Driver				*/
Extern Void		envDrv(Driver *dp);		/* environmental data driver	*/
Extern Void		emeter_drv();			/* Power Meter driver			*/
Extern Void		pH_drv();				/* MBARI pH sensor amp board	*/
Extern Void		ctdsim_drv();			/* CTD simulator driver			*/
Extern Void		serialAtoD_drv(Driver *dp); /* Serial A/D				*/


/****************************************/
/*		Driver Descriptors				*/
/****************************************/

#define MODE_N81		(NO_PTY	  | BIT8 | STOP1 | FLOW)
#define MODE_N81NF		(NO_PTY	  | BIT8 | STOP1)
#define MODE_E71		(EVEN_PTY | BIT7 | STOP1 | FLOW)
#define MODE_N72NF		(NO_PTY	  | BIT7 | STOP2)

/* Mask to turn off sampling from 1800 to 0600 hours local (for Eqpac) */
/*#define DAYMASK		  0xfc003fL */

/* Continuous sampling for local deployments */
#define DAYMASK			0L

/************************************************************************/
/* drvDescs Table - This is the table that describes ALL of the possible*/
/*		drivers that can be included via the OASIS.CFG file.  There is	*/
/*		one entry for each driver type.	 The drv_parms indicate the		*/
/*		default parameters (serial port number, baud rate, power bit, etc)*/
/*		but these are used ONLY if the system configurator doesn't		*/
/*		override them in the config file.  In most cases, s/he will		*/
/*		want to override these defaults.								*/
/************************************************************************/
/* In order to add support for a new driver, simply add the entry for	*/
/* that driver into this table.											*/
/*																		*/
/* Note that most instruments are declared with NO_SERIAL and no power	*/
/* bits.  We don't know in advance what ports/bits will be assigned.	*/
/* The system configurator MUST declare the serial port & power bits for*/
/* these instruments in OASIS.CFG										*/
/************************************************************************/

const DrvDesc drvDescs[] = 
{
/* Note that UserIF has no flow control.  Serial port 0 (user console)	*/
/* doesn't support XON/XOFF, so it does you no good to try to turn it on*/

  { "UserIF", usr_drv, null_func,
	SECS_PER_DAY, 0, 38400, (MODE_N81NF | ECHO | AUTOCR), 0, LOG_EMPTY, 0,
	120, 0, 0, 0},

  { "Freewave", freewave_drv, null_func,
	600, 1, 19200, (MODE_N81 | NEWCR | BIG_TX_BUF), 0x02, LOG_EMPTY, 0,
	240, 20, 0, 0},

  { "Teledesign", freewave_drv, null_func,
	600, 1, 9600, (MODE_N81 | BIG_TX_BUF | ECHO | AUTOCR), 0x02, LOG_EMPTY, 0,
	240, 20, 2, 0},

  { "Viper", freewave_drv, null_func,
	600, 1, 9600, (MODE_N81 | BIG_TX_BUF | ECHO | AUTOCR), 0x02, LOG_EMPTY, 0,
	240, 20, 15, 0},

  { "CTD", ctd_drv, null_func,
	600, NO_SERIAL, 9600, MODE_N81NF, 0, CTD, 0, 3, 10, 3, 0},

  { "Microcat", microcat_drv, null_func,
	600, NO_SERIAL, 9600, MODE_N81NF, 0, MICROCAT, 0, 3, 10, 0, 0},

  { "Analog", analog_drv, null_func,
	1800, NO_SERIAL, 0, 0, 0, LOG_EMPTY, 0, 60, 5, 1, 100},

  { "GF", gf_drv, null_func,
	1800, NO_SERIAL, 9600, MODE_N81NF, 0, GNDFAULT, 0, 3, 5, 0, 0},

  { "OASIS", analog_drv,null_func,
	1800, NO_SERIAL, 0, 0, 0, OASIS_CAN, 0, 3, 0, 3, 100},

  { "AanderaaO2", optrode_drv, null_func,
	600, NO_SERIAL, 9600, MODE_N81NF, 0, AANDERAA_O2, 0, 5, 1, 0, 0},

  { "Logger", log_drv, null_func,
	0, NO_SERIAL, 0, 0, 0, LOG_COMMENT, 0, 1, 1000, 0, 0},
  
  { "FileLogger", file_drv, null_func,
	0, NO_SERIAL, 0, 0, 0, LOG_COMMENT, 0, 1, 1000, 0, 0},
  
  { "env", envDrv, null_func,
	600, NO_SERIAL, 0, 0, 0, LOG_EMPTY, 0, 0, 0, 0, 0},

  { "OnOff", onoff_drv, null_func,
	0, NO_SERIAL, 0, 0, 0, SPECIAL1, 0, 60, 0, 0, 0},

  { "emeter", emeter_drv, null_func,
	600, NO_SERIAL, 9600, MODE_N81NF, 2, EMETER, 0, 15, 1, 3, 0},

  { "isfet_pH", pH_drv, null_func,
	600, NO_SERIAL, 9600, MODE_N81NF, 0, ISFET_PH, 0, 5, 2, 40, 0},

  { "PowerSwitch", pswitch_drv, null_func,
	0, NO_SERIAL, 0, 0, 0, SPECIAL1, 0, 0, 0, 0, 0},

  { "CTDSim", ctdsim_drv, null_func,
	30, NO_SERIAL, 9600, MODE_N81NF, 0, CTD, 0, 10, 0, 0, 0}

};


/************************************************************************/
/* drv_default Table - This is the table of drivers that get built if	*/
/*		OASIS.CFG doesn't exist, is corrupt, or doesn't have any drivers*/
/*		in it.	In other words, this is what the system will use as a	*/
/*		last resort.													*/
/************************************************************************/

const DrvDesc drv_default[] = 
{

  { "UserIF", usr_drv, null_func,
	SECS_PER_DAY, 0, 38400, (MODE_N81NF | ECHO | AUTOCR), 0, LOG_EMPTY, 0,
	120, 0, 0, 0},

  { "OASIS", analog_drv,null_func,
	1800, NO_SERIAL, 0, 0, 0, OASIS_CAN, 0, 3, 0, 3, 100}

};

#endif /* INCdrvrh */

