-3
\$\begingroup\$

I have few question that I am not able to understand.

  1. What is the difference between API and library in embedded software? Any example would be appreciated.
  2. What is CMSIS - is it a library provided by ARM that provides little bit higher level than programming by pointing to the pure registers?
\$\endgroup\$
0

2 Answers 2

5
\$\begingroup\$
  1. A library is a piece of code and the way you call the library code is the API.

  2. CMSIS is basically a standard for abstraction layer for different microcontrollers - it defines the API, or the way you call the code in the library to do something.

\$\endgroup\$
0
\$\begingroup\$

CMSIS is not an API...there is no "application" that needs a programming interface. It is not a "library", as there isn't the notion of a library in C.

CMSIS is a group of C header files. They provide a standard way of accessing hardware registers, some intrinsic functions to directly access special assembly instructions, and a few standardized functions for using the ARM architecture. CMSIS is very well documented, so if you look through the examples provided by ARM I'm sure you will get the drift.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ CMSIS it is an API. an interface for the application to access the hardware \$\endgroup\$
    – Juraj
    Commented Aug 15, 2021 at 6:25
  • 2
    \$\begingroup\$ It might be a matter of opinion, but while C language compiler itself does not have a notion of libraries, the linker sure does. Which means you can include a header to allow your code to call code in a libray and the linker is told to include code in from a library when linking the executable together. Also things like strncmp or memset come from the C standard library. \$\endgroup\$
    – Justme
    Commented Aug 15, 2021 at 7:35
  • \$\begingroup\$ @Justme You are right, that occurred to me later. \$\endgroup\$ Commented Aug 15, 2021 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.