arduino / ArduinoCore-samd

Arduino Core for SAMD21 CPU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

variant.cpp has so many mistakes that it can only be intentional

maxlem opened this issue · comments

Hi,
I've been using this variant.cpp and the g_APinDescription has so many mistakes in it that I can only conclude these mistakes are maybe intentionnal. Let's take a random example:

  { PORTA,  6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0]

If you read the spec sheet, PA06 can be used for many things, as correctly noted in the comments

| 8          | ~8               |  PA06  |                 | EIC/EXTINT[6]  ADC/AIN[6]  AC/AIN[2] PTC/Y[4]  SERCOM0/PAD[2]                
TCC1/WO[0]

This pin can be muxed to be

  • external interrup 6
  • adc in 6
  • ac in 2
  • ptc 4
  • sercom0 2
  • tcc1 0

but the description tells e.g. No_ADC_Channel (and omit attribute PIN_ATTR_ANALOG)

Before I spend time fixing this and I submit a PR, can somebody confirm it is not a "feature".
And if it is indeed a feature, I propose to add, starting from e.g. position 50 in g_APinDescription (i.e. leaving a few empty spots), the complete pin definitions for each PortA and PortB pins (even for pins not broken out)