EEPROM High current bit is byte 0 Bit 4 for a and Byte 1 bit 4 for b
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Thu, 9 Sep 2010 20:29:16 +0000 (22:29 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 20 Sep 2010 13:34:38 +0000 (15:34 +0200)
src/ftdi.c
src/ftdi.h

index bab3544..701cc65 100644 (file)
@@ -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);
 
index 6906894..03bb167 100644 (file)
@@ -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