McStas Readout Master 0.8.0
Loading...
Searching...
No Matches
Structs.h
Go to the documentation of this file.
1// Copyright (C) 2022 European Spallation Source, ERIC. See LICENSE file
2//===----------------------------------------------------------------------===//
7//===----------------------------------------------------------------------===//
8#pragma once
9
10#ifdef __cplusplus
11#include <cinttypes>
12#else
13#include <inttypes.h>
14#endif
15
16#ifdef __GNUC__
17#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
18#endif
19
20#ifdef _MSC_VER
21#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop))
22#endif
23
24
28PACK(struct PacketHeaderV0 {
29 uint8_t Padding0;
30 uint8_t Version;
31 uint32_t CookieAndType;
32 uint16_t TotalLength;
33 uint8_t OutputQueue;
34 uint8_t TimeSource;
35 uint32_t PulseHigh;
36 uint32_t PulseLow;
37 uint32_t PrevPulseHigh;
38 uint32_t PrevPulseLow;
39 uint32_t SeqNum;
40 });
41
44PACK(struct CaenData {
45 uint8_t Ring;
46 uint8_t FEN;
47 uint16_t Length;
48 uint32_t TimeHigh;
49 uint32_t TimeLow;
50 uint8_t OMFlag;
51 uint8_t Tube;
52 uint16_t SeqNum;
53 uint16_t AmplA;
54 uint16_t AmplB;
55 uint16_t AmplC;
56 uint16_t AmplD;
57 });
58
61PACK(struct CDTData {
62 uint8_t Ring;
63 uint8_t FEN;
64 uint16_t Length;
65 uint32_t TimeHigh;
66 uint32_t TimeLow;
67 uint8_t OM;
68 uint8_t Unused;
69 uint8_t Cathode;
70 uint8_t Anode;
71 });
72
75PACK(struct VMM3Data {
76 uint8_t Ring;
77 uint8_t FEN;
78 uint16_t Length;
79 uint32_t TimeHigh;
80 uint32_t TimeLow;
81 uint16_t BC;
82 uint16_t OTADC;
83 uint8_t GEO;
84 uint8_t TDC;
85 uint8_t VMM;
86 uint8_t Channel;
87 });
88
94PACK(struct BM0Data {
95 uint8_t Ring;
96 uint8_t FEN;
97 uint16_t Length;
98 uint32_t TimeHigh;
99 uint32_t TimeLow;
100 uint8_t Type;
101 uint8_t Channel;
102 uint16_t Debug16;
103 uint32_t Debug32;
104});
105
108PACK(struct BM2Data {
109 uint8_t Ring;
110 uint8_t FEN;
111 uint16_t Length;
112 uint32_t TimeHigh;
113 uint32_t TimeLow;
114 uint8_t Type;
115 uint8_t Channel;
116 uint16_t Debug16;
117 uint16_t X;
118 uint16_t Y;
119});
120
123PACK(struct BMIData {
124 uint8_t Ring;
125 uint8_t FEN;
126 uint16_t Length;
127 uint32_t TimeHigh;
128 uint32_t TimeLow;
129 uint8_t Type;
130 uint8_t Channel;
131 uint16_t Debug16;
132 uint32_t Pack; // 'left' '24 bits: ADC, 'right' 8 bits MCA sum
133});
PACK(struct PacketHeaderV0 { uint8_t Padding0;uint8_t Version;uint32_t CookieAndType;uint16_t TotalLength;uint8_t OutputQueue;uint8_t TimeSource;uint32_t PulseHigh;uint32_t PulseLow;uint32_t PrevPulseHigh;uint32_t PrevPulseLow;uint32_t SeqNum;})
Header common to all ESS readout data. Reviewed ICD (version 2) packet header version 0; ownCloud: ht...