Hi Chris,
The C compiler itself is a standards compliant C/C++ compiler; we actually use armcc. That is the program that turns the C language code in to machine instructions that can run on the processor.
It is also common for compilers to provide an implementation of the Standard C Library. This gives you useful platform-independant functions like printf/fopen (stdio.h), sin/cos (math.h), malloc/exit (stdlib.h). So this is pretty standardised across compiler toolchains.
The mbed libraries are an additional set of classes and functions that provide simple high-level abstractions for microcontroller specific peripherals; DigitalIn, SPI, AnalogOut etc (mbed.h). These are unique to mbed, and are not currently supported by other tool chains. As you identify, other toolchains may well provide their own functions to achieve similar things, and most MCU vendors provide "Peripheral Driver" code examples on their websites too.
Unlike the Standard C Library, there isn't really a dominant standard for microcontroller peripherals. Much of this is down to the differences between microcontroller peripherals and the different potential trade-offs between device specific flexibility and simplicity/uniformity. With mbed, we made a library that went strongly down the simplicity/uniformity route, so hopefully it is easy to pick up and use for the common case.
Hope that is helpful, and good luck!
Simon
Hello,
I'm just starting to use mbed, with Bert van Dam's "ARM Microcontrollers" book as a guide.
My knowledge of C is a bit shaky, but as I understand it, with the mbed compiler, there are various C functions which have been created specifically for programming the mbed microcontroller e.g. DigitalOut, DigitalIn, AnalogIn, etc. My question is: if I was to move to another compiler in the future such as LPCXpresso or uVision, would I come across the same functions or would they have their own unique functions?
Thanks...