mrfioc2  2.3.0
Public Member Functions | List of all members
evgInput Class Reference

#include <evgInput.h>

Inheritance diagram for evgInput:
Inheritance graph
[legend]
Collaboration diagram for evgInput:
Collaboration graph
[legend]

Public Member Functions

 evgInput (const std::string &, const epicsUInt32, const InputType, volatile epicsUInt8 *const)
 
 ~evgInput ()
 
virtual void lock () const
 
virtual void unlock () const
 
epicsUInt32 getNum () const
 
InputType getType () const
 
void setExtIrq (bool)
 
bool getExtIrq () const
 
void setDbusMap (epicsUInt16, bool)
 
bool getDbusMap (epicsUInt16) const
 
void setSeqTrigMap (epicsUInt32)
 
epicsUInt32 getSeqTrigMap () const
 
void setTrigEvtMap (epicsUInt16, bool)
 
bool getTrigEvtMap (epicsUInt16) const
 
- Public Member Functions inherited from mrf::ObjectInst< evgInput >
virtual propertyBasegetPropertyBase (const char *pname, const std::type_info &ptype)
 
virtual void visitProperties (bool(*cb)(propertyBase *, void *), void *arg)
 
- Public Member Functions inherited from mrf::Object
const std::string & name () const
 
const Objectparent () const
 
child_iterator beginChild () const
 
child_iterator endChild () const
 
template<typename P >
mrf::auto_ptr< property< P > > getProperty (const char *pname)
 

Additional Inherited Members

- Public Types inherited from mrf::Object
typedef m_obj_children_t::const_iterator child_iterator
 
typedef std::map< std::string, std::string > create_args_t
 
typedef Object *(* create_factory_t) (const std::string &name, const std::string &klass, const create_args_t &args)
 
- Static Public Member Functions inherited from mrf::ObjectInst< evgInput >
static int initObject ()
 
- Static Public Member Functions inherited from mrf::Object
static ObjectgetObject (const std::string &name)
 
static ObjectgetCreateObject (const std::string &name, const std::string &klass, const create_args_t &args=create_args_t())
 
static void addFactory (const std::string &klass, create_factory_t fn)
 
static void visitObjects (bool(*)(Object *, void *), void *)
 
- Protected Member Functions inherited from mrf::ObjectInst< evgInput >
 ObjectInst (const std::string &n)
 
 ObjectInst (const std::string &n, A &a)
 
virtual ~ObjectInst ()
 
- Protected Member Functions inherited from mrf::Object
 Object (const std::string &n, const Object *par=0)
 
virtual ~Object ()=0
 

Detailed Description

Definition at line 18 of file evgInput.h.

Constructor & Destructor Documentation

◆ evgInput()

evgInput::evgInput ( const std::string &  name,
const epicsUInt32  num,
const InputType  type,
volatile epicsUInt8 * const  pInReg 
)

Definition at line 13 of file evgInput.cpp.

16  ,m_num(num)
17  ,m_type(type)
18  ,m_pInReg(pInReg)
19 {}
const std::string & name() const
Definition: object.h:393

◆ ~evgInput()

evgInput::~evgInput ( )

Definition at line 21 of file evgInput.cpp.

21  {
22 }

Member Function Documentation

◆ getDbusMap()

bool evgInput::getDbusMap ( epicsUInt16  dbus) const

Definition at line 68 of file evgInput.cpp.

68  {
69  if(dbus > 7)
70  throw std::runtime_error("EVG DBUS num out of range. Max: 7");
71 
72  epicsUInt32 mask = 0x10000 << dbus;
73  epicsUInt32 map = nat_ioread32(m_pInReg);
74  return (map & mask) != 0;
75 }
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48

◆ getExtIrq()

bool evgInput::getExtIrq ( ) const

Definition at line 45 of file evgInput.cpp.

45  {
46  return (nat_ioread32(m_pInReg) & (epicsUInt32)EVG_EXT_INP_IRQ_ENA) != 0;
47 }
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48
#define EVG_EXT_INP_IRQ_ENA
Definition: evgRegMap.h:277

◆ getNum()

epicsUInt32 evgInput::getNum ( ) const

Definition at line 25 of file evgInput.cpp.

25  {
26  return m_num;
27 }

◆ getSeqTrigMap()

epicsUInt32 evgInput::getSeqTrigMap ( ) const

