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