X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=ftdi%2Fftdi.h;fp=ftdi%2Fftdi.h;h=943b61180ec3ac25dc8738ac11b54b2dcb299358;hp=4463fdf6478a15b84743d61477992aeda0c8c948;hb=98452d97079f1708f333d12340c4102c761130e5;hpb=a97980ad32623e72503398bcc5f4976344c2d36d diff --git a/ftdi/ftdi.h b/ftdi/ftdi.h index 4463fdf..943b611 100644 --- a/ftdi/ftdi.h +++ b/ftdi/ftdi.h @@ -17,21 +17,15 @@ #ifndef __libftdi_h__ #define __libftdi_h__ -#include -#include - -/* Kernel USB headers */ -#include -#include +#include enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2 }; struct ftdi_context { // USB specific - int usb_fd; + 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; @@ -85,6 +79,7 @@ extern "C" { int ftdi_init(struct ftdi_context *ftdi); void ftdi_deinit(struct ftdi_context *ftdi); + void ftdi_set_usbdev (struct ftdi_context *ftdi, usb_dev_handle *usbdev); int ftdi_usb_open(struct ftdi_context *ftdi, int vendor, int product); int ftdi_usb_close(struct ftdi_context *ftdi); int ftdi_usb_reset(struct ftdi_context *ftdi); @@ -107,12 +102,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);