From 8e938957c2d66a35274d0c8a800b595c02b181af Mon Sep 17 00:00:00 2001 From: dulibo1 Date: Wed, 8 Nov 2023 11:14:54 +0800 Subject: [PATCH] gpio:add example for wakeup gpio type Signed-off-by: dulibo1 --- examples/gpio/gpio_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/gpio/gpio_main.c b/examples/gpio/gpio_main.c index 9793fbba4..c097a265f 100644 --- a/examples/gpio/gpio_main.c +++ b/examples/gpio/gpio_main.c @@ -67,6 +67,12 @@ static void show_usage(FAR const char *progname) fprintf(stderr, "\t 8: GPIO_INTERRUPT_RISING_PIN\n"); fprintf(stderr, "\t 9: GPIO_INTERRUPT_FALLING_PIN\n"); fprintf(stderr, "\t10: GPIO_INTERRUPT_BOTH_PIN\n"); + fprintf(stderr, "\t11: GPIO_INTERRUPT_PIN_WAKEUP\n"); + fprintf(stderr, "\t12: GPIO_INTERRUPT_HIGH_PIN_WAKEUP\n"); + fprintf(stderr, "\t13: GPIO_INTERRUPT_LOW_PIN_WAKEUP\n"); + fprintf(stderr, "\t14: GPIO_INTERRUPT_RISING_PIN_WAKEUP\n"); + fprintf(stderr, "\t15: GPIO_INTERRUPT_FALLING_PIN_WAKEUP\n"); + fprintf(stderr, "\t16: GPIO_INTERRUPT_BOTH_PIN_WAKEUP\n"); } /**************************************************************************** @@ -308,6 +314,12 @@ int main(int argc, FAR char *argv[]) case GPIO_INTERRUPT_RISING_PIN: case GPIO_INTERRUPT_FALLING_PIN: case GPIO_INTERRUPT_BOTH_PIN: + case GPIO_INTERRUPT_PIN_WAKEUP: + case GPIO_INTERRUPT_HIGH_PIN_WAKEUP: + case GPIO_INTERRUPT_LOW_PIN_WAKEUP: + case GPIO_INTERRUPT_RISING_PIN_WAKEUP: + case GPIO_INTERRUPT_FALLING_PIN_WAKEUP: + case GPIO_INTERRUPT_BOTH_PIN_WAKEUP: { printf(" Interrupt pin: Value=%u\n", invalue);