mrfioc2  2.3.0
evr.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2010 Brookhaven Science Associates, as Operator of
3 * Brookhaven National Laboratory.
4 * Copyright (c) 2015 Paul Scherrer Institute (PSI), Villigen, Switzerland
5 * mrfioc2 is distributed subject to a Software License Agreement found
6 * in file LICENSE that is included with this distribution.
7 \*************************************************************************/
8 /*
9  * Author: Michael Davidsaver <mdavidsaver@gmail.com>
10  */
11 
12 #ifndef EVR_HPP_INC
13 #define EVR_HPP_INC
14 
15 #include <epicsTypes.h>
16 #include <epicsTime.h>
17 #include <callback.h>
18 #include <dbScan.h>
19 
20 #include "evr/output.h"
21 #include "mrf/object.h"
22 
23 #include "configurationInfo.h"
24 
25 class Pulser;
26 class PreScaler;
27 class Input;
28 class CML;
29 class DelayModuleEvr;
30 
31 enum TSSource {
35 };
36 
45 class epicsShareClass EVR : public mrf::ObjectInst<EVR>
46 {
47 public:
48  EVR(const std::string& n, bus_configuration& busConfig) : mrf::ObjectInst<EVR>(n), busConfiguration(busConfig) {}
49 
50  virtual ~EVR()=0;
51 
53  virtual std::string model() const=0;
54 
56  virtual MRFVersion version() const=0;
57  std::string versionStr() const;
59  virtual std::string versionSw() const;
60 
62  virtual std::string position() const;
63  bus_configuration* getBusConfiguration();
64 
68  virtual bool enabled() const=0;
69  virtual void enable(bool)=0;
72  virtual bool mappedOutputState() const=0;
73 
81  virtual bool specialMapped(epicsUInt32 code, epicsUInt32 func) const=0;
82  virtual void specialSetMap(epicsUInt32 code, epicsUInt32 func,bool set)=0;
83 
90 
94  virtual double clock() const=0;
98  virtual void clockSet(double clk)=0;
99 
101  virtual bool pllLocked() const=0;
102 
104  virtual epicsUInt32 uSecDiv() const=0;
107  virtual bool extInhib() const=0;
109  virtual void setExtInhib(bool)=0;
110 
116  virtual void setSourceTS(TSSource)=0;
118  virtual TSSource SourceTS() const=0;
119 
123  virtual double clockTS() const=0;
127  virtual void clockTSSet(double)=0;
128 
130  virtual epicsUInt32 tsDiv() const=0;
131 
135  virtual bool interestedInEvent(epicsUInt32 event,bool set)=0;
136 
137 
138  virtual bool TimeStampValid() const=0;
139  virtual IOSCANPVT TimeStampValidEvent() const=0;
140 
148  virtual bool getTimeStamp(epicsTimeStamp *ts,epicsUInt32 event)=0;
149 
154  virtual bool getTicks(epicsUInt32 *tks)=0;
155 
156  virtual IOSCANPVT eventOccurred(epicsUInt32 event) const=0;
157 
158  typedef void (*eventCallback)(void* userarg, epicsUInt32 event);
159  virtual void eventNotifyAdd(epicsUInt32 event, eventCallback, void*)=0;
160  virtual void eventNotifyDel(epicsUInt32 event, eventCallback, void*)=0;
163  virtual epicsUInt32 irqCount() const=0;
164 
168  virtual bool linkStatus() const=0;
169  virtual IOSCANPVT linkChanged() const=0;
170  virtual epicsUInt32 recvErrorCount() const=0;
173  virtual epicsUInt16 dbus() const=0;
174 
175  virtual epicsUInt32 heartbeatTIMOCount() const=0;
176  virtual IOSCANPVT heartbeatTIMOOccured() const=0;
177 
178  virtual epicsUInt32 FIFOFullCount() const=0;
179  virtual epicsUInt32 FIFOOverRate() const=0;
180  virtual epicsUInt32 FIFOEvtCount() const=0;
181  virtual epicsUInt32 FIFOLoopCount() const=0;
182 
183 
189  void setSourceTSraw(epicsUInt32 r){setSourceTS((TSSource)r);};
190  epicsUInt32 SourceTSraw() const{return (TSSource)SourceTS();};
193 private:
194  bus_configuration busConfiguration;
195 }; // class EVR
196 
197 #endif // EVR_HPP_INC
EVR(const std::string &n, bus_configuration &busConfig)
Definition: evr.h:48
TSSource
Definition: evr.h:31
Definition: cml.h:25
Definition: input.h:24
A programmable delay unit.
Definition: pulser.h:38
User implementation hook.
Definition: object.h:459
epicsUInt32 SourceTSraw() const
Definition: evr.h:190
Base interface for EVRs.
Definition: evr.h:45
void setSourceTSraw(epicsUInt32 r)
Definition: evr.h:189
Definition: flash.cpp:23