Skip to content

Can't disable internal biasing #9

Open
@habnabit

Description

@habnabit

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):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions