pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
ROC.h
1#ifndef PFLIB_ROC_H_INCLUDED
2#define PFLIB_ROC_H_INCLUDED
3
4#include "pflib/I2C.h"
5#include <vector>
6#include <map>
7#include <string>
8
9namespace pflib {
10
15class ROC {
16 public:
17 ROC(I2C& i2c, int ibus=0);
18
19 std::vector<uint8_t> readPage(int ipage, int len);
20 void setValue(int page, int offset, uint32_t value);
21
22 std::vector<uint8_t> getChannelParameters(int ichan);
23 void setChannelParameters(int ichan, std::vector<uint8_t>& values);
24
25 void setRegisters(const std::map<int,std::map<int,uint8_t>>& registers);
26 void applyParameters(const std::map<std::string,std::map<std::string,int>>& parameters);
27
28 // short-hand for just applying a single parameter
29 void applyParameter(const std::string& page, const std::string& param, const int& val);
30
31
32 private:
33 I2C& i2c_;
34 int ibus_;
35};
36
37}
38
39#endif // PFLIB_ROC_H_INCLUDED
Class which encapsulates the I2C controller in the Polarfire.
Definition: I2C.h:13
Definition: ROC.h:15
Polarfire Interaction Library.
Definition: Backend.h:8
std::vector< std::string > parameters(const std::string &page)
get the parameter names for the input page-type
Definition: Compile.cxx:522