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

Can't disable internal biasing #9

Open
habnabit opened this issue Oct 7, 2021 · 0 comments
Open

Can't disable internal biasing #9

habnabit opened this issue Oct 7, 2021 · 0 comments

Comments

@habnabit
Copy link

habnabit commented Oct 7, 2021

I have GPIO pins connected to a circuit which requires no internal biasing (no pull-up; no pull-down). asyncgpio seems to only support pull-up biasing.

In attempting to patch this myself, I hit a dead end. I have something that sort-of works, but only by also using gpiozero for doing some initialization code. I don't know what it does. I assume this could be possible with only asyncgpio:

import gpiozero
gpiozero.Button(6, pull_up=False).is_pressed
import asyncgpio as gpio
GPIOD_LINE_REQUEST_FLAG_BIAS_DISABLE = gpio.libgpiod.lib.GPIOD_LINE_REQUEST_FLAG_BIAS_DISABLE

Only then am I be able to do this and have it actually disable bias:

with in_.monitor(gpio.REQUEST_EVENT_BOTH_EDGES, flags=GPIOD_LINE_REQUEST_FLAG_BIAS_DISABLE):
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