EPICS Base 7.0.8.0
Loading...
Searching...
No Matches
devSup.h
Go to the documentation of this file.
1/*************************************************************************\
2* Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
3* National Laboratory.
4* Copyright (c) 2002 The Regents of the University of California, as
5* Operator of Los Alamos National Laboratory.
6* SPDX-License-Identifier: EPICS
7* EPICS BASE is distributed subject to a Software License Agreement found
8* in file LICENSE that is included with this distribution.
9\*************************************************************************/
15/*
16 * Author: Marty Kraimer
17 * Date: 6-1-90
18 */
19
20#ifndef INCdevSuph
21#define INCdevSuph 1
22
23#include "errMdef.h"
24#include "dbCoreAPI.h"
25
26/* structures defined elsewhere */
27struct dbCommon;
28struct devSup;
29typedef struct ioscan_head *IOSCANPVT;
30struct link; /* aka DBLINK */
31
65typedef struct typed_dset {
68 long number;
70 long (*report)(int lvl);
75 long (*init)(int after);
77 long (*init_record)(struct dbCommon *prec);
108 long (*get_ioint_info)(int detach, struct dbCommon *prec, IOSCANPVT* pscan);
109 /* Any further functions are specified by the record type. */
110} typed_dset;
111
118typedef struct dsxt {
123 long (*add_record)(struct dbCommon *precord);
128 long (*del_record)(struct dbCommon *precord);
129 /* Only future Base releases may extend this table. */
130} dsxt;
131
132#ifdef __cplusplus
133extern "C" {
134 typedef long (*DEVSUPFUN)(void *); /* ptr to device support function*/
135#else
136 typedef long (*DEVSUPFUN)(); /* ptr to device support function*/
137#endif
138
139#ifndef USE_TYPED_DSET
140
141typedef struct dset { /* device support entry table */
142 long number; /*number of support routines*/
143 DEVSUPFUN report; /*print report*/
144 DEVSUPFUN init; /*init support layer*/
145 DEVSUPFUN init_record; /*init device for particular record*/
146 DEVSUPFUN get_ioint_info; /* get io interrupt information*/
147 /*other functions are record dependent*/
148} dset;
149
150#else
151typedef typed_dset dset;
152#endif /* USE_TYPED_DSET */
153
154/* exists only to disambiguate dset dbCommon::dset */
155typedef dset unambiguous_dset;
156
161DBCORE_API struct link* dbGetDevLink(struct dbCommon* prec);
162
163DBCORE_API extern dsxt devSoft_DSXT; /* Allow anything table */
164
165DBCORE_API void devExtend(dsxt *pdsxt);
166DBCORE_API void dbInitDevSup(struct devSup *pdevSup, dset *pdset);
167
168
169#define S_dev_noDevSup (M_devSup| 1) /*SDR_DEVSUP: Device support missing*/
170#define S_dev_noDSET (M_devSup| 3) /*Missing device support entry table*/
171#define S_dev_missingSup (M_devSup| 5) /*Missing device support routine*/
172#define S_dev_badInpType (M_devSup| 7) /*Bad INP link type*/
173#define S_dev_badOutType (M_devSup| 9) /*Bad OUT link type*/
174#define S_dev_badInitRet (M_devSup|11) /*Bad init_rec return value */
175#define S_dev_badBus (M_devSup|13) /*Illegal bus type*/
176#define S_dev_badCard (M_devSup|15) /*Illegal or nonexistent module*/
177#define S_dev_badSignal (M_devSup|17) /*Illegal signal*/
178#define S_dev_NoInit (M_devSup|19) /*No init*/
179#define S_dev_Conflict (M_devSup|21) /*Multiple records accessing same signal*/
180#define S_dev_noDeviceFound (M_devSup|23) /*No device found at specified address*/
181
182#ifdef __cplusplus
183} /* extern "C" */
184#endif
185
186#endif
DBCORE_API struct link * dbGetDevLink(struct dbCommon *prec)
Declaration of dbCommon.
Definition dbCommon.h:18
Definition devSup.h:141
Definition devSup.h:118
long(* add_record)(struct dbCommon *precord)
Definition devSup.h:123
long(* del_record)(struct dbCommon *precord)
Definition devSup.h:128
long(* init_record)(struct dbCommon *prec)
Definition devSup.h:77
long(* get_ioint_info)(int detach, struct dbCommon *prec, IOSCANPVT *pscan)
Definition devSup.h:108
long(* init)(int after)
Definition devSup.h:75
long(* report)(int lvl)
Definition devSup.h:70
long number
Definition devSup.h:68