CMake: bump the minimal required version to 3.5
[libftdi] / src / ftdi.c
index 3d16674..534e3dd 100644 (file)
@@ -2218,6 +2218,24 @@ int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned
 }
 
 /**
+    Set module detach mode.
+
+    \param ftdi pointer to ftdi_context
+    \param mode detach mode to use.
+
+    \retval  0: all fine
+    \retval -1: can't enable bitbang mode
+*/
+int ftdi_set_module_detach_mode(struct ftdi_context *ftdi, enum ftdi_module_detach_mode mode)
+{
+    if (ftdi == NULL)
+        ftdi_error_return(-1, "FTDI context invalid");
+
+    ftdi->module_detach_mode = mode;
+    return 0;
+}
+
+/**
     Disable bitbang mode.
 
     \param ftdi pointer to ftdi_context
@@ -3880,11 +3898,18 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose)
                     (eeprom->data_order)?"LSB":"MSB",
                     (eeprom->flow_control)?"":"No ");
         }
-        if ((ftdi->type == TYPE_2232H) || (ftdi->type == TYPE_4232H))
+        if ((ftdi->type == TYPE_2232H) || (ftdi->type == TYPE_4232H) || (ftdi->type == TYPE_2232C))
             fprintf(stdout,"Channel B has Mode %s%s%s\n",
                     channel_mode[eeprom->channel_b_type],
                     (eeprom->channel_b_driver)?" VCP":"",
                     (eeprom->high_current_b)?" High Current IO":"");
+        if (ftdi->type == TYPE_4232H)
+        {
+            fprintf(stdout,"Channel C has Mode UART%s\n",
+                    (eeprom->channel_c_driver)?" VCP":"");
+            fprintf(stdout,"Channel D has Mode UART%s\n",
+                    (eeprom->channel_d_driver)?" VCP":"");
+        }
         if (((ftdi->type == TYPE_BM) || (ftdi->type == TYPE_2232C)) &&
                 eeprom->use_usb_version)
             fprintf(stdout,"Use explicit USB Version %04x\n",eeprom->usb_version);
@@ -4176,6 +4201,9 @@ int ftdi_get_eeprom_value(struct ftdi_context *ftdi, enum ftdi_eeprom_value valu
         case EXTERNAL_OSCILLATOR:
             *value = ftdi->eeprom->external_oscillator;
             break;
+        case USER_DATA_ADDR:
+            *value = ftdi->eeprom->user_data_addr;
+            break;
         default:
             ftdi_error_return(-1, "Request for unknown EEPROM value");
     }