}
/**
+ 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
}
}
case TYPE_230X: /* FT230X is only UART */
+ case TYPE_AM:
+ case TYPE_BM:
+ case TYPE_4232H:
default: return 0;
}
+ /* fallback */
return 0;
}
i = 0x40;
}
if ((ftdi->type == TYPE_230X) && (i >= 0x40) && (i < 0x50)) {
- uint16_t data;
+ uint16_t data = 0;
if (ftdi_read_eeprom_location(ftdi, i, &data)) {
fprintf(stderr, "Reading Factory Configuration Data failed\n");
i = 0x50;
switch (ftdi->type)
{
case TYPE_BM:
- case TYPE_2232C:
+ case TYPE_2232C:
chip_type_location = 0x14;
break;
case TYPE_2232H:
case TYPE_232H:
chip_type_location = 0x1e;
break;
+ case TYPE_AM:
+ case TYPE_R:
+ case TYPE_230X:
default:
ftdi_error_return(-4, "Device can't access unprotected area");
}