CMSIS-Pack
Version 1.7.2
Delivery Mechanism for Software Packs
|
Application Programming Interfaces (apis) are C/C++ interface specifications that allow software to be divided into largely independent modules. Such modules can then be developed, tested, and maintained independently, and reused by different projects. One example is the use of device drivers. If device drivers are developed for different devices implementing the same API, the application software itself can be written independent from the device it is build for.
The apis allow to distribute the Application Programming Interface Specifications decoupled from actual implementation. One example is the CMSIS-RTOS API, which is specified as part of CMSIS, however, the actual RTOS implementation is provided by different vendors.
An API consists of a name, a brief description as well as one or more header files, and a document containing a detailed specification of the API.
The API typically defines one or more header files and optionally an include directory. It should have also related documentation that describes the API.
Example:
The API can be used either in the same software pack or other software packs. Having the API definition in one central software pack provides the benefit that implementations are consistent.
The include file and directory are included in the application project when a component is selected that specifics the same Cclass and Cgroup. The selection of a software component adds therefore both to a project: the files specified by the component element and the files specified by the api element. Therefore, the component that is based on the API should not contain the header file that defines the API.
Example: this component adds also the api header file above
Optionally, it is possible to request a minimum API version using the Capiversion attribute.
It is also possible to expose a combination of API definitions. An example for that is the CMSIS-Driver for Ethernet that is defined as:
This element is a grouping element for all application programming interfaces included in the Software Pack. The element itself is optional. Only one such section can exist in a package.
Example:
Parents | Element Chain | ||
---|---|---|---|
package | /package | ||
Child Elements | Description | Type | Occurrence |
api | Named specification of an API containing a brief description, C/C++ header files and documentation | ApiType | 1..* |
Application Programming Interfaces (apis) are C/C++ interface specifications that allow components to inter-work by either implementing or using a set of functions, data types, and definitions. This element is mandatory and can exist multiple times.
Example:
Parent Element | Element Chain | ||
---|---|---|---|
apis | /package/apis | ||
Attributes | Description | Type | Use |
Cclass | Defines the component class to which this component belongs. This is a mandatory part of the component ID. Predefined values can be used as listed in the table Component Classes. | CclassType | required |
Cgroup | Defines the component group to which this component belongs. This is a mandatory part of the component ID. Predefined values can be used as listed in the table Component Groups. | CgroupType | required |
exclusive | Makes the selection of a component implementing the API exclusive. If set to 0, then multiple components implementing the API can be selected. Default is 1. | xs:boolean | optional |
condition | Enter the identifier (attribute id) of a condition. The element is used if the condition resolves to true. If the condition resolves to false, then the element will be ignored. For example, an API might be specific for a certain toolchain or processor instruction set. | xs:string | optional |
Capiversion | Version of this component. Is a mandatory part of the component ID. The version format is described in Version Type. | VersionType | optional |
Child Elements | Description | Type | Occurrence |
description | Brief summary about the purpose and scope of an API. | xs:string | 0..1 |
files | Grouping element for all file descriptions that are part of this component.. | group | 0..1 |