/******************************************************************************
 *
 * devGpib.h,v (This file is best viewed with a tabwidth of 4)
 *
 ******************************************************************************/
/***********************************************************************
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory, and the Regents of the University of
* California, as Operator of Los Alamos National Laboratory, and
* Berliner Elektronenspeicherring-Gesellschaft m.b.H. (BESSY).
* gpibCore is distributed subject to a Software License Agreement
* found in file LICENSE that is included with this distribution.
***********************************************************************/
/*
 * Header file to be included in gpib device support modules
 *
 * Author: Benjamin Franksen
 ******************************************************************************
 *
 * Notes:
 *
 *	This file is intended to be included by GPIB device support modules.
 *	If one or more of the names
 *
 *	DSET_AI,	DSET_AO,	DSET_LI,	DSET_LO,
 *	DSET_BI,	DSET_BO,	DSET_MBBO,	DSET_MBBI,
 *	DSET_MBBOD,	DSET_MBBID,
 *	DSET_SI,	DSET_SO,	DSET_EV,	DSET_WF
 *
 *	are defined before this header is included, the corresponding record
 *	types may be used in the parameter table. No further initialization
 *	is then necessary.
 *
 */
#ifndef INCdevGpibh
#define INCdevGpibh
#include <devCommonGpib.h>
#include <epicsExport.h>
#include <devSup.h>
/* forward declaration: */
static devGpibParmBlock devSupParms;

/******************************************************************************
 *
 * Define all the DSETs.
 *
 * Note that the dset names must be provided via the #define lines at the top of
 * the file that includes this one. If one is not defined, the init_ and
 * report_ functions are set to NULL in order to generate an error when used.
 *
 * The user code must also implement init_ai
 *
 * Other than for the debugging flag(s), these DSETs are the only items that
 * will appear in the global name space within the IOC.
 *
 * The last 3 items in the DSET structure are used to point to the parm
 * structure, the work functions used for each record type, and the srq
 * handler for each record type.
 *
 ******************************************************************************/

#ifdef DSET_AI
static long report_ai();
static long init_ai(int pass);
static gDset DSET_AI = {6,
    {report_ai, init_ai, devGpibLib_initAi, devGpibLib_get_ioint_info,
     devGpibLib_readAi, NULL, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_aiGpibWork, (DEVSUPFUN)devGpibLib_aiGpibSrq}
};
epicsExportAddress(dset,DSET_AI);
static long report_ai() {return devGpibLib_report(&DSET_AI);}
/* init_ai MUST be implemented by device specific support*/
#endif

#ifdef DSET_AO
static long report_ao();
static long init_ao(int pass);
static gDset DSET_AO = {6,
    {report_ao, init_ao, devGpibLib_initAo, devGpibLib_get_ioint_info,
     devGpibLib_writeAo, NULL, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_aoGpibWork}
};
epicsExportAddress(dset,DSET_AO);
static long report_ao() { return devGpibLib_report(&DSET_AO); }
static long init_ao(int pass) {return devGpibLib_initDevSup(pass,&DSET_AO);}
#endif

#ifdef DSET_LI
static long report_li();
static long init_li(int pass);
static gDset DSET_LI = {5,
    {report_li, init_li, devGpibLib_initLi, devGpibLib_get_ioint_info,
     devGpibLib_readLi, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_liGpibWork, (DEVSUPFUN)devGpibLib_liGpibSrq}
};
epicsExportAddress(dset,DSET_LI);
static long report_li(){return devGpibLib_report(&DSET_LI);}
static long init_li(int pass){return devGpibLib_initDevSup(pass, &DSET_LI);}
#endif

#ifdef DSET_LO
static long report_lo();
static long init_lo(int pass);
static gDset DSET_LO = {5,
    {report_lo, init_lo, devGpibLib_initLo, devGpibLib_get_ioint_info,
     devGpibLib_writeLo, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_loGpibWork}
};
epicsExportAddress(dset,DSET_LO);
static long report_lo(){return devGpibLib_report(&DSET_LO);}
static long init_lo(int pass){return devGpibLib_initDevSup(pass, &DSET_LO);}
#endif

#ifdef DSET_BI
static long report_bi();
static long init_bi(int pass);
static gDset DSET_BI = {5,
    {report_bi, init_bi, devGpibLib_initBi, devGpibLib_get_ioint_info,
     devGpibLib_readBi, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_biGpibWork, (DEVSUPFUN)devGpibLib_biGpibSrq}
};
epicsExportAddress(dset,DSET_BI);
static long report_bi(){return devGpibLib_report(&DSET_BI);}
static long init_bi(int pass) {return devGpibLib_initDevSup(pass, &DSET_BI);}
#endif

#ifdef DSET_BO
static long report_bo();
static long init_bo(int pass);
static gDset DSET_BO = {5,
    {report_bo, init_bo, devGpibLib_initBo, devGpibLib_get_ioint_info,
     devGpibLib_writeBo, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_boGpibWork}
};
epicsExportAddress(dset,DSET_BO);
static long report_bo() {return devGpibLib_report(&DSET_BO);}
static long init_bo(int pass) {return devGpibLib_initDevSup(pass, &DSET_BO);}
#endif

#ifdef DSET_MBBI
static long report_mbbi();
static long init_mbbi(int pass);
static gDset DSET_MBBI = {5,
    {report_mbbi, init_mbbi, devGpibLib_initMbbi, devGpibLib_get_ioint_info,
     devGpibLib_readMbbi, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_mbbiGpibWork,(DEVSUPFUN) devGpibLib_mbbiGpibSrq}
};
epicsExportAddress(dset,DSET_MBBI);
static long report_mbbi() {return devGpibLib_report(&DSET_MBBI);}
static long init_mbbi(int pass){return devGpibLib_initDevSup(pass, &DSET_MBBI);}
#endif

