SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
Hello everyone.

I'm thinking of developing a peripheral library with common API for a variety of microcontrollers from different manufacturers and architectures. I think this would be useful to facilitate reducing the time that a user need to adapt to using a different microcontroller and to facilitate porting an application made for a type of microcontroller to another (especially if it's from a different manufacturer). I would like to know your opinion on this idea. Do you think that would be really useful to have something like that? Thank you very much in advance.

Yes, I'm aware of it. But the CMSIS leaves out the device peripherals driver library. According to CMSIS this is work for the silicon vendor. It's true that the peripherals from different manufacturers have differences but also many similarities. The notion is to develop a peripheral driver library with a common API to exploit the similarities. What do you think about that?
I agree it sounds like a terrific idea. But once you get into it I fear the trade-offs you'll have to make between consistency, performance, and flexibility will turn the project into an ugly mess.

For example, I'm very impressed with the stupendous effort ST has made to provide a library that works with their cortex-M parts. Yet, while I wouldn't say "ugly mess", I think it is fair to say that it can be less than intuitive to set up at times, while simultaneously providing larger code and longer execution times than you'd get with direct register access.

That said, have you looked at what Giovanni Di Sirio has done with Chibios ?
hsutherl wrote: That said, have you looked at what Giovanni Di Sirio has done with Chibios ?
Thank you, hsutherl. My idea is very simmilar to the HAL layer of ChibiOS. I should have had this idea many years ago. I don't know if there would be something better I can do after the magnificent work of Giovanni Di Sirio.