libftdi Archives

Subject: Multiple interface example?

From: Steve Soloski <ssoloski@xxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 12 Mar 2014 13:28:31 -0400
Hello,

Are there any examples of how to use libFTDI with multiple interfaces on the same USB device?

Some background:

Our device (an FT2232H) supports two interfaces; INTERFACE_B is being used in MPSSE mode to control I2C and GPIO functions; INTERFACE_A is being used to stream images to the host. We use libMPSSE to open INTERFACE_B, and I'm hoping I can re-use the existing open USB device to talk via libFTDI to INTERFACE_A - specifically using ftdi_readstream(). Here's what I've tried so far:

struct mpsse_context *mpsse = <already open mpsse context on intf b>

// create a new ftdi context
struct ftdi_context *ftdi = ftdi_new();

// set the interface to A
ftdi_set_interface(ftdi, FTDI_INTERFACE_A);

// tell ftdi to use an already open device
ftdi_set_usbdev(ftdi, can->mpsse->ftdi.usb_dev);

<do other ftdi stuff here?>

ftdi_readstream(...);

But this just results in an error message "Device doesn't support synchronous FIFO mode". This is understandable, since ftdi->type doesn't get set unless ftdi_open is called. But I don't think I need to call that since it will re-initialize the usb device... I think.

Bottom line - is this approach reasonable? I'm sure I'm missing something - both in code and in concept - so any information or examples would be great!

Steve Soloski






--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
Current Thread