|
libexsid
2.1
|
FTDI access wrapper header file. More...

Go to the source code of this file.
Macros | |
| #define | XSFW_EXTERN extern |
| #define | XSFW_PROTODEF(a) XSFW_EXTERN a ## _p a |
Typedefs | |
| typedef void *(* | xSfw_new_p) (void) |
| Allocate new ftdi handle. More... | |
| typedef void(* | xSfw_free_p) (void *ftdi) |
| Free ftdi handle. More... | |
| typedef int(* | xSfw_write_data_p) (void *ftdi, const unsigned char *buf, int size) |
| Write data to FTDI. More... | |
| typedef int(* | xSfw_read_data_p) (void *ftdi, unsigned char *buf, int size) |
| Read data from FTDI. More... | |
| typedef int(* | xSfw_usb_open_desc_p) (void **ftdi, int vid, int pid, const char *desc, const char *serial) |
| Open device by description. More... | |
| typedef int(* | xSfw_usb_purge_buffers_p) (void *ftdi) |
| Purge FTDI buffers. More... | |
| typedef int(* | xSfw_usb_close_p) (void *ftdi) |
| Close FTDI device. More... | |
| typedef char *(* | xSfw_get_error_string_p) (void *ftdi) |
| Get error string. More... | |
Functions | |
| int | xSfw_usb_setup (void *ftdi, int baudrate, int latency) |
| Setup FTDI chip to match exSID firmware. More... | |
| int | xSfw_dlopen () |
| Attempt to dlopen a known working library to access FTDI chip. More... | |
| void | xSfw_dlclose () |
| Release dlopen'd library. More... | |
Variables | |
| xSfw_new_p | xSfw_new |
| Handle allocation callback. More... | |
| xSfw_free_p | xSfw_free |
| Handle deallocation callback. More... | |
| xSfw_write_data_p | xSfw_write_data |
| Data write callback. More... | |
| xSfw_read_data_p | xSfw_read_data |
| Data read callback. More... | |
| xSfw_usb_open_desc_p | xSfw_usb_open_desc |
| Device open callback. More... | |
| xSfw_usb_close_p | xSfw_usb_close |
| Device close callback. More... | |
| xSfw_get_error_string_p | xSfw_get_error_string |
| Human readable error string callback. More... | |
FTDI access wrapper header file.
Definition in file exSID_ftdiwrap.h.
| #define XSFW_EXTERN extern |
Definition at line 71 of file exSID_ftdiwrap.h.
| #define XSFW_PROTODEF | ( | a | ) | XSFW_EXTERN a ## _p a |
Definition at line 76 of file exSID_ftdiwrap.h.
| typedef void(* xSfw_free_p) (void *ftdi) |
Free ftdi handle.
Definition at line 21 of file exSID_ftdiwrap.h.
| typedef char*(* xSfw_get_error_string_p) (void *ftdi) |
Get error string.
| ftdi | ftdi handle. |
Definition at line 68 of file exSID_ftdiwrap.h.
| typedef void*(* xSfw_new_p) (void) |
Allocate new ftdi handle.
Definition at line 18 of file exSID_ftdiwrap.h.
| typedef int(* xSfw_read_data_p) (void *ftdi, unsigned char *buf, int size) |
Read data from FTDI.
| ftdi | ftdi handle. |
| buf | read buffer. |
| size | number of bytes to read. |
Definition at line 41 of file exSID_ftdiwrap.h.
| typedef int(* xSfw_usb_close_p) (void *ftdi) |
Close FTDI device.
Definition at line 60 of file exSID_ftdiwrap.h.
| typedef int(* xSfw_usb_open_desc_p) (void **ftdi, int vid, int pid, const char *desc, const char *serial) |
Open device by description.
| ftdi | pointer to ftdi handle. |
| vid | target vendor id. Ignored by ftd2xx. |
| pid | target product id. Ignored by ftd2xx. |
| desc | Description string. |
| serial | target product serial. Ignored by ftd2xx. |
Definition at line 54 of file exSID_ftdiwrap.h.
| typedef int(* xSfw_usb_purge_buffers_p) (void *ftdi) |
Purge FTDI buffers.
Definition at line 57 of file exSID_ftdiwrap.h.
| typedef int(* xSfw_write_data_p) (void *ftdi, const unsigned char *buf, int size) |
Write data to FTDI.
| ftdi | ftdi handle. |
| buf | write buffer. |
| size | number of bytes to write. |
Definition at line 31 of file exSID_ftdiwrap.h.
| void xSfw_dlclose | ( | ) |
Release dlopen'd library.
Definition at line 335 of file exSID_ftdiwrap.c.
References _xSfw_dlclose.
Referenced by exSID_exit(), and xSfw_dlopen().
| int xSfw_dlopen | ( | ) |
Attempt to dlopen a known working library to access FTDI chip.
Will try libftd2xx first, then libftdi.
Definition at line 175 of file exSID_ftdiwrap.c.
References _xSfw_clear_dlerror, _xSfw_dlopen, _xSfw_free_errstr, EXSID_INTERFACES, XS_LIBFTD2XX, XS_LIBFTDI, xsdbg, xSfw_dlclose(), XSFW_DLSYM, xSfw_free, xSfw_get_error_string, xSfw_new, xSfw_read_data, xSfw_usb_close, xSfw_usb_open_desc, and xSfw_write_data.
Referenced by exSID_init().
| int xSfw_usb_setup | ( | void * | ftdi, |
| int | baudrate, | ||
| int | latency | ||
| ) |
Setup FTDI chip to match exSID firmware.
Defaults to 8N1, no flow control.
| ftdi | ftdi handle |
| baudrate | Target baudrate |
| latency | Target latency |
Definition at line 267 of file exSID_ftdiwrap.c.
References XS_LIBFTD2XX, XS_LIBFTDI, and xsdbg.
Referenced by exSID_init().
| xSfw_free_p xSfw_free |
Handle deallocation callback.
Referenced by exSID_exit(), exSID_free(), exSID_init(), and xSfw_dlopen().
| xSfw_get_error_string_p xSfw_get_error_string |
Human readable error string callback.
Referenced by exSID_exit(), exSID_init(), and xSfw_dlopen().
| xSfw_new_p xSfw_new |
Handle allocation callback.
Referenced by exSID_init(), and xSfw_dlopen().
| xSfw_read_data_p xSfw_read_data |
Data read callback.
Referenced by xSfw_dlopen().
| xSfw_usb_close_p xSfw_usb_close |
Device close callback.
Referenced by exSID_exit(), and xSfw_dlopen().
| xSfw_usb_open_desc_p xSfw_usb_open_desc |
Device open callback.
Referenced by exSID_init(), and xSfw_dlopen().
| xSfw_write_data_p xSfw_write_data |
Data write callback.
Referenced by xSfw_dlopen().