KEIL自带操作系统RTX各个函数简介

本文介绍了RTOS(实时操作系统)内核的基本操作,包括初始化、启动及状态查询等,并详细阐述了任务线程的创建、终止、优先级调整等功能。此外,还涵盖了信号量、互斥锁、定时器等多种同步机制的使用方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Kernel Information and Control

· osKernelInitialize: Initialize the RTOS kernel.

· osKernelStart: Start the RTOS kernel.

· osKernelRunning: Query if the RTOS kernel is running.

· osKernelSysTick$ : Get RTOS kernel system timer counter.

· osKernelSysTickFrequency$ : RTOS kernel system timer frequency in Hz.

· osKernelSysTickMicroSec$ : Convert microseconds value to RTOS kernel system timer value.

Thread Management

· osThreadCreate: Start execution of a thread function.

· osThreadTerminate: Stop execution of a thread function.

· osThreadYield: Pass execution to next ready thread function.

· osThreadGetId: Get the thread identifier to reference this thread.

· osThreadSetPriority: Change the execution priority of a thread function.

· osThreadGetPriority: Obtain the current execution priority of a thread function.

Generic Wait Functions

· osDelay: Wait for a specified time.

· osWait$ : Wait for any event of the type Signal, Message, or Mail.

· Timer Management

· osTimerCreate: Define attributes of the timer callback function.

· osTimerStart: Start or restart the timer with a time value.

· osTimerStop: Stop the timer.

· osTimerDelete: Delete a timer.

Signal Management

· osSignalSet: Set signal flags of a thread.

· osSignalClear: Reset signal flags of a thread.

· osSignalWait: Suspend execution until specific signal flags are set.

· Mutex Management

· osMutexCreate: Define and initialize a mutex.

· osMutexWait: Obtain a mutex or Wait until it becomes available.

· osMutexRelease: Release a mutex.

· osMutexDelete: Delete a mutex.

· Semaphore Management

· osSemaphoreCreate: Define and initialize a semaphore.

· osSemaphoreWait: Obtain a semaphore token or Wait until it becomes available.

· osSemaphoreRelease: Release a semaphore token.

· osSemaphoreDelete: Delete a semaphore.

· Memory Pool Management

· osPoolCreate: Define and initialize a fix-size memory pool.

· osPoolAlloc: Allocate a memory block.

· osPoolCAlloc: Allocate a memory block and zero-set this block.

· osPoolFree: Return a memory block to the memory pool.

· Message Queue Management

· osMessageCreate: Define and initialize a message queue.

· osMessagePut: Put a message into a message queue.

· osMessageGet: Get a message or suspend thread execution until message arrives.

· Mail Queue Management

· osMailCreate: Define and initialize a mail queue with fix-size memory blocks.

· osMailAlloc: Allocate a memory block.

· osMailCAlloc: Allocate a memory block and zero-set this block.

· osMailPut: Put a memory block into a mail queue.

· osMailGet: Get a mail or suspend thread execution until mail arrives.

· osMailFree: Return a memory block to the mail queue.

The following CMSIS-RTOS functions can be called from threads and interrupt service routines (ISR):

· osSignalSet

· osSemaphoreRelease

· osPoolAllocosPoolCAllocosPoolFree

· osMessagePutosMessageGet

· osMailAllocosMailCAllocosMailGetosMailPutosMailFree

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值