CMake: bump the minimal required version to 3.5
[libftdi] / src / ftdi.c
index 4b16468..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
@@ -4183,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");
     }