Difference between revisions of "Fitlet GPIO SDK for Linux"

From fit-PC wiki
Jump to: navigation, search
Line 1: Line 1:
== fitlet GPIO SDK for Linux ==
 
* [http://fit-pc.com/download/fitlet/sw/fitlet-gpio-sdk-for-linux.zip fitlet GPIO SDK for Linux]
 
 
 
== Installation ==
 
== Installation ==
1. Download the custom kernel image and headers ''<LINK_TO_DEB_FILES_HERE>'' to the fitlet.
+
* 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.
  
2. Open the terminal and install the new linux-*.deb packages:
+
* Open the terminal and install the new linux-*.deb packages:
 
  $ sudo dpkg -i /path/to/linux-*.deb
 
  $ sudo dpkg -i /path/to/linux-*.deb
  
3. Reboot the system:
+
* Reboot the system:
 
  $ sudo reboot -f
 
  $ sudo reboot -f
  
=== fitlet GPIO ===
+
== fitlet GPIO ==
(based on http://droid/mirror/mediawiki/index.php/CM-iGT:_Linux:_Mint#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:
  
1. GPIO interface on fitlet consists of 9 I/Os provided by AMD FCH (Fusion Controller Hub) <br>
 
2. The responsible kernel module is '''gpio_fch'''  <br>
 
3. The kernel modules uses the following pin naming convention:  <br>
 
  
P-1, GPIO89
+
{| cellpadding="3" border="1" style="border: 1px solid rgb(85, 85, 85); border-collapse: collapse;"
P-2,  GPIO132
+
|+ GPIO pin naming convention on fitlet
P-3,  GPIO65
+
|-
P-4,  GPIO66
+
| GPIO name
P-5,  GPIO29 Vout 1.5V
+
| HW source
P-8,  GPIO73
+
| Pin on GPIO Connector
P-9,  GPIO27 Vout 1.5V
+
| Notes
P-10, GPIO28 Vout 1.5V
+
|-
P-11, GPIO12
+
| 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
 +
|
 +
|-
 +
|}
  
4. The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically. <br>
+
* The GPIO sysfs interface allows users to manipulate any GPIO from userspace dynamically.
5. A basic example of GPIO usage (as root user): <br>
+
* 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
  
6. The source code of '''gpio_fch''' driver ''<LINK_TO_DIFF_FILE_HERE>''  <br>
+
* 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]
7. The GPIO framework and GPIO sysfs interface are documented in Linux Kernel Documentation <br>
+
* 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

  • 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 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
$ 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