ftdi->writebuffer_chunksize = 4096;
ftdi->max_packet_size = 0;
- ftdi->interface = 0;
- ftdi->index = 0;
- ftdi->in_ep = 0x02;
- ftdi->out_ep = 0x81;
+ ftdi_set_interface(ftdi, INTERFACE_ANY);
ftdi->bitbang_mode = 1; /* when bitbang is enabled this holds the number of the mode */
ftdi->error_str = NULL;
{
case INTERFACE_ANY:
case INTERFACE_A:
- /* ftdi_usb_open_desc cares to set the right index, depending on the found chip */
+ ftdi->interface = 0;
+ ftdi->index = INTERFACE_A;
+ ftdi->in_ep = 0x02;
+ ftdi->out_ep = 0x81;
break;
case INTERFACE_B:
ftdi->interface = 1;
if (ftdi == NULL || ftdi->usb_dev == NULL)
ftdi_error_return(-2, "USB device unavailable");
- if (libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_IN_REQTYPE, SIO_READ_EEPROM_REQUEST, 0, eeprom_addr, (char *)eeprom_val, 2, ftdi->usb_read_timeout) != 2)
+ if (libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_IN_REQTYPE, SIO_READ_EEPROM_REQUEST, 0, eeprom_addr, (unsigned char *)eeprom_val, 2, ftdi->usb_read_timeout) != 2)
ftdi_error_return(-1, "reading eeprom failed");
return 0;