24.4.1 Initialization
To enable event routing within the system, the Event Users Multiplexer and Event Channels must
also be configured 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
(EVACT) bit field in the respective Event control register (e.g.,
TCn.EVCTRL.EVACT). Note: This step is not required by all peripherals.
- Enable event input by
writing a ‘
1’ to the respective Event Input Enable (‘EI’) bit in the peripheral’s Event Control register (e.g., ADCn.EVCTRL.STARTEI).
- Configure the action to
be executed upon receiving an event by writing to the Event Action
(EVACT) bit field in the respective Event control register (e.g.,
TCn.EVCTRL.EVACT).
- Configure the EVSYS:
- Configure the channel for Event User n by writing to the corresponding User n Channel Selection (EVSYS.USER[n]) register. Refer to Event Users for all available event users.
- Configure the path for event channel n by writing to the corresponding Path Selection bit field in the Channel n Control register (EVSYS.CHANNEL[n].PATH).
- Optional: Configure edge detection for channel n by writing to the Edge Detection Selection bit field in the Channel n Control register (EVSYS.CHANNEL[n].EDGSEL).
- Configure the event generator for channel n, 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 (‘EO’) bit in the Event Control register (e.g., TCCn.EVCTRL.MCEO1, ACn.EVCTRL.WINEO0) of the peripheral.
