>>>>> "Matt" == Matt Barclay <mbarclay@xxxxxxxxx> writes:
Matt> --20cf3071cc4af2d7be04c767927e Content-Type: text/plain;
Matt> charset=ISO-8859-1
Matt> Hello,
Matt> The FTDI D2xx API has an FT_SetEventNotification() function that
Matt> lets you register a callback when some event has occurred. I'm
Matt> trying to block my thread until pins on the FT4232 BDBUS go low.
Matt> That tells my thread that the slave SPI chips have data in their
Matt> FIFO's that need to be unloaded. Currently my read thread is just
Matt> spinning on a request for GET_BITS_LOW, which is ugly and might
Matt> lead to buffer overflow on my slave SPI chips.
FTDI libftd2xx has a seperate thread continious polling the FTDI chip. If it
sees the requested event, it signals the user thread. libftdi has no such
thread, and so no way to wait for an event yet.
Matt> Looking in ftdi.h, there's a WAIT_ON_LOW 0x89, but I don't see
Matt> that used anywhere. Is there any way to get event notification on
Matt> input GPIO line change with libftdi?
So at present I see no easy way other than an architectural rewrite.
However WAIT_ON_LOW might be an option. You switch to MPSSE mode and queue
some read command after the wait. Reading will fail until the PIN-LOW event
happens, as the MPSSE machine stalls until the event happens.
Bye
--
Uwe Bonnes bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|