Quantcast
Viewing all articles
Browse latest Browse all 4867

Interfacing (DSI, CSI, I2C, etc.) • how to stop driving a gpio (pinctrl?)

I am relearning how to set, read, and abandon (tri-state) GPIOs in Bash.
until very recently I was using /sys/class/gpio/unexport and echo "in" > /sys/class/gpio/gpio9/direction

Surprise! old BASH script doesn't work on new OS.
ok.

I have succeeded in setting and reading a few gpios having read some forum posts on here.

pinctrl set 9 op dl
pinctrl set 9 op dh
__foo=$(pinctrl get 9 | sed "s/^.*\(| hi \).*$/1/;s/^.*\(| lo \).*$/0/")

I am hacking this. I really need more of a clue.

I need to be able to release a GPIO and let it be tristate, and also to be able to first write a GPIO and then wait for it to be externally pulled. Is this done with pinctrl?

Is there a man page for pinctrl or help reference? My Bookworm Raspberry PI 4B says "No manual entry for pinctrl".

Thanks!

Statistics: Posted by tadd — Sat Jun 29, 2024 5:30 am



Viewing all articles
Browse latest Browse all 4867

Trending Articles