Skip to content

Fixes for bitbang mode#431

Open
steelman wants to merge 4 commits into
eblot:mainfrom
steelman:main
Open

Fixes for bitbang mode#431
steelman wants to merge 4 commits into
eblot:mainfrom
steelman:main

Conversation

@steelman

Copy link
Copy Markdown

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 <l.stelmach@samsung.com>
The release_interface() called from Ftdi.close() should be matched by
claim_interface() in Ftdi.open_from_device().

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
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 <l.stelmach@samsung.com>
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 <l.stelmach@samsung.com>
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