GPIO Mode Select

Hi Robert,

Table 11 defines Header P9 pinout:

For the pin name: I2C2_SCL, if the port is MODE3, it matches the Header P9 name. Does that imply the pin is in MODE3?

In the /sys/class/gpio:
image
There is no mode for R/W. Does that imply the pin is in GPIO mode, which is MODE7.
Just for this GPIO0_13 pin, how do I know what is the current PIN function? Or is there a way to confirm or to switch the pin modes?

I configured the pin as output through /sys/class/gpio/gpio13, but it doesn’t toggle. Is it possible that the pin is used by some other driver as I2C2_SCL.

I used your command and it returns cape i2c scl.

If this is the case, it is possible that to remove/disable cape i2c? Or the I2C is necessary and used by the system?

Also, the pin is not used by some other drivers, then it is default to mode7 as GPIO pin, is it true?

Thank You,
David

MODE3 is a TI specific configuration for this AM335x, it is not show in a “generic” way under /sys/class/gpio/… Our show-pin’s script does a lookup under debugfs to determine what mode it’s under…

If you want to use GPIO0_13 in gpio mode, disable the i2c/pinmux in the device tree and define it in your device tree as a gpio/led/etc…

Nope, it’s in a ‘reset’ state, which varies between i/o on the AM335x, these reset states are listed in the AM335x reference manual…

Regards,

Hi Robert,

Thank you very much for your answers.
Best Regards,
David