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 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
初次前来,多多关照!
[***.217.46.12]2024年04月03日 14时31分54秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
别再对分类变量进行独热编码!你还有更好的选择
2019-04-29
如果不能用Python执行机器学习,那该用什么呢?
2019-04-29
不论何时,互联网从业者一直幸福着~
2019-04-29
mysql用户口令中含有特殊字符@的情况下,如何正确链接数据库
2019-04-29
SpringFox接口文档API DOC
2019-04-29
netty优化策略
2019-04-29
架构师知识体系全景图
2019-04-29
guava中EventBus(事件总线)源码分析与使用
2019-04-29
程序员成神之路文章目录
2019-04-29
SASS软件的成熟度模型总结
2019-04-29
一次搞定redis使用
2019-04-29
最全架构设计实践方法论: 微服务
2019-04-29
Linux下简单几步安装AI开发环境-ROS(超有意思)
2019-04-29
epoll详解
2019-04-29
linux入门--磁盘管理之分区、格式化与挂载
2019-04-29
开发必备:HTTP 及 TLS
2019-04-29
如何设计自己的第一个加密交易机器人?
2019-04-29
TKDE 2020 | 综述:基于知识图谱的推荐系统
2019-04-29
休息时间!哪些业余活动能提升开发人员的技能?
2019-04-29
把人脑“森林”上传到计算机:人类脑计划只是一个科幻野心?
2019-04-29