Fitlet GPIO SDK for Linux

From fit-PC wiki
Revision as of 08:56, 26 October 2015 by Maxim (Talk | contribs)

Jump to: navigation, search

fitlet GPIO SDK for Linux


1. Download the custom kernel image and headers <LINK_TO_DEB_FILES_HERE> to the fitlet.

2. Open the terminal and install the new linux-*.deb packages:

$ sudo dpkg -i /path/to/linux-*.deb

3. Reboot the system:

$ sudo reboot -f

fitlet GPIO

(based on http://droid/mirror/mediawiki/index.php/CM-iGT:_Linux:_Mint#GPIO)

1. GPIO interface on fitlet consists of 9 I/Os provided by AMD FCH (Fusion Controller Hub)
2. The responsible kernel module is gpio_fch
3. The kernel modules uses the following pin naming convention:

P-1,  GPIO89
P-2,  GPIO132
P-3,  GPIO65
P-4,  GPIO66
P-5,  GPIO29	Vout 1.5V
P-8,  GPIO73
P-9,  GPIO27	Vout 1.5V
P-10, GPIO28	Vout 1.5V
P-11, GPIO12

4. The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically.
5. 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

6. The source code of gpio_fch driver <LINK_TO_DIFF_FILE_HERE>
7. The GPIO framework and GPIO sysfs interface are documented in Linux Kernel Documentation