esp-idf/examples/21_gpio
Wangjialin ade7ee2092 gpio_driver: add per-pin interrupt handlers
1. add ISR handler apis so that users of different layers can hook their own isr handler on different GPIO.
    Audio project has different software layers, they need different gpio isr handler for layer instead of processing all GPIO interrupts in one handler.
    If this kind of calling a handler from isr is not proper, please kindly point out.
2. add gpio example code.
3. improve gpio.rst
4. add readme for gpio example

Squashed commits:
[278e50f] update: GPIO
1. coding style, add a space between conditional or loop keyword and an opening paren.
2. modify some return value and doc
3. use printf in example code
Squashed commits:
[efb23bb] minor change of comment
2016-12-29 11:16:32 +08:00
..
main gpio_driver: add per-pin interrupt handlers 2016-12-29 11:16:32 +08:00
Makefile gpio_driver: add per-pin interrupt handlers 2016-12-29 11:16:32 +08:00
README.md gpio_driver: add per-pin interrupt handlers 2016-12-29 11:16:32 +08:00

README.md

Example: GPIO

###This test code shows how to configure gpio and how to use gpio interrupt.

####GPIO functions:

  • GPIO18: output
  • GPIO19: output
  • GPIO4: input, pulled up, interrupt from rising edge and falling edge
  • GPIO5: input, pulled up, interrupt from rising edge.

####Test:

  • Connect GPIO18 with GPIO4
  • Connect GPIO19 with GPIO5
  • Generate pulses on GPIO18/19, that triggers interrupt on GPIO4/5