libftdi: (tomj) completed eeprom building code
[libftdi] / ftdi / ftdi.h
index 911bee0..b07c357 100644 (file)
@@ -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
 }