Changes between Version 10 and Version 11 of gpio


Ignore:
Timestamp:
11/29/2018 04:13:30 PM (3 months ago)
Author:
Cale Collins
Comment:

double edge trigger section added.

Legend:

Unmodified
Added
Removed
Modified
  • gpio

    v10 v11  
    449449 * 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)
    450450
    451 
    452451BSP Specific notes:
    453452 * 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.
    454453 * Android can map Linux input events to Android key events via a !KeyLayout file - see [wiki:Android/OSDevelopment#gpio-pushbutton here] for details.
    455454
    456 
    457 References:
     455=== Double edge trigger
     456
     457OcteonTX GPIO's support double edge trigger, this will create an IRQ for both the leading and falling edge of a signal. 
     458
     459Here is an example using a GW6304. 
     460
     461Create an input GPIO and "high" GPIO, these are CPU-DIO's: 
     462
     463Connect 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
     467echo 488 > /sys/class/gpio/export
     468echo in > /sys/class/gpio/gpio488/direction
     469echo both > /sys/class/gpio/gpio488/edge
     470#Create "high" GPIO
     471echo 489 > /sys/class/gpio/export
     472echo out > /sys/class/gpio/gpio489/direction
     473echo 1 > /sys/class/gpio/gpio489/value
     474}}}
     475Watch IRQ events:
     476{{{#!bash
     477watch -n 0.5 cat /proc/interrupts
     478}}}
     479Look for "GPIO 24 Edge" IRQ count increases on both edges of signal. 
     480
     481==== References
    458482 * 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]
    459483 * 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]
     
    472496 * [wiki:ventana/DigitalIO Ventana product family Digital I/O]
    473497 * [wiki:newport/DigitalIO Newport product family Digital I/O]
     498