15 #include "xum1541_types.h"
22 #define CTASSERT(x) _CTASSERT(x, __LINE__)
23 #define _CTASSERT(x, y) __CTASSERT(x, y)
24 #define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1]
27 CTASSERT(
sizeof(
CBM_FILE) >=
sizeof(usb_dev_handle *));
35 #define USB_TIMEOUT ((int)(XUM1541_TIMEOUT * 1100))
38 #define LIBUSB_NO_TIMEOUT 0x7fffffff
41 #define MAX_ALLOWED_XUM1541_SERIALNUM 255
44 #define DeviceDriveMode_NoTapeSupport -1 // Firmware has no tape support
45 #define DeviceDriveMode_Uninit 0 // Uninitialized
46 #define DeviceDriveMode_Disk 1 // Disk drive mode (only communication to disk drives allowed)
47 #define DeviceDriveMode_Tape 2 // Tape drive mode (only communication to tape drive allowed)
50 int xum1541_init(usb_dev_handle **HandleXum1541,
int PortNumber);
53 int xum1541_ioctl(usb_dev_handle *HandleXum1541,
unsigned int cmd,
54 unsigned int addr,
unsigned int secaddr);
57 int xum1541_write(usb_dev_handle *HandleXum1541,
unsigned char mode,
58 const unsigned char *data,
size_t size);
60 const unsigned char *data,
size_t size,
int *Status,
int *BytesWritten);
61 int xum1541_read(usb_dev_handle *HandleXum1541,
unsigned char mode,
62 unsigned char *data,
size_t size);
64 unsigned char *data,
size_t size,
int *Status,
int *BytesRead);
const char * xum1541_device_path(int PortNumber)
Query unique identifier for the xum1541 device This function tries to find an unique identifier for t...
void xum1541_close(usb_dev_handle *HandleXum1541)
close the xum1541 device
int xum1541_tap_break(usb_dev_handle *HandleXum1541)
Send tape operations abort command to the xum1541 device.
int xum1541_write(usb_dev_handle *HandleXum1541, unsigned char modeFlags, const unsigned char *data, size_t size)
Write data to the xum1541 device.
int xum1541_read_ext(usb_dev_handle *HandleXum1541, unsigned char mode, unsigned char *data, size_t size, int *Status, int *BytesRead)
Wrapper for xum1541_read() forcing xum1541_wait_status(), with additional parameters: ...
DLL interface for accessing the driver.
int xum1541_init(usb_dev_handle **HandleXum1541, int PortNumber)
Initialize the xum1541 device This function tries to find and identify the xum1541 device...
int xum1541_write_ext(usb_dev_handle *HandleXum1541, unsigned char modeFlags, const unsigned char *data, size_t size, int *Status, int *BytesWritten)
Wrapper for xum1541_write() forcing xum1541_wait_status(), with additional parameters: ...
int xum1541_ioctl(usb_dev_handle *HandleXum1541, unsigned int cmd, unsigned int addr, unsigned int secaddr)
Perform an ioctl on the xum1541, which is any command other than read/write or special device managem...
int xum1541_control_msg(usb_dev_handle *HandleXum1541, unsigned int cmd)
Handle synchronous USB control messages, e.g. for RESET. xum1541_ioctl() is used for bulk messages...
int xum1541_read(usb_dev_handle *HandleXum1541, unsigned char mode, unsigned char *data, size_t size)
Read data from the xum1541 device.