forked from ganzziani/xscopes-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sniffer.h
59 lines (36 loc) · 743 Bytes
/
sniffer.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
#ifndef SNIFFER_H
#define SNIFFER_H
struct Serial
{
uint8_t RX[640];
uint8_t TX[640];
uint8_t dummy;
};
struct I2C
{
uint8_t decoded[1024];
uint8_t addr_ack[257];
};
struct All
{
uint8_t decoded[1280];
uint8_t dummy;
};
union Data
{
Serial serial;
I2C i2c;
All all;
};
struct Sniffer
{
Data data;
uint16_t indrx; // RX index
uint16_t indtx; // TX index
uint8_t databits; // UART Data bits
uint8_t *addr_ack_ptr; // pointer to address or data (packed bits)
uint8_t *data_ptr;
uint8_t addr_ack_pos; // counter for keeping track of all bits / location for DMA
uint16_t baud; // Baud rate
};
#endif // SNIFFER_H