]> git.sesse.net Git - pistorm/blob - a314/a314device/protocol.h
Add Meson build files.
[pistorm] / a314 / a314device / protocol.h
1 /*
2  * Copyright 2020-2021 Niklas Ekström
3  */
4
5 #include <exec/types.h>
6
7 // Packet types that are sent across the physical channel.
8 #define PKT_DRIVER_STARTED              1
9 #define PKT_DRIVER_SHUTTING_DOWN        2
10 #define PKT_SETTINGS                    3
11 #define PKT_CONNECT                     4
12 #define PKT_CONNECT_RESPONSE            5
13 #define PKT_DATA                        6
14 #define PKT_EOS                         7
15 #define PKT_RESET                       8
16
17 // Events that are communicated via IRQ from Amiga to Raspberry.
18 #define R_EVENT_A2R_TAIL        1
19 #define R_EVENT_R2A_HEAD        2
20 #define R_EVENT_STARTED         4
21
22 // Events that are communicated from Raspberry to Amiga.
23 #define A_EVENT_R2A_TAIL        1
24 #define A_EVENT_A2R_HEAD        2
25
26 // The communication area, used to create the physical channel.
27 struct ComArea
28 {
29         volatile UBYTE a_events;
30         volatile UBYTE a_enable;
31         volatile UBYTE r_events;
32         volatile UBYTE r_enable;
33
34         ULONG mem_base;
35         ULONG mem_size;
36
37         volatile UBYTE a2r_tail;
38         volatile UBYTE r2a_head;
39         volatile UBYTE r2a_tail;
40         volatile UBYTE a2r_head;
41
42         UBYTE a2r_buffer[256];
43         UBYTE r2a_buffer[256];
44 };
45
46 extern struct ComArea *ca;