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

SDK • Re: HiZ Tristate Outputs

$
0
0
Is it possible to set a GPIO output pin to a HiZ state with PIO?
...
I'm guessing this has something to do with "PINDIRS" ?
Sounds right to me.

A couple of notes, if you want to side set 3 pins to output then it should be side 7 and not side 1 like you have below:

Code:

; Set all pins in pindirs set to outputs (5 pins) and do the same with 3 side-set pinsset pindirs, 31 side 1
You could also do more than 5 pins with a single OUT instruction if you can make temporary use of the OSR register:

Code:

; Load 0xFFFFFFFF into OSRmov osr, !null; Pop 8 of these 1 bits off into PINDIRS (as mapped for OUT pins)out pindirs, 8; Drop the other 24 bits with an "out null, 24" or just discard and overwrite with actual data from Tx FIFO with "pull" instruction.

Statistics: Posted by adam_green — Sat Dec 16, 2023 6:24 am



Viewing all articles
Browse latest Browse all 5359

Trending Articles