case TYPE_230X:
output[0x00] = 0x80; /* Actually, leave the default value */
output[0x0a] = 0x08; /* Enable USB Serial Number */
- output[0x0c] = (0x01) | (0x3 << 4); /* DBUS drive 4mA, CBUS drive 16mA */
+ /*FIXME: Make DBUS & CBUS Control configurable*/
+ output[0x0c] = 0; /* DBUS drive 4mA, CBUS drive 4 mA like factory default */
for (j = 0; j <= 6; j++)
{
output[0x1a + j] = eeprom->cbus_function[j];
/* FT230X has a user section in the MTP which is not part of the checksum */
i = 0x40;
}
- value = output[i*2];
- value += output[(i*2)+1] << 8;
-
+ if ((ftdi->type == TYPE_230X) && (i >= 0x40) && (i < 0x50)) {
+ uint16_t data;
+ if (ftdi_read_eeprom_location(ftdi, i, &data)) {
+ fprintf(stderr, "Reading Factory Configuration Data failed\n");
+ i = 0x50;
+ }
+ value = data;
+ }
+ else {
+ value = output[i*2];
+ value += output[(i*2)+1] << 8;
+ }
checksum = value^checksum;
checksum = (checksum << 1) | (checksum >> 15);
}
/**
Decode binary EEPROM image into an ftdi_eeprom structure.
+ For FT-X devices use AN_201 FT-X MTP memory Configuration to decode.
+
\param ftdi pointer to ftdi_context
\param verbose Decode EEPROM on stdout
channel_mode[eeprom->channel_a_type],
(eeprom->channel_a_driver)?" VCP":"",
(eeprom->high_current_a)?" High Current IO":"");
- if (ftdi->type >= TYPE_232H)
+ if (ftdi->type == TYPE_232H)
{
fprintf(stdout,"FT1284 Mode Clock is idle %s, %s first, %sFlow Control\n",
(eeprom->clock_polarity)?"HIGH":"LOW",
(eeprom->data_order)?"LSB":"MSB",
(eeprom->flow_control)?"":"No ");
}
- if ((ftdi->type >= TYPE_2232C) && (ftdi->type != TYPE_R) && (ftdi->type != TYPE_232H))
+ if ((ftdi->type == TYPE_2232H) || (ftdi->type == TYPE_4232H))
fprintf(stdout,"Channel B has Mode %s%s%s\n",
channel_mode[eeprom->channel_b_type],
(eeprom->channel_b_driver)?" VCP":"",
"I2C_TXE#", "I2C_RXF#", "VBUS_SENSE", "BB_WR#",
"BBRD#", "TIME_STAMP", "AWAKE#",
};
- fprintf(stdout,"IOBUS has %d mA drive%s%s\n",
+ fprintf(stdout,"DBUS has %d mA drive%s%s\n",
(eeprom->group0_drive+1) *4,
(eeprom->group0_schmitt)?" Schmitt Input":"",
(eeprom->group0_slew)?" Slow Slew":"");
if (ftdi == NULL || ftdi->usb_dev == NULL)
ftdi_error_return(-2, "USB device unavailable");
- if (ftdi->type == TYPE_R)
+ if ((ftdi->type == TYPE_R) || (ftdi->type == TYPE_230X))
{
ftdi->eeprom->chip = 0;
return 0;