]> cloudbase.mooo.com Git - z180-stamp.git/blame - include/z180-serv.h
New command(s): attach (and detach) - not fully working.
[z180-stamp.git] / include / z180-serv.h
CommitLineData
35edb766
L
1/*
2 * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
89adce76
L
7#ifndef Z180_SERV_H
8#define Z180_SERV_H
9
cb4fb1ed
L
10#include <stdbool.h>
11#include "ff.h"
12
89adce76
L
13void setup_z180_serv(void);
14void restart_z180_serv(void);
15
cb4fb1ed
L
16
17/* CP/M drive interface */
18
19/* TODO: Variable Disk Format */
20#define CONFIG_CPM_DISKSIZE (8*1024*1024L)
21
22typedef uint8_t drv_opt_t;
23
24#define DRV_OPT_RO (1<<0) /* Drive is write protected */
25#define DRV_OPT_DEBUG (1<<1) /* Debug this drive */
26#define DRV_OPT_REATTATCH (1<<7) /* Change existing attachment */
27
28struct cpm_drive_s {
29 drv_opt_t opt;
30 bool dirty;
31 uint32_t dph;
32 char *img_name;
33 FIL fd;
34};
35
36/* Return codes */
37
38#define AT_OK 0
39#define AT_ERROR 1
40#define AT_RANGE 2
41#define AT_ALREADY 3
42#define AT_NOT 4
43#define AT_NOFILE 5
44#define AT_NOMEM 6
45#define AT_OPEN 7
46#define AT_OTHER 8
47
48
49int drv_list(void);
50int drv_detach(uint8_t drv);
51int drv_attach(uint8_t drv, const char *filename, drv_opt_t options);
52
89adce76 53#endif /* Z180_SERV_H */