Skip to content

Conversation

@steelman
Copy link

These commits fix several problems I had when running an FTDI dongle in BITBANG mode to control external hardware.

Łukasz Stelmach added 4 commits November 13, 2025 10:27
When using FTDI as a GPIO adapter in bitbanging mode to control some
external hardware, it is highly undesirable to leave ttyUSBn available
for opening and possibly ruining the state of output pins.

Signed-off-by: Łukasz Stelmach <[email protected]>
The release_interface() called from Ftdi.close() should be matched by
claim_interface() in Ftdi.open_from_device().

Signed-off-by: Łukasz Stelmach <[email protected]>
When using Ftdi.open_bintbang_*() functions, don't reset the bitmode
because it causes some pins to twich briefley before the BITBANG mode
is set.

Signed-off-by: Łukasz Stelmach <[email protected]>
According to libusb documentation [1] it isn't always desirable to call
SET_CONFIGURAITON if a device has already been configured.

The same approach can be found in libftdi[2].

I have observed that devices didn't work properly in BITBANG mode after
the configuration was set to the one the device had alredy been using.

[1] https://libusb.sourceforge.io/api-1.0/libusb_caveats.html#configsel
[2] http://developer.intra2net.com/git/?p=libftdi;a=blob;f=src/ftdi.c;h=f5b70188f91fc1d4c329d891698ec74566ebeb94;hb=5c2c58e03ea999534e8cb64906c8ae8b15536c30#l631

Signed-off-by: Łukasz Stelmach <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant