]> git.sesse.net Git - pistorm/blob - a314/a314device/protocol.h
Add A314 emulation
[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 #define COM_AREA_BASE           0xe90000
23
24 #define PISTORM_BASE            0xc00000
25 #define PISTORM_SIZE            (3*512*1024)
26
27 // The communication area, used to create the physical channel.
28 struct ComArea
29 {
30         volatile UBYTE a_events;
31         volatile UBYTE a_enable;
32         volatile UBYTE r_events;
33         volatile UBYTE r_enable;
34
35         volatile UBYTE a2r_tail;
36         volatile UBYTE r2a_head;
37         volatile UBYTE r2a_tail;
38         volatile UBYTE a2r_head;
39
40         UBYTE a2r_buffer[256];
41         UBYTE r2a_buffer[256];
42 };
43
44 extern struct ComArea *ca;