pflib v3.0.0-rc1-25-gb91774e
Pretty Fine HGCROC Interaction Library
All Classes Namespaces Files Functions Variables Typedefs Pages
GPIO.h
1#ifndef PFLIB_GPIO_H_
2#define PFLIB_GPIO_H_
3
4#include <vector>
5#include <string>
6
7namespace pflib {
8
12class GPIO {
13 protected:
14 GPIO(int gpo, int gpi) : ngpo_{gpo}, ngpi_{gpi} { }
15
16 public:
20 int getGPOcount() { return ngpo_; }
21
25 int getGPIcount() { return ngpi_; }
26
28 virtual std::string getBitName(int ibit, bool isgpo=true) { return ""; }
29
33 virtual bool getGPI(int ibit);
34
39
43 virtual void setGPO(int ibit, bool toTrue=true);
44
48 virtual void setGPO(const std::vector<bool>& bits) = 0;
49
54
56 bool getGPI_single(int ibit) { return getGPI(ibit); }
57 std::vector<bool> getGPI_all() { return getGPI(); }
58 void setGPO_single(int ibit, bool t) { return setGPO(ibit,t); }
59 void setGPO_all(const std::vector<bool>& b) { return setGPO(b); }
60
61 private:
65 int ngpi_, ngpo_;
66};
67
68GPIO* make_GPIO_HcalHGCROCZCU();
69
70}
71
72#endif // PFLIB_GPIO_H_
Representation of GPIO controller.
Definition GPIO.h:12
virtual std::vector< bool > getGPO()=0
Read all GPO bits.
bool getGPI_single(int ibit)
convenience wrapper for python bindings
Definition GPIO.h:56
virtual std::string getBitName(int ibit, bool isgpo=true)
Get the name of a bit if possible.
Definition GPIO.h:28
int getGPOcount()
Get the number of GPO bits.
Definition GPIO.h:20
int ngpi_
Cached numbers of GPI and GPO bits.
Definition GPIO.h:65
virtual void setGPO(int ibit, bool toTrue=true)
Set a single GPO bit.
Definition GPIO.cxx:18
virtual void setGPO(const std::vector< bool > &bits)=0
Set all GPO bits.
int getGPIcount()
Get the number of GPI bits.
Definition GPIO.h:25
virtual std::vector< bool > getGPI()=0
Read all GPI bits.
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3