ZERO example: PWM + DMA, timer-capture event + DMA

The following contrived ZERO sketch was constructed based on this Atmel example. The sketch varies the PWM duty cycle with a circular DMA buffer. The event subsystem triggers a timer-capture event that saves the time stamps in another DMA circular buffer. I viewed the PWM output on a logic analyzer to verify the duty cycle changes.

I downloaded the Atmel xdk to help me decipher their example in order to translate it into arduino-speak.