otsdaq_components  v2_02_00
FSSRROCDefinitions.h
1 #ifndef _ots_FSSRROCDEfinitions_h_
2 #define _ots_FSSRROCDEfinitions_h_
3 
4 #include "otsdaq-components/DetectorHardware/VROCDefinitions.h"
5 //#include "otsdaq-core/BitManipulator/BitManipulator.h"
6 //#include "otsdaq/DAQHardware/FSSRFirmwareDefinitions.h"
7 //#include "otsdaq/DAQHardware/FSSRFirmware.h"
8 //#include "otsdaq-core/DataTypes/DataTypes.h"
9 //#include "otsdaq-core/ConfigurationInterface/ROCStream.h"
10 
11 #include <string>
12 #include <stdint.h>
13 
14 namespace ots
15 {
16 
18 {
19 
20 public:
22  virtual ~FSSRROCDefinitions(void);
23 
24  static uint64_t makeDACWriteHeader (int chipId, const std::string& registerName);//Does not work for SendData and RejectHits
25  static uint64_t makeDACSetHeader (int chipId, const std::string& registerName);//Only works for SendData and RejectHits
26  static uint64_t makeDACResetHeader (int chipId, const std::string& registerName);//Only works for SendData and RejectHits
27  static uint64_t makeDACReadHeader (int chipId, const std::string& registerName);//Does not work for SendData and RejectHits
28  static uint64_t makeDACWriteCommand (int chipId, const std::string& registerName, unsigned int valueToWrite);
29  static uint64_t makeDACReadCommand (int chipId, const std::string& registerName );
30  static std::string makeMaskWriteCommand (int chipId, const std::string& registerName, std::string valueToWrite);
31  static uint64_t makeMaskReadCommand (int chipId, const std::string& registerName );
32 
33  uint64_t setSendData (int chipId);
34  uint64_t resetSendData (int chipId);
35  uint64_t setRejectHits (int chipId);
36  uint64_t resetRejectHits(int chipId);
37 
38 private:
39  static uint64_t makeDACHeader (int chipId, const std::string& registerName, unsigned int instruction);
40  static unsigned int getDACRegisterAddress(const std::string& registerName);
41  enum
42  {
43  write = 1,
44  set = 2,
45  read = 4,
46  reset = 5,
47  setDefault = 6
48  };
49 };
50 
51 }
52 
53 #endif