OpenCBM
xum1541/s1_s2_pp.c
Go to the documentation of this file.
1 /*
2  * xum1541 plugin interface, derived from the xu1541 file of the same name
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version
7  * 2 of the License, or (at your option) any later version.
8  *
9  * Copyright 2009-2010 Nate Lawson <nate@root.org>
10  * Copyright 1999-2001 Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>
11  * Copyright 2001-2005, 2007, 2010 Spiro Trikaliotis
12  */
13 
22 #ifdef WIN32
23 #include <windows.h>
24 #include <windowsx.h>
25 
27 #define DBG_USERMODE
28 
30 // #define DBG_DLL
31 
33 #define DBG_PROGNAME "OPENCBM-XUM1541.DLL"
34 
36 // #define DBG_IS_DEBUG_C
37 
38 #include "debug.h"
39 #endif
40 
41 #include <stdlib.h>
42 
44 #define OPENCBM_PLUGIN
45 //#include "i_opencbm.h"
46 #include "archlib.h"
47 
48 #include "xum1541.h"
49 
50 
51 /*-------------------------------------------------------------------*/
52 /*--------- OPENCBM ARCH FUNCTIONS ----------------------------------*/
53 
69 int CBMAPIDECL
70 opencbm_plugin_s1_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
71 {
72  return xum1541_read((usb_dev_handle *)HandleDevice, XUM1541_S1, data, size);
73 }
74 
90 int CBMAPIDECL
91 opencbm_plugin_s1_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
92 {
93  return xum1541_write((usb_dev_handle *)HandleDevice, XUM1541_S1, data, size);
94 }
95 
111 int CBMAPIDECL
112 opencbm_plugin_s2_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
113 {
114  return xum1541_read((usb_dev_handle *)HandleDevice, XUM1541_S2, data, size);
115 }
116 
132 int CBMAPIDECL
133 opencbm_plugin_s2_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
134 {
135  return xum1541_write((usb_dev_handle *)HandleDevice, XUM1541_S2, data, size);
136 }
137 
153 int CBMAPIDECL
154 opencbm_plugin_pp_dc_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
155 {
156  return xum1541_read((usb_dev_handle *)HandleDevice, XUM1541_PP, data, size);
157 }
158 
174 int CBMAPIDECL
175 opencbm_plugin_pp_dc_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
176 {
177  return xum1541_write((usb_dev_handle *)HandleDevice, XUM1541_PP, data, size);
178 }
179 
195 int CBMAPIDECL
196 opencbm_plugin_pp_cc_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
197 {
198  return xum1541_read((usb_dev_handle *)HandleDevice, XUM1541_P2, data, size);
199 }
200 
216 int CBMAPIDECL
217 opencbm_plugin_pp_cc_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
218 {
219  return xum1541_write((usb_dev_handle *)HandleDevice, XUM1541_P2, data, size);
220 }
221 
237 int CBMAPIDECL
238 opencbm_plugin_nib_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
239 {
240  return xum1541_read((usb_dev_handle *)HandleDevice, XUM1541_NIB, data, size);
241 }
242 
258 int CBMAPIDECL
259 opencbm_plugin_nib_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
260 {
261  return xum1541_write((usb_dev_handle *)HandleDevice, XUM1541_NIB, data, size);
262 }
int CBMAPIDECL opencbm_plugin_s2_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
Read data with serial2 protocol.
int CBMAPIDECL opencbm_plugin_pp_dc_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
Write data with parallel protocol (d64copy)
Define makros for debugging purposes.
#define CBMAPIDECL
Definition: opencbm.h:85
int CBMAPIDECL opencbm_plugin_pp_cc_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
Write data with parallel protocol (cbmcopy)
int CBMAPIDECL opencbm_plugin_s1_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
Write data with serial1 protocol.
int CBMAPIDECL opencbm_plugin_nib_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
Write data with burst nibbler protocol (cbmcopy)
int CBMAPIDECL opencbm_plugin_s2_write_n(CBM_FILE HandleDevice, const unsigned char *data, unsigned int size)
Write data with serial2 protocol.
#define CBM_FILE
Definition: opencbm.h:87
int xum1541_write(usb_dev_handle *HandleXum1541, unsigned char modeFlags, const unsigned char *data, size_t size)
Write data to the xum1541 device.
Definition: xum1541.c:686
int CBMAPIDECL opencbm_plugin_pp_cc_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
Read data with parallel protocol (cbmcopy)
int CBMAPIDECL opencbm_plugin_nib_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
Read data with burst nibbler protocol (cbmcopy)
int CBMAPIDECL opencbm_plugin_pp_dc_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
Read data with parallel protocol (d64copy)
int CBMAPIDECL opencbm_plugin_s1_read_n(CBM_FILE HandleDevice, unsigned char *data, unsigned int size)
Read data with serial1 protocol.
int xum1541_read(usb_dev_handle *HandleXum1541, unsigned char mode, unsigned char *data, size_t size)
Read data from the xum1541 device.
Definition: xum1541.c:833