Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:applications:gpio:irq

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
products:sbc:common:applications:gpio:irq [2022/07/04 22:27]
nick ↷ Links adapted because of a move operation
products:sbc:common:applications:gpio:irq [2022/08/07 22:41] (current)
olivia [Introduction]
Line 3: Line 3:
 ===== Introduction ===== ===== Introduction =====
  
-This document mainly introduces how to use GPIO interrupts on Khadas SBC. You will know how to use GPIO interrupts with the GPIO number test program.+The page leads you to use GPIO interrupts with the GPIO number test program on Khadas SBC.
  
 <WRAP important > <WRAP important >
-Use ''GPIOH6'' on VIM3 as example.+Here we use ''GPIOH_6'' on VIM3 as an example.
 </WRAP> </WRAP>
    
 ===== Hardware Connection ===== ===== Hardware Connection =====
  
-Connect the physical pins ''PIN20'' and ''PIN15'' using a DuPont line.+Connect the physical pins ''PIN20'' and ''PIN15'' by using a DuPont line.
  
 ===== System Configuration ===== ===== System Configuration =====
  
-  * Get ''GPIOH6'' number\\ Refer [[/products/sbc/vim4/applications/gpio/40pin-header|40-Pin Header]] to get the GPIO number is ''433''+Get ''GPIOH_6'' number 
-  Export GPIO ```sh+ 
 +Refer to [[/products/sbc/vim4/applications/gpio/40pin-header|40-Pin Header]]the GPIO number you get is ''433''
 + 
 +Export GPIO 
 + 
 +```shell
 $ echo 433 | sudo tee /sys/class/gpio/export $ echo 433 | sudo tee /sys/class/gpio/export
 ``` ```
  
 <WRAP info > <WRAP info >
-Please use gpio readall to check the status of GPIOH_6, if it is not shown as a normal GPIO, you need to remove uart3 from overlays in the /boot/env.txt file. \\+Please use ''gpio readall'' to check the status of ''GPIOH_6'', if it is not shown as a normal GPIO, you need to remove ''uart3'' from ''overlays'' in file ''/boot/env.txt''. \\
 Check the [[products:sbc:vim4:configurations:device-tree-overlay|Device Tree Overlay]] for more details. Check the [[products:sbc:vim4:configurations:device-tree-overlay|Device Tree Overlay]] for more details.
 </WRAP> </WRAP>
Line 28: Line 33:
 ===== Demo Source Code ===== ===== Demo Source Code =====
  
-  * Get demo source code```c gpio_interrupts.c+Get demo source code 
 + 
 +```c gpio_interrupts.c
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /* /*
Line 201: Line 208:
  
 ``` ```
-  * Compile the source code```sh+Compile the source code 
 + 
 +```shell
 $ gcc -o gpio_interrupts gpio_interrupts.c $ gcc -o gpio_interrupts gpio_interrupts.c
 ``` ```
Line 209: Line 218:
 The test code running format is as follows: The test code running format is as follows:
  
-```sh+```shell
 $ sudo ./gpio_interrupts <edge> [pull] $ sudo ./gpio_interrupts <edge> [pull]
  
Line 216: Line 225:
 Run test: Run test:
  
-```sh+```shell
 $ sudo ./gpio_interrupts rising down $ sudo ./gpio_interrupts rising down
 . .
Last modified: 2022/07/04 22:27 by nick