modm API documentation
|
Classes | |
class | modm::platform::Exti |
Macros | |
#define | MODM_EXTI_HANDLER_STORAGE sizeof(void*) |
lbuild module: modm:platform:exti
This driver provides an API for configuring all EXTI lines via register access. Note that you need to pass a mask, which allows you to configure multiple EXTI lines at once.
A typical use-case is to trigger on multiple GPIO inputs:
Note that you can also use this to configure more than just GPIO trigger sources, you can configure all other device specific EXTI lines as well. However, you need to manually configure the NVIC vector and possibly also configure the sending peripheral separately.
You can also trigger events instead of interrupts to facilitate WFE.
To simplify the external IRQ management of external GPIO triggers, you can use the connect method to attach a void(uint8_t)
callback to EXTI lines 0-15, which gets passed the triggered line number as an argument:
MODM_ISR(EXTI*)
IRQs, so you cannot define them anymore in your application!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_EXTI_HANDLER_STORAGE=bytes
in your project.xml
:
Generated with: yes in [yes, no]