Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
en:c2_hardware_irq [2016/04/26 11:22] charles.park created |
en:c2_hardware_irq [2017/03/02 11:05] odroid [Hardware GPIO-IRQ] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Hardware GPIO-IRQ ====== | ====== Hardware GPIO-IRQ ====== | ||
---- | ---- | ||
- | **ODROID-C1** supports the GPIO interrupt of Edge trigger.\\ | + | **ODROID-C2** supports the GPIO interrupt of Edge trigger.\\ |
The maximum number of interrupt is limited to 8 when you use the falling(Low) or rising(High) edge trigger.\\ | The maximum number of interrupt is limited to 8 when you use the falling(Low) or rising(High) edge trigger.\\ | ||
- | If you use the Both (rising and falling together) edge triggers, the maximum number is only 4. | + | If you use the Both (rising and falling together) edge triggers, the maximum number is only 4. \\ |
- | You must use the **Linux 3.10.79-87 June** or higher to use the GPIO interrupt in the user-land. | + | Please note that SD card driver is using 2 interrupts to implement the card detection (insertion/remove) by default.\\ |
+ | So __**we can use only GPIO 6 IRQs**__. | ||
+ | |||
+ | You must use the **Linux Kernel 3.14.29-56 Apr** or higher to use the GPIO interrupt in the user-land. | ||
===== Usage ===== | ===== Usage ===== | ||
To use the GPIO Interrupt in the User space, you must export the GPIO and add the Trigger option in Edge parameter.\\ | To use the GPIO Interrupt in the User space, you must export the GPIO and add the Trigger option in Edge parameter.\\ | ||
- | GPIO SYSFS node is accessible via **/sys/class/aml_gpio/**. The access method is exactly same as /sys/class/gpio.\\ | + | GPIO SYSFS node is accessible via **/sys/class/gpio/**.\\ |
=== GPIO Export === | === GPIO Export === | ||
- | echo [GPIO Number(Refer **[[en:c1_hardware|Expansion Connectors]]** )] > /sys/class/aml_gpio/export | + | echo [GPIO Number(Refer **[[en:c2_hardware#expansion_connectors]]** )] > /sys/class/gpio/export |
- | e.g) GPIOY.BIT3 Export (Pin Number 7) | + | e.g) GPIOX.BIT21 Export (Pin Number 7) |
<code> | <code> | ||
- | echo 83 > /sys/class/aml_gpio/export | + | echo 249 > /sys/class/gpio/export |
</code> | </code> | ||
Line 33: | Line 36: | ||
== Run == | == Run == | ||
+ | |||
+ | "Usage: aml_gpio_irq [GPIO Number]" | ||
<code> | <code> | ||
- | sudo aml_gpio_irq_test [GPIO Number] | + | sudo aml_gpio_irq_test 249 |
</code> | </code> | ||
Line 55: | Line 60: | ||
//[*]-------------------------------------------------------------------------[*] | //[*]-------------------------------------------------------------------------[*] | ||
- | #define SYSFS_GPIO_DIR "/sys/class/aml_gpio" | + | #define SYSFS_GPIO_DIR "/sys/class/gpio" |
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */ | #define POLL_TIMEOUT (3 * 1000) /* 3 seconds */ | ||
#define MAX_BUF 64 | #define MAX_BUF 64 | ||
Line 288: | Line 293: | ||
+ | |||
+ | ===== Kernel driver GPIO IRQ Example code by crashoverride ===== | ||
+ | |||
+ | [[http://forum.odroid.com/viewtopic.php?f=112&t=18559|HC-SR04 kernel driver]] | ||