Using an ESP32, I have GPIO inputs on pins 26, 27, 14, 34, 32, and 35. I am using this code snippet to enable interrupt handlers:
Code: Select all
void enable_button_input_isr (gpio_num_t gpio_pin, void* pvUser) {
{
gpio_config_t config = {};
config.intr_type = GPIO_INTR_ANYEDGE;
config.pin_bit_mask = 1ull << gpio_pin;
config.mode = GPIO_MODE_INPUT;
::gpio_config (&config);
}
::printf ("# enable button interrupt on %d\n", int (gpio_pin));
::gpio_isr_handler_add (gpio_pin, button_isr, pvUser);
::gpio_intr_enable (gpio_pin); }
Cheers