This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF51822 and Zephyr: GPIO interrupt on multiple GPIOs

Hello, guys!

I am using nRF51822 SoC with Zephyr. There is a need to configure multiple GPIOs as inputs, with the possibility to fire an interrupt on rising/falling/both edges.
The following piece of code is used to configure one single GPIO:

#define GPIO_PORT DT_LABEL(DT_NODELABEL(gpio0))
const struct device *gpio0;
struct gpio_callback callback;
void Touch1IrqCallback(const struct device *port, struct gpio_callback *cb, gpio_port_pins_t pins);
    
gpio0 = device_get_binding(GPIO_PORT);

gpio_pin_configure(gpio0, Pin1, GPIO_INPUT | GPIO_PULL_UP);
gpio_pin_interrupt_configure(gpio0, Pin1, GPIO_INT_EDGE_BOTH);
gpio_init_callback(&callback, Touch1IrqCallback, BIT(Pin1));    
gpio_add_callback(gpio0, &callback);



Everything works well until the point when I want to configure 3rd GPIO the same way. At that moment, gpio_pin_interrupt_configure() function returns -19 which is the code for ENODEV.

Is there anything I am missing or I am not aware of? Can we configure multiple nRF51822 GPIOs to fire an interrupt?

Related