Skip to content
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

GPIO state reset when opening device #368

Open
jsteinhofff opened this issue Feb 28, 2024 · 0 comments
Open

GPIO state reset when opening device #368

jsteinhofff opened this issue Feb 28, 2024 · 0 comments

Comments

@jsteinhofff
Copy link

Using pyftdi==0.55.0 .

As already mentioned in #218 , when a device gets opened, the state is reset and the last configured state cannot be retrieved anymore.

I was able to workaround this by temporarily monkey-patching out the set_bitmode function:
image
And i could verify that indeed this works for my use-case: I can set the GPIO state in one invocation of the script and i can retrieve the state with above workaround in another invocation of the script. I also verified that after a ftdi.reset(usb_reset=True) the approach still works but then obviously returns the default state (by which i mean that calling read() seems to be ok even if set_bitmode has not been called before on the device)

But obviously this is a quite nasty workaround and i wonder whether maybe it could be supported maybe as a special kind of GpioReadOnceController or something?

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

No branches or pull requests

1 participant