Changes between Version 10 and Version 11 of gpio
- Timestamp:
- 11/30/2018 12:13:30 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
gpio
v10 v11 449 449 * The gpio node needs to be at the top level and its placement is arbitrary however its customary to put it in alphabetical order (thus between the '''chosen''' node and the '''leds''' node) 450 450 451 452 451 BSP Specific notes: 453 452 * OpenWrt replaces the gpio-keys and gpio-keys-polled Linux driver with their out-of-tree driver called gpio-button-hotplug which instead of emiting linux input events emits uevent messages to the button subsystem which tie into the OpenWrt hotplug daemon. See the [wiki:OpenWrt/gpio#button-hotplug-gw OpenWrt/gpio page] for more details. 454 453 * Android can map Linux input events to Android key events via a !KeyLayout file - see [wiki:Android/OSDevelopment#gpio-pushbutton here] for details. 455 454 456 457 References: 455 === Double edge trigger 456 457 OcteonTX GPIO's support double edge trigger, this will create an IRQ for both the leading and falling edge of a signal. 458 459 Here is an example using a GW6304. 460 461 Create an input GPIO and "high" GPIO, these are CPU-DIO's: 462 463 Connect Push button normally open (push-to-make switch) between leads attached to J13 pin 1 and 2. 464 465 {{{#!bash 466 #Create double edge input GPIO 467 echo 488 > /sys/class/gpio/export 468 echo in > /sys/class/gpio/gpio488/direction 469 echo both > /sys/class/gpio/gpio488/edge 470 #Create "high" GPIO 471 echo 489 > /sys/class/gpio/export 472 echo out > /sys/class/gpio/gpio489/direction 473 echo 1 > /sys/class/gpio/gpio489/value 474 }}} 475 Watch IRQ events: 476 {{{#!bash 477 watch -n 0.5 cat /proc/interrupts 478 }}} 479 Look for "GPIO 24 Edge" IRQ count increases on both edges of signal. 480 481 ==== References 458 482 * gpio-keys [http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/input/keyboard/gpio_keys.c driver] and [https://lxr.missinglinkelectronics.com/linux/Documentation/devicetree/bindings/input/gpio-keys.txt device-tree bindings] 459 483 * gpio-keys-polled [http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/input/keyboard/gpio_keys_polled.c driver] and [https://lxr.missinglinkelectronics.com/linux/Documentation/devicetree/bindings/input/gpio-keys-polled.txt device-tree bindings] … … 472 496 * [wiki:ventana/DigitalIO Ventana product family Digital I/O] 473 497 * [wiki:newport/DigitalIO Newport product family Digital I/O] 498