X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=ftdi%2Fftdi.h;h=df959ad1c105e6e443ac36ad2d0e9f3cd9f57ce1;hp=911bee01b4bd6f86da0805063dd0e12608fced7d;hb=8ed611210cf9b99329aa0ef664a82523768594dd;hpb=a3da1d9515a0b4eaede5648f3ee06b6218407a8c diff --git a/ftdi/ftdi.h b/ftdi/ftdi.h index 911bee0..df959ad 100644 --- a/ftdi/ftdi.h +++ b/ftdi/ftdi.h @@ -17,7 +17,7 @@ #ifndef __libftdi_h__ #define __libftdi_h__ -struct usb_dev_handle; +#include struct ftdi_context { // USB specific @@ -32,6 +32,28 @@ struct ftdi_context { char *error_str; }; +struct ftdi_eeprom { + int vendor_id; + int product_id; + + int self_powered; + int remote_wakeup; + int BM_type_chip; + + int in_is_isochronous; + int out_is_isochronous; + int suspend_pull_downs; + + int use_serial; + int change_usb_version; + int usb_version; + int max_power; + + char *manufacturer; + char *product; + char *serial; +}; + #ifdef __cplusplus extern "C" { #endif @@ -53,11 +75,15 @@ 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 + 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 int ftdi_read_eeprom(struct ftdi_context *ftdi, char *eeprom); int ftdi_write_eeprom(struct ftdi_context *ftdi, char *eeprom); - int ftdi_erase(struct ftdi_context *ftdi); + int ftdi_erase_eeprom(struct ftdi_context *ftdi); #ifdef __cplusplus }