From 85394e6249329e13fd8530a5aeb72355c5340d62 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Thu, 9 Sep 2010 22:29:16 +0200 Subject: [PATCH] EEPROM High current bit is byte 0 Bit 4 for a and Byte 1 bit 4 for b --- src/ftdi.c | 6 +++++- src/ftdi.h | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index bab3544..701cc65 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2314,7 +2314,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) memset (output, 0, eeprom->size); // Addr 00: High current IO - output[0x00] = eeprom->high_current ? HIGH_CURRENT_DRIVE : 0; + output[0x00] = eeprom->high_current_a ? HIGH_CURRENT_DRIVE : 0; // Addr 01: IN endpoint size (for R type devices, different for FT2232) if (ftdi->type == TYPE_R) { output[0x01] = 0x40; @@ -2506,6 +2506,10 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size, eeprom_size = 0x80; eeprom = ftdi->eeprom; + eeprom_high_current_a = buf[0x00] & HIGH_CURRENT_DRIVE; + eeprom_high_current_b = buf[0x01] & HIGH_CURRENT_DRIVE; + + // Addr 02: Vendor ID eeprom->vendor_id = buf[0x02] + (buf[0x03] << 8); diff --git a/src/ftdi.h b/src/ftdi.h index 6906894..03bb167 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -212,7 +212,9 @@ struct ftdi_eeprom /** CBUS pin function. See CBUS_xxx defines. */ int cbus_function[5]; /** Select hight current drive. */ - int high_current; + int high_current_a; + /** Select hight current drive on B port (2232C). */ + int high_current_b; /** Select inversion of data lines (bitmask). */ int invert; @@ -337,7 +339,7 @@ struct ftdi_device_list #define INVERT_RI 0x80 /** High current drive. */ -#define HIGH_CURRENT_DRIVE 0x04 +#define HIGH_CURRENT_DRIVE 0x10 /** \brief Progress Info for streaming read -- 1.7.1