EEPROM bit for high current IO seems at different bits for TYPE_R and TYPE_2232C
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Fri, 10 Sep 2010 13:18:28 +0000 (15:18 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 20 Sep 2010 13:34:41 +0000 (15:34 +0200)
src/ftdi.c
src/ftdi.h

index 99daf43..dd2ad33 100644 (file)
@@ -2512,6 +2512,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size,
     // Addr 00: Channel A setting
 
     eeprom->channel_a_type   = buf[0x00] & 0x7;
+    eeprom->high_current     = buf[0x00] & HIGH_CURRENT_DRIVE_R;
     eeprom->channel_a_driver = buf[0x00] & DRIVER_VCP;
     eeprom->high_current_a   = buf[0x00] & HIGH_CURRENT_DRIVE;
 
@@ -2557,7 +2558,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size,
     eeprom->out_is_isochronous = buf[0x0A]&0x02;
     eeprom->suspend_pull_downs = buf[0x0A]&0x04;
     eeprom->use_serial         = buf[0x0A] & USE_SERIAL_NUM;
-    if((buf[0x0A]&0x10) != 0x10)
+    if(buf[0x0A]&0x10)
         fprintf(stderr,
                 "EEPROM byte[0x0a] Bit 4 unexpected set. If this happened with the EEPROM\n"
                 "programmed by FTDI tools, please report to libftdi@developer.intra2net.com\n");
index 6d6df15..8fc235f 100644 (file)
@@ -221,9 +221,11 @@ struct ftdi_eeprom
     /* Special function of FT232R devices (and possibly others as well) */
     /** CBUS pin function. See CBUS_xxx defines. */
     int cbus_function[5];
-    /** Select hight current drive. */
+    /** Select hight current drive on R devices. */
+    int high_current;
+    /** Select hight current drive on A channel (2232C */
     int high_current_a;
-    /** Select hight current drive on B port (2232C). */
+    /** Select hight current drive on B channel (2232C). */
     int high_current_b;
     /** Select inversion of data lines (bitmask). */
     int invert;
@@ -365,6 +367,7 @@ enum ftdi_cbus_func {/* FIXME: Recheck value, especially the last */
 
 /** High current drive. */
 #define HIGH_CURRENT_DRIVE 0x10
+#define HIGH_CURRENT_DRIVE_R 0x04
 
 /**
     \brief Progress Info for streaming read