X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=ftdi%2Fftdi.h;fp=ftdi%2Fftdi.h;h=50bf454442b7e3a7744a56b5b234c17f0d7c3239;hp=943b61180ec3ac25dc8738ac11b54b2dcb299358;hb=0e302db669e822c7a2d4c00d0a59da9c17c51031;hpb=257079045ddaa190f5b9b3a9d74cf6729e6e9aff diff --git a/ftdi/ftdi.h b/ftdi/ftdi.h index 943b611..50bf454 100644 --- a/ftdi/ftdi.h +++ b/ftdi/ftdi.h @@ -17,8 +17,29 @@ #ifndef __libftdi_h__ #define __libftdi_h__ +/* libusb header */ #include +/* Kernel USB headers */ +#include +#include + +/* Keep this in sync with libusb */ +struct usb_dev_handle { + int fd; + + struct usb_bus *bus; + struct usb_device *device; + + int config; + int interface; + int altsetting; + + /* Added by RMT so implementations can store other per-open-device data */ + void *impl_info; +}; + + enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2 }; struct ftdi_context { @@ -26,6 +47,7 @@ struct ftdi_context { struct usb_dev_handle *usb_dev; int usb_read_timeout; int usb_write_timeout; + struct usbdevfs_urb *urb; // FTDI specific enum ftdi_chip_type type; @@ -102,12 +124,12 @@ extern "C" { int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency); int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency); - // init and build eeprom from ftdi_eeprom structure + /* init and build eeprom from ftdi_eeprom structure */ void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom); int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output); - // "eeprom" needs to be valid 128 byte eeprom (generated by the eeprom generator) - // the checksum of the eeprom is valided + /* "eeprom" needs to be valid 128 byte eeprom (generated by the eeprom generator) + the checksum of the eeprom is valided */ int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom); int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom); int ftdi_erase_eeprom(struct ftdi_context *ftdi);