ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbMOD.hpp
Go to the documentation of this file.
1
8#ifndef ngcbMOD_H
9#define ngcbMOD_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16#include <ngc/core/ngcb.h>
17#include <ngc/core/ngcbOBJ.hpp>
18#include <ngc/core/ngcbIFC.hpp>
19
20
24class ngcbMOD: public ngcbOBJ
25{
26public:
29
32
34 char moduleName[64];
35
37 int id;
38
41
44
47
50
53
55 ngcbMOD &operator=(const ngcbMOD &other);
56
58 ngcbMOD(const ngcbMOD &other);
59
61 explicit ngcbMOD(const ngcb_route_t &modRoute);
62
64 ngcbMOD(ngcbIFC *modDev, const ngcb_route_t &modRoute);
65
67 virtual ~ngcbMOD();
68
70 ngcbIFC *Dev();
71
73 void Dev(ngcbIFC *newDev);
74
76 int Connected();
77
82 int Sim();
83
85 int Initialize();
86
88 void ErrState(const char *msg, int errorId = 0);
89
91 virtual int CkAddrCB(int addr, const int *buffer, int size);
92
94 virtual void WrAddrCB(int addr, const int *buffer, int size);
95
97 virtual int Load(const char *fileName);
98
100 int Board();
101
103 void RpcCopy(void *dest, const void *src, size_t size, size_t items = 1);
104
106 int RPC(int target, int req, void *payload, unsigned int size,
107 unsigned int *status = NULL);
108
110 int ReadAddr(int addr, int *buffer, int size);
111
113 int WriteAddr(int addr, const int *buffer, int size);
114
116 int ReadAddr64(int addr, uint64_t *buffer, int size);
117
119 int WriteAddr64(int addr, const uint64_t *buffer, int size);
120
122 int Temperature(double *t);
123
125 int BackPlane();
126
128 virtual void CV(int chan, double volt);
129
131 virtual void Reset();
132
134 virtual int Disable();
135
137 virtual int Enable(int check = 1);
138
139protected:
140
141private:
143 void Init_();
144
146 int native_;
147};
148
149#endif
Definition ngcbIFC.hpp:760
int Sim()
Definition ngcbMOD.cpp:132
int firmware
Firmware revision.
Definition ngcbMOD.hpp:46
void ErrState(const char *msg, int errorId=0)
Go to error state.
Definition ngcbMOD.cpp:721
char moduleName[64]
Module name.
Definition ngcbMOD.hpp:34
int BackPlane()
Return back-plane ID.
Definition ngcbMOD.cpp:710
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:684
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:43
void RpcCopy(void *dest, const void *src, size_t size, size_t items=1)
Copy RPC payload.
Definition ngcbMOD.cpp:548
virtual ~ngcbMOD()
Destructor.
Definition ngcbMOD.cpp:84
int boardId
Physical board id.
Definition ngcbMOD.hpp:49
int RPC(int target, int req, void *payload, unsigned int size, unsigned int *status=NULL)
Execute RPC.
Definition ngcbMOD.cpp:553
ngcb_route_t route
Local route to module (header)
Definition ngcbMOD.hpp:31
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:603
virtual void Reset()
Align soft-states after reset.
Definition ngcbMOD.cpp:144
int id
ID-register content.
Definition ngcbMOD.hpp:37
int ReadAddr(int addr, int *buffer, int size)
Read from address (32-bit)
Definition ngcbMOD.cpp:585
ngcbIFC * dev
Interface device.
Definition ngcbMOD.hpp:28
int productCode
Product code.
Definition ngcbMOD.hpp:40
int Board()
Return the board number of the module (starts with zero)
Definition ngcbMOD.cpp:546
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:666
int ReadAddr64(int addr, uint64_t *buffer, int size)
Read from address (64-bit)
Definition ngcbMOD.cpp:648
virtual void CV(int chan, double volt)
Voltage conversion call-back.
Definition ngcbMOD.cpp:716
int fitsHdr
Enable FITS-header for this module.
Definition ngcbMOD.hpp:52
ngcbOBJ()
Constructor.
Definition ngcbOBJ.cpp:35
Definition ngcbIFC.hpp:78