#ifndef __libftdi_h__
#define __libftdi_h__
-struct usb_dev_handle;
+#include <usb.h>
struct ftdi_context {
// USB specific
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
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
}