Tutorial needed on SAMD21G variant cpp.

Hi, does anyone know if there is a tutorial on how to multiplex the ZERO pins and what the significance of the different elements in Pin description of variant cpp. are, ie what do they do? What happens if I change them.

The Uno was straight forward, we didn't need an explanation of how to manipulate it's pins' characteristics because you couldn't. But with the ZERO you can choose each pin's attributes. I am assuming the 'control console' for this is the Pin descriptions array, amongst other definitions in variant cpp. and variant.h.

Structure 'Pin Description' appears to have 8 variables, for example:

{ PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 } for pin D6.

{ PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 } for pin D7.

What do they mean? What happens if I change them? Will it explode? Wouldn't it be nice if the Arduino team were to elaborate on how to take advantage of the most useful feature of the chip. Or does every individual have to work it out for themselves? Listen to me, I sound a bit spoiled, but that's the legacy of the UNO, and what I thought Arduino was all about.

Did you look in the device's Datasheet?

Yes I have looked in the data sheet. That doesn't tell me how the arduino code is implemented.

Yea, as near as I can tell, you pretty much have to slog your way through the Arduino code and figure it out on you own. I haven’t seen any tutorials regarding the Arduino implementation. Only bright spot is that the code uses register and bit field names that are identical to those in the datasheet – or at least nearly so.

See the core file Wvariant.h for more details of the g_aPinDecription structure elements.