ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcbMOD.hpp
Go to the documentation of this file.
1
7#ifndef ngcbMOD_H
8#define ngcbMOD_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15#include <ngc/core/ngcb.h>
16#include <ngc/core/ngcbOBJ.hpp>
17#include <ngc/core/ngcbIFC.hpp>
18
19
23class ngcbMOD: public ngcbOBJ
24{
25public:
28
31
33 char moduleName[64];
34
36 int id;
37
40
43
46
49
52
54 ngcbMOD &operator=(const ngcbMOD &other);
55
57 ngcbMOD(const ngcbMOD &other);
58
60 explicit ngcbMOD(const ngcb_route_t &modRoute);
61
63 ngcbMOD(ngcbIFC *modDev, const ngcb_route_t &modRoute);
64
66 virtual ~ngcbMOD();
67
69 ngcbIFC *Dev();
70
72 void Dev(ngcbIFC *newDev);
73
75 int Connected();
76
81 int Sim();
82
84 int Initialize();
85
87 void ErrState(const char *msg, int errorId = 0);
88
90 virtual int CkAddrCB(int addr, const int *buffer, int size);
91
93 virtual void WrAddrCB(int addr, const int *buffer, int size);
94
96 virtual int Load(const char *fileName);
97
99 int Board();
100
102 void RpcCopy(void *dest, const void *src, size_t size, size_t items = 1);
103
105 int RPC(int target, int req, void *payload, unsigned int size,
106 unsigned int *status = NULL);
107
109 int ReadAddr(int addr, int *buffer, int size);
110
112 int WriteAddr(int addr, const int *buffer, int size);
113
115 int ReadAddr64(int addr, uint64_t *buffer, int size);
116
118 int WriteAddr64(int addr, const uint64_t *buffer, int size);
119
121 int Temperature(double *t);
122
124 int BackPlane();
125
127 virtual void CV(int chan, double volt);
128
130 virtual void Reset();
131
133 virtual int Disable();
134
136 virtual int Enable(int check = 1);
137
138protected:
139
140private:
142 void Init_();
143
145 int native_;
146};
147
148#endif
Definition ngcbIFC.hpp:754
int Sim()
Definition ngcbMOD.cpp:132
int firmware
Firmware revision.
Definition ngcbMOD.hpp:45
void ErrState(const char *msg, int errorId=0)
Go to error state.
Definition ngcbMOD.cpp:659
char moduleName[64]
Module name.
Definition ngcbMOD.hpp:33
int BackPlane()
Return back-plane ID.
Definition ngcbMOD.cpp:648
virtual int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcbMOD.cpp:148
int Temperature(double *t)
Read board temperature (degree C)
Definition ngcbMOD.cpp:622
ngcbIFC * Dev()
Return current interface device.
Definition ngcbMOD.cpp:107
virtual int Load(const char *fileName)
Load register instruction file.
Definition ngcbMOD.cpp:202
virtual int CkAddrCB(int addr, const int *buffer, int size)
Check-address call-back for alignment.
Definition ngcbMOD.cpp:191
ngcbMOD & operator=(const ngcbMOD &other)
Operator =.
Definition ngcbMOD.cpp:25
int revision
HW revision number.
Definition ngcbMOD.hpp:42
void RpcCopy(void *dest, const void *src, size_t size, size_t items=1)
Copy RPC payload.
Definition ngcbMOD.cpp:502
virtual ~ngcbMOD()
Destructor.
Definition ngcbMOD.cpp:84
int boardId
Physical board id.
Definition ngcbMOD.hpp:48
int RPC(int target, int req, void *payload, unsigned int size, unsigned int *status=NULL)
Execute RPC.
Definition ngcbMOD.cpp:507
ngcb_route_t route
Local route to module (header)
Definition ngcbMOD.hpp:30
int Initialize()
Initialize module.
Definition ngcbMOD.cpp:154
int Connected()
Return 1 if device is connected, zero otherwise.
Definition ngcbMOD.cpp:120
virtual void WrAddrCB(int addr, const int *buffer, int size)
Write-to-address call-back for alignment.
Definition ngcbMOD.cpp:197
int WriteAddr(int addr, const int *buffer, int size)
Write to address (32-bit)
Definition ngcbMOD.cpp:541
virtual void Reset()
Align soft-states after reset.
Definition ngcbMOD.cpp:144
int id
ID-register content.
Definition ngcbMOD.hpp:36
int ReadAddr(int addr, int *buffer, int size)
Read from address (32-bit)
Definition ngcbMOD.cpp:523
ngcbIFC * dev
Interface device.
Definition ngcbMOD.hpp:27
int productCode
Product code.
Definition ngcbMOD.hpp:39
int Board()
Return the board number of the module (starts with zero)
Definition ngcbMOD.cpp:500
virtual int Disable()
Call-back at transition to not operational state.
Definition ngcbMOD.cpp:146
ngcbMOD(const ngcbMOD &other)
Copy constructor.
Definition ngcbMOD.cpp:43
int WriteAddr64(int addr, const uint64_t *buffer, int size)
Write to address (64-bit)
Definition ngcbMOD.cpp:604
int ReadAddr64(int addr, uint64_t *buffer, int size)
Read from address (64-bit)
Definition ngcbMOD.cpp:586
virtual void CV(int chan, double volt)
Voltage conversion call-back.
Definition ngcbMOD.cpp:654
int fitsHdr
Enable FITS-header for this module.
Definition ngcbMOD.hpp:51
ngcbOBJ()
Constructor.
Definition ngcbOBJ.cpp:34
Definition ngcbIFC.hpp:72