Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7760

General • Re: Question on GPIO and PIO

$
0
0
I am aware that for output the pio must be in control, but is it true for inputs as well?
Nope, inputs are always available to PIO and SIO, regardless of the direction, or function, unless you explicitly disable the input (enabled by default).
Pindirs are actually controlling only the Output Enable: viewtopic.php?t=398098

You don't need gpio_init(), gpio_set_dir(), neither pio_gpio_init() for input only pins.
5.1.16.10.20. pio_gpio_init
...
Note that, if your PIO program only needs the input from a given GPIO, it’s not necessary to select the PIO GPIO function,
because PIO input paths ignore the GPIO muxing.
Just on RP2350 must remove pad isolation, which is not the case for RP2040.
Hello, thank you for your reply.

If I understand that post correctly, out pindirs,1 only enable the output.So if I set it as set pindirs, 1, then I essentially say the pio/rp2040 can output from that pin, and if I were to use that pin as an output oin as well,, sm config set out pins, then I would have to set that as a pindirs 1, then out pins, n, correct?

Statistics: Posted by Maaz1 — Tue Jun 02, 2026 8:29 pm



Viewing all articles
Browse latest Browse all 7760

Latest Images

Trending Articles



Latest Images