Skip to content

External Interrupt Handler

lbuild module: modm:platform:extint

This driver provides an API for configuring all IRQ lines via register access.

// Powers on the LED on the low->high transition, and off on high->low.
                                [](Gpio::InputTrigger_t triggers) {
                                    Led::set(!!(triggers & Gpio::InputTrigger::RisingEdge));

// Toggles LED each time gpio input is at the high level.
                                [](Gpio::InputTrigger_t) { Led::toggle(); });

Multicore mode

Each core can register callbacks in the same IntHandler, but for the different pins (current implementation's constraint).

Also, enable/disable and connect/disconnect calls affect the NVIC of the executing core only.


The callback is implemented using modm::inplace_function, therefore uses no heap, but has a fixed storage size of sizeof(void*) by default. You can increase this storage size by defining a new global storage size MODM_EXTINT_HANDLER_STORAGE=bytes in your project.xml:

    <collect name="modm:build:cppdefines">MODM_EXTINT_HANDLER_STORAGE=12</collect>

IRQ Types

You can explicitly enable or disable handling of the specific IRQ type in your project.xml:

    <option name="modm:platform:extint:gpio">no</option>
    <option name="modm:platform:extint:qspi">yes</option>

This module is only available for rp2040.



Enable IRQ support for GPIO

Default: yes
Inputs: [yes, no]


Enable IRQ support for QSPI

Default: no
Inputs: [yes, no]


modm:platform:extint modm_platform_extint modm: platform: extint modm_architecture_interrupt modm: architecture: interrupt modm_platform_extint->modm_architecture_interrupt modm_cmsis_device modm: cmsis: device modm_platform_extint->modm_cmsis_device modm_platform_gpio modm: platform: gpio modm_platform_extint->modm_platform_gpio

Limited availability: Check with 'lbuild discover' if this module is available for your target!