forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fed_trailer.h
76 lines (59 loc) · 2.51 KB
/
fed_trailer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef DataFormats_FEDRawData_fed_trailer_h
#define DataFormats_FEDRawData_fed_trailer_h
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
*
* data structures and associated typedefs
*
*************************************************************************/
/*
* FED trailer - at the end of each FED block
*/
typedef struct fedt_struct {
uint32_t conscheck;
uint32_t eventsize;
} fedt_t;
#define FED_SLINK_END_MARKER 0xa
#define FED_TCTRLID_WIDTH 0x0000000f
#define FED_TCTRLID_SHIFT 28
#define FED_TCTRLID_MASK (FED_TCTRLID_WIDTH << FED_TCTRLID_SHIFT)
#define FED_TCTRLID_EXTRACT(a) (((a) >> FED_TCTRLID_SHIFT) & FED_TCTRLID_WIDTH)
#define FED_EVSZ_WIDTH 0x00ffffff
#define FED_EVSZ_SHIFT 0
#define FED_EVSZ_MASK (FED_EVSZ_WIDTH << FED_EVSZ_SHIFT)
#define FED_EVSZ_EXTRACT(a) (((a) >> FED_EVSZ_SHIFT) & FED_EVSZ_WIDTH)
#define FED_CRCS_WIDTH 0x0000ffff
#define FED_CRCS_SHIFT 16
#define FED_CRCS_MASK (FED_CRCS_WIDTH << FED_CRCS_SHIFT)
#define FED_CRCS_EXTRACT(a) (((a) >> FED_CRCS_SHIFT) & FED_CRCS_WIDTH)
#define FED_STAT_WIDTH 0x0000000f
#define FED_STAT_SHIFT 8
#define FED_STAT_MASK (FED_STAT_WIDTH << FED_STAT_SHIFT)
#define FED_STAT_EXTRACT(a) (((a) >> FED_STAT_SHIFT) & FED_STAT_WIDTH)
#define FED_TTSI_WIDTH 0x0000000f
#define FED_TTSI_SHIFT 4
#define FED_TTSI_MASK (FED_TTSI_WIDTH << FED_TTSI_SHIFT)
#define FED_TTSI_EXTRACT(a) (((a) >> FED_TTSI_SHIFT) & FED_TTSI_WIDTH)
#define FED_MORE_TRAILERS_WIDTH 0x00000001
#define FED_MORE_TRAILERS_SHIFT 3
#define FED_MORE_TRAILERS_MASK (FED_MORE_TRAILERS_WIDTH << FED_MORE_TRAILERS_SHIFT)
#define FED_MORE_TRAILERS_EXTRACT(a) (((a) >> FED_MORE_TRAILERS_SHIFT) & FED_MORE_TRAILERS_WIDTH)
#define FED_CRC_MODIFIED_WIDTH 0x00000001
#define FED_CRC_MODIFIED_SHIFT 2
#define FED_CRC_MODIFIED_MASK (FED_CRC_MODIFIED_WIDTH << FED_CRC_MODIFIED_SHIFT)
#define FED_CRC_MODIFIED_EXTRACT(a) (((a) >> FED_CRC_MODIFIED_SHIFT) & FED_CRC_MODIFIED_WIDTH)
#define FED_SLINK_ERROR_WIDTH 0x00000001
#define FED_SLINK_ERROR_SHIFT 14
#define FED_SLINK_ERROR_MASK (FED_SLINK_ERROR_WIDTH << FED_SLINK_ERROR_SHIFT)
#define FED_SLINK_ERROR_EXTRACT(a) (((a) >> FED_SLINK_ERROR_SHIFT) & FED_SLINK_ERROR_WIDTH)
#define FED_WRONG_FEDID_WIDTH 0x00000001
#define FED_WRONG_FEDID_SHIFT 15
#define FED_WRONG_FEDID_MASK (FED_WRONG_FEDID_WIDTH << FED_WRONG_FEDID_SHIFT)
#define FED_WRONG_FEDID_EXTRACT(a) (((a) >> FED_WRONG_FEDID_SHIFT) & FED_WRONG_FEDID_WIDTH)
#ifdef __cplusplus
}
#endif
#endif // DataFormats_FEDRawData_fed_trailer_h