This is Unofficial EPICS BASE Doxygen Site
devMbboDirectSoftRaw.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2012 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 /* devMbboDirectSoftRaw.c */
10 /*
11  * Original Author: Janet Anderson
12  * Date: 10-08-93
13  */
14 
15 #include <stdio.h>
16 
17 #include "dbAccess.h"
18 #include "epicsTypes.h"
19 #include "devSup.h"
20 #include "mbboDirectRecord.h"
21 #include "epicsExport.h"
22 
23 static long init_record(dbCommon *pcommon)
24 {
25  mbboDirectRecord *prec = (mbboDirectRecord *)pcommon;
26 
27  if (prec->nobt == 0)
28  prec->mask = 0xffffffff;
29 
30  prec->mask <<= prec->shft;
31 
32  return 2; /* Don't convert */
33 }
34 
35 static long write_mbbo(mbboDirectRecord *prec)
36 {
37  epicsUInt32 data;
38 
39  data = prec->rval & prec->mask;
40  dbPutLink(&prec->out, DBR_ULONG, &data, 1);
41  return 0;
42 }
43 
44 /* Create the dset for devMbboDirectSoftRaw */
45 mbbodirectdset devMbboDirectSoftRaw = {
46  {5, NULL, NULL, init_record, NULL},
47  write_mbbo
48 };
49 epicsExportAddress(dset, devMbboDirectSoftRaw);
mbbodirectdset devMbboDirectSoftRaw
#define init_record
#define NULL
Definition: catime.c:38
unsigned int epicsUInt32
Definition: epicsTypes.h:43
Device support routines.
Definition: devSup.h:140
epicsExportAddress(dset, devMbboDirectSoftRaw)
int prec
Definition: reader.c:29
#define DBR_ULONG
Definition: dbFldTypes.h:82
Exporting IOC objects.