Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:applications:gpio:40pin-header

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
products:sbc:common:applications:gpio:40pin-header [2022/10/18 03:10]
hyphop [Boards reference table vendor kernel]
products:sbc:common:applications:gpio:40pin-header [2023/08/16 06:31]
jacobe [Set GPIO value]
Line 3: Line 3:
 ====== GPIO Header ====== ====== GPIO Header ======
  
-Universal GPIO 40 pins board header, used for communication between board and different external devices. +===== GPIO usage examples =====
- +
- +
-<WRAP important > +
-Current GPIO numbers valid for vendor kernel only. Mainline linux kernel GPIO numbers will be different...  +
-</WRAP> +
- +
- +
-===== Control GPIO examples =====+
  
 <WRAP important > <WRAP important >
Line 22: Line 14:
  
 ```shell ```shell
-$ echo 465 | sudo tee /sys/class/gpio/export+$ echo 111 | sudo tee /sys/class/gpio/export
 ``` ```
  
Line 30: Line 22:
  
 ```shell ```shell
-$ echo out | sudo tee /sys/class/gpio/gpio465/direction # Set GPIO output +$ echo out | sudo tee /sys/class/gpio/gpio111/direction # Set GPIO output 
-$ echo in | sudo tee /sys/class/gpio/gpio465/direction # Set GPIO input+$ echo in  | sudo tee /sys/class/gpio/gpio111/direction # Set GPIO input
 ``` ```
  
Line 37: Line 29:
  
 ```shell ```shell
-$ echo 1 | sudo tee /sys/class/gpio/gpio465/value # Set GPIO output high +$ echo 1 | sudo tee /sys/class/gpio/gpio111/value # Set GPIO output high 
-$ echo 0 | sudo tee /sys/class/gpio/gpio465/value # Set GPIO output low+$ echo 0 | sudo tee /sys/class/gpio/gpio111/value # Set GPIO output low
 ``` ```
  
Line 44: Line 36:
  
 ```shell ```shell
-$ cat /sys/class/gpio/gpio465/value # Get GPIO input value+$ cat /sys/class/gpio/gpio111/value # Get GPIO input value
 ``` ```
  
Line 50: Line 42:
  
 ```shell ```shell
-$ echo 465 | sudo tee /sys/class/gpio/unexport+$ echo 111 | sudo tee /sys/class/gpio/unexport
 ``` ```
  
Line 58: Line 50:
  
 ```shell ```shell
-khadas@Khadas:~$ echo 465 | sudo tee /sys/class/gpio/export +khadas@Khadas:~$ echo 111 | sudo tee /sys/class/gpio/export 
 tee: /sys/class/gpio/export: Invalid argument tee: /sys/class/gpio/export: Invalid argument
 ``` ```
  
Last modified: 2023/08/16 06:33 by jacobe