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

How to use sense-edge-mask?

I am registering interrupts for many pins:

static struct gpio_callback pin_cb_data;
void pin_toggled(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
    printk("Pin toggled");
}

const struct device * gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0));

for (int pin = 11 ; pin <= 21 ; pin++) {
    printk("%u ", gpio_pin_interrupt_configure(gpio_dev, pin, GPIO_INT_EDGE_BOTH));
}
gpio_init_callback(&pin_cb_data, pin_toggled, 0xFFFFFFFF);
gpio_add_callback(gpio_dev, &pin_cb_data);

This only works for the first 8 pins, because from what I understand the GPIOTE peripheral is used and that has only 8 channels.

As a solution I found that I should use sense-edge-mask in my device tree:

&gpio0 {
	status = "okay";
	sense-edge-mask = < 0xffffffff >;
};

However, with this setting, the interrupts don't work at all.

Do I need to change my code as well in addition to the device tree setting?

Related