mrfioc2  2.3.0
mrmGpio.cpp
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2015 Paul Scherrer Institute (PSI), Villigen, Switzerland
3 * mrfioc2 is distributed subject to a Software License Agreement found
4 * in file LICENSE that is included with this distribution.
5 \*************************************************************************/
6 
7 #include "mrmGpio.h"
8 #include "drvem.h"
9 #include "evrRegMap.h"
10 
11 MRMGpio::MRMGpio(EVRMRM &o): owner_(o)
12 {
13 }
14 
15 epicsUInt32 MRMGpio::getDirection()
16 {
17  epicsUInt32 val = READ32(owner_.base, GPIODir);
18  return val;
19 }
20 
21 void MRMGpio::setDirection(epicsUInt32 val)
22 {
23  WRITE32(owner_.base, GPIODir, val);
24 }
25 
26 epicsUInt32 MRMGpio::read()
27 {
28  epicsUInt32 val = READ32(owner_.base, GPIOIn);
29  return val;
30 }
31 
32 epicsUInt32 MRMGpio::getOutput()
33 {
34  epicsUInt32 val = READ32(owner_.base, GPIOOut);
35  return val;
36 }
37 
38 void MRMGpio::setOutput(epicsUInt32 val)
39 {
40  WRITE32(owner_.base, GPIOOut, val);
41 }
void setOutput(epicsUInt32)
Definition: mrmGpio.cpp:38
void setDirection(epicsUInt32)
Definition: mrmGpio.cpp:21
#define READ32(base, offset)
Definition: mrfCommonIO.h:114
volatile unsigned char *const base
Definition: drvem.h:223
Modular Register Map Event Receivers.
Definition: drvem.h:86
epicsUInt32 getDirection()
Definition: mrmGpio.cpp:15
epicsUInt32 getOutput()
Definition: mrmGpio.cpp:32
MRMGpio(EVRMRM &)
Definition: mrmGpio.cpp:11
#define WRITE32(base, offset, value)
Definition: mrfCommonIO.h:119
epicsUInt32 read()
Definition: mrmGpio.cpp:26