]> cloudbase.mooo.com Git - z180-stamp.git/blob - include/z80-if.h
working host communication, new command: connect
[z180-stamp.git] / include / z80-if.h
1
2 #define ZST_ACQUIRED 0x01
3 #define ZST_RUNNING 0x02
4
5 typedef enum {
6 RESET = 0x00,
7 RESET_AQRD = ZST_ACQUIRED,
8 RUNNING = ZST_RUNNING,
9 RUNNING_AQRD = ZST_RUNNING | ZST_ACQUIRED,
10 } zstate_t;
11
12 typedef enum {
13 Reset,
14 Request,
15 Release,
16 Run,
17 Restart,
18 M_Cycle
19 } bus_cmd_t;
20
21 typedef enum {LOW, HIGH} level_t;
22
23 zstate_t z80_bus_state(void);
24 zstate_t z80_bus_cmd(bus_cmd_t cmd);
25 void z80_setup_bus(void);
26 int z80_stat_reset(void);
27 //void z80_busreq(level_t level);
28 int z80_stat_halt(void);
29
30
31 void z80_write(uint32_t addr, uint8_t data);
32 uint8_t z80_read(uint32_t addr);
33 void z80_memset(uint32_t addr, uint8_t data, uint32_t length);
34 void z80_write_block(const FLASH uint8_t *src, uint32_t dest, uint32_t length);
35
36
37 typedef enum fifo_t {
38 fifo_msgin, fifo_msgout,
39 fifo_conout, fifo_conin,
40 NUM_FIFOS
41 } fifo_t;
42
43 void z80_memfifo_init(const fifo_t f, uint32_t adr);
44 int z80_memfifo_is_empty(const fifo_t f);
45 int z80_memfifo_is_full(const fifo_t f);
46 int z80_memfifo_getc(const fifo_t f);
47 uint8_t z80_memfifo_getc_wait(const fifo_t f);
48 void z80_memfifo_putc(fifo_t f, uint8_t val);
49