Documentation for Programmers?

Take a look at the source code to the Arduino core - it's in the lib/targets/arduino subdirectory of the Arduino application directory, or online at: Arduino Starter Kit kaufen [verschiedene Ausführungen].

A few things are initialized: timer 0 to keep track of the timing needed for the millis() functions, and timers 0, 1 and 2 for PWM generation. The analog to digital converter is initialized and the prescaler set.

Basically, the only thing we do to the code is add an #include statement to the top of it, and automatically generate prototypes for your functions. I think there are a few things that don't work because there's parser that goes through the code and complains about certain constructs. However, you can create new tabs in a sketch (use the right pointing arrow at the upper right) that are straight .c, .cpp, or .h files (just give them a name with the appropriate extension). These will be passed straight to the compiler without modification.

It is compatible with standard gcc library functions. You can add any #include statements you like. The only trick is that since you can't modify the command line arguments passed to the compiler or linker (we could support this, but there hasn't been much demand for it), a few things don't work: some of the math.h functions (e.g. sin) because of a bug in avr-gcc/avr-libc (that means you need an extra -lm argument) and printing of floating point numbers.

The runtime does nothing between calls to loop(), the code is literally for (;;) loop();. This structure comes from Processing, and was chosen to try to provide beginners with a slightly simpler framework (e.g. removing the need for an explicit main loop, so they don't need to know the syntax of, say, a for-loop to write a program).

It's not that flexible... porting the core libraries to a new platform requires going in and adding appropriate #ifdefs and the like. It's not too hard, but I don't think there's been much interest from the community. I guess most people who decide they need to use a different board have been willing to just code in straight C. That said, it'd be great to support more hardware, so any contributions are welcome.