15.3.1 Initialization
To utilize events, the Event System, the generating peripheral, and the peripheral(s) using the event must be set up accordingly:
- Configure the generating peripheral appropriately. For example, if the generating peripheral is a timer, set the prescaling, the Compare register, etc., so that the desired event is generated.
- Configure the event user peripheral(s) appropriately. For example, if the ADC is the event user, set the ADC prescaler, resolution, conversion time, etc., as desired, and configure the ADC conversion to start at the reception of an event.
- Configure the Event System to route the desired source. In this case, the Timer/Compare match to the desired event channel. This may, for example, be Channel 0, which is accomplished by writing to the Channel 0 Generator Selection (EVSYS.CHANNEL0) register.
- Configure the ADC to listen to this channel by writing to the corresponding User x Channel MUX (EVSYS.USERx) register.