-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlecroy1877dec.c
More file actions
38 lines (32 loc) · 905 Bytes
/
lecroy1877dec.c
File metadata and controls
38 lines (32 loc) · 905 Bytes
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
#include <stdio.h>
#include <stdint.h>
#include "lecroy1877dec.h"
void
lecroy1877DataDecode(uint32_t data)
{
static uint32_t nwords = 0, iword = 0;
if ((nwords == 0) || ((iword + 1) == nwords))
{
/* Assume we're at the beginning of module output. data should
be the header */
lecroy1877_header_t d;
d.raw = data;
printf("%8X - HEADER - G = %2d P = %d Buff = %d Word Count = %d\n",
d.raw,
d.bf.geo_address,
d.bf.word_parity, d.bf.buffer_number, d.bf.word_count);
iword = 0;
nwords = d.bf.word_count;
}
else
{
lecroy1877_data_t d;
d.raw = data;
printf
("%8X - DATA (%4d/%4d) - G = %2d P = %d Buff = %d Chan %3d E = %d data = %5d\n",
d.raw, iword + 2, nwords, d.bf.geo_address, d.bf.word_parity,
d.bf.buffer_number, d.bf.channel_number, d.bf.leading_edge,
d.bf.data);
iword++;
}
}