This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:common:applications:gpio:40pin-header [2022/10/18 03:00] hyphop [Boards reference table vendor kernel] |
products:sbc:common:applications:gpio:40pin-header [2024/08/12 03:08] (current) william [Troubleshooting] |
||
|---|---|---|---|
| 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 |
| - | + | ||
| - | ===== Boards reference table vendor kernel | + | |
| - | + | ||
| - | <WRAP important > | + | |
| - | Current | + | |
| - | </ | + | |
| - | + | ||
| - | ==== VIM4 ==== | + | |
| - | + | ||
| - | ^ GPIO ^ Name ^ Physical | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | 420 | SPDIFOUT | + | |
| - | | | + | |
| - | | 491 | PIN.Y7 | + | |
| - | | 490 | PIN.Y6 | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | + | ||
| - | + | ||
| - | ==== VIM1S ==== | + | |
| - | + | ||
| - | ^ GPIO ^ Name ^ Physical | + | |
| - | | | 5V | | + | |
| - | | | 5V | | + | |
| - | | | USB_DM | + | |
| - | | | USB_DP | + | |
| - | | | | + | |
| - | | | VCCMCU | + | |
| - | | | MCU_NRST | + | |
| - | | | MCU_SWIM | + | |
| - | | | | + | |
| - | | | | + | |
| - | | | VDD1V8 | + | |
| - | | | | + | |
| - | | | + | |
| - | | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | | + | |
| - | | | PIN.D1 | + | |
| - | | | PIN.D0 | + | |
| - | | | | + | |
| - | + | ||
| - | ==== Edge-V ==== | + | |
| - | + | ||
| - | ^ GPIO ^ Name ^ Physical | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | 112 | SPDIF/ | + | |
| - | | | + | |
| - | | 50 | + | |
| - | | 49 | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | + | ||
| - | ==== Edge2 ==== | + | |
| - | + | ||
| - | ^ GPIO ^ Name ^ Physical | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | 112 | SPI1_MOSI_M1/ | + | |
| - | | 111 | SPI1_MISO_M1/ | + | |
| - | | 114 | SPI1_CS_M1/ | + | |
| - | | 113 | SPI1_CLK_M1/ | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | | | + | |
| - | + | ||
| - | + | ||
| - | ===== Control GPIO examples | + | |
| <WRAP important > | <WRAP important > | ||
| Line 117: | Line 11: | ||
| When you get the GPIO number, you can follow the steps below to control it. Here we take GPIO number '' | When you get the GPIO number, you can follow the steps below to control it. Here we take GPIO number '' | ||
| - | ==== Export GPIO ==== | + | ===== Export GPIO ===== |
| ```shell | ```shell | ||
| Line 123: | Line 17: | ||
| ``` | ``` | ||
| - | ==== Set-up GPIO direction ==== | + | ===== Set-up GPIO direction |
| We can configure direction as input or output. | We can configure direction as input or output. | ||
| Line 129: | Line 23: | ||
| ```shell | ```shell | ||
| $ echo out | sudo tee / | $ echo out | sudo tee / | ||
| - | $ echo in | sudo tee / | + | $ echo in | sudo tee / |
| ``` | ``` | ||
| - | ==== Set GPIO value ==== | + | ===== Set GPIO value ===== |
| ```shell | ```shell | ||
| Line 139: | Line 33: | ||
| ``` | ``` | ||
| - | ==== Get GPIO value ==== | + | ===== Get GPIO value ===== |
| ```shell | ```shell | ||
| Line 145: | Line 39: | ||
| ``` | ``` | ||
| - | ==== Unexport GPIO ==== | + | ===== Unexport GPIO ===== |
| ```shell | ```shell | ||
| Line 151: | Line 45: | ||
| ``` | ``` | ||
| - | ==== Troubleshooting ==== | + | ===== Troubleshooting |
| If you got the similar error below, it means that the PIN you try to export is used for another function, you need to edit [[products: | If you got the similar error below, it means that the PIN you try to export is used for another function, you need to edit [[products: | ||
| ```shell | ```shell | ||
| - | khadas@Khadas: | + | $ echo 465 | sudo tee / |
| tee: / | tee: / | ||
| ``` | ``` | ||