Hi,
I'm trying to understand the definition files in order to make some changes.
I noticed that the files within the cores->USB folder differs from the ones of the zero definitions.
Can someone explain why?
I'd like to use UART on PB22/23 as standard serial instead of serial0 and get in conflict with some redefinition in the USB class whereas it's working with the boards definition for Arduino zero
The pins in the SAMD have many possible functions. See the IO Multiplexing section of the datasheet for all these combinations.
The Arduino platform has a certain way, or "syntax" that is required to make things work correctly.
To explain anything in depth here would be almost extraneous, the subject is too vast and complex.
Essentially, each board definition can define pins to its own author's preference or depending on what that board does with those pins. A set of pins 1/2 GPIO on an adafruit board can be pin 17/18 and I2C on another board.
I tried to keep my definitions close to other generic boards. But I tailored the pins to match the layout in a useful way on the M0.
You can always programatically change a pin or set of pins to make them do something else.
Adafruit has some good guides such as this one (https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports/creating-a-new-spi), on how to enable other peripherals on pins that are not defined as such, or are just generic pins in the core pin defines of a certain board definition. Certainly a good read to get some insight as to how capable these chips really are.