<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.gumstix.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dhylands</id>
		<title>Gumstix User Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.gumstix.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dhylands"/>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php/Special:Contributions/Dhylands"/>
		<updated>2026-06-09T14:32:32Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.3</generator>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=5699</id>
		<title>GPIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=5699"/>
				<updated>2011-11-14T04:20:44Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Fixed links that pointed to gumstix.net&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overo GPIO ==&lt;br /&gt;
&lt;br /&gt;
The Overo kernels support the sysfs gpio implementation for accessing GPIO from userspace. &lt;br /&gt;
&lt;br /&gt;
This allows you to control GPIO from the command line this way&lt;br /&gt;
&lt;br /&gt;
 root@overo# echo 146 &amp;gt; /sys/class/gpio/export&lt;br /&gt;
 root@overo:/sys/class/gpio# cat gpio146/direction&lt;br /&gt;
 in&lt;br /&gt;
 root@overo# echo out &amp;gt; /sys/class/gpio/gpio146/direction&lt;br /&gt;
 root@overo:/sys/class/gpio# cat gpio146/direction&lt;br /&gt;
 out&lt;br /&gt;
 root@overo# cat /sys/class/gpio/gpio146/value&lt;br /&gt;
 0&lt;br /&gt;
 root@overo# echo 1 &amp;gt; /sys/class/gpio/gpio146/value&lt;br /&gt;
 root@overo# cat /sys/class/gpio/gpio146/value&lt;br /&gt;
 1&lt;br /&gt;
