OpenCBM
cbmcopy_int.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2001 Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>
8  * Copyright 2011 Thomas Winkler
9  * Copyright 2011 Wolfgang Moser
10 */
11 
12 #ifndef CBMCOPY_INT_H
13 #define CBMCOPY_INT_H
14 
15 #include "opencbm.h"
16 #include "cbmcopy.h"
17 
18 #ifdef LIBCBMCOPY_DEBUG
19 # define DEBUG_STATEDEBUG
20 #endif
21 #include "statedebug.h"
22 
23 #define SA_READ 0
24 #define SA_WRITE 1
25 
26 /* mandatory functions for the transfer function modules */
27 typedef struct {
28  int (*write_blk)(CBM_FILE,const void *,unsigned char,cbmcopy_message_cb);
29  int (*read_blk)(CBM_FILE,void *,size_t,cbmcopy_message_cb);
30  int (*check_error)(CBM_FILE,int);
31  int (*upload_turbo)(CBM_FILE, unsigned char, enum cbm_device_type_e,int);
32  int (*start_turbo)(CBM_FILE,int);
33  void (*exit_turbo)(CBM_FILE,int);
35 
36 /* callbacks from generic block handlers to the transfer function modules */
37 typedef int (*write_byte_t)(CBM_FILE,unsigned char);
38 typedef unsigned char (*read_byte_t)(CBM_FILE);
39 
40 /* generic block handlers to the transfer data with single byte transfers */
41 int write_block_generic(CBM_FILE,const void *,unsigned char,write_byte_t,cbmcopy_message_cb);
42 int read_block_generic(CBM_FILE,void *,size_t,read_byte_t,cbmcopy_message_cb);
43 
44 #define DECLARE_TRANSFER_FUNCS(x) \
45  transfer_funcs cbmcopy_ ## x = {write_blk, read_blk, check_error, \
46  upload_turbo, start_turbo, exit_turbo}
47 
48 #endif
#define CBM_FILE
Definition: opencbm.h:87
cbm_device_type_e
Definition: opencbm.h:114
DLL interface for accessing the driver.