]> cloudbase.mooo.com Git - z180-stamp.git/blame_incremental - include/z80-if.h
cli_readline_into_buffer: remove unneeded buf[]
[z180-stamp.git] / include / z80-if.h
... / ...
CommitLineData
1/*
2 * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#define ZST_ACQUIRED 0x01
8#define ZST_RUNNING 0x02
9
10typedef enum {
11 RESET = 0x00,
12 RESET_AQRD = ZST_ACQUIRED,
13 RUNNING = ZST_RUNNING,
14 RUNNING_AQRD = ZST_RUNNING | ZST_ACQUIRED,
15} zstate_t;
16
17typedef enum {
18 Reset,
19 Request,
20 Release,
21 Run,
22 Restart,
23 M_Cycle
24} bus_cmd_t;
25
26typedef enum {LOW, HIGH} level_t;
27
28zstate_t z80_bus_state(void);
29zstate_t z80_bus_cmd(bus_cmd_t cmd);
30void z80_setup_bus(void);
31int z80_stat_reset(void);
32//void z80_busreq(level_t level);
33int z80_stat_halt(void);
34
35
36void z80_write(uint32_t addr, uint8_t data);
37uint8_t z80_read(uint32_t addr);
38void z80_memset(uint32_t addr, uint8_t data, uint32_t length);
39void z80_write_block_P(const FLASH uint8_t *src, uint32_t dest, uint32_t length);
40void z80_write_block(const uint8_t *src, uint32_t dest, uint32_t length);
41void z80_read_block (uint8_t *dest, uint32_t src, size_t length);
42
43
44typedef enum fifo_t {
45 fifo_msgin, fifo_msgout,
46 fifo_conout, fifo_conin,
47 NUM_FIFOS
48 } fifo_t;
49
50void z80_memfifo_init(const fifo_t f, uint32_t adr);
51int z80_memfifo_is_empty(const fifo_t f);
52int z80_memfifo_is_full(const fifo_t f);
53int z80_memfifo_getc(const fifo_t f);
54uint8_t z80_memfifo_getc_wait(const fifo_t f);
55void z80_memfifo_putc(fifo_t f, uint8_t val);