&lt;br /&gt;
If you have an expansion card with a 40 pin header, then this will be controlling pin 27. You can use pin 1 for a ground. (If you don't have a meter, a p/n 276-0330 1.8V Red LED from Radio Shack works for testing.) &lt;br /&gt;
&lt;br /&gt;
Schematics and pin-outs for the Gumstix expansion boards can be found [http://pubs.gumstix.com/boards/ here.]&lt;br /&gt;
&lt;br /&gt;
=== How It Works ===&lt;br /&gt;
&lt;br /&gt;
See the kernel docs [http://www.kernel.org/doc/Documentation/gpio.txt gpio.txt] for an overview of gpio and the userspace sysfs interface. The &amp;quot;Sysfs Interface for Userspace (OPTIONAL)&amp;quot; section near the end discusses the userspace implementation.&lt;br /&gt;
&lt;br /&gt;
See the [http://www-s.ti.com/sc/techlit/spruf98 OMAP35X Technical Reference Manual] Section 7.6.3 PADCONFS Register Description and Table 7.5 Core Control Module PadConf Register Field in Section 7.4.4.3 Pad Multiplexing Register Fields for identifying the possible MUX configuration for each GPIO.&lt;br /&gt;
&lt;br /&gt;
Then see the U-Boot source code, board/overo/overo.h for how the pins on the Overo are actually being muxed. See include/asm-arm/arch-omap3/mux.h in the U-Boot tree for the definitions used in overo.h. The pins in mux mode M4 are already configured for GPIO.&lt;br /&gt;
&lt;br /&gt;
=== Making Modifications ===&lt;br /&gt;
&lt;br /&gt;
Currently all the GPIO multiplexing for the Overo's is being done by the bootloader U-Boot, so the conventional way to modify the pin muxing is to edit overo.h and rebuild U-Boot.&lt;br /&gt;
&lt;br /&gt;
You can also change the mux configuration from within Linux. One simple approach is to do it from userspace accessing /dev/mem. A program devmem2 is part of the omap3-console-image and will work. See the remuxing example below.&lt;br /&gt;
&lt;br /&gt;
If you are writing your own kernel module, you can also read/write the PADCONF registers the way you normally would after an ioremap.&lt;br /&gt;
&lt;br /&gt;
Third, there is a Linux build config option CONFIG_OMAP_MUX, not normally enabled in the Overo configs, that will give you some additional utility functions to simplify mux changes within kernel or module code (see arch/arm/plat-omap/mux.c).&lt;br /&gt;
&lt;br /&gt;
Finally, it looks like the Linux OMAP34xx pin muxing code is getting a complete overhaul. See this [http://www.mail-archive.com/linux-omap@vger.kernel.org/msg18474.html thread] on the Linux OMAP mailing list. Judging from some posts on the Gumstix lists, it sounds like this will be available in 2.6.33.&lt;br /&gt;
&lt;br /&gt;
=== Overo Kernel Usage ===&lt;br /&gt;
&lt;br /&gt;
Just because pins are configured as GPIO in u-boot, doesn't necessarily mean you can use them. If you look at /sys/class/gpio on a default Overo, you'll get something like this.&lt;br /&gt;
&lt;br /&gt;
 root@overo:~# ls /sys/class/gpio&lt;br /&gt;
 export	gpio164  gpio65       gpiochip160  gpiochip64&lt;br /&gt;
 gpio15	gpio168  gpiochip0    gpiochip192  gpiochip96&lt;br /&gt;
 gpio16	gpio176  gpiochip128  gpiochip32   unexport&lt;br /&gt;
&lt;br /&gt;
The reason you see some GPIO already exported is because the linux code in arch/arm/mach-omap2/board-overo.c is explicitly exporting these pins for another use. Whether they are being used depends on the hardware you have attached. The kernel also uses pins configured as GPIO that it doesn't export. These depend on the board configuration and the kernel drivers being used.&lt;br /&gt;
&lt;br /&gt;
To be more explicit, look inside board-overo.c, you'll see these definitions&lt;br /&gt;
&lt;br /&gt;
 #define OVERO_GPIO_BT_XGATE     15&lt;br /&gt;
 #define OVERO_GPIO_W2W_NRESET   16&lt;br /&gt;
 #define OVERO_GPIO_PENDOWN      114&lt;br /&gt;
 #define OVERO_GPIO_BT_NRESET    164&lt;br /&gt;
 #define OVERO_GPIO_USBH_CPEN    168&lt;br /&gt;
 #define OVERO_GPIO_USBH_NRESET  183&lt;br /&gt;
 ...&lt;br /&gt;
 #define OVERO_SMSC911X_GPIO    176&lt;br /&gt;
 #define OVERO_SMSC911X2_GPIO   65&lt;br /&gt;
 ...&lt;br /&gt;
 #define OVERO_GPIO_LCD_EN 144&lt;br /&gt;
 #define OVERO_GPIO_LCD_BL 145&lt;br /&gt;
&lt;br /&gt;
Follow their usage inside the file and you will be able to explain the /sys/class/gpio output you see above.&lt;br /&gt;
&lt;br /&gt;
=== Input or Output ===&lt;br /&gt;
&lt;br /&gt;
Pins configured as GPIO are sometimes also specified as being strictly input or output. &lt;br /&gt;
&lt;br /&gt;
This can happen when they are mux'd or when they are explicitly exported by the kernel. &lt;br /&gt;
&lt;br /&gt;
In either of those cases you won't be able to change the I/O direction from userspace.&lt;br /&gt;
&lt;br /&gt;
=== Electrical Specifications ===&lt;br /&gt;
&lt;br /&gt;
Voltage is 1.8v &lt;br /&gt;
&lt;br /&gt;
Current specifications &amp;lt;TODO ???&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Usable Pins ===&lt;br /&gt;
&lt;br /&gt;
Here's a few GPIO you can use immediately from userspace without any u-boot or kernel changes.&lt;br /&gt;
It will however require that the specific GPIO isn't used by the attached expansion board. &lt;br /&gt;
&lt;br /&gt;
==== 40 Pin Expansion Header ==== &lt;br /&gt;
&lt;br /&gt;
Pin 4 - gpio114&amp;lt;br /&amp;gt;&lt;br /&gt;
It's the pendown signal on the touchscreen controller but it's available if you aren't using a expansion board with touchscreen support.&amp;lt;br /&amp;gt;&lt;br /&gt;
Configured as input only when exported by the kernel in board-overo.h. Can't change the direction from userspace without modifying kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Pulled-low, reads 0 with no input, reads 1 with an input applied&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pin 19 - gpio170&amp;lt;br /&amp;gt;&lt;br /&gt;
The HDQ/1-Wire output. Not used unless you explicitly enable the 1-wire module.&amp;lt;br /&amp;gt;&lt;br /&gt;
User exportable&amp;lt;br /&amp;gt;&lt;br /&gt;
Output only - configured this way in the u-boot muxing&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pin 27 - gpio146&amp;lt;br /&amp;gt;&lt;br /&gt;
Pin 29 - gpio147&amp;lt;br /&amp;gt;&lt;br /&gt;
User exportable&amp;lt;br /&amp;gt;&lt;br /&gt;
Direction can be changed&amp;lt;br /&amp;gt;&lt;br /&gt;
Floating state&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pin 28 - gpio145&amp;lt;br /&amp;gt;&lt;br /&gt;
Pin 30 - gpio144&amp;lt;br /&amp;gt;&lt;br /&gt;
Used with LCD, but available if not using an LCD&amp;lt;br /&amp;gt;&lt;br /&gt;
Configured as output only when exported by the kernel in board-overo.h. Can't change direction from userspace without modifying kernel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Set to ON by kernel during init (not all configs, see board-overo.c). This could be a problem for real use, but okay for testing.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Palo43 Board ====&lt;br /&gt;
&lt;br /&gt;
LED D2 - gpio21&amp;lt;br /&amp;gt;&lt;br /&gt;
LED D3 - gpio22&amp;lt;br /&amp;gt;&lt;br /&gt;
Userspace exportable, set the direction as out&amp;lt;br /&amp;gt;&lt;br /&gt;
echo 0 &amp;gt; gpioxx/value to turn on, echo 1 &amp;gt; gpioxx/value to turn off&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch - gpio14&amp;lt;br /&amp;gt;&lt;br /&gt;
Switch - gpio23&amp;lt;br /&amp;gt;&lt;br /&gt;
Userspace exportable, leave direction as in&amp;lt;br /&amp;gt;&lt;br /&gt;
With the switch open (not pushed) will register a value of 1&amp;lt;br /&amp;gt;&lt;br /&gt;
Push the switch and the value will be 0&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example: Changing the multiplexing for a pin ===&lt;br /&gt;
&lt;br /&gt;
If you aren't using the first SPI bus, then there are 5 pins on the 40-pin expansion header that you could repurpose for GPIO.&lt;br /&gt;
&lt;br /&gt;
Pin 3 - gpio171(spi1_clk)&amp;lt;br /&amp;gt;&lt;br /&gt;
Pin 5 - gpio172 (spi1_mosi)&amp;lt;br /&amp;gt;&lt;br /&gt;
Pin 6 - gpio174 (spi1_cs0)&amp;lt;br /&amp;gt;&lt;br /&gt;
Pin 7 - gpio173 (spi1_miso)&amp;lt;br /&amp;gt;&lt;br /&gt;
Pin 8 - gpio175 (spi1_cs1)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first step is to find the appropriate PADCONF register address for each gpio from Table 7.5 of the TRM. Pay attention to whether it is the low or high order 16 bits for each gpio. You should come up with these values.&lt;br /&gt;
&lt;br /&gt;
gpio171 : 0x4800 21C8&amp;lt;br /&amp;gt;&lt;br /&gt;
gpio172 : 0x4800 21CA&amp;lt;br /&amp;gt;&lt;br /&gt;
gpio173 : 0x4800 21CC&amp;lt;br /&amp;gt;&lt;br /&gt;
gpio174 : 0x4800 21CE&amp;lt;br /&amp;gt;&lt;br /&gt;
gpio175 : 0x4800 21D0&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using devmem2, here is how you could read the current PADCONF value for what could be gpio171&lt;br /&gt;
&lt;br /&gt;
 root@overo# devmem2 0x480021c8 h&lt;br /&gt;
 ...&lt;br /&gt;
 Value at address 0x480021C8 (0x400201c8): 0x100&lt;br /&gt;
&lt;br /&gt;
Which corresponds to a mux value of (IEN | PTD | DIS | M0) using the U-Boot mux.h definitions. Mux mode 0 for this pin is the spi1_clk configuration found by looking in Table 7.5 of the TRM.&lt;br /&gt;
&lt;br /&gt;
To reconfigure pin 3 to be gpio171, as input or output with inputs pulled low, write 0x010C to the controlling PADCONF register. This would correspond to (IEN | PTD | EN | M4). The bit fields are defined in the TRM Section 7.6.3.&lt;br /&gt;
&lt;br /&gt;
 root@overo# devmem2 0x480021c8 h 0x10c&lt;br /&gt;
&lt;br /&gt;
Now you can export and configure gpio171 from userspace like the example with gpio146 at the beginning.&lt;br /&gt;
&lt;br /&gt;
If you want this multiplexing to be permanent, then you would modify the U-Boot file board/overo/overo.h and rebuild U-Boot. If you are using OE, then you'll want to generate a patch file to be used in the u-boot-omap3 recipe.&lt;br /&gt;
&lt;br /&gt;
There are additional pins on the header that can be reconfigured this way.&lt;br /&gt;
&lt;br /&gt;
=== GPIO Software for the Overo ===&lt;br /&gt;
&lt;br /&gt;
Dave Hylands has written several software packages to facilitate GPIO programming on the Overos.&lt;br /&gt;
&lt;br /&gt;
[[GPIO Event Driver]] allows multiple GPIO lines to be monitored from user-space.&lt;br /&gt;
&lt;br /&gt;
[[User GPIO Driver]] is a reflection of the kernel's gpiolib API into user space.&lt;br /&gt;
&lt;br /&gt;
=== More Links ===&lt;br /&gt;
&lt;br /&gt;
Here is another article [http://elinux.org/BeagleBoardPinMux BeagleBoardPinMux] talking about OMAP3 pin muxing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Verdex GPIO ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:100px&amp;quot;&lt;br /&gt;
| style=&amp;quot;background:yellow;&amp;quot; | GPIO(&amp;lt;i&amp;gt; n &amp;lt;/i&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Logic level (3.3V) signals &lt;br /&gt;
* 3-4mA max&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
all GPIO's information and examples should go here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
todo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
According to the PXA270 datasheet:&lt;br /&gt;
http://pubs.gumstix.com/documents/PXA%20Documentation/PXA270/PXA270%20Electrical,%20Mechanical,%20and%20Thermal%20Specification%20%5b280002-005%5d.pdf&lt;br /&gt;
most of the pins are limited to 3mA, and a few can go upto 4 mA (see page 5-9) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Accessing GPIO's from userland ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If proc-gpio is a module, add it to /etc/modules or do a modprobe proc-gpio.&lt;br /&gt;
&lt;br /&gt;
A number of files exist under /proc/gpio, one for each GPIO on the PXA processor.&lt;br /&gt;
&lt;br /&gt;
If you cat one of these files, you get, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /proc/gpio/GPIO12&lt;br /&gt;
12 GPIO in set&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That tells you — GPIO number, function (either GPIO, AF 1, AF 2, or AF 3), in|out, set|clear.&lt;br /&gt;
&lt;br /&gt;
You can change any of those values, by writing to the file, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;AF1 out&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets GPIO12 to AF1, out mode. (In the case of GPIO12, the PXA defines this function as putting out the 32kHz clock signal.) this is currently case-sensitive&lt;br /&gt;
&lt;br /&gt;
If you have the GPIO set to an output, and GPIO mode, you can set or clear the signal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;GPIO out set&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
# echo &amp;quot;GPIO out clear&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The alternative functions are described in the PXA255 Developer's Manual (link should be found in the Featured links-box) section 4.1.2.&lt;br /&gt;
&lt;br /&gt;
=== Alternative method to access GPIO's from userland ===&lt;br /&gt;
&lt;br /&gt;
The [[User GPIO Driver]] provides a reflection of the kernel's gpiolib library into userspace.&lt;br /&gt;
&lt;br /&gt;
=== gpio-event driver ===&lt;br /&gt;
&lt;br /&gt;
The [[GPIO Event Driver]] allows gpio changes to be captured from user-space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------&lt;br /&gt;
&lt;br /&gt;
Related pages on the old wiki:&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Tips_and_tricks#Access_GPIOs_from_user-space&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Sample_code/C/gpregs&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Kernel_programming&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
[[Category:Literature]]&lt;br /&gt;
[[Category:GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4219</id>
		<title>GPIO Event Driver</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4219"/>
				<updated>2010-06-30T08:13:33Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added overview of how the gpio-event driver works.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the gpio-event driver, which allows multiple GPIO lines to be monitored from user-space.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event driver consists of a loadable kernel module, which registers an interrupt handler, along with an example user-mode program, which allows the settings to be manipulated and changes to be reported.&lt;br /&gt;
&lt;br /&gt;
== Driver Sources ==&lt;br /&gt;
&lt;br /&gt;
The source code can be found [http://svn.hylands.org/linux/gpio-event/ here]. The app directory contains the example user mode application, and the module directory contains the loadable kernel module. The Makefiles have been setup such that if you define the environment variable OVEROTOP then you should be able to just type make in top level directory and both the app and module will be built.&lt;br /&gt;
&lt;br /&gt;
There are also some bitbake recipes in the [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-app gpio-event-app] and [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-module gpio-event-module] directories.&lt;br /&gt;
&lt;br /&gt;
== Adding pins to be monitored ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can be used to add gpio pins to be monitored. Simply run the gpio-event program, passing it a pin specification of the form: pin:edge:debounce. pin should be the GPIO number that you want to monitor. Edge should be r, f, or b to monitor rising, falling, or both edges, and debounce should be the number of milliseconds of debounce that you'd like. A debounce of 0 may be used for &amp;quot;clean&amp;quot; signals. For example:&lt;br /&gt;
 gpio-event 58:f:20 59:r:20 60:b:20&lt;br /&gt;
&lt;br /&gt;
would cause gpio 58 to be monitored for falling edges, gpio 59 to be monitored for rising edges, and gpio 60 to be monitored for both rising and falling edges. Each pin will have a debounce of 20 milliseconds (which should be adequate for most pushbuttons).&lt;br /&gt;
&lt;br /&gt;
You can pass as many pins to be monitored as you'd like on the command line. Each call is cumulative. If you specify the same pin, the new specification will override whatever is currently set. You can see the current pins being monitored by using:&lt;br /&gt;
 cat /proc/gpio-event/pins&lt;br /&gt;
&lt;br /&gt;
Passing in a negative gpio number will cause the pin to stop being monitored.&lt;br /&gt;
&lt;br /&gt;
== Detecting events ==&lt;br /&gt;
&lt;br /&gt;
Once pins are setup to be monitored, any program can read /dev/gpio-event to get notified of the events. By default, an ASCII string of the form: &amp;quot;pin edge timestamp&amp;quot; followed by a newline will be delievered to /dev/gpio-event for each event that occurs. Running gpio-event with the -m or --monitor command line will cause the events to be monitored and printed. You could also use the command:&lt;br /&gt;
 cat /dev/gpio-event&lt;br /&gt;
&lt;br /&gt;
to achieve a similar result. For C programs, you can opt to use a binary interface instead. The binary versus ASCII setting is maintained on a per-file basis, so each program could each open /dev/gpio-event with a different ASCII/binary setting.&lt;br /&gt;
&lt;br /&gt;
The edge will be an R or an F depending on whether a rising or falling edge is being reported. The timestamp is a number with the integer portion being the current system time (as returned from the gettimeofday function) and the fractional portion reporting in microseconds.&lt;br /&gt;
&lt;br /&gt;
== Lauching a script ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can also be given the -e or --execute command line option, and the provided program or script will be launched with the same 3 paramters (gpio edge timestamp). For example:&lt;br /&gt;
 gpio-event --execute echo&lt;br /&gt;
&lt;br /&gt;
will produce similar output to&lt;br /&gt;
 gpio-event --monitor&lt;br /&gt;
&lt;br /&gt;
== Integrating/Building with Open Embedded ==&lt;br /&gt;
&lt;br /&gt;
In order to build the driver under OE, you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 cd to the directory containing org.embedded.dev&lt;br /&gt;
 svn co http://svn.hylands.org/linux/oe/user.collection user.collection&lt;br /&gt;
 bitbake task-gpio-all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will build the following packages for gpio-event:&lt;br /&gt;
 ./deploy/glibc/ipk/overo/gpio-event-module_svn20100218-r50.5_overo.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-event-app_svn20100218-r2.5_armv7a.ipk&lt;br /&gt;
&lt;br /&gt;
and these packages for the [[User GPIO Driver]]&lt;br /&gt;
 ./deploy/glibc/ipk/overo/gpio-module_svn20100218-r50.5_overo.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-app_svn20100218-r0.5_armv7a.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-lib_svn20100218-r0.5_armv7a.ipk&lt;br /&gt;
&lt;br /&gt;
Note that the numeric portions of the pathnames will almost certainly be different.&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
&lt;br /&gt;
Everything starts with the module_init directive near the very end of the gpio-event-drv.c file. The function passed to this directive, namely gpio_event_init, will be called automatically when the module is loaded. Similarly, the gpio_event_exit function, passed to the module_exit directive, will be called when the module is unloaded.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_init ===&lt;br /&gt;
* alloc_chrdev_region - Allocates a major number dynamically&lt;br /&gt;
* create_proc_entry - Creates a directory, namely /proc/gpio-event&lt;br /&gt;
* create_proc_entry - Creates a proc entry, namely /proc/gpio-event/pins. This particular proc entry is processed using the functions described in pins_proc_ops.&lt;br /&gt;
* register_sysctl_table - Registers some sysctl entries, described by gSysCtl and gSysCtlSample. I find using sysctl entries a quick and easy way to enable debug flags in my drivers. The sysctl entries will appear in /proc/sys/gpio-event and cause the global variables gLostEvents, gDebugTrace, gDebugIoctl, and gDebugError to be manipulated.&lt;br /&gt;
* cdev_init associates the functions in gpio_event_fops against the major number allocated earlier with alloc_chrdev_region.&lt;br /&gt;
* cdev_add registers the driver with the kernel, and makes it &amp;quot;go live&amp;quot;. Once cdev_add is called, user mode programs can open the driver.&lt;br /&gt;
* class_create creates a class, and device_create registers that class. This gets picked up by udev which will create the /dev/gpio-entry and associate with the dynamically allocated major number.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_open ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_open is called when a user mode program calls open on /dev/gpio-event. The gpio-event driver assumes that it can be opened by multiple applications simultaneously, and uses a GPIO_FileData_t structure to keep track of each instance of the driver which is open. gFileList is a kernel list which contains a list of all of the currently open GPIO_FileData_t data structures.&lt;br /&gt;
&lt;br /&gt;
=== GPIO_FileData_t data structure ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1 px&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! list&lt;br /&gt;
| Element used to make list of GPIO_FileData_t structures&lt;br /&gt;
|-&lt;br /&gt;
! waitQueue&lt;br /&gt;
| Object that reader waits on when no events are available. &lt;br /&gt;
|-&lt;br /&gt;
! queueLock&lt;br /&gt;
| Mutual exclusion lock acquired when manipulating queueData, getIndex, putIndex, or numEvents.&lt;br /&gt;
|-&lt;br /&gt;
! queueData&lt;br /&gt;
| Circular queue of events waiting to be read for a given file.&lt;br /&gt;
|-&lt;br /&gt;
! getIndex&lt;br /&gt;
| Index of the next item to be retrieved from the circular queue.&lt;br /&gt;
|-&lt;br /&gt;
! putIndex&lt;br /&gt;
| Index of the next place that an event will be placed into the circular queue.&lt;br /&gt;
|-&lt;br /&gt;
! numEvents&lt;br /&gt;
| The number of events currently in the circular queue.&lt;br /&gt;
|-&lt;br /&gt;
! readMode&lt;br /&gt;
| Determines if this file is being read in binary or ASCII mode. Defaults to ASCII.&lt;br /&gt;
|-&lt;br /&gt;
! buffer&lt;br /&gt;
| Contains the next event worth of data, formatted in either binary or ASCII format.&lt;br /&gt;
|-&lt;br /&gt;
! bufBytes&lt;br /&gt;
| The number of bytes of data that are currently sitting in buffer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: When manipuating the gFileList linked list, the driver should hold the gFileListLock spinlock with interrupts disabled.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_ioctl ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_ioctl is called when a user mode program issues an ioctl call on the file handle returned from opening /dev/gpio-event. The user mode program can use GPIO_EVENT_IOCTL_MONITOR_GPIO to add/removee/modify monitoring for a pin. The user mode program can use GPIO_EVENT_IOCTL_SET_READ_MODE to set the read mode to binary or ASCII.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_poll ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_poll adds the appropriate glue to allow the poll or select calls to work as expected from user mode. Basically, this function determines if there is data to be read or not.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_read ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_read is called when the user issues a read call on the files handle returned from opening /dev/gpio-event. It first checks to see if any data remains from previous calls. If a non-blocking read is performed and no events are available, then it returns immediately, otherwise it blocks waiting for an event to be placed in the queue before returning. If multiple events are available, and the caller provided sufficient buffer space, then as much data as can be returned will be. gpio_event_dequeue_event is called to retrieve queued events.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_release ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_release is called when a given file handle is closed. It removes the GPIO_FileData_t structure from the list of open files.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_monitor ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_monitor is called in response to the GPIO_EVENT_IOCTL_MONITOR_GPIO ioctl. If monitoring for a pin is being added, then request_irq is called to register an interrupt handler, gpio_event_irq, whenever an appropriate type of edge is detected, and init_timer is called to setup the debounce timer. If monitoring for a pin is being removed, then free_irq is called, along with del_timer_sync to unregister the timer.&lt;br /&gt;
&lt;br /&gt;
=== GPIO_PinData_t data structure ===&lt;br /&gt;
&lt;br /&gt;
There is an instance of this structure for each pin which is actively being monitored.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1 px&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! list&lt;br /&gt;
| Element used to make list of GPIO_PinData_t structures&lt;br /&gt;
|-&lt;br /&gt;
! gpio&lt;br /&gt;
| The gpio pin which is being monitored.&lt;br /&gt;
|-&lt;br /&gt;
! debounceTimer&lt;br /&gt;
| Timer object used to perform debounce.&lt;br /&gt;
|-&lt;br /&gt;
! debounceMilliSec&lt;br /&gt;
| Amount of time that the debounce timer should be activated for after an edge.&lt;br /&gt;
|-&lt;br /&gt;
! devName&lt;br /&gt;
| device name used when registering an irq handler (shows up in /proc/irq)&lt;br /&gt;
|-&lt;br /&gt;
! edgeType&lt;br /&gt;
| The type of edge that is being monitored.&lt;br /&gt;
|-&lt;br /&gt;
! pinState&lt;br /&gt;
| Holds the current state of the pin.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: When manipuating the gPinList linked list, the driver should hold the gPinListLock spinlock with interrupts disabled.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_irq ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_irq is called whenever an edge is detected on enabled pins. The type of edge is determined and an event is queued using gpio_event_queue_event. If pin deboucing is used, then interrupts are disabled (for the particular pin) and a timer is started. &lt;br /&gt;
&lt;br /&gt;
=== gpio_event_timer ===&lt;br /&gt;
&lt;br /&gt;
If debouncing is used on a pin, then a timer is started when an edge occurs. This allows interrupts to be disabled for a short time when the pin &amp;quot;bounces&amp;quot; or generates lots of edges. At the end of the timeout, interrupts are re-enabled.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_dequeue_event ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_dequeue_event is called to retrieve any events queued up for a given file descriptor.&lt;br /&gt;
&lt;br /&gt;
=== gpio_event_queue_event ===&lt;br /&gt;
&lt;br /&gt;
gpio_event_queue_event adds an event to all open file descriptors. The waitQueues for each file descriptor is also &amp;quot;woken&amp;quot; which allows any readers which are blocked waiting for an event to run.&lt;br /&gt;
&lt;br /&gt;
=== find_pin ===&lt;br /&gt;
&lt;br /&gt;
find_pin is a utility function to detemine if a particular gpio is being monitored.&lt;br /&gt;
&lt;br /&gt;
=== pins_proc_open ===&lt;br /&gt;
&lt;br /&gt;
Called when a user mode program opens /proc/gpio-event/pins&lt;br /&gt;
&lt;br /&gt;
=== pin_seq_xxx ===&lt;br /&gt;
&lt;br /&gt;
Set of functions which are called to process the output which goes to /proc/gpio-event/pins.&lt;br /&gt;
&lt;br /&gt;
[[Category: GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=User_GPIO_Driver&amp;diff=4106</id>
		<title>User GPIO Driver</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=User_GPIO_Driver&amp;diff=4106"/>
				<updated>2010-02-18T17:29:32Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added instructions for building under OE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the user GPIO driver, which is a reflection of the kernel's gpiolib API into user space.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The kernel provides an API, called gpiolib, which abstracts access to GPIO pins. It has a mechanism for exporting pins into userspace, and in general this is the preferred method of accessing gpio pins from userspace. This method works particularly well if it is setup for a given overo/daughtercard combination. However, since the kernel is often configured in a more generic manner, using the export method is inconvenient, so the user-gpio driver was created.&lt;br /&gt;
&lt;br /&gt;
WARNING: It is possible to damage your overo chip if you do things incorrectly. This code has no way of knowing for example, if a pin is physically connected to an output or not. If, for example, a GPIO pin was connected to Vcc, and you choose to configure that pin as an output and drive it low, you've essentially created a short circuit, and this can stress or damagethe pin, possibly bricking your processor. You have been warned.&lt;br /&gt;
&lt;br /&gt;
== Driver Sources ==&lt;br /&gt;
&lt;br /&gt;
The source code can be found [http://svn.hylands.org/linux/gpio/ here]. The app directory contains the example user mode application. The lib directory contains the usermode library which translates the C API into the appropriate ioctl calls into the kernel driver, and the module directory contains the loadable kernel module. The Makefiles have been setup such that if you define the environment variable OVEROTOP then you should be able to just type make in top level directory and both the app and module will be built.&lt;br /&gt;
&lt;br /&gt;
There are also some bitbake recipes in the [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-app gpio-app], [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-lib gpio-lib] and [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-module gpio-event-module] directories.&lt;br /&gt;
&lt;br /&gt;
== Integrating/Building with Open Embedded ==&lt;br /&gt;
&lt;br /&gt;
In order to build the driver under OE, you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 cd to the directory containing org.embedded.dev&lt;br /&gt;
 svn co http://svn.hylands.org/linux/oe/user.collection user.collection&lt;br /&gt;
 bitbake task-gpio-all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will build the following packages for the [[GPIO Event Driver]]:&lt;br /&gt;
 ./deploy/glibc/ipk/overo/gpio-event-module_svn20100218-r50.5_overo.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-event-app_svn20100218-r2.5_armv7a.ipk&lt;br /&gt;
&lt;br /&gt;
and these packages for the user gpio driver:&lt;br /&gt;
 ./deploy/glibc/ipk/overo/gpio-module_svn20100218-r50.5_overo.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-app_svn20100218-r0.5_armv7a.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-lib_svn20100218-r0.5_armv7a.ipk&lt;br /&gt;
&lt;br /&gt;
Note that the numeric portions of the pathnames will almost certainly be different.&lt;br /&gt;
&lt;br /&gt;
[[Category: GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4105</id>
		<title>GPIO Event Driver</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4105"/>
				<updated>2010-02-18T17:27:05Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added instructions on building for OE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the gpio-event driver, which allows multiple GPIO lines to be monitored from user-space.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event driver consists of a loadable kernel module, which registers an interrupt handler, along with an example user-mode program, which allows the settings to be manipulated and changes to be reported.&lt;br /&gt;
&lt;br /&gt;
== Driver Sources ==&lt;br /&gt;
&lt;br /&gt;
The source code can be found [http://svn.hylands.org/linux/gpio-event/ here]. The app directory contains the example user mode application, and the module directory contains the loadable kernel module. The Makefiles have been setup such that if you define the environment variable OVEROTOP then you should be able to just type make in top level directory and both the app and module will be built.&lt;br /&gt;
&lt;br /&gt;
There are also some bitbake recipes in the [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-app gpio-event-app] and [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-module gpio-event-module] directories.&lt;br /&gt;
&lt;br /&gt;
== Adding pins to be monitored ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can be used to add gpio pins to be monitored. Simply run the gpio-event program, passing it a pin specification of the form: pin:edge:debounce. pin should be the GPIO number that you want to monitor. Edge should be r, f, or b to monitor rising, falling, or both edges, and debounce should be the number of milliseconds of debounce that you'd like. A debounce of 0 may be used for &amp;quot;clean&amp;quot; signals. For example:&lt;br /&gt;
 gpio-event 58:f:20 59:r:20 60:b:20&lt;br /&gt;
&lt;br /&gt;
would cause gpio 58 to be monitored for falling edges, gpio 59 to be monitored for rising edges, and gpio 60 to be monitored for both rising and falling edges. Each pin will have a debounce of 20 milliseconds (which should be adequate for most pushbuttons).&lt;br /&gt;
&lt;br /&gt;
You can pass as many pins to be monitored as you'd like on the command line. Each call is cumulative. If you specify the same pin, the new specification will override whatever is currently set. You can see the current pins being monitored by using:&lt;br /&gt;
 cat /proc/gpio-event/pins&lt;br /&gt;
&lt;br /&gt;
Passing in a negative gpio number will cause the pin to stop being monitored.&lt;br /&gt;
&lt;br /&gt;
== Detecting events ==&lt;br /&gt;
&lt;br /&gt;
Once pins are setup to be monitored, any program can read /dev/gpio-event to get notified of the events. By default, an ASCII string of the form: &amp;quot;pin edge timestamp&amp;quot; followed by a newline will be delievered to /dev/gpio-event for each event that occurs. Running gpio-event with the -m or --monitor command line will cause the events to be monitored and printed. You could also use the command:&lt;br /&gt;
 cat /dev/gpio-event&lt;br /&gt;
&lt;br /&gt;
to achieve a similar result. For C programs, you can opt to use a binary interface instead. The binary versus ASCII setting is maintained on a per-file basis, so each program could each open /dev/gpio-event with a different ASCII/binary setting.&lt;br /&gt;
&lt;br /&gt;
The edge will be an R or an F depending on whether a rising or falling edge is being reported. The timestamp is a number with the integer portion being the current system time (as returned from the gettimeofday function) and the fractional portion reporting in microseconds.&lt;br /&gt;
&lt;br /&gt;
== Lauching a script ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can also be given the -e or --execute command line option, and the provided program or script will be launched with the same 3 paramters (gpio edge timestamp). For example:&lt;br /&gt;
 gpio-event --execute echo&lt;br /&gt;
&lt;br /&gt;
will produce similar output to&lt;br /&gt;
 gpio-event --monitor&lt;br /&gt;
&lt;br /&gt;
== Integrating/Building with Open Embedded ==&lt;br /&gt;
&lt;br /&gt;
In order to build the driver under OE, you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 cd to the directory containing org.embedded.dev&lt;br /&gt;
 svn co http://svn.hylands.org/linux/oe/user.collection user.collection&lt;br /&gt;
 bitbake task-gpio-all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will build the following packages for gpio-event:&lt;br /&gt;
 ./deploy/glibc/ipk/overo/gpio-event-module_svn20100218-r50.5_overo.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-event-app_svn20100218-r2.5_armv7a.ipk&lt;br /&gt;
&lt;br /&gt;
and these packages for the [[User GPIO Driver]]&lt;br /&gt;
 ./deploy/glibc/ipk/overo/gpio-module_svn20100218-r50.5_overo.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-app_svn20100218-r0.5_armv7a.ipk&lt;br /&gt;
 ./deploy/glibc/ipk/armv7a/gpio-lib_svn20100218-r0.5_armv7a.ipk&lt;br /&gt;
&lt;br /&gt;
Note that the numeric portions of the pathnames will almost certainly be different.&lt;br /&gt;
&lt;br /&gt;
[[Category: GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=4098</id>
		<title>GPIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=4098"/>
				<updated>2010-02-11T20:46:00Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added link to User GPIO Driver&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:100px&amp;quot;&lt;br /&gt;
| style=&amp;quot;background:yellow;&amp;quot; | GPIO(&amp;lt;i&amp;gt; n &amp;lt;/i&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Logic level (3.3V) signals &lt;br /&gt;
* 3-4mA max&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
all GPIO's information and examples should go here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
todo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
According to the PXA270 datasheet:&lt;br /&gt;
http://pubs.gumstix.com/documents/PXA%20Documentation/PXA270/PXA270%20Electrical,%20Mechanical,%20and%20Thermal%20Specification%20%5b280002-005%5d.pdf&lt;br /&gt;
most of the pins are limited to 3mA, and a few can go upto 4 mA (see page 5-9) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Accessing GPIO's from userland ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If proc-gpio is a module, add it to /etc/modules or do a modprobe proc-gpio.&lt;br /&gt;
&lt;br /&gt;
A number of files exist under /proc/gpio, one for each GPIO on the PXA processor.&lt;br /&gt;
&lt;br /&gt;
If you cat one of these files, you get, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /proc/gpio/GPIO12&lt;br /&gt;
12 GPIO in set&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That tells you — GPIO number, function (either GPIO, AF 1, AF 2, or AF 3), in|out, set|clear.&lt;br /&gt;
&lt;br /&gt;
You can change any of those values, by writing to the file, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;AF1 out&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets GPIO12 to AF1, out mode. (In the case of GPIO12, the PXA defines this function as putting out the 32kHz clock signal.) this is currently case-sensitive&lt;br /&gt;
&lt;br /&gt;
If you have the GPIO set to an output, and GPIO mode, you can set or clear the signal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;GPIO out set&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
# echo &amp;quot;GPIO out clear&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The alternative functions are described in the PXA255 Developer's Manual (link should be found in the Featured links-box) section 4.1.2.&lt;br /&gt;
&lt;br /&gt;
== Alternative method to access GPIO's from userland ==&lt;br /&gt;
&lt;br /&gt;
The [[User GPIO Driver]] provides a reflection of the kernel's gpiolib library into userspace.&lt;br /&gt;
&lt;br /&gt;
== gpio-event driver ==&lt;br /&gt;
&lt;br /&gt;
The [[GPIO Event Driver]] allows gpio changes to be captured from user-space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------&lt;br /&gt;
&lt;br /&gt;
Related pages on the old wiki:&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Tips_and_tricks#Access_GPIOs_from_user-space&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Sample_code/C/gpregs&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Kernel_programming&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
[[Category:Literature]]&lt;br /&gt;
[[Category:GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=User_GPIO_Driver&amp;diff=4097</id>
		<title>User GPIO Driver</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=User_GPIO_Driver&amp;diff=4097"/>
				<updated>2010-02-11T20:45:25Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Initial version of user-gpio driver page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the user GPIO driver, which is a reflection of the kernel's gpiolib API into user space.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The kernel provides an API, called gpiolib, which abstracts access to GPIO pins. It has a mechanism for exporting pins into userspace, and in general this is the preferred method of accessing gpio pins from userspace. This method works particularly well if it is setup for a given overo/daughtercard combination. However, since the kernel is often configured in a more generic manner, using the export method is inconvenient, so the user-gpio driver was created.&lt;br /&gt;
&lt;br /&gt;
WARNING: It is possible to damage your overo chip if you do things incorrectly. This code has no way of knowing for example, if a pin is physically connected to an output or not. If, for example, a GPIO pin was connected to Vcc, and you choose to configure that pin as an output and drive it low, you've essentially created a short circuit, and this can stress or damagethe pin, possibly bricking your processor. You have been warned.&lt;br /&gt;
&lt;br /&gt;
== Driver Sources ==&lt;br /&gt;
&lt;br /&gt;
The source code can be found [http://svn.hylands.org/linux/gpio/ here]. The app directory contains the example user mode application. The lib directory contains the usermode library which translates the C API into the appropriate ioctl calls into the kernel driver, and the module directory contains the loadable kernel module. The Makefiles have been setup such that if you define the environment variable OVEROTOP then you should be able to just type make in top level directory and both the app and module will be built.&lt;br /&gt;
&lt;br /&gt;
There are also some bitbake recipes in the [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-app gpio-app], [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-lib gpio-lib] and [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-module gpio-event-module] directories.&lt;br /&gt;
&lt;br /&gt;
[[Category: GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=4096</id>
		<title>GPIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=4096"/>
				<updated>2010-02-11T19:57:35Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added GPIO Category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:100px&amp;quot;&lt;br /&gt;
| style=&amp;quot;background:yellow;&amp;quot; | GPIO(&amp;lt;i&amp;gt; n &amp;lt;/i&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Logic level (3.3V) signals &lt;br /&gt;
* 3-4mA max&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
all GPIO's information and examples should go here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
todo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
According to the PXA270 datasheet:&lt;br /&gt;
http://pubs.gumstix.com/documents/PXA%20Documentation/PXA270/PXA270%20Electrical,%20Mechanical,%20and%20Thermal%20Specification%20%5b280002-005%5d.pdf&lt;br /&gt;
most of the pins are limited to 3mA, and a few can go upto 4 mA (see page 5-9) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Accessing GPIO's from userland ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If proc-gpio is a module, add it to /etc/modules or do a modprobe proc-gpio.&lt;br /&gt;
&lt;br /&gt;
A number of files exist under /proc/gpio, one for each GPIO on the PXA processor.&lt;br /&gt;
&lt;br /&gt;
If you cat one of these files, you get, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /proc/gpio/GPIO12&lt;br /&gt;
12 GPIO in set&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That tells you — GPIO number, function (either GPIO, AF 1, AF 2, or AF 3), in|out, set|clear.&lt;br /&gt;
&lt;br /&gt;
You can change any of those values, by writing to the file, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;AF1 out&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets GPIO12 to AF1, out mode. (In the case of GPIO12, the PXA defines this function as putting out the 32kHz clock signal.) this is currently case-sensitive&lt;br /&gt;
&lt;br /&gt;
If you have the GPIO set to an output, and GPIO mode, you can set or clear the signal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;GPIO out set&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
# echo &amp;quot;GPIO out clear&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The alternative functions are described in the PXA255 Developer's Manual (link should be found in the Featured links-box) section 4.1.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== gpio-event driver ==&lt;br /&gt;
&lt;br /&gt;
The [[GPIO Event Driver]] allows gpio changes to be captured from user-space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------&lt;br /&gt;
&lt;br /&gt;
Related pages on the old wiki:&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Tips_and_tricks#Access_GPIOs_from_user-space&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Sample_code/C/gpregs&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Kernel_programming&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
[[Category:Literature]]&lt;br /&gt;
[[Category:GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=Category:GPIO&amp;diff=4095</id>
		<title>Category:GPIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=Category:GPIO&amp;diff=4095"/>
				<updated>2010-02-11T19:56:32Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added GPIO category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These pages are all related to using GPIO pins.&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=4094</id>
		<title>GPIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO&amp;diff=4094"/>
				<updated>2010-02-11T19:54:14Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added link to new GPIO Event Driver page. Removed reference to docwiki page for gpio-event-driver&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:100px&amp;quot;&lt;br /&gt;
| style=&amp;quot;background:yellow;&amp;quot; | GPIO(&amp;lt;i&amp;gt; n &amp;lt;/i&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Logic level (3.3V) signals &lt;br /&gt;
* 3-4mA max&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
all GPIO's information and examples should go here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
todo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
According to the PXA270 datasheet:&lt;br /&gt;
http://pubs.gumstix.com/documents/PXA%20Documentation/PXA270/PXA270%20Electrical,%20Mechanical,%20and%20Thermal%20Specification%20%5b280002-005%5d.pdf&lt;br /&gt;
most of the pins are limited to 3mA, and a few can go upto 4 mA (see page 5-9) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Accessing GPIO's from userland ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If proc-gpio is a module, add it to /etc/modules or do a modprobe proc-gpio.&lt;br /&gt;
&lt;br /&gt;
A number of files exist under /proc/gpio, one for each GPIO on the PXA processor.&lt;br /&gt;
&lt;br /&gt;
If you cat one of these files, you get, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /proc/gpio/GPIO12&lt;br /&gt;
12 GPIO in set&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That tells you — GPIO number, function (either GPIO, AF 1, AF 2, or AF 3), in|out, set|clear.&lt;br /&gt;
&lt;br /&gt;
You can change any of those values, by writing to the file, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;AF1 out&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets GPIO12 to AF1, out mode. (In the case of GPIO12, the PXA defines this function as putting out the 32kHz clock signal.) this is currently case-sensitive&lt;br /&gt;
&lt;br /&gt;
If you have the GPIO set to an output, and GPIO mode, you can set or clear the signal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;GPIO out set&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
# echo &amp;quot;GPIO out clear&amp;quot; &amp;gt; /proc/gpio/GPIO12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The alternative functions are described in the PXA255 Developer's Manual (link should be found in the Featured links-box) section 4.1.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== gpio-event driver ==&lt;br /&gt;
&lt;br /&gt;
The [[GPIO Event Driver]] allows gpio changes to be captured from user-space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------&lt;br /&gt;
&lt;br /&gt;
Related pages on the old wiki:&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Tips_and_tricks#Access_GPIOs_from_user-space&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Sample_code/C/gpregs&lt;br /&gt;
&lt;br /&gt;
http://docwiki.gumstix.org/index.php/Kernel_programming&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
[[Category:Literature]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4092</id>
		<title>GPIO Event Driver</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4092"/>
				<updated>2010-02-11T17:49:28Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: moved GpioEventDriver to GPIO Event Driver:&amp;amp;#32;Forgot how the title stuff worked&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the gpio-event driver, which allows multiple GPIO lines to be monitored from user-space.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event driver consists of a loadable kernel module, which registers an interrupt handler, along with an example user-mode program, which allows the settings to be manipulated and changes to be reported.&lt;br /&gt;
&lt;br /&gt;
== Driver Sources ==&lt;br /&gt;
&lt;br /&gt;
The source code can be found [http://svn.hylands.org/linux/gpio-event/ here]. The app directory contains the example user mode application, and the module directory contains the loadable kernel module. The Makefiles have been setup such that if you define the environment variable OVEROTOP then you should be able to just type make in top level directory and both the app and module will be built.&lt;br /&gt;
&lt;br /&gt;
There are also some bitbake recipes in the [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-app gpio-event-app] and [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-module gpio-event-module] directories.&lt;br /&gt;
&lt;br /&gt;
== Adding pins to be monitored ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can be used to add gpio pins to be monitored. Simply run the gpio-event program, passing it a pin specification of the form: pin:edge:debounce. pin should be the GPIO number that you want to monitor. Edge should be r, f, or b to monitor rising, falling, or both edges, and debounce should be the number of milliseconds of debounce that you'd like. A debounce of 0 may be used for &amp;quot;clean&amp;quot; signals. For example:&lt;br /&gt;
 gpio-event 58:f:20 59:r:20 60:b:20&lt;br /&gt;
&lt;br /&gt;
would cause gpio 58 to be monitored for falling edges, gpio 59 to be monitored for rising edges, and gpio 60 to be monitored for both rising and falling edges. Each pin will have a debounce of 20 milliseconds (which should be adequate for most pushbuttons).&lt;br /&gt;
&lt;br /&gt;
You can pass as many pins to be monitored as you'd like on the command line. Each call is cumulative. If you specify the same pin, the new specification will override whatever is currently set. You can see the current pins being monitored by using:&lt;br /&gt;
 cat /proc/gpio-event/pins&lt;br /&gt;
&lt;br /&gt;
Passing in a negative gpio number will cause the pin to stop being monitored.&lt;br /&gt;
&lt;br /&gt;
== Detecting events ==&lt;br /&gt;
&lt;br /&gt;
Once pins are setup to be monitored, any program can read /dev/gpio-event to get notified of the events. By default, an ASCII string of the form: &amp;quot;pin edge timestamp&amp;quot; followed by a newline will be delievered to /dev/gpio-event for each event that occurs. Running gpio-event with the -m or --monitor command line will cause the events to be monitored and printed. You could also use the command:&lt;br /&gt;
 cat /dev/gpio-event&lt;br /&gt;
&lt;br /&gt;
to achieve a similar result. For C programs, you can opt to use a binary interface instead. The binary versus ASCII setting is maintained on a per-file basis, so each program could each open /dev/gpio-event with a different ASCII/binary setting.&lt;br /&gt;
&lt;br /&gt;
The edge will be an R or an F depending on whether a rising or falling edge is being reported. The timestamp is a number with the integer portion being the current system time (as returned from the gettimeofday function) and the fractional portion reporting in microseconds.&lt;br /&gt;
&lt;br /&gt;
== Lauching a script ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can also be given the -e or --execute command line option, and the provided program or script will be launched with the same 3 paramters (gpio edge timestamp). For example:&lt;br /&gt;
 gpio-event --execute echo&lt;br /&gt;
&lt;br /&gt;
will produce similar output to&lt;br /&gt;
 gpio-event --monitor&lt;br /&gt;
&lt;br /&gt;
[[Category: GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GpioEventDriver&amp;diff=4093</id>
		<title>GpioEventDriver</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GpioEventDriver&amp;diff=4093"/>
				<updated>2010-02-11T17:49:28Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: moved GpioEventDriver to GPIO Event Driver:&amp;amp;#32;Forgot how the title stuff worked&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[GPIO Event Driver]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4091</id>
		<title>GPIO Event Driver</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=GPIO_Event_Driver&amp;diff=4091"/>
				<updated>2010-02-11T17:39:25Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Initial version of gpio-event for the new wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the gpio-event driver, which allows multiple GPIO lines to be monitored from user-space.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event driver consists of a loadable kernel module, which registers an interrupt handler, along with an example user-mode program, which allows the settings to be manipulated and changes to be reported.&lt;br /&gt;
&lt;br /&gt;
== Driver Sources ==&lt;br /&gt;
&lt;br /&gt;
The source code can be found [http://svn.hylands.org/linux/gpio-event/ here]. The app directory contains the example user mode application, and the module directory contains the loadable kernel module. The Makefiles have been setup such that if you define the environment variable OVEROTOP then you should be able to just type make in top level directory and both the app and module will be built.&lt;br /&gt;
&lt;br /&gt;
There are also some bitbake recipes in the [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-app gpio-event-app] and [http://svn.hylands.org/linux/oe/user.collection/recipes/gpio-event-module gpio-event-module] directories.&lt;br /&gt;
&lt;br /&gt;
== Adding pins to be monitored ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can be used to add gpio pins to be monitored. Simply run the gpio-event program, passing it a pin specification of the form: pin:edge:debounce. pin should be the GPIO number that you want to monitor. Edge should be r, f, or b to monitor rising, falling, or both edges, and debounce should be the number of milliseconds of debounce that you'd like. A debounce of 0 may be used for &amp;quot;clean&amp;quot; signals. For example:&lt;br /&gt;
 gpio-event 58:f:20 59:r:20 60:b:20&lt;br /&gt;
&lt;br /&gt;
would cause gpio 58 to be monitored for falling edges, gpio 59 to be monitored for rising edges, and gpio 60 to be monitored for both rising and falling edges. Each pin will have a debounce of 20 milliseconds (which should be adequate for most pushbuttons).&lt;br /&gt;
&lt;br /&gt;
You can pass as many pins to be monitored as you'd like on the command line. Each call is cumulative. If you specify the same pin, the new specification will override whatever is currently set. You can see the current pins being monitored by using:&lt;br /&gt;
 cat /proc/gpio-event/pins&lt;br /&gt;
&lt;br /&gt;
Passing in a negative gpio number will cause the pin to stop being monitored.&lt;br /&gt;
&lt;br /&gt;
== Detecting events ==&lt;br /&gt;
&lt;br /&gt;
Once pins are setup to be monitored, any program can read /dev/gpio-event to get notified of the events. By default, an ASCII string of the form: &amp;quot;pin edge timestamp&amp;quot; followed by a newline will be delievered to /dev/gpio-event for each event that occurs. Running gpio-event with the -m or --monitor command line will cause the events to be monitored and printed. You could also use the command:&lt;br /&gt;
 cat /dev/gpio-event&lt;br /&gt;
&lt;br /&gt;
to achieve a similar result. For C programs, you can opt to use a binary interface instead. The binary versus ASCII setting is maintained on a per-file basis, so each program could each open /dev/gpio-event with a different ASCII/binary setting.&lt;br /&gt;
&lt;br /&gt;
The edge will be an R or an F depending on whether a rising or falling edge is being reported. The timestamp is a number with the integer portion being the current system time (as returned from the gettimeofday function) and the fractional portion reporting in microseconds.&lt;br /&gt;
&lt;br /&gt;
== Lauching a script ==&lt;br /&gt;
&lt;br /&gt;
The gpio-event program can also be given the -e or --execute command line option, and the provided program or script will be launched with the same 3 paramters (gpio edge timestamp). For example:&lt;br /&gt;
 gpio-event --execute echo&lt;br /&gt;
&lt;br /&gt;
will produce similar output to&lt;br /&gt;
 gpio-event --monitor&lt;br /&gt;
&lt;br /&gt;
[[Category: GPIO]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=Help:Editing&amp;diff=4090</id>
		<title>Help:Editing</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=Help:Editing&amp;diff=4090"/>
				<updated>2010-02-11T17:30:30Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Copied Editing:help from the old wiki since it doesn't seem to exist in the new wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [http://en.wikipedia.org/wiki/Wikipedia:Quick_guide Quick guide] shows some of the simple ways of doing things.&lt;br /&gt;
&lt;br /&gt;
The [http://en.wikipedia.org/wiki/Help:Wiki_markup_examples Wiki markup examples] goes into more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Wiki]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=Category:Setup_-_Psyco_JIT_compiler_for_Overo_build_environment_for_Fedora_10&amp;diff=3835</id>
		<title>Category:Setup - Psyco JIT compiler for Overo build environment for Fedora 10</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=Category:Setup_-_Psyco_JIT_compiler_for_Overo_build_environment_for_Fedora_10&amp;diff=3835"/>
				<updated>2009-08-26T15:18:26Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added note about Psyco and 64-bit architectures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
==Download Psyco JIT compiler sources from svn==&lt;br /&gt;
 svn co http://codespeak.net/svn/psyco/dist/ psyco-dist/&lt;br /&gt;
&lt;br /&gt;
==Run the python installation script as a super user==&lt;br /&gt;
cd psyco-dist&lt;br /&gt;
 &lt;br /&gt;
su python setup.py install&lt;br /&gt;
&lt;br /&gt;
==Note: Psyco only supported on 32-bit architectures==&lt;br /&gt;
If you download and try to install Psyco on a 64-bit architecture, you'll get the following error:&lt;br /&gt;
 c/codegen.h:15:3: error: #error &amp;quot;-----------------------------------------------------&amp;quot;&lt;br /&gt;
 c/codegen.h:16:3: error: #error &amp;quot;Sorry, non-32-bit platforms are not supported at all.&amp;quot;&lt;br /&gt;
 c/codegen.h:17:3: error: #error &amp;quot;You may try with a Python compiled in 32-bit         &amp;quot;&lt;br /&gt;
 c/codegen.h:18:3: error: #error &amp;quot;compatibility mode.  Note that Psyco will probably   &amp;quot;&lt;br /&gt;
 c/codegen.h:19:3: error: #error &amp;quot;never support non-32-bit platforms, as it is no      &amp;quot;&lt;br /&gt;
 c/codegen.h:20:3: error: #error &amp;quot;longer actively developed.  Instead, the PyPy group  &amp;quot;&lt;br /&gt;
 c/codegen.h:21:3: error: #error &amp;quot;plans to replace it with a more flexible and easily  &amp;quot;&lt;br /&gt;
 c/codegen.h:22:3: error: #error &amp;quot;retargettable Psyco-for-PyPy during the year 2006.   &amp;quot;&lt;br /&gt;
 c/codegen.h:23:3: error: #error &amp;quot;See http://codespeak.net/pypy/                       &amp;quot;&lt;br /&gt;
 c/codegen.h:24:3: error: #error &amp;quot;-----------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:How_to_-_general]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	<entry>
		<id>https://wiki.gumstix.com/index.php?title=Robostix_toolchain&amp;diff=3820</id>
		<title>Robostix toolchain</title>
		<link rel="alternate" type="text/html" href="https://wiki.gumstix.com/index.php?title=Robostix_toolchain&amp;diff=3820"/>
				<updated>2009-08-24T17:40:13Z</updated>
		
		<summary type="html">&lt;p&gt;Dhylands: Added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes setting up the AVR toolchain, needed to build code for the robostix and roboaudiostix boards.&lt;br /&gt;
&lt;br /&gt;
==Install compiler==&lt;br /&gt;
&lt;br /&gt;
When things work, you can do the following under ubuntu:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install gcc-avr avr-libc gawk&lt;br /&gt;
&lt;br /&gt;
However, some versions of avr-libc will give you compile errors when trying to build the i2c bootloader. (the error will mention __eerd_block). Ubuntu 9.04 installs a version of avr-libc with this problem. See below for details on manually installing a newer runtime library.&lt;br /&gt;
&lt;br /&gt;
==Manually install runtime library==&lt;br /&gt;
&lt;br /&gt;
The following steps can be used to install (or replace) the avr runtime library (avr-libc). Ubuntu-9.04 installs version 1.6.2, which has some issues.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;wget http://mirror.csclub.uwaterloo.ca/nongnu/avr-libc/avr-libc-1.6.7.tar.bz2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 tar xjf avr-libc-1.6.7.tar.bz2&lt;br /&gt;
 cd avr-libc-1.6.7/&lt;br /&gt;
 ./configure --build=`./config.guess` --host=avr --prefix=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
[[Category:How_to_-_robotics]]&lt;/div&gt;</summary>
		<author><name>Dhylands</name></author>	</entry>

	</feed>