mrfioc2  2.3.0
evgOutput.cpp
Go to the documentation of this file.
1 #include "evgOutput.h"
2 
3 #include <iostream>
4 #include <stdexcept>
5 
6 #include <mrfCommonIO.h>
7 #include <errlog.h>
8 #include <mrfCommon.h>
9 
10 #include "evgRegMap.h"
11 
12 evgOutput::evgOutput(const std::string& name, const epicsUInt32 num,
13  const evgOutputType type, volatile epicsUInt8* const pOutReg):
14 mrf::ObjectInst<evgOutput>(name),
15 m_num(num),
16 m_type(type),
17 m_pOutReg(pOutReg) {
18  switch(m_type) {
19  case(FrontOut):
20  if(m_num >= evgNumFrontOut)
21  throw std::runtime_error("EVG Front panel output ID out of range");
22  break;
23 
24  case(UnivOut):
25  if(m_num >= evgNumUnivOut)
26  throw std::runtime_error("EVG Universal output ID out of range");
27  break;
28 
29  default:
30  throw std::runtime_error("Wrong EVG Output type");
31  }
32 }
33 
35 }
36 
37 void
38 evgOutput::setSource(epicsUInt16 map) {
39  nat_iowrite16(m_pOutReg, map);
40 }
41 
42 epicsUInt16
44  return nat_ioread16(m_pOutReg);
45 }
evgOutput(const std::string &, const epicsUInt32, const evgOutputType, volatile epicsUInt8 *const)
Definition: evgOutput.cpp:12
void setSource(epicsUInt16)
Definition: evgOutput.cpp:38
#define evgNumUnivOut
Definition: evgRegMap.h:286
INLINE epicsUInt16 nat_ioread16(volatile void *addr)
Definition: mrfIoOpsDef.h:34
epicsUInt16 getSource() const
Definition: evgOutput.cpp:43
evgOutputType
Definition: evgOutput.h:7
#define evgNumFrontOut
Definition: evgRegMap.h:285
INLINE void nat_iowrite16(volatile void *addr, epicsUInt16 val)
Definition: mrfIoOpsDef.h:41
Definition: flash.cpp:23