I had reviewed this section which covers the input setup. However, I didn’t see a reference to a register to read to “sample” the pin state as high vs low.
For instance, pin G5 in the pinmux shows addr 0x022140b0 as the OUT register. For bidir support (and similar to other flavored SOMs) I’m looking for a register (MMIO) to read the IN. Even the TRM, for the next output section, didn’t spell out the OUT register but this was derived from the pinmux.
I’m not having any problem with control – that’s all spelled out nicely in the TRM. I’m having problem with sampling the pin itself to do software edge detect on clock and then just straight sampling on the data pin.
Say we’re dealing with GPIO20 as incoming 160kHz clock and GPIO21 is a data pin synchronous to the 160kHz clock.
I’m not having issue “setting up” the pins as input. I haven’t found how to resolve which register I read to grab the value as driven by an external device (serial bit bang sampling with software).
PADCTL_ regs (I get this)
E_SCHMT = 0x00000000 // [12:12] DISABLE [DISABLE=0,ENABLE=1]
GPIO_SF_SEL = 0x00000001 // [10:10] SFIO [GPIO=0,SFIO=1]
E_LPDR = 0x00000000 // [08:08] DISABLE [DISABLE=0,ENABLE=1]
E_INPUT = 0x00000001 // [06:06] ENABLE [DISABLE=0,ENABLE=1]
E_IO_HV = 0x00000001 // [05:05] ENABLE [DISABLE=0,ENABLE=1]
TRISTATE = 0x00000001 // [04:04] TRISTATE [PASSTHROUGH=0,TRISTATE=1]
PUPD = 0x00000001 // [03:02] PULL_DOWN [NONE=0,PULL_DOWN=1,PULL_UP=2,RSVD=3]
PM = 0x00000000 // [01:00] VGP3 [EXTPERIPH4=1,RSVD2=2,RSVD3=3,VGP3=0]
Assuming I set PADCTL.E_INPUT, where do I read the sampled value?
Set PM field as per PinMux selection in pad control register PADCTL_<padctl_group><ball_name>*.PM =
Set SFIO/GPIO selection to SFIO selection, (PADCTL_<padctl_group><ball_name>*.GPIO_SFIO_SEL =
HSIO) (nothing but SFIO).
Set (PADCTL_<padctl_group><ball_name>* .TRISTATE = TRISTATE) to disable SoC functional logic
driving the I/O.
Set (PADCTL_<padctl_group><ball_name>* .E_INPUT= ENABLE) to turn on input receiver.
The specific I/O controllers driving the I/Os is configured and activated.
At this point (in the TRM guide) I have an input pin “configured and activated” - but where do I read the value to determine the driven value (as driven by an external device wired to the GPIO header pins?
This is the documentation I am not resolving.