I know this is a tough concept, for people used to electronics and microcontrollers, and I have to admit I don't have specific background in this fields.
The problem is that when talking about 'generality', people immediately think to 'performance loss', 'big code size', and so on... But this is a different problem: since we are programmers, we must be used to think in terms of problems to solve, assigning priorities, and finding the best solution we can. Only then we can understand if that solution is good enough for us.
Having said this, and specifying that I have what I think a strong background in C/C++/C#, but not specific in this field, and having started to program MSP430 Value Line chips, I soon realized what are MY personal problems that I have to solve, and that maybe are common to other programmers.
The general objective is to have a general libray to simplify coding solutions for these chips, and these are the priorities I have in mind.
1 - Details are overwhelming! If, for example, I write a program that uses Timer_A, the very next time I have to use Timer_A again, I forgot everything about TACTL, TACCTL0, and so on... The best thing I can do is to search through the program I already wrote, finding the place where I used the timer, trying to remember why I set those particular registers in that way, copy and paste some code, and adapting to the new needs. GOAL: write this code once, in a library, and use that in a more readable way.
2 - Good performance. Compiled library must give me a performance in the 90-95% range of the hypothetical hand-written code. Since we are at second level priority, we must be ready to accept a little degradation, in performance, according to my (and maybe everybody's) needs.
3 - Compact code size. With 16Kb chips available, I place this need in third position. Apart from particular cases, I think that microcontroller programs can easily stand inside this size. Nevertheless, we must check that executable size doesn't explode: I would say that executable code size should stand in the 110% range of the hypothetical hand-written equivalent program.
From the next post, I will try to start my search of the right solution, together with my own personal thoughts about it.
I choose to post all of this in the forum, because I really need observation, thoughts, critics, from expert people, that can drive me along the right way, if there's one... :-)
Andrea