#ifdef DSET_MBBO
static long report_mbbo();
static long init_mbbo(int pass);
static gDset DSET_MBBO = {5,
    {report_mbbo, init_mbbo, devGpibLib_initMbbo, devGpibLib_get_ioint_info,
     devGpibLib_writeMbbo, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_mbboGpibWork}
};
epicsExportAddress(dset,DSET_MBBO);
static long report_mbbo() {return devGpibLib_report(&DSET_MBBO);}
static long init_mbbo(int pass){return devGpibLib_initDevSup(pass, &DSET_MBBO);}
#endif

#ifdef DSET_MBBID
static long report_mbbiDirect();
static long init_mbbiDirect(int pass);
static gDset DSET_MBBID = {5,
    {report_mbbiDirect, init_mbbiDirect, devGpibLib_initMbbi,
     devGpibLib_get_ioint_info, devGpibLib_readMbbi, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_mbbiDirectGpibWork,
     devGpibLib_mbbiDirectGpibSrq}
};
epicsExportAddress(dset,DSET_MBBID);
static long report_mbbiDirect(){return devGpibLib_report(&DSET_MBBID);}
static long init_mbbiDirect(int pass)
#endif

#ifdef DSET_MBBOD
static long report_mbboDirect();
static long init_mbboDirect(int pass);
static gDset DSET_MBBOD = {5,
    {report_mbboDirect, init_mbboDirect, devGpibLib_initMbbo,
     devGpibLib_get_ioint_info, devGpibLib_writeMbbo, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_mbboDirectGpibWork}
};
epicsExportAddress(dset,DSET_MBBOD);
static long report_mbboDirect(){devGpibLib_report(&DSET_MBBOD);}
static long init_mbboDirect(int pass)
#endif

#ifdef DSET_SI
static long report_si();
static long init_si(int pass);
static gDset DSET_SI = {5,
    {report_si, init_si, devGpibLib_initSi, devGpibLib_get_ioint_info,
     devGpibLib_readSi, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_stringinGpibWork,(DEVSUPFUN)devGpibLib_stringinGpibSrq}
};
epicsExportAddress(dset,DSET_SI);
static long report_si(){return devGpibLib_report(&DSET_SI);}
static long init_si(int pass){return devGpibLib_initDevSup(pass, &DSET_SI);}
#endif

#ifdef DSET_SO
static long report_so();
static long init_so(int pass);
static gDset DSET_SO = {5,
    {report_so, init_so, devGpibLib_initSo, devGpibLib_get_ioint_info,
     devGpibLib_writeSo, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_stringoutGpibWork}
};
epicsExportAddress(dset,DSET_SO);
static long report_so(){return devGpibLib_report(&DSET_SO);}
static long init_so(int pass){return devGpibLib_initDevSup(pass, &DSET_SO);}
#endif

#ifdef DSET_EV
static long report_ev();
static long init_ev(int pass);
static gDset DSET_EV = {5,
    {report_ev, init_ev, devGpibLib_initEv, devGpibLib_get_ioint_info,
     devGpibLib_readEv, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_evGpibWork, (DEVSUPFUN)devGpibLib_evGpibSrq}
};
epicsExportAddress(dset,DSET_EV);
static long report_ev(){return devGpibLib_report(&DSET_EV);}
static long init_ev(int pass){return devGpibLib_initDevSup(pass, &DSET_EV);}
#endif

#ifdef DSET_WF
static long report_wf();
static long init_wf(int pass);
static gDset DSET_WF = {6,
    {report_wf, init_wf, devGpibLib_initWf, devGpibLib_get_ioint_info,
     devGpibLib_readWf, NULL, (DEVSUPFUN)&devSupParms,
     (DEVSUPFUN)devGpibLib_wfGpibWork, (DEVSUPFUN)devGpibLib_wfGpibSrq}
};
epicsExportAddress(dset,DSET_WF);
static long report_wf(){return devGpibLib_report(&DSET_WF);}
static long init_wf(int pass){return devGpibLib_initDevSup(pass, &DSET_WF);}
#endif

/*
 * devGpib.h,v
 * Revision 1.7  2003/04/10 15:17:02  mrk
 * open source license
 *
 * Revision 1.6  2003/04/02 14:08:15  mrk
 * changes for R3.14.2 build rules
 *
 * Revision 1.5  2003/03/31 19:06:27  norume
 * Fix token-pasting.
 *
 * Revision 1.4  2003/03/31 17:09:28  mrk
 * changes for new way to register device support
 *
 * Revision 1.3  2003/03/14 16:46:16  mrk
 * Changes for March 2003 version
 *
 * Revision 1.2  2002/10/21 15:59:47  mrk
 * build a single library
 *
 * Revision 1.1  2002/10/18 17:21:04  mrk
 * moved to here
 *
 * Revision 1.1.1.1  2001/02/15 14:52:50  mrk
 * Import sources
 *
 * Revision 1.2  2000/05/19 12:57:42  franksen
 * use errlogPrintf; fixed bug in drvGpibGetLink;
 * changed type of link/gpibAddr from short to int
 *
 * Revision 1.1.1.1  2000/03/21 18:06:35  franksen
 * unbundled gpib first version
 */
#endif	/* INCdevGpibh */
