libftdi Archives

Subject: Re: Multiple interface example?

From: Steve Soloski <ssoloski@xxxxxxxxxxxxxx>
To: Anders Larsen <al@xxxxxxxxxxx>
Cc: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 17 Mar 2014 13:06:49 -0400
Thanks Anders!

Right after I send out this email I saw the example of doing this, and like you said it does "JustWork(tm)"!

I did have an issue with ftdi_readstream(); had to change the default mode from BITMODE_SYNCFF but got that changed and now things are good.

Thanks for the info!

Steve

On 03/17/2014 01:00 PM, Anders Larsen wrote:
Hello,

On 2014-03-12 18:28, Steve Soloski wrote:
Are there any examples of how to use libFTDI with multiple interfaces on the same USB device?

just do it (se below)!

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().

this should JustWork(tm)

Here's what I've tried so far:
[snip]
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.

You _must_ call ftdi_open() to initialise the internal structures of libftdi ... and don't worry, this will _not_ reset the (entire) FTDI chip.

Been there, done that, got the T-shirt:

My application uses libftdi (in bitbang mode) to set an output low on port A (write enable on an SPI flash chip) then using libmpsse on port B programs the flash.

It's an FT2234H, but the FT2232H should behave similarly.

Cheers
Anders


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