Fixes for bitbang mode#431
Open
steelman wants to merge 4 commits into
Open
Conversation
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>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These commits fix several problems I had when running an FTDI dongle in BITBANG mode to control external hardware.