liam-geotab opened a new pull request, #19853: URL: https://github.com/apache/nuttx/pull/19853
## Summary Add a `stm32_gpiosetevent` implementation to support GPIO interrupts. Add `board_button_irq` and "buttons" defconfig for nucleo-h563zi to exercise the working interrupt functionality. Update MCU family peripheral docs and board docs. arch/arm/src/stm32h5/stm32_exti_gpio.c is copied from the stm32u5 implementation and some necessary extra changes were added. See them by diffing stm32u5/stm32_exti_gpio.c and stm32h5/stm32_exti_gpio.c. The magic numbers added are admittedly unclear so please advise whether to create defines for them. I copied arch/arm/src/stm32u5/hardware/stm32_exti.h (per the original patch) but omitted the "Register Bitfield Definitions" because they are not used and they are not correct (for U5 either). The buttons defconfig is based on the nsh defconfig with the following configs enabled from menuconfig: ``` CONFIG_ARCH_IRQBUTTONS=y CONFIG_EXAMPLES_BUTTONS=y CONFIG_INPUT=y CONFIG_INPUT_BUTTONS=y CONFIG_INPUT_BUTTONS_LOWER=y ``` There are other minimal defconfigs elsewhere in the repo like this, also named "buttons". ## Impact The changes are additive. It's consistent with other STM32 support for the same feature. Enabling EXTI GPIO interrupts is now possible on stm32h5. ## Testing You can test this change by using the added "buttons" defconfig for nucleo-h563zi. ``` nsh> buttons buttons_main: Starting the button_daemon buttons_main: button_daemon started button_daemon: Running button_daemon: Opening /dev/buttons button_daemon: Supported BUTTONs 0x01 nsh> Sample = 1 Sample = 0 Sample = 1 Sample = 0 ``` I confirmed it doesn't work when the critical parts of stm32_gpiosetevent are removed. In particular, it doesn't work when the stm32u5 implementation is used without the added modifications described in the summary. Besides that reproducible verification, this change has also been used in production for some months. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
