-
Notifications
You must be signed in to change notification settings - Fork 2
/
f1v1dec.c
55 lines (47 loc) · 1.13 KB
/
f1v1dec.c
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
#include <stdio.h>
#include <stdint.h>
#include "f1v1dec.h"
void
f1v1DataDecode(uint32_t data)
{
f1_data_t f1word;
f1word.raw = data;
printf("%8X - Slot %2u Err %d%d%d",
f1word.raw,
f1word.bf.slot_id,
f1word.bf.res_locked,
f1word.bf.output_fifo_overflow,
f1word.bf.hit_fifo_overflow);
switch (f1word.bf.chip_word_type)
{
case 0: /* CHIP HEADER / TRAILER */
{
f1_chip_header_t d;
d.raw = data;
printf(" - H/T Chip=%u Chan=%u Err=%d XOR=%d Trignum=%2d Time=%3u\n",
d.bf.channel_address, // chip
d.bf.chip_address, // chan
d.bf.trigger_fifo_overflow, // ERR
d.bf.Xor_setup_register, // XOR
d.bf.trigger_number, // TRIGNUM
d.bf.trigger_time); // TIME
break;
}
case 1: /* CHIP DATA */
{
f1_chip_data_t d;
d.raw = data;
printf(" - DATA Chip=%u Chan=%u Time=%4u\n",
d.bf.chip_address, // chip
d.bf.channel_address, // chan
d.bf.time_measurement); // t
break;
}
default:
{
printf(" - UNDEFINED TYPE = %d\n",
f1word.bf.chip_word_type);
break;
}
}
}