Difference between revisions of "Fitlet GPIO SDK for Linux"
From fit-PC wiki
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
== Installation == | == Installation == | ||
− | + | * Download the [http://www.fit-pc2.com/download/fitlet/Linux/mint/17/linux-image-3.16.7-generic.fitlet_2015.09.27_amd64.deb kernel image] and [http://www.fit-pc2.com/download/fitlet/Linux/mint/17/linux-headers-3.16.7-generic.fitlet_2015.09.27_amd64.deb kernel headers] to the fitlet. | |
− | + | * Open the terminal and install the new linux-*.deb packages: | |
$ sudo dpkg -i /path/to/linux-*.deb | $ sudo dpkg -i /path/to/linux-*.deb | ||
− | + | * Reboot the system: | |
$ sudo reboot -f | $ sudo reboot -f | ||
− | + | == fitlet GPIO == | |
− | + | * GPIO interface on fitlet consists of 9 I/Os provided by AMD FCH (Fusion Controller Hub) | |
+ | * The responsible kernel module is gpio_fch | ||
+ | * The kernel modules uses the following pin naming convention: | ||
− | |||
− | |||
− | |||
− | + | {| cellpadding="3" border="1" style="border: 1px solid rgb(85, 85, 85); border-collapse: collapse;" | |
− | + | |+ GPIO pin naming convention on fitlet | |
− | + | |- | |
− | + | | GPIO name | |
− | + | | HW source | |
− | + | | Pin on GPIO Connector | |
− | + | | Notes | |
− | + | |- | |
− | + | | GPIO89 | |
+ | | FCH | ||
+ | | P-1 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO132 | ||
+ | | FCH | ||
+ | | P-2 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO65 | ||
+ | | FCH | ||
+ | | P-3 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO66 | ||
+ | | FCH | ||
+ | | P-4 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO29 | ||
+ | | FCH | ||
+ | | P-5 | ||
+ | | Vout 1.5V | ||
+ | |- | ||
+ | | GPIO73 | ||
+ | | FCH | ||
+ | | P-8 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO27 | ||
+ | | FCH | ||
+ | | P-9 | ||
+ | | Vout 1.5V | ||
+ | |- | ||
+ | | GPIO28 | ||
+ | | FCH | ||
+ | | P-10 | ||
+ | | Vout 1.5V | ||
+ | |- | ||
+ | | GPIO12 | ||
+ | | FCH | ||
+ | | P-11 | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
− | + | * The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically. | |
− | + | * A basic example of GPIO usage (as root user): | |
$ modprobe fch_gpio | $ modprobe fch_gpio | ||
Line 40: | Line 81: | ||
$ echo 89 > /sys/class/gpio/unexport | $ echo 89 > /sys/class/gpio/unexport | ||
− | + | * The source code of gpio_fch driver [http://www.fit-pc2.com/download/fitlet/Linux/mint/17/fitlet.gpio.3.16.diff fitlet.gpio.3.16.diff] | |
− | + | * The GPIO framework and GPIO sysfs interface are documented in [https://www.kernel.org/doc/Documentation/gpio/gpio.txt Linux Kernel Documentation :: GPIO] | |
− | + | ||
[[category:fitlet]] | [[category:fitlet]] |
Revision as of 16:31, 26 October 2015
Installation
- Download the kernel image and kernel headers to the fitlet.
- Open the terminal and install the new linux-*.deb packages:
$ sudo dpkg -i /path/to/linux-*.deb
- Reboot the system:
$ sudo reboot -f
fitlet GPIO
- GPIO interface on fitlet consists of 9 I/Os provided by AMD FCH (Fusion Controller Hub)
- The responsible kernel module is gpio_fch
- The kernel modules uses the following pin naming convention:
GPIO name | HW source | Pin on GPIO Connector | Notes |
GPIO89 | FCH | P-1 | |
GPIO132 | FCH | P-2 | |
GPIO65 | FCH | P-3 | |
GPIO66 | FCH | P-4 | |
GPIO29 | FCH | P-5 | Vout 1.5V |
GPIO73 | FCH | P-8 | |
GPIO27 | FCH | P-9 | Vout 1.5V |
GPIO28 | FCH | P-10 | Vout 1.5V |
GPIO12 | FCH | P-11 |
- The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically.
- A basic example of GPIO 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 should give 3.3V $ echo 0 > /sys/class/gpio/gpio89/value ## at this point voltage measuring on P-1 should give 0.0V $ echo 89 > /sys/class/gpio/unexport
- The source code of gpio_fch driver fitlet.gpio.3.16.diff
- The GPIO framework and GPIO sysfs interface are documented in Linux Kernel Documentation :: GPIO