24.4.1 Initialization
To enable event routing within the system, the Event Users Multiplexer and Event Channels must be
selected in the Event System (EVSYS), and the two peripherals that generate and use the
event must be configured. The recommended sequence is:
- In the event user peripheral,
corresponding to the configuration in step 2a:
- Configure the action to be executed upon receiving an event by writing to the Event Action bits (EVACT) in the respective Event control register (e.g., TCn.EVCTRL.EVACT). Note: Not all peripherals require this step.
- Enable event input by
writing a ‘
1’ to the respective Event Input Enable bit ("EI") in the peripheral's Event Control register (e.g., ADCn.EVCTRL.STARTEI).
- Configure the EVSYS:
- Configure which channel Event User n should use by writing to the respective User n Channel Selection register (EVSYS.USER[n]). Refer to Event Users for all available event users.
- Configure which path event channel n should use by writing to the respective Path Selection bit field in the Channel n Control register (EVSYS.CHANNEL[n].PATH).
- Optional: Configure the edge detection of channel n by writing to the Edge Detection Selection bit field in the Channel n Control register (EVSYS.CHANNEL[n].EDGESEL).
- Configure which event generator channel n should use, corresponding to the configuration in step 1, by writing to the Event Generator bit field in the Channel n Control register (EVSYS.CHANNEL[n].EVGEN). Refer to Event Generators for all available event generators.
Note: To use the EVSYS, other parts of the system must be configured first. Refer to the Dependencies section for further information. - In the peripheral generating the
event, enable event output by writing a ‘
1’ to the respective Event Output Enable bit ("EO") in the peripheral's Event Control register (e.g., TCCn.EVCTRL.MCEO1, ACn.EVCTRL.WINEO0).
