-
Notifications
You must be signed in to change notification settings - Fork 2
/
caen775dec.h
73 lines (62 loc) · 1.2 KB
/
caen775dec.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
#ifndef __CAEN775DEC__
#define __CAEN775DEC__
#include <stdint.h>
#define CAEN775_DATATYPE_HEADER 2
#define CAEN775_DATATYPE_DATA 0
#define CAEN775_DATATYPE_END_OF_BLOCK 4
#define CAEN775_DATATYPE_INVALID 6
typedef struct
{
uint32_t undef:24;
uint32_t word_type:3;
uint32_t geo:5;
} caen775_generic_word;
typedef union
{
uint32_t raw;
caen775_generic_word bf;
} caen775_generic_word_t;
typedef struct
{
uint32_t undef0:8;
uint32_t data_count:6;
uint32_t undef1:2;
uint32_t crate:8;
uint32_t word_type:3;
uint32_t geo:5;
} caen775_header;
typedef union
{
uint32_t raw;
caen775_header bf;
} caen775_header_t;
typedef struct
{
uint32_t adc:12;
uint32_t overflow:1;
uint32_t underflow:1;
uint32_t valid:1;
uint32_t undef:1;
uint32_t channel_number:5;
uint32_t undef2:3;
uint32_t word_type:3;
uint32_t geo:5;
} caen775_data;
typedef union
{
uint32_t raw;
caen775_data bf;
} caen775_data_t;
typedef struct
{
uint32_t event_counter:24;
uint32_t word_type:3;
uint32_t geo:5;
} caen775_end_of_block;
typedef union
{
uint32_t raw;
caen775_end_of_block bf;
} caen775_end_of_block_t;
void caen775DataDecode(uint32_t data);
#endif /* __CAEN775DEC__ */