There's a lot of info that isn't in the .h files that programs include.
Stuff like mapping port pins ("PA02") to the functions it might provide, or even chip pin numbers to what port or function they are.
This IS available in ".ATDF" files that Atmel provides. And most probably in the ".SVD" files that are supposedly standard for ARM Cortex-M chips in general. All you have to do is parse them and do some fiddling.
Teaser:
showChipPin("44")
Chip Pin 44 on ATSAMD51P20A is PB15
ADC0
CCL
EIC
GCLK
PCC
PORT
SERCOM4
TC5
TCC0
TCC4
None