X-Git-Url: http://developer.intra2net.com/git/?a=blobdiff_plain;f=src%2Fftdi.h;h=759e61b5c783f3c491d89558d732033528fef019;hb=92cbae17a56ce3c6e5f01ea89dafaec75d865be7;hp=15518b5997f88aecb275cfb07ed540cddf716c2e;hpb=263d3ba0f28fa9e78e752e65537d98377eb29119;p=libftdi diff --git a/src/ftdi.h b/src/ftdi.h index 15518b5..759e61b 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -45,6 +45,7 @@ enum ftdi_mpsse_mode BITMODE_OPTO = 0x10, /**< Fast Opto-Isolated Serial Interface Mode, available on 2232x chips */ BITMODE_CBUS = 0x20, /**< Bitbang on CBUS pins of R-type chips, configure in EEPROM before */ BITMODE_SYNCFF = 0x40, /**< Single Channel Synchronous FIFO mode, available on 2232H chips */ + BITMODE_FT1284 = 0x80, /**< FT1284 mode, available on 232H chips */ }; /** Port interface for chips with multiple interfaces */ @@ -199,6 +200,10 @@ struct ftdi_eeprom int vendor_id; /** product id */ int product_id; + + /** Was the eeprom structure initialized for the actual + connected device? **/ + int initialized_for_connected_device; /** self powered */ int self_powered; @@ -244,7 +249,7 @@ struct ftdi_eeprom /* Special function of FT232R/FT232H devices (and possibly others as well) */ /** CBUS pin function. See CBUS_xxx defines. */ - int cbus_function[9]; + int cbus_function[10]; /** Select hight current drive on R devices. */ int high_current; /** Select hight current drive on A channel (2232C */ @@ -413,7 +418,7 @@ struct ftdi_device_list struct libusb_device *dev; }; #define FT1284_CLK_IDLE_STATE 0x01 -#define FT1284_DATA_LSB 0x02 +#define FT1284_DATA_LSB 0x02 /* DS_FT232H 1.3 amd ftd2xx.h 1.0.4 disagree here*/ #define FT1284_FLOW_CONTROL 0x04 #define POWER_SAVE_DISABLE_H 0x80 @@ -447,9 +452,10 @@ enum ftdi_cbush_func {/* FIXME: Recheck value, especially the last */ /** Interface Mode. */ #define CHANNEL_IS_UART 0x0 -#define CHANNEL_IS_245 0x1 -#define CHANNEL_IS_CPU 0x2 -#define CHANNEL_IS_OPTO 0x4 +#define CHANNEL_IS_FIFO 0x1 +#define CHANNEL_IS_OPTO 0x2 +#define CHANNEL_IS_CPU 0x4 +#define CHANNEL_IS_FT1284 0x8 #define DRIVE_4MA 0 #define DRIVE_8MA 1 @@ -492,6 +498,23 @@ typedef struct typedef int (FTDIStreamCallback)(uint8_t *buffer, int length, FTDIProgressInfo *progress, void *userdata); +/** + * Provide libftdi version information + * major: Library major version + * minor: Library minor version + * micro: Currently unused, ight get used for hotfixes. + * version_str: Version as (static) string + * snapshot_str: Git snapshot version if known. Otherwise "unknown" or empty string. +*/ +struct ftdi_version_info +{ + int major; + int minor; + int micro; + const char *version_str; + const char *snapshot_str; +}; + #ifdef __cplusplus extern "C" @@ -506,6 +529,8 @@ extern "C" void ftdi_free(struct ftdi_context *ftdi); void ftdi_set_usbdev (struct ftdi_context *ftdi, struct libusb_device_handle *usbdev); + struct ftdi_version_info ftdi_get_library_version(); + int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product); void ftdi_list_free(struct ftdi_device_list **devlist); @@ -582,6 +607,7 @@ extern "C" int ftdi_set_eeprom_value(struct ftdi_context *ftdi, enum ftdi_eeprom_value value_name, int value); int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char * buf, int size); + int ftdi_set_eeprom_buf(struct ftdi_context *ftdi, const unsigned char * buf, int size); int ftdi_read_eeprom(struct ftdi_context *ftdi); int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid);