https://arm-software.github.io/CMSIS_5/RTOS2/html/os2MigrationFunctions.html
Detailed API Function Differences
This section lists the CMSIS-RTOS API v1 and API v2 functions along with the differences in functionality. The list is sorted alphabetically by API v2 function names and is structured the following way: RTOS API v2 function prototype RTOS API v1 function p
arm-software.github.io
자세한 API 기능 차이점
이 섹션에서는 기능의 차이점과 함께 CMSIS-RTOS API v1 및 API v2 기능을 나열합니다. 목록은 API v2 함수 이름을 기준으로 알파벳순으로 정렬되며 다음과 같은 방식으로 구성됩니다.
- RTOS API v2 함수 프로토타입
- 동등하거나 유사한 기능을 제공하는 RTOS API v1 기능 프로토타입
- RTOS v2 기능에 대한 간략한 설명입니다.
- 차이점에 대한 설명입니다.
배경색은 다음을 나타냅니다.
- 녹색: API v1에서 사용할 수 없는 API v2의 새로운 기능
- 황색: API v1과 비교하여 API v2에서 수정되거나 대체된 함수
- 빨간색: API v2에서 더 이상 사용되지 않는 API v1의 함수
커널 정보 및 제어
osStatus_t osKernelGetInfo (osVersion_t* version, char* id_buf, uint32_t id_size)
없음
RTOS 커널 정보를 가져옵니다.
새로운 기능 osKernelGetInfo .
osKernelState_t osKernelGetState (void)
int32_t osKernelRunning (void)
현재 RTOS 커널 상태를 가져옵니다.
- 함수 osKernelGetState는 RTOS가 V1 기능 대체 osKernelRunning을 .
- 반환 유형이 osKernelState_t 로 변경되었습니다 .
uint32_t osKernelGetTickCount (void)
없음
RTOS 커널 틱 수를 가져옵니다.
새로운 기능.
uint32_t osKernelGetTickFreq (void)
없음
RTOS 커널 틱 빈도를 가져옵니다.
- osKernelGetTickFreq 함수 는 RTOS v1 매크로 osKernelTickMicroSec를 대체합니다 .
uint32_t osKernelGetSysTimerCount (void)
uint32_t osKernelSysTick (void)
RTOS 커널 시스템 타이머 수를 가져옵니다.
- 함수 osKernelGetSysTimerCount는 RTOS가 v1의 기능을 대체 osKernelSysTick을 .
uint64_t osKernelGetSysTimerFreq (void)
없음
RTOS 커널 시스템 타이머 주파수를 가져옵니다.
새로운 기능.
osStatus_t osKernelInitialize (void)
osStatus osKernelInitialize (void)
RTOS 커널을 초기화합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
int32_t osKernelLock (void)
없음
RTOS 커널 스케줄러를 잠급니다.
새로운 기능.
int32_t osKernelUnlock (void)
없음
RTOS 커널 스케줄러를 잠금 해제합니다.
새로운 기능.
void osKernelRestoreLock (void)
없음
RTOS 커널 스케줄러 잠금 상태를 복원합니다.
새로운 기능.
osStatus_t osKernelStart (void)
osStatus osKernelStart (void)
RTOS 커널 스케줄러를 시작합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
uint32_t osKernelSuspend (void)
없음
RTOS 커널 스케줄러를 일시 중단합니다.
새로운 기능.
void osKernelResume (uint32_t sleep_time)
없음
RTOS 커널 스케줄러를 재개합니다.
새로운 기능.
스레드 관리
osStatus_t osThreadDetach (osThreadId_t thread_id)
없음
스레드를 분리합니다(스레드가 종료되면 스레드 저장소를 회수할 수 있음).
새로운 기능.
uint32_t osThreadEnumerate (osThreadId_t *thread_array, uint32_t array_items)
없음
활성 스레드를 열거합니다.
새로운 기능.
__NO_RETURN void osThreadExit (void)
없음
현재 실행 중인 스레드의 실행을 종료합니다.
새로운 기능.
uint32_t osThreadGetCount (osThreadId_t thread_id)
없음
활성 스레드 수를 가져옵니다.
새로운 기능.
const char *osThreadGetName (osThreadId_t thread_id)
없음
스레드의 이름을 가져옵니다.
새로운 기능.
osThreadId_t osThreadGetId (void)
osThreadId osThreadGetId (void)
현재 실행 중인 스레드의 스레드 ID를 반환합니다.
- 반환 유형이 osThreadId_t 로 변경되었습니다 .
osPriority_t osThreadGetPriority (osThreadId_t thread_id)
osPriority osThreadGetPriority (osThreadId thread_id)
스레드의 현재 우선 순위를 가져옵니다.
- 반환 유형이 osPriority_t 로 변경되었습니다 .
- 매개변수 유형이 osThreadId_t 로 변경되었습니다 .
uint32_t osThreadGetStackSize (osThreadId_t thread_id)
없음
스레드의 스택 크기를 가져옵니다.
새로운 기능.
uint32_t osThreadGetStackSpace (osThreadId_t thread_id)
없음
실행 중 스택 워터마크 기록을 기반으로 스레드의 사용 가능한 스택 공간을 가져옵니다.
새로운 기능.
osThreadState_t osThreadGetState (osThreadId_t thread_id)
없음
스레드의 현재 스레드 상태를 가져옵니다.
새로운 기능.
osStatus_t osThreadJoin (osThreadId_t thread_id)
없음
지정된 스레드가 종료될 때까지 기다립니다.
새로운 기능.
osThreadId_t osThreadNew (osThreadFunc_t function, void *argument, const osThreadAttr_t *attr)
osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument)
스레드를 생성하여 활성 스레드에 추가합니다.
- 기능 osThreadNew는 RTOS가 V1 기능 대체 osThreadCreate을 .
- 옵션은 이제 osThreadDef 매크로를 대체 하는 osThreadAttr_t 구조체를 사용하여 전달됩니다 .
- 새 함수 프로토타입은 void func (void *arg), 이전: void func (const void *arg)입니다.
osStatus_t osThreadResume (osThreadId_t thread_id)
없음
스레드 실행을 재개합니다.
새로운 기능.
osStatus_t osThreadSetPriority (osThreadId_t thread_id, osPriority_t priority)
osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority)
스레드의 우선 순위를 변경합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osThreadId_t 및 osPriority_t 로 변경되었습니다 .
osStatus_t osThreadSuspend (osThreadId_t thread_id)
없음
스레드 실행을 일시 중단합니다.
새로운 기능.
osStatus_t osThreadTerminate (osThreadId_t thread_id)
osStatus osThreadTerminate (osThreadId thread_id)
스레드의 실행을 종료합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osThreadId_t 로 변경되었습니다 .
osStatus_t osThreadYield (void)
osStatus osThreadYield (void)
READY 상태에 있는 다음 스레드에 제어를 전달 합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
스레드 플래그
플래그를 사용하여 스레드를 동기화하는 새 섹션. 스레드 플래그와 보다 유연한 이벤트 플래그 가 RTOS v1 신호 이벤트를 대체합니다 . 더 이상 사용되지 않는 기능 목록은 신호 이벤트 를 참조하세요 . 자세한 내용은 스레드 플래그 를 참조하십시오.
uint32_t osThreadFlagsSet (osThreadId_t thread_id, uint32_t flags)
없음
스레드의 지정된 스레드 플래그를 설정합니다.
새로운 기능.
uint32_t osThreadFlagsClear (uint32_t flags)
없음
현재 실행 중인 스레드의 지정된 스레드 플래그를 지웁니다.
새로운 기능.
uint32_t osThreadFlagsGet (void)
없음
현재 실행 중인 스레드의 현재 스레드 플래그를 가져옵니다.
새로운 기능.
uint32_t osThreadFlagsWait (uint32_t flags, uint32_t options, uint32_t timeout)
없음
현재 실행 중인 스레드의 하나 이상의 스레드 플래그가 신호를 받을 때까지 기다립니다.
새로운 기능.
이벤트 플래그
플래그를 사용하여 이벤트를 동기화하는 새 섹션. 이벤트 플래그 및 스레드 플래그는 RTOS v1 신호 이벤트를 대체합니다 . RTOS v1 신호 이벤트에 나열된 모든 기능은 더 이상 사용되지 않습니다. 더 이상 사용되지 않는 기능 목록은 신호 이벤트 를 참조하세요 . 새 기능에 대한 자세한 내용은 이벤트 플래그 를 참조하십시오 .
uint32_t osEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags)
없음
지정된 이벤트 플래그를 지웁니다.
새로운 기능.
const char *osEventFlagsGetName (osEventFlagsId_t ef_id)
없음
이벤트 플래그 개체의 이름을 가져옵니다.
새로운 기능.
osStatus_t osEventFlagsDelete (osEventFlagsId_t ef_id)
없음
이벤트 플래그 개체를 삭제합니다.
새로운 기능.
uint32_t osEventFlagsGet (osEventFlagsId_t ef_id)
없음
현재 이벤트 플래그를 가져옵니다.
새로운 기능.
osEventFlagsId_t osEventFlagsNew (const osEventFlagsAttr_t *attr)
없음
이벤트 플래그 개체를 만들고 초기화합니다.
새로운 기능.
uint32_t osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags)
없음
지정된 이벤트 플래그를 설정합니다.
새로운 기능.
uint32_t osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout)
없음
하나 이상의 이벤트 플래그가 신호를 받을 때까지 기다립니다.
새로운 기능.
일반 대기 함수
자세한 내용은 일반 대기 기능 을 참조하십시오.
osStatus_t osDelay (uint32_t ticks)
osStatus osDelay (uint32_t timeout)
시간 초과(시간 지연)를 기다립니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
osStatus_t osDelayUntil (uint32_t ticks)
없음
지정된 시간까지 기다립니다.
새로운 기능.
더 이상
osEvent osWait (uint32_t millisec)
사용 되지 않습니다.
타이머 관리
자세한 내용은 타이머 관리 를 참조하세요.
osStatus_t osTimerDelete (osTimerId_t timer_id)
osStatus osTimerDelete (osTimerId timer_id)
타이머를 삭제합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osTimerId_t 로 변경되었습니다 .
const char *osTimerGetName (osTimerId_t timer_id)
없음
타이머의 이름을 가져옵니다.
새로운 기능.
uint32_t osTimerIsRunning (osTimerId_t timer_id)
없음
타이머가 실행 중인지 확인합니다.
새로운 기능.
osTimerId_t osTimerNew (osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument)
타이머를 만들고 초기화합니다.
- 기능 osTimerNew는 RTOS가 V1 기능 대체 osTimerCreate을 .
- 반환 유형이 osTimerId_t 로 변경되었습니다 .
- 매개변수 목록 및 유형이 변경되었습니다.
osStatus_t osTimerStart (osTimerId_t timer_id, uint32_t ticks)
osStatus osTimerStart (osTimerId timer_id, uint32_t timeout)
타이머를 시작하거나 다시 시작합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 첫 번째 매개변수 유형이 osTimerId_t 로 변경되었습니다 .
osStatus_t osTimerStop (osTimerId_t timer_id)
osStatus osTimerStop (osTimerId timer_id)
타이머를 중지합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osTimerId_t 로 변경되었습니다 .
뮤텍스
자세한 내용은 뮤텍스 관리 를 참조하십시오.
osStatus_t osMutexAcquire (osMutexId_t mutex_id, uint32_t timeout)
osStatus osMutexWait (osMutexId mutex_id, uint32_t timeout)
뮤텍스를 획득하거나 잠겨 있는 경우 시간 초과를 가져옵니다.
- 기능 osMutexAcquire는 RTOS가 V1 기능 대체 osMutexWait을 .
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 첫 번째 매개변수 유형이 osMutexId_t 로 변경되었습니다 .
osStatus_t osMutexDelete (osMutexId_t mutex_id)
osStatus osMutexDelete (osMutexId mutex_id)
뮤텍스 개체를 삭제합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osMutexId_t 로 변경되었습니다 .
const char *osMutexGetName (osMutexId_t mutex_id)
없음
Mutex 객체의 이름을 가져옵니다.
새로운 기능.
osThreadId_t osMutexGetOwner (osMutexId_t mutex_id)
없음
Mutex 객체를 소유하는 스레드를 가져옵니다.
새로운 기능.
osMutexId_t osMutexNew (const osMutexAttr_t *attr)
osMutexId osMutexCreate (const osMutexDef_t *mutex_def)
Mutex 개체를 만들고 초기화합니다.
- 기능 osMutexNew는 RTOS가 V1 기능 대체 osMutexCreate을 .
- 반환 유형이 osMutexId_t 로 변경되었습니다 .
- 매개변수 유형이 osMutexAttr_t 로 변경되었습니다 .
osStatus_t osMutexRelease (osMutexId_t mutex_id)
osStatus osMutexRelease (osMutexId mutex_id)
osMutexAcquire 가 획득한 뮤텍스를 해제합니다 .
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osMutexId_t 로 변경되었습니다 .
세마포어
자세한 내용은 세마포어 를 참조하십시오.
osStatus_t osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout)
없음
세마포어 토큰을 획득하거나 사용 가능한 토큰이 없으면 시간 초과됩니다.
새로운 기능. 를 대체합니다 osSemaphoreWait.
osStatus_t osSemaphoreDelete (osSemaphoreId_t semaphore_id)
osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)
세마포어 개체를 삭제합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osSemaphoreId_t 로 변경되었습니다 .
uint32_t osSemaphoreGetCount (osSemaphoreId_t semaphore_id)
없음
현재 세마포어 토큰 수를 가져옵니다.
새로운 기능.
const char *osSemaphoreGetName (osSemaphoreId_t semaphore_id)
없음
세마포어 개체의 이름을 가져옵니다.
새로운 기능.
osSemaphoreId_t osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr)
osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count)
세마포어 개체를 만들고 초기화합니다.
- 기능 osSemaphoreNew는 RTOS가 v1의 기능을 대체 osSemaphoreCreate을 .
- 반환 유형이 osSemaphoreId_t 로 변경되었습니다 .
- 매개변수 목록 및 유형이 변경되었습니다.
osStatus_t osSemaphoreRelease (osSemaphoreId_t semaphore_id)
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
초기 최대 개수까지 세마포어 토큰을 해제합니다.
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 유형이 osSemaphoreId_t 로 변경되었습니다 .
더 이상
int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t timeout)
사용 되지 않습니다. osSemaphoreAcquire 로 대체되었습니다 .
메모리 풀
void * osMemoryPoolAlloc (osMemoryPoolId_t mp_id, uint32_t timeout)
void * osPoolAlloc (osPoolId pool_id)
메모리 풀에서 메모리 블록을 할당합니다.
- osMemoryPoolAlloc 함수 는 두 RTOS v1 함수 osPoolAlloc을 모두 대체합니다 .
- 매개변수 목록 및 유형이 변경되었습니다.
osStatus_t osMemoryPoolDelete (osMemoryPoolId_t mp_id)
없음
메모리 풀 개체를 삭제합니다.
새로운 기능.
osStatus_t osMemoryPoolFree (osMemoryPoolId_t mp_id, void * block)
osStatus osPoolFree (osPoolId pool_id, void * block)
할당된 메모리 블록을 다시 메모리 풀로 반환합니다.
- 함수 osMemoryPoolFree는 RTOS가 V1 기능 대체 osPoolFree을 .
- 첫 번째 매개변수 유형 osMemoryPoolId_t 는 ROTS v1 유형 osPoolId를 대체합니다 .
uint32_t osMemoryPoolGetBlockSize (osMemoryPoolId_t mp_id)
없음
메모리 풀에서 메모리 블록 크기를 가져옵니다.
새로운 기능.
uint32_t osMemoryPoolGetCapacity (osMemoryPoolId_t mp_id)
없음
메모리 풀의 최대 메모리 블록 수를 가져옵니다.
새로운 기능.
uint32_t osMemoryPoolGetCount (osMemoryPoolId_t mp_id)
없음
메모리 풀에서 사용된 메모리 블록의 수를 가져옵니다.
새로운 기능.
const char *osMemoryPoolGetName (osMemoryPoolId_t mp_id)
없음
메모리 풀 개체의 이름을 가져옵니다.
새로운 기능.
uint32_t osMemoryPoolGetSpace (osMemoryPoolId_t mp_id)
없음
메모리 풀에서 사용 가능한 메모리 블록 수를 가져옵니다.
새로운 기능.
osMemoryPoolId_t osMemoryPoolNew (uint32_t block_count, uint32_t block_size, const osMemoryPoolAttr_t *attr)
osPoolId osPoolCreate (const osPoolDef_t * pool_def)
메모리 풀에서 사용 가능한 메모리 블록 수를 가져옵니다.
- 기능 osMemoryPoolNew는 RTOS가 V1 기능 대체 osPoolCreate을 .
- 반환 유형이 osMemoryPoolId_t 로 변경되었습니다 .
- 매개변수 목록 및 매개변수 유형이 변경되었습니다.
메시지 대기열
일반적으로 메시지는 이제 32비트 값 대신 고정 크기 메모리를 사용합니다. 자세한 내용은 메시지 큐 를 참조하십시오.
osStatus_t osMessageQueueDelete (osMessageQueueId_t mq_id)
없음
Message Queue 객체를 삭제합니다.
새로운 기능.
osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)
osEvent osMessageGet (osMessageQId queue_id, uint32_t timeout)
대기열에서 메시지를 가져오거나 대기열이 비어 있으면 시간이 초과됩니다.
- 기능 osMessageQueueGet는 RTOS가 V1 기능 대체 osMessageGet을 .
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 목록 및 매개변수 유형이 변경되었습니다.
uint32_t osMessageQueueGetCapacity (osMessageQueueId_t mq_id)
없음
Message Queue의 최대 메시지 수를 가져옵니다.
새로운 기능.
uint32_t osMessageQueueGetCount (osMessageQueueId_t mq_id)
없음
Message Queue에서 대기 중인 메시지 수를 가져옵니다.
새로운 기능.
uint32_t osMessageQueueGetMsgSize (osMessageQueueId_t mq_id)
없음
Message Queue의 최대 메시지 크기를 가져옵니다.
새로운 기능.
const char *osMessageQueueGetName (osMessageQueueId_t mq_id)
없음
Message Queue 객체의 이름을 가져옵니다.
새로운 기능.
uint32_t osMessageQueueGetSpace (osMessageQueueId_t mq_id)
없음
Message Queue의 메시지에 사용 가능한 슬롯 수를 가져옵니다.
새로운 기능.
osMessageQueueId_t osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr)
osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id)
Message Queue 객체를 만들고 초기화합니다.
- 기능 osMessageQueueNew는 RTOS가 V1 기능 대체 osMessageCreate을 .
- 반환 유형이 osMessageQueueId_t 로 변경되었습니다 .
- 매개변수 목록 및 매개변수 유형이 변경되었습니다.
osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t timeout)
메시지를 대기열에 넣거나 대기열이 가득 찬 경우 시간 초과됩니다.
- 기능 osMessageQueuePut는 RTOS가 V1 기능 대체 osMessagePut을 .
- 반환 유형이 osStatus_t 로 변경되었습니다 .
- 매개변수 목록 및 매개변수 유형이 변경되었습니다.
osStatus_t osMessageQueueReset (osMessageQueueId_t mq_id)
없음
Message Queue를 초기 빈 상태로 재설정합니다.
새로운 기능.
메일 대기열
메일 큐 RTOS (V1) 기능이 사용되지 않습니다. 대신 Message Queue 의 기능을 사용하십시오 . 차이점은 Message Queue 아래에 나열됩니다 .
더 이상
void * osMailAlloc (osMailQId queue_id, uint32_t timeout)
사용 되지 않습니다.
더 이상
void * osMailCAlloc (osMailQId queue_id, uint32_t timeout)
사용 되지 않습니다.
더 이상
osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id)
사용 되지 않습니다.
더 이상
osStatus osMailFree (osMailQId queue_id, void *mail)
사용 되지 않습니다.
더 이상
osEvent osMailGet (osMailQId queue_id, uint32_t timeout)
사용 되지 않습니다.
더 이상
osStatus osMailPut (osMailQId queue_id, void *mail)
사용 되지 않습니다.
신호 이벤트
RTOS v1 신호 이벤트 섹션 은 더 이상 사용되지 않습니다. 대신 스레드 플래그 아래에 나열된 기능을 사용하십시오 .
더 이상
int32_t osSignalClear (osThreadId thread_id, int32_t signals)
사용 되지 않습니다.
더 이상
int32_t osSignalSet (osThreadId thread_id, int32_t signals)
사용 되지 않습니다.
더 이상
osEvent osSignalWait (int32_t signals, uint32_t timeout)
사용 되지 않습니다.
'하드웨어 > STM32(FreeRTOS)' 카테고리의 다른 글
5.STM32 FreeRTOS - preemptive, non-preemptive 설정하기 (0) | 2021.10.20 |
---|---|
4.STM32 FreeRTOS - CUBEIDE, Truestudio printf()함수로 디버깅 하기 (0) | 2021.10.20 |
3. STM32 FreeRTOS -Task 생성하기 (0) | 2021.10.19 |
2.STM32 FreeRTOS - systick Timer를 변경해주기 (0) | 2021.10.18 |
1. STM32 FreeRTOS - 직접 포팅하기 (0) | 2021.10.18 |