This is Unofficial EPICS BASE Doxygen Site
devMbbiDirectSoftRaw.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2008 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 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 /*
11  * Original Authors: Bob Dalesio and Matthew Needes
12  * Date: 10-08-93
13  */
14 
15 #include <stdlib.h>
16 #include <stdio.h>
17 #include <string.h>
18 
19 #include "alarm.h"
20 #include "dbDefs.h"
21 #include "dbAccess.h"
22 #include "recGbl.h"
23 #include "devSup.h"
24 #include "mbbiDirectRecord.h"
25 #include "epicsExport.h"
26 
27 /* Create the dset for devMbbiDirectSoftRaw */
28 static long init_record(dbCommon *pcommon);
29 static long read_mbbi(mbbiDirectRecord *prec);
30 
31 mbbidirectdset devMbbiDirectSoftRaw = {
32  {5, NULL, NULL, init_record, NULL},
33  read_mbbi
34 };
36 
37 static long init_record(dbCommon *pcommon)
38 {
39  mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon;
40 
41  recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval);
42 
43  /* Preserve old functionality */
44  if (prec->nobt == 0)
45  prec->mask = 0xffffffff;
46 
47  prec->mask <<= prec->shft;
48  return 0;
49 }
50 
51 static long read_mbbi(mbbiDirectRecord *prec)
52 {
53  if (!dbGetLink(&prec->inp, DBR_ULONG, &prec->rval, 0, 0)) {
54  prec->rval &= prec->mask;
55  if (dbLinkIsConstant(&prec->tsel) &&
56  prec->tse == epicsTimeEventDeviceTime)
57  dbGetTimeStamp(&prec->inp, &prec->time);
58  }
59  return 0;
60 }
#define init_record
#define NULL
Definition: catime.c:38
Miscellaneous macro definitions.
Device support routines.
Definition: devSup.h:140
#define epicsTimeEventDeviceTime
Definition: epicsTime.h:362
mbbidirectdset devMbbiDirectSoftRaw
epicsExportAddress(dset, devMbbiDirectSoftRaw)
int prec
Definition: reader.c:29
#define DBR_ULONG
Definition: dbFldTypes.h:82
Exporting IOC objects.