Difference between revisions of "Fitlet GPIO SDK for Linux"
From fit-PC wiki
(→GPIO) (change visibility) |
|||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== GPIO == | == GPIO == | ||
+ | * '''NOTE!''' Not supported in mainline Linux kernel. [[Fitlet:_Linux:_Kernel | Linux Kernel for Fitlet]] should be installed to make this feature work | ||
* GPIO interface on fitlet consists of 9 GPIOs provided by AMD FCH (Fusion Controller Hub) | * GPIO interface on fitlet consists of 9 GPIOs provided by AMD FCH (Fusion Controller Hub) | ||
* The responsible kernel module is gpio_fch | * The responsible kernel module is gpio_fch | ||
Line 15: | Line 7: | ||
{| cellpadding="3" border="1" style="border: 1px solid rgb(85, 85, 85); border-collapse: collapse;" | {| cellpadding="3" border="1" style="border: 1px solid rgb(85, 85, 85); border-collapse: collapse;" | ||
− | |+ | + | |+ GPIO connector pinout |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
| Pin Number | | Pin Number | ||
| Color Code | | Color Code | ||
+ | | GPIO name | ||
+ | | Power domain | ||
+ | | HW source | ||
+ | | Notes | ||
|- | |- | ||
| 1 | | 1 | ||
| Brown | | Brown | ||
− | |||
− | |||
| GPIO89 | | GPIO89 | ||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 2 | | 2 | ||
| Red | | Red | ||
− | |||
− | |||
| GPIO132 | | GPIO132 | ||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 3 | | 3 | ||
| Orange | | Orange | ||
− | |||
− | |||
| GPIO65 | | GPIO65 | ||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 4 | | 4 | ||
| Yellow | | Yellow | ||
− | |||
− | |||
| GPIO66 | | GPIO66 | ||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 5 | | 5 | ||
| Green | | Green | ||
− | |||
− | |||
| GPIO29 | | GPIO29 | ||
| 1.5V | | 1.5V | ||
− | | | + | | Soc |
− | | | + | | |
|- | |- | ||
| 6 | | 6 | ||
| Blue | | Blue | ||
− | |||
| I2C Clock | | I2C Clock | ||
− | |||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
| | | | ||
|- | |- | ||
| 7 | | 7 | ||
| Purple | | Purple | ||
− | |||
| I2C Data | | I2C Data | ||
− | |||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
| | | | ||
|- | |- | ||
| 8 | | 8 | ||
| Grey | | Grey | ||
− | |||
− | |||
| GPIO73 | | GPIO73 | ||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 9 | | 9 | ||
| White | | White | ||
− | |||
− | |||
| GPIO27 | | GPIO27 | ||
| 1.5V | | 1.5V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 10 | | 10 | ||
| Black | | Black | ||
− | |||
− | |||
| GPIO28 | | GPIO28 | ||
| 1.5V | | 1.5V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 11 | | 11 | ||
| Brown | | Brown | ||
− | |||
− | |||
| GPIO12 | | GPIO12 | ||
| 3.3V | | 3.3V | ||
− | | | + | | SoC |
− | | | + | | |
|- | |- | ||
| 12 | | 12 | ||
| Red | | Red | ||
− | |||
| UART Rx | | UART Rx | ||
− | |||
| 3.3V | | 3.3V | ||
− | | | + | | SuperIO |
| | | | ||
|- | |- | ||
| 13 | | 13 | ||
| Orange | | Orange | ||
− | |||
| UART Tx | | UART Tx | ||
− | |||
| 3.3V | | 3.3V | ||
− | | | + | | SuperIO |
| | | | ||
|- | |- | ||
| 14 | | 14 | ||
| Yellow | | Yellow | ||
− | |||
| | | | ||
| | | | ||
| GND | | GND | ||
− | |||
| | | | ||
|} | |} | ||
Line 156: | Line 117: | ||
* The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically. | * The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically. | ||
− | * A basic example of GPIO usage (as root user): | + | * A basic example of GPIO P-1 (Brown) usage (as root user): |
$ modprobe fch_gpio | $ modprobe fch_gpio | ||
Line 167: | Line 128: | ||
$ echo 89 > /sys/class/gpio/unexport | $ echo 89 > /sys/class/gpio/unexport | ||
− | + | * The GPIO framework and GPIO sysfs interface are documented in https://www.kernel.org/doc/Documentation/gpio/gpio.txt | |
− | * The GPIO framework and GPIO sysfs interface are documented in | + | |
[[category:fitlet]] | [[category:fitlet]] | ||
+ | [[category:gpio]] |
Revision as of 13:06, 17 December 2015
GPIO
- NOTE! Not supported in mainline Linux kernel. Linux Kernel for Fitlet should be installed to make this feature work
- GPIO interface on fitlet consists of 9 GPIOs provided by AMD FCH (Fusion Controller Hub)
- The responsible kernel module is gpio_fch
- The kernel module uses the following pin naming convention:
Pin Number | Color Code | GPIO name | Power domain | HW source | Notes |
1 | Brown | GPIO89 | 3.3V | SoC | |
2 | Red | GPIO132 | 3.3V | SoC | |
3 | Orange | GPIO65 | 3.3V | SoC | |
4 | Yellow | GPIO66 | 3.3V | SoC | |
5 | Green | GPIO29 | 1.5V | Soc | |
6 | Blue | I2C Clock | 3.3V | SoC | |
7 | Purple | I2C Data | 3.3V | SoC | |
8 | Grey | GPIO73 | 3.3V | SoC | |
9 | White | GPIO27 | 1.5V | SoC | |
10 | Black | GPIO28 | 1.5V | SoC | |
11 | Brown | GPIO12 | 3.3V | SoC | |
12 | Red | UART Rx | 3.3V | SuperIO | |
13 | Orange | UART Tx | 3.3V | SuperIO | |
14 | Yellow | GND |
- The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically.
- A basic example of GPIO P-1 (Brown) usage (as root user):
$ modprobe fch_gpio $ echo 89 > /sys/class/gpio/export $ echo out > /sys/class/gpio/gpio89/direction $ echo 1 > /sys/class/gpio/gpio89/value ## at this point voltage measuring on P-1 (Brown) should give 3.3V $ echo 0 > /sys/class/gpio/gpio89/value ## at this point voltage measuring on P-1 (Brown) should give 0.0V $ echo 89 > /sys/class/gpio/unexport
- The GPIO framework and GPIO sysfs interface are documented in https://www.kernel.org/doc/Documentation/gpio/gpio.txt