DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
sspmodules
src
anlBoard
Device.hpp
Go to the documentation of this file.
1
8
#ifndef SSPMODULES_SRC_ANLBOARD_DEVICE_HPP_
9
#define SSPMODULES_SRC_ANLBOARD_DEVICE_HPP_
10
11
//#include "ftd2xx.h"
12
13
#include <cstdio>
14
#include <cstring>
15
#include <iomanip>
16
#include <iostream>
17
#include <stdint.h>
18
#include <string>
19
#include <unistd.h>
20
#include <vector>
21
22
namespace
dunedaq
{
23
namespace
sspmodules
{
24
25
// PABC defining low-level interface to an SSP board.
26
// Actual hardware calls must be implemented by derived classes.
27
class
Device
28
{
29
30
// Allow the DeviceManager access to call Open() to prepare
31
// the hardware for use. User code must then call
32
// DeviceManager::OpenDevice() to get a pointer to the object
33
friend
class
DeviceManager
;
34
35
public
:
36
virtual
~Device
(){}
37
38
// Return whether device is currently open
39
virtual
bool
IsOpen
() = 0;
40
41
// Close the device. In order to open the device again, another device needs to be
42
// requested from the DeviceManager
43
virtual
void
Close
() = 0;
44
45
// Flush communication channel
46
virtual
void
DevicePurgeComm
() = 0;
47
48
// Flush data channel
49
virtual
void
DevicePurgeData
() = 0;
50
51
// Get number of bytes in data queue (put into numWords)
52
virtual
void
DeviceQueueStatus
(
unsigned
int
* numWords) = 0;
53
54
// Read data into vector, up to defined size
55
virtual
void
DeviceReceive
(std::vector<unsigned int>& data,
unsigned
int
size
) = 0;
56
57
//============================//
58
// Read from/write to registers//
59
//============================//
60
// Where mask is given, only read/write bits which are high in mask
61
62
virtual
void
DeviceRead
(
unsigned
int
address
,
unsigned
int
* value) = 0;
63
64
virtual
void
DeviceReadMask
(
unsigned
int
address
,
unsigned
int
mask,
unsigned
int
* value) = 0;
65
66
virtual
void
DeviceWrite
(
unsigned
int
address
,
unsigned
int
value) = 0;
67
68
virtual
void
DeviceWriteMask
(
unsigned
int
address
,
unsigned
int
mask,
unsigned
int
value) = 0;
69
70
// Set bits high in mask to 1
71
virtual
void
DeviceSet
(
unsigned
int
address
,
unsigned
int
mask) = 0;
72
73
// Set bits high in mask to 0
74
virtual
void
DeviceClear
(
unsigned
int
address
,
unsigned
int
mask) = 0;
75
76
// Read series of contiguous registers, number to read given in "size"
77
virtual
void
DeviceArrayRead
(
unsigned
int
address
,
unsigned
int
size
,
unsigned
int
* data) = 0;
78
79
// Write series of contiguous registers, number to write given in "size"
80
virtual
void
DeviceArrayWrite
(
unsigned
int
address
,
unsigned
int
size
,
unsigned
int
* data) = 0;
81
82
//=============================
83
84
protected
:
85
bool
fSlowControlOnly
;
86
87
private
:
88
// Device can only be opened from the DeviceManager.
89
virtual
void
Open
(
bool
slowControlOnly =
false
) = 0;
90
};
91
92
}
// namespace sspmodules
93
}
// namespace dunedaq
94
95
#endif
// SSPMODULES_SRC_ANLBOARD_DEVICE_HPP_
dunedaq::sspmodules::Device
Definition
Device.hpp:28
dunedaq::sspmodules::Device::DeviceSet
virtual void DeviceSet(unsigned int address, unsigned int mask)=0
dunedaq::sspmodules::Device::Close
virtual void Close()=0
dunedaq::sspmodules::Device::DeviceArrayRead
virtual void DeviceArrayRead(unsigned int address, unsigned int size, unsigned int *data)=0
dunedaq::sspmodules::Device::fSlowControlOnly
bool fSlowControlOnly
Definition
Device.hpp:85
dunedaq::sspmodules::Device::DeviceRead
virtual void DeviceRead(unsigned int address, unsigned int *value)=0
dunedaq::sspmodules::Device::DeviceQueueStatus
virtual void DeviceQueueStatus(unsigned int *numWords)=0
dunedaq::sspmodules::Device::DeviceWriteMask
virtual void DeviceWriteMask(unsigned int address, unsigned int mask, unsigned int value)=0
dunedaq::sspmodules::Device::DevicePurgeComm
virtual void DevicePurgeComm()=0
dunedaq::sspmodules::Device::DeviceClear
virtual void DeviceClear(unsigned int address, unsigned int mask)=0
dunedaq::sspmodules::Device::Open
virtual void Open(bool slowControlOnly=false)=0
dunedaq::sspmodules::Device::DevicePurgeData
virtual void DevicePurgeData()=0
dunedaq::sspmodules::Device::DeviceReceive
virtual void DeviceReceive(std::vector< unsigned int > &data, unsigned int size)=0
dunedaq::sspmodules::Device::DeviceReadMask
virtual void DeviceReadMask(unsigned int address, unsigned int mask, unsigned int *value)=0
dunedaq::sspmodules::Device::DeviceArrayWrite
virtual void DeviceArrayWrite(unsigned int address, unsigned int size, unsigned int *data)=0
dunedaq::sspmodules::Device::DeviceWrite
virtual void DeviceWrite(unsigned int address, unsigned int value)=0
dunedaq::sspmodules::Device::DeviceManager
friend class DeviceManager
Definition
Device.hpp:33
dunedaq::sspmodules::Device::~Device
virtual ~Device()
Definition
Device.hpp:36
dunedaq::sspmodules::Device::IsOpen
virtual bool IsOpen()=0
dunedaq::sspmodules
Definition
anlExceptions.hpp:15
dunedaq
Including Qt Headers.
Definition
module.cpp:16
dunedaq::size
FELIX Initialization std::string initerror FELIX queue timed std::string queuename Unexpected chunk size
Definition
FelixIssues.hpp:28
dunedaq::address
Invalid address
Definition
CommonIssues.hpp:29
Generated on
for DUNE-DAQ by
1.17.0