DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SSPTypes.hpp
Go to the documentation of this file.
1
6#ifndef SSPMODULES_SRC_ANLBOARD_SSPTYPES_HPP_
7#define SSPMODULES_SRC_ANLBOARD_SSPTYPES_HPP_
8
9#include <cstdlib>
10
11namespace dunedaq::sspmodules {
12
13static const constexpr int max_control_data = 256; // Maximum size of packet payload on comms channel
14
15//==============================================================================
16// Enumerated Constants
17// These are defined by the SSP hardware spec
18//==============================================================================
19
20// Command to send to SSP
22{
24 // Basic Commands
29 // Array Commands
32 // Fifo Commands
36};
37
38// Holder for status returned from SSP
51
52//==============================================================================
53// Types
54//==============================================================================
55
56
57// Structure defined by hardware, i.e. hardware output can be written straight into this struct
59{ // NOTE: Group fields are listed from MSB to LSB
60 unsigned int header; // NOLINT // 0xAAAAAAAA
61 unsigned short length; // NOLINT // Packet Length in unsigned ints (including header)
62 unsigned short group1; // NOLINT // Trigger Type, Status Flags, Header Type
63 unsigned short triggerID; // NOLINT // Trigger ID
64 unsigned short group2; // NOLINT // Module ID, Channel ID
65 unsigned short timestamp[4]; // NOLINT // External Timestamp
66 // Words 0-1 = Clocks since last sync pulse
67 // Words 2-3 = Sync pulse count
68 unsigned short peakSumLow; // NOLINT // Lower 16 bits of Peak Sum
69 unsigned short group3; // NOLINT // Offset of Peak, Higher 8 bits of Peak Sum
70 unsigned short preriseLow; // NOLINT // Lower 16 bits of Prerise
71 unsigned short group4; // NOLINT // Lower 8 bits of integratedSum, Higher 8 bits of Prerise
72 unsigned short intSumHigh; // NOLINT // Upper 16 bits of integratedSum
73 unsigned short baseline; // NOLINT // Baseline
74 unsigned short cfdPoint[4]; // NOLINT // CFD Timestamp Interpolation Points
75 unsigned short intTimestamp[4]; // NOLINT // Internal Timestamp
76 // Word 0 = Reserved for interpolation
77 // Words 1-3 = 48 bit Timestamp
78};
79
80// static_assert(sizeof(struct EventHeader) == 12, "Check your assumptions on SSP EventHeader size");
81
82// byte-level structure of command header to send to SSP
84{
85 unsigned int length;
86 unsigned int address;
87 unsigned int command;
88 unsigned int size;
89 unsigned int status;
90};
91
92// Struct containing header followed by payload.
93// Since control packets are small, just allocate enough space to accommodate
94// longest possible message
96{
98 unsigned int data[max_control_data];
99};
100
101} // namespace dunedaq::sspmodules
102
103#endif // SSPMODULES_SRC_ANLBOARD_SSPTYPES_HPP_
static const constexpr int max_control_data
Definition SSPTypes.hpp:13
unsigned int data[max_control_data]
Definition SSPTypes.hpp:98
unsigned short intTimestamp[4]
Definition SSPTypes.hpp:75