Does any one know why there are so many more functions in the asf framework files than there are in the files contained in the arduino folder scope
ie pio toggle pin, pin group, toggle group etc...
Does any one know why there are so many more functions in the asf framework files than there are in the files contained in the arduino folder scope
ie pio toggle pin, pin group, toggle group etc...
Yeah: ASF is the "Chip support library" provided by Atmel, aimed at commercial developers, and thus they want it to support every possible feature available on the chip. The Arduino core, on the other hand, is a simplified "least common denominator" library aimed at supporting artists and maybe semi-technical hobbyists doing relatively simple things. Also, The Arduino core originated on an older, simpler chip that doesn't have all the capabilities of the SAM3X.
So for example, neither the ATmega8 nor the ATmega128 (the original Arduino/Wiring chips) supported a pin-toggle function in hardware, so there isn't one in the core, either.
The Due core doesn't include ASF; it's based on an earlier Atmel Library ("llbsam") that is no longer recommended by Atmel (it's hard to even find.) Frankly, I think it was a mistake to use even libsam. Vendor-provided libraries usually make for reasonable examples to figure out how things work, but they tend to be bloated and slow in clumsy attempts to support EVERYTHING while still looking like "Computer Science Major" code. The functions that Arduino provides are simple enough to implement on "bare metal." (I believe that the Arduino Zero (SAMD) core is bare metal.")
Cheers Wes,
youre right about "reasonable examples to figure out how things work", it makes it a lot easier to crossreference with the datasheet, which i now see was always meant to be used in conjunction with the ASF. it all makes sense why the datasheet itself is so vague. when you put the 2 together it makes life a lot easier. i wonder why arduino is set in there ways using the same commands for all boards instead of splitting the code up for each board. dont get me wrong i wouldnt have started with microcontrollers if it wasnt for arduino, but it seems they could get a lot more out of baords like the due in there standard code.
Do you do professional coding, what would be the next step to look at from evaluation boards ie Due, explained to get something in production on a board i have (want to) build