This is a list of the GPIOs available on conga-QMX6:
Q7 name | Q7 connector | schematic name | type | resistor | OS numbering/naming | startup code numbering/naming | comment |
---|---|---|---|---|---|---|---|
GPIO0 | Q7-185 | GPIO5_2 | push-pull | internal 100k PU | gpio130 | GPIO5_2 | |
GPIO1 | Q7-186 | USB_OTG_PWR_CTL_WAKE (rev.E) | push-pull | internal 100k PU | gpio8 (rev.E), | GPIO1_8 (rev.E) GPIO3_22 (rev.B/C) | rev.E: not used as gpio (is usb-otg-pwr) |
GPIO2 | Q7-187 | GPIO_26 | push-pull | internal 100k PU | gpio122 | GPIO4_26 | |
GPIO4 / (GPO1) | Q7-189 | GPIO_0 | push-pull | internal 100k PD | gpio0 | GPIO1_0 | |
GPIO5 / (GPI) | Q7-190 | GPIO_15 | push-pull | internal 100k PD | gpio111 | GPIO4_15 | Attention: This pin has pulldown enabled on coldstart and even without any bootloader software. It is not set to pullup in startup code to prevent pin toggling from low to high in the first 100ms of boot. |
GPIO6 / (GPIO4) | Q7-191 | GPIO_16 | push-pull | internal 100k PU | gpio203 | GPIO7_11 | on conga-QMX6 Q7 interface this is named GPIO4 |
GPIO7 / (GPO0) | Q7-192 | GPIO_14 | push-pull | internal 100k PU | gpio110 | GPIO4_14 |
How to access the GPIOS from OS
GPIO pins are already configured from current Kirkstone BSP as GPIOs. Check via sysfs:
root@cgtqmx6:~# cd /sys/class/gpio root@cgtqmx6:/sys/class/gpio# ls export gpio110 gpio122 gpio130 gpiochip0 gpiochip160 gpiochip32 gpiochip96 gpio0 gpio111 gpio123 gpio203 gpiochip128 gpiochip192 gpiochip64 unexport
All aready configured gpios are lited here. If a GPIO is not yet configured, enable it like e.g. for GPIO0:
$ echo gpio130 > /sys/class/gpio/export
Example: set gpio0 as output and switch between high and low:
$ echo out > /sys/class/gpio/gpio130/direction $ echo 1 > /sys/class/gpio/gpio130 /value $ echo 0 > /sys/class/gpio/gpio130 /value
Example: set gpio0 as input:
$ echo in > /sys/class/gpio/gpio130/direction $ cat /sys/class/gpio/gpio130/value
How to access the GPIOs from startup code
Example for gpio0:
==> gpio set GPIO5_2 ==> gpio clear GPIO5_2