libsidplayfp  2.0.2
exSID_ftdiwrap.h
Go to the documentation of this file.
1 //
2 // exSID_ftdiwrap.h
3 // A FTDI access wrapper for exSID USB - header file
4 //
5 // (C) 2016 Thibaut VARENE
6 // License: GPLv2 - http://www.gnu.org/licenses/gpl-2.0.html
7 //
8 
14 #ifndef exSID_ftdiwrap_h
15 #define exSID_ftdiwrap_h
16 
18 typedef void * (* xSfw_new_p)(void);
19 
21 typedef void (* xSfw_free_p)(void * ftdi);
22 
31 typedef int (* xSfw_write_data_p)(void * ftdi, const unsigned char * buf, int size);
32 
41 typedef int (* xSfw_read_data_p)(void * ftdi, unsigned char * buf, int size);
42 
54 typedef int (* xSfw_usb_open_desc_p)(void ** ftdi, int vid, int pid, const char * desc, const char * serial);
55 
57 typedef int (* xSfw_usb_purge_buffers_p)(void * ftdi);
58 
60 typedef int (* xSfw_usb_close_p)(void * ftdi);
61 
68 typedef char * (* xSfw_get_error_string_p)(void * ftdi);
69 
70 #ifndef XSFW_WRAPDECL
71 #define XSFW_EXTERN extern
72 #else
73 #define XSFW_EXTERN /* nothing */
74 #endif
75 
76 #define XSFW_PROTODEF(a) XSFW_EXTERN a ## _p a
77 
78 XSFW_PROTODEF(xSfw_new);
79 XSFW_PROTODEF(xSfw_free);
80 XSFW_PROTODEF(xSfw_write_data);
81 XSFW_PROTODEF(xSfw_read_data);
82 XSFW_PROTODEF(xSfw_usb_open_desc);
83 XSFW_PROTODEF(xSfw_usb_purge_buffers);
84 XSFW_PROTODEF(xSfw_usb_close);
85 XSFW_PROTODEF(xSfw_get_error_string);
86 int xSfw_usb_setup(void *ftdi, int baudrate, int latency);
87 
88 int xSfw_dlopen();
89 void xSfw_dlclose();
90 
91 #endif /* exSID_ftdiwrap_h */
xSfw_dlclose
void xSfw_dlclose()
Definition: exSID_ftdiwrap.c:335
xSfw_usb_setup
int xSfw_usb_setup(void *ftdi, int baudrate, int latency)
Definition: exSID_ftdiwrap.c:273
xSfw_usb_open_desc_p
int(* xSfw_usb_open_desc_p)(void **ftdi, int vid, int pid, const char *desc, const char *serial)
Definition: exSID_ftdiwrap.h:54
xSfw_usb_purge_buffers_p
int(* xSfw_usb_purge_buffers_p)(void *ftdi)
Definition: exSID_ftdiwrap.h:57
xSfw_read_data_p
int(* xSfw_read_data_p)(void *ftdi, unsigned char *buf, int size)
Definition: exSID_ftdiwrap.h:41
xSfw_dlopen
int xSfw_dlopen()
Definition: exSID_ftdiwrap.c:184
xSfw_free_p
void(* xSfw_free_p)(void *ftdi)
Definition: exSID_ftdiwrap.h:21
xSfw_usb_close_p
int(* xSfw_usb_close_p)(void *ftdi)
Definition: exSID_ftdiwrap.h:60
XSFW_PROTODEF
XSFW_PROTODEF(xSfw_new)
Handle allocation callback.
xSfw_write_data_p
int(* xSfw_write_data_p)(void *ftdi, const unsigned char *buf, int size)
Definition: exSID_ftdiwrap.h:31