Definition at line 92 of file evgInput.cpp.

92  {
93  epicsUInt32 map = nat_ioread32(m_pInReg);
94  map = map & 0x0000ff00;
95  map = map >> 8;
96  return map;
97 }
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48

◆ getTrigEvtMap()

bool evgInput::getTrigEvtMap ( epicsUInt16  trigEvt) const

Definition at line 117 of file evgInput.cpp.

117  {
118  if(trigEvt > 7)
119  throw std::runtime_error("EVG Trig Event num out of range. Max: 7");
120 
121  epicsUInt32 mask = 0x1 << trigEvt;
122  epicsUInt32 map = nat_ioread32(m_pInReg);
123  return (map & mask) != 0;
124 }
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48

◆ getType()

InputType evgInput::getType ( ) const

Definition at line 30 of file evgInput.cpp.

30  {
31  return m_type;
32 }

◆ lock()

virtual void evgInput::lock ( ) const
inlinevirtual

Implements mrf::Object.

Definition at line 25 of file evgInput.h.

25 {};

◆ setDbusMap()

void evgInput::setDbusMap ( epicsUInt16  dbus,
bool  ena 
)

Definition at line 50 of file evgInput.cpp.

50  {
51  if(dbus > 7)
52  throw std::runtime_error("EVG DBUS num out of range. Max: 7");
53 
54  epicsUInt32 mask = 0x10000 << dbus;
55 
56  //Read-Modify-Write
57  epicsUInt32 map = nat_ioread32(m_pInReg);
58 
59  if(ena)
60  map = map | mask;
61  else
62  map = map & ~mask;
63 
64  nat_iowrite32(m_pInReg, map);
65 }
INLINE void nat_iowrite32(volatile void *addr, epicsUInt32 val)
Definition: mrfIoOpsDef.h:55
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48

◆ setExtIrq()

void evgInput::setExtIrq ( bool  ena)

Definition at line 35 of file evgInput.cpp.

35  {
36  if(ena)
37  nat_iowrite32(m_pInReg, nat_ioread32(m_pInReg) |
38  (epicsUInt32)EVG_EXT_INP_IRQ_ENA);
39  else
40  nat_iowrite32(m_pInReg, nat_ioread32(m_pInReg) &
41  (epicsUInt32)~(EVG_EXT_INP_IRQ_ENA));
42 }
INLINE void nat_iowrite32(volatile void *addr, epicsUInt32 val)
Definition: mrfIoOpsDef.h:55
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48
#define EVG_EXT_INP_IRQ_ENA
Definition: evgRegMap.h:277

◆ setSeqTrigMap()

void evgInput::setSeqTrigMap ( epicsUInt32  seqTrigMap)

Definition at line 78 of file evgInput.cpp.

78  {
79  if(seqTrigMap > 3)
80  throw std::runtime_error("Seq Trig Map out of range. Max: 3");
81 
82  //Read-Modify-Write
83  epicsUInt32 map = nat_ioread32(m_pInReg);
84 
85  map = map & 0xffff00ff;
86  map = map | (seqTrigMap << 8);
87 
88  nat_iowrite32(m_pInReg, map);
89 }
INLINE void nat_iowrite32(volatile void *addr, epicsUInt32 val)
Definition: mrfIoOpsDef.h:55
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48

◆ setTrigEvtMap()

void evgInput::setTrigEvtMap ( epicsUInt16  trigEvt,
bool  ena 
)

Definition at line 100 of file evgInput.cpp.

100  {
101  if(trigEvt > 7)
102  throw std::runtime_error("Trig Event num out of range. Max: 7");
103 
104  epicsUInt32 mask = 1 << trigEvt;
105  //Read-Modify-Write
106  epicsUInt32 map = nat_ioread32(m_pInReg);
107 
108  if(ena)
109  map = map | mask;
110  else
111  map = map & ~mask;
112 
113  nat_iowrite32(m_pInReg, map);
114 }
INLINE void nat_iowrite32(volatile void *addr, epicsUInt32 val)
Definition: mrfIoOpsDef.h:55
INLINE epicsUInt32 nat_ioread32(volatile void *addr)
Definition: mrfIoOpsDef.h:48

◆ unlock()

virtual void evgInput::unlock ( ) const
inlinevirtual

Implements mrf::Object.

Definition at line 26 of file evgInput.h.

26 {};

The documentation for this class was generated from the following files: