ARM芯片 - CMSIS标准 (学习C做复杂嵌入式开发,不错的参考)
发布日期:2021-06-29 14:23:04 浏览次数:3 分类:技术文章

本文共 1443 字,大约阅读时间需要 4 分钟。

CMSIS是什么

ARM公司,Cortex-M系列IP的硬件抽象标准。(Cortex-A5,A7,A9也用支持该标准)

CMSIS:Cortex Microcontroller Software Interface Standard

 

采用CMSIS优点:

可以为处理器和外设实现一致且简单的软件接口,

简化软件的重用、缩短微控制器新开发人员的学习过程,并缩短新设备的开发周期。

 

源码

 

基于CMSIS标准的软件架构主要有四层:

用户应用层、

操作系统层、

CMSIS层

和硬件寄存器层。

CMSIS层主要分为3个部分:

  • 核内外设访问层(CPAL),由ARM负责实现对寄存器名称、地址定义、NVIC接口等定义,统一用_INLINE屏蔽差异,其接口函数均是可重入的。
  • 片上外设访问层(DPAL),由芯片厂商负责实现,可调用CPAL提供的接口函数处理相应的外设中断请求
  • 外设访问函数(AFP),由芯片厂商负责,提供访问片上外设的函数

Coding Rules

The CMSIS uses the following essential coding rules and conventions:

  • Compliant with ANSI C (C99) and C++ (C++03).
  • Uses ANSI C standard data types defined in <stdint.h>.
  • Variables and parameters have a complete data type.
  • Expressions for #define constants are enclosed in parenthesis.
  • Conforms to MISRA 2012 (but does not claim MISRA compliance). MISRA rule violations are documented.

In addition, the CMSIS recommends the following conventions for identifiers:

  • CAPITAL names to identify Core Registers, Peripheral Registers, and CPU Instructions.
  • CamelCase names to identify function names and interrupt functions.
  • Namespace_ prefixes avoid clashes with user identifiers and provide functional groups (i.e. for peripherals, RTOS, or DSP Library).

The CMSIS is documented within the source files with:

  • Comments that use the C or C++ style.
  •  compliant function comments that provide:
    • brief function overview.
    • detailed description of the function.
    • detailed parameter explanation.
    • detailed information about return values.

 

转载地址:https://chilaidashi.blog.csdn.net/article/details/111276923 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:安全加密 - DEP, ASLR
下一篇:5G - MEC(移动边缘计算)

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年04月03日 14时31分54秒