devSup.h
Device support routines.
Defines
-
S_dev_noDevSup
-
S_dev_noDSET
-
S_dev_missingSup
-
S_dev_badInpType
-
S_dev_badOutType
-
S_dev_badInitRet
-
S_dev_badBus
-
S_dev_badCard
-
S_dev_badSignal
-
S_dev_NoInit
-
S_dev_Conflict
-
S_dev_noDeviceFound
Functions
-
struct typed_dset
- #include <devSup.h>
Type safe version of ‘struct dset’
Recommended usage:
In Makefile:
USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
In C source file:
#include <devSup.h> #include <dbScan.h> // For IOCSCANPVT ... #include <epicsExport.h> // defines epicsExportSharedSymbols ... static long init_record(dbCommon *prec); static long get_iointr_info(int detach, dbCommon *prec, IOCSCANPVT* pscan); static long longin_read(longinRecord *prec); longindset devLiDevName = { { 5, // 4 from dset + 1 from longinRecord NULL, NULL, &init_record, &get_iointr_info }, &longin_read }; epicsExportAddress(dset, devLiDevName);
Public Members
-
long number
Number of function pointers which follow. The value depends on the recordtype, but must be >=4
-
long (*report)(int lvl)
Called from dbior()
-
long (*init)(int after)
Called twice during iocInit(). First with after = 0 before init_record() or array field allocation. Again with after = 1 after init_record() has finished.
-
long (*get_ioint_info)(int detach, struct dbCommon *prec, IOSCANPVT *pscan)
Called when SCAN=”I/O Intr” on startup, or after SCAN is changed.
Caller must assign the third argument (IOCSCANPVT*). eg.
struct mpvt { IOSCANPVT drvlist; }; ... // init_record() routine calls scanIoInit(&pvt->drvlist); ... static long get_ioint_info(int detach, struct dbCommon *prec, IOCSCANPVT* pscan) { if(prec->dpvt) *pscan = &((mypvt*)prec->dpvt)->drvlist;
When a particular record instance can/will only used a single scan list, the detach argument can be ignored.
If this is not the case, then the following should be noted.
get_ioint_info() is called with detach = 0 to fetch the scan list to which this record will be added.
get_ioint_info() is called later with detach = 1 to fetch the scan list from which this record should be removed.
Calls will be balanced, so a call with detach = 0 will be followed by one with detach = 1.
Note
get_ioint_info() will be called during IOC shutdown if the dsxt::del_record() extended callback is defined. (from 3.15.0.1)
-
long number
-
struct dsxt
- #include <devSup.h>
Device support extension table.
Optional routines to allow run-time address modifications to be communicated to device support, which must register a struct dsxt by calling devExtend() from its init() routine.
-
struct dset