-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
writing to GPIO pins #82
Comments
To make it clear, here's a minimal working program written in C using the D2xx library calls. I'd like to replicate this functionality using pyftdi:
|
Solved. But some documentation might help. Bitbang for CBUS is a bit strange, since the set_bitmode() mask argument defines the data direction and state of the bits -- there is no separate write function. Working code example follows:
|
@rdpoor I get: AttributeError: type object 'Ftdi' has no attribute 'BITMODE_CBUS' :( |
Please do not comment on tickets that are 4 years old, the code has evolved quite a bit since. If there is an issue that is related to an existing ticket, open a new one and add a reference to it. Thanks. |
I'm able to get my FT232RQ into bitbang mode and read pins using
ftdi.read_pins()
, but I can't find documentation (nor even source code) that shows how to write to the pins. I thought maybe I should be usingftdi.write_data()
, but that doesn't appear to be having the desired effect:Here's what I tried and what I observed:
Since
read_pins()
now returns 255, it appears thatwrite_data([0x0])
had some effect (despite the error message), but it did not produce visible effects in my FT232RQ: there are LEDs on two of the GPIO pins and they did not light up as I would expect them to.The fundamental question remains: how do I write to the GPIO port in bitbang mode?
update
I should make it clear that I'm trying to access the 4-bit CBUS rather than the 8-bit I/O bus.
The text was updated successfully, but these errors were encountered: