libftdi Archives

Subject: How to use async mode

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 3 Feb 2010 17:48:15 +0100

with my FT2232H test setup, libftdi-1/libusb-1 with asyn mode enabled and
following code snipplet (after setting up everything):

      struct ftdi_transfer_control *tc;
      int size = (1<<(CHUNKEXP));
      unsigned char buf[size];
      int actual_length;
      int res;
          tc  = ftdi_read_data_submit(&ftdic, 
          res = ftdi_transfer_data_done (tc);
          res = ftdi_read_data(&ftdic, buf, size);
        if (res>0)
        /*do something with the data */

I don't see any consistant difference between both modes. Reading tops out
at 22 MByte/sec if no further processing is done. Writing out the data gets
me down to 18 MByte/sec

Probably I use the async mode in some wrong way. Any usage hints welcome!

Meanwhile I found fastftdi.c from the dsi/ram-tracer project. Throughing out
everything project related I can reach 28 MB/sec, even writing the data. Is
the license
( open
enough that I can offer an adapted version for libftdi? Is there interest?

Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

libftdi - see for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread