Add FT1284 driver mode and new VCP bit position
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Fri, 17 Jun 2011 17:22:16 +0000 (19:22 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 28 Jun 2011 14:30:29 +0000 (16:30 +0200)
src/ftdi.c
src/ftdi.h

index e7902d4..ab57c27 100644 (file)
@@ -2658,6 +2658,12 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
             fprintf(stderr,"FIXME: Build FT4232H specific EEPROM settings\n");
             break;
         case TYPE_232H:
+            output[0x00] = (eeprom->channel_a_type);
+            if ( eeprom->channel_a_driver == DRIVER_VCP)
+                output[0x00] |= DRIVER_VCPH;
+            else
+                output[0x00] &= ~DRIVER_VCPH;
+
             output[0x1e] = eeprom->chip;
             fprintf(stderr,"FIXME: Build FT232H specific EEPROM settings\n");
             break;
@@ -2899,13 +2905,15 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose)
     }
     else if (ftdi->type == TYPE_232H)
     {
+        eeprom->channel_a_type   = buf[0x00] & 0xf;
+        eeprom->channel_a_driver = (buf[0x00] & DRIVER_VCPH)?DRIVER_VCP:0;
         eeprom->chip = buf[0x1e];
         /*FIXME: Decipher more values*/
     }
 
     if (verbose)
     {
-        char *channel_mode[] = {"UART","245","CPU", "unknown", "OPTO"/*, "FT1284"*/};
+        char *channel_mode[] = {"UART","245","CPU", "unknown", "OPTO", "unknown1","unknown2","unknown3","FT1284"};
         fprintf(stdout, "VID:     0x%04x\n",eeprom->vendor_id);
         fprintf(stdout, "PID:     0x%04x\n",eeprom->product_id);
         fprintf(stdout, "Release: 0x%04x\n",release);
index dced21d..cd3f63b 100644 (file)
@@ -436,6 +436,7 @@ enum ftdi_cbus_func {/* FIXME: Recheck value, especially the last */
 
 /** Driver Type. */
 #define DRIVER_VCP 0x08
+#define DRIVER_VCPH 0x10 /* FT232H has moved the VCP bit */
 
 #define USE_USB_VERSION_BIT 0x10