You can handle MSPM0 interrupts via the traditional service request handler. But it also has a messaging system. With message handlers, you can route notifications from one peripheral to another.
In this example: react on a button click and toggle a LED. With the EasyL1105 kit.

This is TI's event_input_triggers_output example. SysConfig adapted to EasyL1105.
What does the project do?
- When you press or release the user button, an trigger is generated. It's set up to send an event message.
- The led pin is set up to toggle when it receives an event
- result is that the led chan ges state when you push or release the user button. A manual blinky
All of this is configuration. There is no logic related to this on the C source.

image: excerpt from TI MSPM0 EVENT module introduction
Resources used:
| LED 1 | PA27 |
| USER BUTTON | PA16 |
| Event channel |
1 |
Resources not used: TI's project uses the clock tree. I've switched it off and use the default clock.

image source: EasyL1105 GitHub project
Button configuration

LED configuration

check Event
You don't have to set anything here. It's a result of configuring the button and LED GPIOs.

main
The code just sets the controller in a low power mode that allows execution of interrupts. All our logic is managed by the setup we just did.
#include "ti_msp_dl_config.h"
int main(void)
{
SYSCFG_DL_init();
/* Calling WFI after calling DL_SYSCTL_enableSleepOnExit will result in
* only ISR code to be executed. This is done to showcase the device's
* low power consumption when sleeping.
*/
DL_SYSCTL_enableSleepOnExit();
while (1) {
__WFI();
}
}I designed this in VS Code, starting from the template project MSPM0 project with VS Code, CMake and GCC - part 6: empty "template" project . That VS Code project is attached.

If you use Code Composer Studio, you can create the project from the New Project wizard. Both choices will work the same.
Thank you for reading.
VS Code project for EasyL1105: EasyL1105_event_input_triggers_output.zip
part of the EasyL1105 series. all posts
-
shabaz
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
-
Jan Cumps
in reply to shabaz
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Comment-
Jan Cumps
in reply to shabaz
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Children