SAM21D Compare match interrupt

Hello guys,
i’m very new to SAMD21 and i come from a good experience with atmega328p.
In order to translate the code done on the old atmel micro, i would like to share my issue with you and get a solution.
I need to receive an external interrupt (attached to input pin, rising edge) that in its service routine do start the timer3 in 16 bit mode. The timer shall count until it reaches the match to a value stored (in CC1 a think) and at the compare match shall interrupt its relative service routine.
In that service routine the timer counter shall load a new value in CC1 and restart counting from 0.
I don’t need to handle the overflow.
Each timer tick shall be of 1us.

Thanks in advance

There are some good examples in the Products section of this forum under topic “Arduino Zero”. Arduino Zero board uses SAMD21. Also look in Arduino MRKZero topic. Not much activity there, so you may need to look back a few pages of posts to find something similar to your project. Good luck.