SAMD extra serial tutorial questions:

I am referring to :

  • Comparing to my own attempts to make it before I found this example, and understand it.

Q1: I have been using pinPeripheral(4, PIO_SERCOM_ALT); - it seems like _ALT chooses peripheral C or D , what is the difference, when to use which ?
PIO_SERCOM =peripheral C
PIO_SERCOM_ALT =peripheral D
so it seems that using _ALT is correct for pins D3,D4 (?)

Q2: how does "pinPeripheral(x, PIO_SERCOM);" know it is meant for &sercom3 , not any other port ?

Have you read this one aswell?