-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsniffer.h
50 lines (30 loc) · 784 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
#ifndef SNIFFER_H
#define SNIFFER_H
struct Sniffer
{
union
{
struct
{
uint8_t RX[640];
uint8_t TX[640];
} Serial;
struct
{
uint8_t decoded[1024];
uint8_t addr_ack[257];
} I2C;
struct
{
uint8_t decoded[1280];
} All;
} data;
volatile uint16_t indrx; // RX index
volatile 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