otsdaq_mu2e  v2_04_02
CFOFrontEndInterface.h
1 #ifndef _ots_CFOFrontEndInterface_h_
2 #define _ots_CFOFrontEndInterface_h_
3 
4 #include <map>
5 #include <string>
6 #include "otsdaq-mu2e/CFOandDTCCore/CFOandDTCCoreVInterface.h"
7 
8 #include "cfoInterfaceLib/CFO_Registers.h"
9 
10 namespace ots
11 {
13 {
14  // clang-format off
15 
16  public:
17  CFOFrontEndInterface(const std::string& interfaceUID,
18  const ConfigurationTree& theXDAQContextConfigTree,
19  const std::string& interfaceConfigurationPath);
20 
21  virtual ~CFOFrontEndInterface(void);
22 
23  // state machine
24  //----------------
25  void configure (void);
26  void halt (void);
27  void pause (void);
28  void resume (void);
29  void start (std::string runNumber);
30  void stop (void);
31  bool running (void);
32 
33  // CFO specific items
34  //----------------
35  float MeasureLoopback (int linkToLoopback);
36  virtual void readStatus (void) override;
37  int getLinkStatus (void);
38 
39  // hardware access
40  //----------------
41 // void universalRead(char* address, char* readValue) override;
42 // void universalWrite(char* address, char* writeValue) override;
43 // int registerRead(int address);
44 // int registerWrite(
45 // int address,
46 // int dataToWrite); // return read value after having written dataToWrite
47 
48 
49  float delay[8][6][8];
50  float delay_rms[8][6][8];
51  float delay_failed[8][6][8];
52 
53  private:
54 // char devfile_[11];
55 // int fd_;
56 // int dtc_ = -1;
57  CFOLib::CFO_Registers* thisCFO_;
58  //int configure_clock_ = 0;
59 
60  m_ioc_reg_access_t reg_access_;
61 
62  int loopback_distribution_[10000];
63  unsigned int min_distribution_;
64  unsigned int max_distribution_;
65  float average_loopback_;
66  float rms_loopback_;
67  float failed_loopback_;
68  unsigned int initial_9100_;
69  unsigned int initial_9114_;
70  unsigned int initial_91a0_;
71  unsigned int initial_9154_;
72 };
73 
74 // clang-format on
75 } // namespace ots
76 
77 #endif
CFOFrontEndInterface(const std::string &interfaceUID, const ConfigurationTree &theXDAQContextConfigTree, const std::string &interfaceConfigurationPath)