Configure EVSYS

Events must be enabled as generators and/or triggers when configuring peripherals. In this example, event generation on overflow is enabled for both default and alternative TC. The default TC is also set to count on incomming events and DMAC is set to trigger a transfer on incoming events. In addition, the event system must be configured to link event generators with event users. In configure_tc_evsys() the alternative TC is set as event user since this counter should increment incoming events. The event generator is overflow on the default TC. In configure_dma_evsys()the DMAC is configured to start a transfer on alternative TC overflow event. DMAC channel 0 and 1 are therefore set as event users while the event generator is alternative TC overflow. With this setup, the alternative TC period and compare value registers will be updated after every periodic overflow.