The discussion of good for beginners vs good for experts has been
decided upon. Arduino is for beginners, if experts can use it good, but
no features for expert that could confuse the beginners. So as your
clearly aim for the more experienced users the Arduino API can only be a
starting point but you will probably divert from it very fast.
> MOTIVATION:
> The Arduino IDE is great for a beginner, but it hides too many things
> when someone wants to dive more into the bare metal programming.
Here I have a problem understanding what you really want. Why do you
want to do "bare metal programming" ? For performance? To not be
portable? to torture yourself?
> Also, I like C++, but the Arduino environment is more resembling of a
> mixed C/C++, and I think that the Due and probably also the Zero have
> more than enough horsepower to run full C++ applications; eve though
> the actual Arduino library is already written in C++, there are still
> many things that can be done only through C-ish calls - digital and
> analog IO, delay(), ...
As you aim for the Due and refer to the "more than enough horsepower" I
assume that you don't want to do "bare metal programming" for
performance reasons. Especially as you seem to want to do the bare metal
programming in C++ with the standard Lib available.
In my confusion I now only see two options:
Either you are a desktop programmer that loves C++ (and hates C) that
used Arduino to get into embedded programming. You know have your first
experiences and think that with the Due you could introduce the much
more comfortable programming environment you are used from doing desktop
application to the Arduino world.
Or you love the Object Oriented programming and have seen how much
easier it makes programming. You have experienced that an OO environment
makes you much more productive and is much more flexible than anything
else. You dream of Objects for each Hardware component (Timer, Uart,
SPI, ADC,..) that you will then use in your OO Application in the
Arduino. You hope that this could give you portability, with
Applications that can be compiled for different Arduinos and just work
because the Hardware objects will just be compiled for the different
hardware with the same API.
Whichever it is you will soon run into the Problem that embedded is all
about performance and bare metal programming to get the best
performance. With "just" a new library that is nice and cleaner and C++
only and with standard Libs this will not work. There simply is no way
to do bare metal programming for performance in your environment. So
with just the Lib I see as your users those Desktop programmers that
don't want to do bare metal programming and don't want to learn about
embedded, those developers that just want a nice C++ only environment.
They are probably OK to get the performance of an Arduino UNO out of an
Arduino Due with your lib.
You should think twice if it is worth the effort to create this C++ only
environment for this user group.
On the other side. If you really want to dig into bare metal programming
and like to play with assembler then use the library just as API. Roll
your own compiler and do aggressive optimizing by breaking some of the
guaranties C gives and let C++ programmers create Firmware that gets the
same performance out of the Arduino that the C programmers get. With
only providing to compile the firmware as one module a lot more
optimizations could be done. With the additional knowledge that there is
no Operating System, that there is no other applications even more
automatic optimizations could be done. Then this would be an interesting
project. It might be that the result is that it can not be done, and it
is probably more work then you intend but it would be new and
interesting and not just another API for Arduino,..