VAR-SOM-AM43 GPIO: Difference between revisions

From Variscite Wiki
Line 34: Line 34:
</pre>
</pre>
Each GPIO is defined as in or out and the state is shown as lo or hi.
Each GPIO is defined as in or out and the state is shown as lo or hi.
<br/>For example , SD-Card card-detect:<br>
<br/>For example , SW4 the Menu Button:<br>
When  SD-Card is removed the state will be:
When  SD-Card is removed the state will be:
<pre>
<pre>
  gpio-60  (cd                  ) in  hi IRQ
  gpio-166 (sw4                ) in  lo IRQ
</pre>
</pre>
When the SD-Card is plugged the state will be:
When the SD-Card is plugged the state will be:
<pre>
<pre>
  gpio-60  (cd                  ) in  lo IRQ
  gpio-166 (sw4                ) in  hi IRQ
</pre>
</pre>



Revision as of 17:00, 23 December 2015

VAR-SOM-AM43 - GPIO


GPIO state

The current state of the systems' GPIOs can be obtained in user-mode, as shown in the following example:

$ cat /sys/kernel/debug/gpio

The above command on Variscite's VAR-DVK-AM43 will show the following:

root@varsomam43:~# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/44e07000.gpio, gpio:
 gpio-6   (cd                  ) in  lo IRQ

GPIOs 32-63, platform/4804c000.gpio, gpio:
 gpio-48  (kim                 ) out lo
 gpio-52  (vmmcwl_fixed        ) out lo

GPIOs 64-95, platform/481ac000.gpio, gpio:

GPIOs 96-127, platform/481ae000.gpio, gpio:

GPIOs 128-159, platform/48320000.gpio, gpio:
 gpio-136 (?                   ) out lo
 gpio-154 (?                   ) out lo
 gpio-157 (ft5x06_irq_gpio     ) in  hi IRQ

GPIOs 160-191, platform/48322000.gpio, gpio:
 gpio-164 (sw6                 ) in  hi IRQ
 gpio-165 (sw5                 ) in  hi IRQ
 gpio-166 (sw4                 ) in  hi IRQ
 gpio-167 (vtt_fixed           ) out hi

GPIOs 510-511, platform/50000000.gpmc, omap-gpmc:

Each GPIO is defined as in or out and the state is shown as lo or hi.
For example , SW4 the Menu Button:
When SD-Card is removed the state will be:

 gpio-166 (sw4                 ) in  lo IRQ

When the SD-Card is plugged the state will be:

 gpio-166 (sw4                 ) in  hi IRQ

Manipulating a single GPIO via /sys/class/gpio

Reference reading

http://processors.wiki.ti.com/index.php/Linux_PSP_GPIO_Driver_Guide