没有合适的资源?快使用搜索试试~ 我知道了~
CMSIS-RTOS API V2
需积分: 1 3 下载量 32 浏览量
2023-09-05
13:48:41
上传
评论 1
收藏 97KB PDF 举报
温馨提示
试读
4页
文档包含CMSIS V2版本的所有API接口及相关功能介绍
资源推荐
资源详情
资源评论
CMSIS-RTOS C API v2
Overview of all CMSIS-RTOS C API v2 functions that are implemented in the cmsis_os2.h header file.
Common Design Concepts
All RTOS objects share a common design concept. The overall life-cycle of an object can be summarized
as created -> in use -> destroyed.
Create Objects
An object is created by calling its osXxxNew function. The new function returns an identifier that can be
used to operate with the new object. The actual state of an object is typically stored in an object specific
control block. The memory layout (and size needed) for the control block is implementation specific. One
should not make any specific assumptions about the control block. The control block layout might change
and hence should be seen as an implementation internal detail.
In order to expose control about object specific options all osXxxNew functions provide an optional attr
argument, which can be left as NULL by default. It takes a pointer to an object specific attribute structure,
commonly containing the fields
• name to attach a human readable name to the object for identification,
• attr_bits to control object-specific options,
• cb_mem to provide memory for the control block manually, and
• cb_size to quantify the memory size provided for the control block.
The name attribute is only used for object identification, e.g. using RTOS-aware debugging. The attached
string is not used for any other purposes internally.
The cb_mem and cb_size attributes can be used to provide memory for the control block manually instead
of relying on the implementation internal memory allocation. One has to assure that the amount of
memory pointed to by cb_mem is sufficient for the objects control block structure. If the size given as
cb_size is not sufficient the osXxxNew function returns with an error, i.e. returning
NULL. Furthermore
providing control block memory manually is less portable. Thus one has to take care about
implementation specific alignment and placement requirements for instance. Refer to Memory
Management for further details.
Object Usage
After an object has been created successfully it can be used until it is destroyed. The actions defined for
an object depends on its type. Commonly all the osXxxDoSomething access function require the reference
to the object to work with as the first xxx_id parameter.
The access function can be assumed to apply some sort of sanity checking on the id parameter. So that it
is assured one cannot accidentally call an access function with a NULL object reference. Furthermore the
concrete object type is verified, i.e. one cannot call access functions of one object type with a reference to
another object type.
All further parameter checks applied are either object and action specific or may even be implementation
specific. Thus one should always check action function return values for osErrorParameter to assure the
provided arguments were accepted.
As a rule of thumb only non-blocking access function can be used from
Interrupt Service Routines
(ISR). This incorporates osXxxWait functions (and similar) limited to be called with parameter timeout set
to 0, i.e. usage of try-semantics.
CMSIS-RTOS C API v2 https://www.keil.com/pack/doc/CMSIS/RTOS2/html/rtos_api2.html
第1页 共4页 2023/9/4 15:56
资源评论
Socko.Lee
- 粉丝: 1
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 原生微信小程序源码 - -滴滴公交-查公交
- 人工智能实验四 感知器算法的设计实现
- java小项目多线程多线程 复制文件 冒泡排序 群聊
- 四数之和(java代码).docx
- 701837906919458TapScanner v3.0.10 (Pro).apk
- 青岛大学人工智能实验二 利用α-β搜索的博弈树算法编写一字棋游戏
- ### 1、项目介绍 本项目Scrapy进行数据爬取,并使用Django框架+PyEcharts实现可视化大屏 效果如下:
- # 微信小程序-健康菜谱 基于微信小程序的一个查找检索菜谱的应用 ### 效果 !动态图(./res/gif/demo
- zabbix-get命令包资源
- 289ssm-mysql-jsp 计算机课程实验管理系统.zip(可运行源码+数据库文件+文档)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功