mrfioc2  2.3.0
mrmevrseq.cpp
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2016 Michael Davidsaver
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 <stdio.h>
8 
9 #include <mrfCommonIO.h>
10 
11 #include "mrmevrseq.h"
12 
13 #include "drvem.h"
14 #include "evrRegMap.h"
15 
16 #if defined(__rtems__)
17 # define DEBUG(LVL, ARGS) do{if(SeqManagerDebug>=(LVL)) {printk ARGS ;}}while(0)
18 #elif defined(vxWorks)
19 # define DEBUG(LVL, ARGS) do{}while(0)
20 #else
21 # define DEBUG(LVL, ARGS) do{if(SeqManagerDebug>=(LVL)) {printf ARGS ;}}while(0)
22 #endif
23 
25  :SeqManager(owner->name()+":SEQMGR", TypeEVR)
26  ,owner(owner)
27 {
28  addHW(0, owner->base + U32_SeqControl(0) , owner->base + U32_SeqRamTS(0,0));
29 }
30 
32 
34 {
35  return owner->clock();
36 }
37 
39 void EvrSeqManager::mapTriggerSrc(unsigned i, unsigned src)
40 {
41  assert(i==0);
42  if((src&0xff000000)!=0x02000000) {
43  DEBUG(0, ("EvrSeqManager::mapTriggerSrc unsupported %x\n", src));
44  return;
45  }
46 }
47 
50 {
51  // SoS for sequencer 0 is bit 8
52  return (NAT_READ32(owner->base, IRQFlag)>>8)&0x1;
53 }
virtual double clock() const OVERRIDE FINAL
Definition: drvem.h:141
volatile unsigned char *const base
Definition: drvem.h:223
#define U32_SeqControl(n)
Definition: evgRegMap.h:142
#define DEBUG(LVL, ARGS)
Definition: mrmevrseq.cpp:21
virtual void mapTriggerSrc(unsigned i, unsigned src)
Called from ISR.
Definition: mrmevrseq.cpp:39
Modular Register Map Event Receivers.
Definition: drvem.h:86
#define U32_SeqRamTS(n, m)
Definition: evgRegMap.h:231
virtual double getClkFreq() const
Definition: mrmevrseq.cpp:33
virtual ~EvrSeqManager()
Definition: mrmevrseq.cpp:31
#define NAT_READ32(base, offset)
Definition: mrfCommonIO.h:145
#define IRQFlag
Definition: mrf.h:106
void addHW(unsigned i, volatile void *ctrl, volatile void *ram)
Definition: mrmSeq.cpp:765
virtual epicsUInt32 testStartOfSeq()
Called from ISR.
Definition: mrmevrseq.cpp:49
EvrSeqManager(EVRMRM *owner)
Definition: mrmevrseq.cpp:24