I just started to use CMSIS in my Project. it seems to me this library should have given me some functions to access the peripherals instead of accessing them directly by using the vendor.h (in my case LPC17xx.h)library to make my code more general and vendor independent. if this concept is correct why I can access to my port by this LPC_GPIOx-> (it's define in LPC17xx.h) and can not use GPIOx-> . I would Appreciate if you tell me the differences between PIN or GPIO Driver under the Device section in Keil "Manage Run Time Environment" and Core in CMSIS (because as I said I Think CMSIS should give us some functions to access the Ports )
Just a quick note.
You can't have any library hiding differences in hardware by just renaming some data type names and then access a generically named pointer. So:
LPC_GPIOx->
can't become a generic:
GPIOx->
Rename of register names and bit field names is only possible when there is a 1-to-1 correlation between available registers, and each register has a 1-to-1 correlation (or if you limit yourself to a common subset).
That's why libraries normally makes use of function calls, C++ method calls or creative macros to perform actions - and then internally takes care of exactly how to do it. Which also means that the processor may need to perform a number of additional instructions consuming additional bytes of code space just for a translation layer.
And what to do if you have a need to perform own actions in an ISR?
In the end, it's a trade-off between a reasonably efficient standard library implementation supporting a generic blend of functionality - or full hardware ownership with tight code being allowed to do 100% of what the hardware supports.
Thanks Per. I didn't rename by myself. I watch it in a clip that use GPIO and said it belong to CMSIS though the Processor was different. I got the point you mentioned. In some codes I see they use "lpc17xx_rtc.h" and the functions that apparently was belong to CMSIS driver, but under the section of "CMSIS Driver" in Manage RTE there is not any driver for RTC (or ADC lpc17xx_adc.h). I even search in the folder of keil but nothing found(I even thought the name for the new version has been changed to something like "ADC_LPC17xx" as GPIO_LPC17xx defined)? is there anything that I miss ??