Dennis-van-Gils / SAMD51_InterruptTimer

SAMD51 Interrupt Timer library for e.g. Adafruit M4 Metro/Feather/ItsyBitsy Express
MIT License
25 stars 7 forks source link

Why TC3? #2

Closed jondoesntgit closed 4 years ago

jondoesntgit commented 5 years ago

How does your code know to select TC3 instead of say, TC4 or TC0?

jamman83 commented 4 years ago

In the source code it specifies to set up the registers for TC3 indicated by "TC3->'whatever register'"

TC3 is defined in file "AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0\CMSIS\Device\ATMEL\samd51\include\component\tcc.h" It does all of the tedious work of pointing to register addresses for you, so all you have to do is name the peripheral/register you want to read/write as it is in the datasheet and bada-bing bada-boom.

jondoesntgit commented 4 years ago

Thanks