I’ve got an app (EFM32GG11) that has several interrupt sources (UART RX, gpio, timers). We’d like to put it into LEM mode and wake it on a specific GPIO pin edge. In all the examples it appears that the chip will wake on any interrupt. We’ve got a peripheral that might be sending data on the UART while the CPU is in LEM and we’d like to ignore it.
Is there a way to assign a ‘wake’ interrupt to a specific source?
Thank you for asking a question regarding interrupt in our community forum.
By definition any interruption that is enabled in the peripheral's IEN register and in the NVIC will wake up the core so if you don't want a specific type of interrupt to wake your device you shouldn't enable it.
In the case of GPIO interruption, you can configure which port/pin combination will trigger an interruption and you can chose which edge (rising/falling or both) will trigger it. For this I suggest that you use the emlib GPIO API, specifically the function GPIO_ExtIntConfig
Each peripheral has it's own handler which will be called upon a previously enabled interrupt been triggered. In the case of the GPIO pin interrupts we have the GPIO_EVEN_IRQHandler and GPIO_ODD_IRQHandler, the pin number determines the handler that will be called. If you have multiple ODD GPIO pins configured as interrupt sources then you'll need to verify which one actually was the source of the interruption inside the handler.
You can always check our GitHub peripheral examples repository for basic projects that show how to use the peripherals of our devices. In your case you may be interested in the following:
if an IRQ is enabled the MCU has no other option than to exit low power mode, and run the ISR snippet in its HFRC mode.
You can simply tell it to go back to low-power mode after IRQ is done, use a flag system to tell to loop in EM2 mode if no flag.
There is an EM4 mode that will not run any general IRQ's and only wake up on EM4-compatible gpio IRQ,
so maybe that could work for you.
But it's nearly the same as a reset though.