pflib v3.0.0-rc1-25-gb91774e
Pretty Fine HGCROC Interaction Library
All Classes Namespaces Files Functions Variables Typedefs Pages
ROC.h
1#ifndef PFLIB_ROC_H_INCLUDED
2#define PFLIB_ROC_H_INCLUDED
3
4#include "pflib/I2C.h"
5#include "pflib/Compile.h"
6#include <vector>
7#include <map>
8#include <string>
9
10namespace pflib {
11
16class ROC {
17 public:
18 ROC(I2C& i2c, uint8_t roc_base_addr, const std::string& type_version);
19
20 void setRunMode(bool active=true);
21 bool isRunMode();
22
23 std::vector<uint8_t> readPage(int ipage, int len);
24 uint8_t getValue(int page, int offset);
25 void setValue(int page, int offset, uint8_t value);
26
27 std::vector<std::string> getDirectAccessParameters();
28 bool getDirectAccess(const std::string& name);
29 bool getDirectAccess(int reg, int bit);
30 void setDirectAccess(const std::string& name, bool val);
31 void setDirectAccess(int reg, int bit, bool val);
32
33 std::vector<uint8_t> getChannelParameters(int ichan);
34 void setChannelParameters(int ichan, std::vector<uint8_t>& values);
35
36 void setRegisters(const std::map<int,std::map<int,uint8_t>>& registers);
37 std::vector<std::string> parameters(const std::string& page);
39
40 void applyParameters(const std::map<std::string,std::map<std::string,int>>& parameters);
41
42 // short-hand for just applying a single parameter
43 void applyParameter(const std::string& page, const std::string& param, const int& val);
44
45
46 private:
47 I2C& i2c_;
48 uint8_t roc_base_;
49 Compiler compiler_;
50};
51
52}
53
54#endif // PFLIB_ROC_H_INCLUDED
Definition of compiling and decompiling functions between page numbers, register numbers,...
The object that does the compiling.
Definition Compile.h:57
Base class which encapsulates the I2C interface, represents a single bus.
Definition I2C.h:14
Definition ROC.h:16
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3