CMSIS2000  0.0.7
 Указатель Структуры данных Файлы Функции Переменные Определения типов Перечисления Элементы перечислений Макросы Группы Страницы
Файл cmsis_os.h
#include <stdint.h>
#include <stddef.h>
Граф включаемых заголовочных файлов для cmsis_os.h:

См. исходные тексты.

Структуры данных

struct  os_mailQ_def
 Definition structure for mail queue. Подробнее...
struct  os_messageQ_def
 Definition structure for message queue. Подробнее...
struct  os_mutex_def
 Mutex Definition structure contains setup information for a mutex. Подробнее...
struct  os_pool_def
 Definition structure for memory block allocation. Подробнее...
struct  os_semaphore_def
 Semaphore Definition structure contains setup information for a semaphore. Подробнее...
struct  os_thread_def
 Thread Definition structure contains startup information of a thread. Подробнее...
struct  os_timer_def
 Timer Definition structure contains timer parameters. Подробнее...
struct  osEvent
 Event structure contains detailed information about an event. Подробнее...

Макросы

#define osCMSIS   0x00003
 API version (main [31:16] .sub [15:0])
#define osCMSIS_KERNEL   0x10000
 RTOS identification and version (main [31:16] .sub [15:0])
#define osFeature_MailQ   1
 Mail Queues: 1=available, 0=not available.
#define osFeature_MainThread   1
 main thread 1=main can be thread, 0=not available
#define osFeature_MessageQ   1
 Message Queues: 1=available, 0=not available.
#define osFeature_Pool   1
 Memory Pools: 1=available, 0=not available.
#define osFeature_Semaphore   30
 maximum count for SemaphoreInit function
#define osFeature_Signals   8
 maximum number of Signal Flags available per thread
#define osFeature_Wait   1
 osWait function: 1=available, 0=not available
#define osKernelSystemId   "KERNEL V1.00"
 RTOS identification string.
#define osMailQ(name)   &os_mailQ_def_##name
 Access a Mail Queue Definition.
#define osMailQDef(name, queue_sz, type)
 Create a Mail Queue Definition.
#define osMessageQ(name)   &os_messageQ_def_##name
 Access a Message Queue Definition.
#define osMessageQDef(name, queue_sz, type)
 Create a Message Queue Definition.
#define osMutex(name)   &os_mutex_def_##name
 Access a Mutex defintion.
#define osMutexDef(name)   osMutexDef_t os_mutex_def_##name = { 0 }
 Define a Mutex.
#define osPool(name)   &os_pool_def_##name
 Access a Memory Pool definition.
#define osPoolDef(name, no, type)
 Define a Memory Pool.
#define osSemaphore(name)   &os_semaphore_def_##name
 Access a Semaphore definition.
#define osSemaphoreDef(name)   osSemaphoreDef_t os_semaphore_def_##name = { 0 }
 Define a Semaphore object.
#define osThread(name)   &os_thread_def_##name
 Access a Thread defintion.
#define osThreadDef(name, priority, instances, stacksz)
 Create a Thread Definition with function, priority, and stack requirements.
#define osTimer(name)   &os_timer_def_##name
 Access a Timer definition.
#define osTimerDef(name, function)
 Define a Timer object.
#define osWaitForever   0xFFFFFFFF
 Timeout value.

Определения типов

typedef void(* os_pthread )(void const *argument)
 Entry point of a thread.
typedef void(* os_ptimer )(void const *argument)
 Entry point of a timer call back function.
typedef struct os_mailQ_def osMailQDef_t
 Definition structure for mail queue.
typedef struct os_mailQ_cb * osMailQId
 Mail ID identifies the mail queue (pointer to a mail queue control block).
typedef struct os_messageQ_def osMessageQDef_t
 Definition structure for message queue.
typedef struct os_messageQ_cb * osMessageQId
 Message ID identifies the message queue (pointer to a message queue control block).
typedef struct os_mutex_def osMutexDef_t
 Mutex Definition structure contains setup information for a mutex.
typedef struct os_mutex_cb * osMutexId
 Mutex ID identifies the mutex (pointer to a mutex control block).
typedef struct os_pool_def osPoolDef_t
 Definition structure for memory block allocation.
typedef struct os_pool_cb * osPoolId
 Pool ID identifies the memory pool (pointer to a memory pool control block).
typedef struct os_semaphore_def osSemaphoreDef_t
 Semaphore Definition structure contains setup information for a semaphore.
typedef struct os_semaphore_cb * osSemaphoreId
 Semaphore ID identifies the semaphore (pointer to a semaphore control block).
typedef struct os_thread_def osThreadDef_t
 Thread Definition structure contains startup information of a thread.
typedef struct os_thread_cb * osThreadId
 Thread ID identifies the thread (pointer to a thread control block).
typedef struct os_timer_def osTimerDef_t
 Timer Definition structure contains timer parameters.
typedef struct os_timer_cb * osTimerId
 Timer ID identifies the timer (pointer to a timer control block).

Перечисления

enum  os_timer_type { osTimerOnce = 0, osTimerPeriodic = 1 }
 Timer type value for the timer definition. Подробнее...
enum  osPriority {
  osPriorityIdle = -3, osPriorityLow = -2, osPriorityBelowNormal = -1, osPriorityNormal = 0,
  osPriorityAboveNormal = +1, osPriorityHigh = +2, osPriorityRealtime = +3, osPriorityError = 0x84
}
 Priority used for thread control. Подробнее...
enum  osStatus {
  osOK = 0, osEventSignal = 0x08, osEventMessage = 0x10, osEventMail = 0x20,
  osEventTimeout = 0x40, osErrorParameter = 0x80, osErrorResource = 0x81, osErrorTimeoutResource = 0xC1,
  osErrorISR = 0x82, osErrorISRRecursive = 0x83, osErrorPriority = 0x84, osErrorNoMemory = 0x85,
  osErrorValue = 0x86, osErrorOS = 0xFF, os_status_reserved = 0x7FFFFFFF
}
 Status code values returned by CMSIS-RTOS functions. Подробнее...

Функции

osStatus osDelay (uint32_t millisec)
 Wait for Timeout (Time Delay)
int32_t osKernelRunning (void)
 Check if the RTOS kernel is already started.
osStatus osKernelStart (osThreadDef_t *thread_def, void *argument)
 Start the RTOS Kernel with executing the specified thread.
void * osMailAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail.
void * osMailCAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail and set memory block to zero.
osMailQId osMailCreate (osMailQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize mail queue.
osStatus osMailFree (osMailQId queue_id, void *mail)
 Free a memory block from a mail.
osEvent osMailGet (osMailQId queue_id, uint32_t millisec)
 Get a mail from a queue.
osStatus osMailPut (osMailQId queue_id, void *mail)
 Put a mail to a queue.
osMessageQId osMessageCreate (osMessageQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize a Message Queue.
osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec)
 Get a Message or Wait for a Message from a Queue.
osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec)
 Put a Message to a Queue.
osMutexId osMutexCreate (osMutexDef_t *mutex_def)
 Create and Initialize a Mutex object.
osStatus osMutexRelease (osMutexId mutex_id)
 Release a Mutex that was obtained by osMutexWait.
osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec)
 Wait until a Mutex becomes available.
void * osPoolAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool.
void * osPoolCAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool and set memory block to zero.
osPoolId osPoolCreate (osPoolDef_t *pool_def)
 Create and Initialize a memory pool.
osStatus osPoolFree (osPoolId pool_id, void *block)
 Return an allocated memory block back to a specific memory pool.
osSemaphoreId osSemaphoreCreate (osSemaphoreDef_t *semaphore_def, int32_t count)
 Create and Initialize a Semaphore object used for managing resources.
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
 Release a Semaphore token.
int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec)
 Wait until a Semaphore token becomes available.
int32_t osSignalClear (osThreadId thread_id, int32_t signal)
 Clear the specified Signal Flags of an active thread.
int32_t osSignalGet (osThreadId thread_id)
 Get Signal Flags status of an active thread.
int32_t osSignalSet (osThreadId thread_id, int32_t signal)
 Set the specified Signal Flags of an active thread.
osEvent osSignalWait (int32_t signals, uint32_t millisec)
 Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
osThreadId osThreadCreate (osThreadDef_t *thread_def, void *argument)
 Create a thread and add it to Active Threads and set it to state READY.
osThreadId osThreadGetId (void)
 Return the thread ID of the current running thread.
osPriority osThreadGetPriority (osThreadId thread_id)
 Get current priority of an active thread.
osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority)
 Change priority of an active thread.
osStatus osThreadTerminate (osThreadId thread_id)
 Terminate execution of a thread and remove it from Active Threads.
osStatus osThreadYield (void)
 Pass control to next thread that is in state READY.
osTimerId osTimerCreate (osTimerDef_t *timer_def, os_timer_type type, void *argument)
 Create a timer.
osStatus osTimerStart (osTimerId timer_id, uint32_t millisec)
 Start or restart a timer.
osStatus osTimerStop (osTimerId timer_id)
 Stop the timer.
osEvent osWait (uint32_t millisec)
 Wait for Signal, Message, Mail, or Timeout.

Макросы

#define osCMSIS   0x00003

API version (main [31:16] .sub [15:0])

Заметки
MUST REMAIN UNCHANGED: osCMSIS identifies the CMSIS-RTOS API version

См. определение в файле cmsis_os.h строка 100

#define osCMSIS_KERNEL   0x10000

RTOS identification and version (main [31:16] .sub [15:0])

Заметки
CAN BE CHANGED: osCMSIS_KERNEL identifies the underlaying RTOS kernel and version number.

См. определение в файле cmsis_os.h строка 103

#define osFeature_MailQ   1

Mail Queues: 1=available, 0=not available.

См. определение в файле cmsis_os.h строка 111

#define osFeature_MainThread   1

main thread 1=main can be thread, 0=not available

Заметки
MUST REMAIN UNCHANGED: osFeature_xxx shall be consistent in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 109

#define osFeature_MessageQ   1

Message Queues: 1=available, 0=not available.

См. определение в файле cmsis_os.h строка 112

#define osFeature_Pool   1

Memory Pools: 1=available, 0=not available.

См. определение в файле cmsis_os.h строка 110

#define osFeature_Semaphore   30

maximum count for SemaphoreInit function

См. определение в файле cmsis_os.h строка 114

#define osFeature_Signals   8

maximum number of Signal Flags available per thread

См. определение в файле cmsis_os.h строка 113

#define osFeature_Wait   1

osWait function: 1=available, 0=not available

См. определение в файле cmsis_os.h строка 115

#define osKernelSystemId   "KERNEL V1.00"

RTOS identification string.

Заметки
MUST REMAIN UNCHANGED: osKernelSystemId shall be consistent in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 106

#define osMailQ (   name)    &os_mailQ_def_##name

Access a Mail Queue Definition.

Аргументы
namename of the queue
Заметки
CAN BE CHANGED: The parameter to osMailQ shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 665

#define osMailQDef (   name,
  queue_sz,
  type 
)
Макроопределение:
osMailQDef_t os_mailQ_def_##name = \
{ (queue_sz), sizeof (type) }

Create a Mail Queue Definition.

Аргументы
namename of the queue
queue_szmaximum number of messages in queue
typedata type of a single message element
Заметки
CAN BE CHANGED: The parameter to osMailQDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 656

#define osMessageQ (   name)    &os_messageQ_def_##name

Access a Message Queue Definition.

Аргументы
namename of the queue
Заметки
CAN BE CHANGED: The parameter to osMessageQ shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 614

#define osMessageQDef (   name,
  queue_sz,
  type 
)
Макроопределение:
osMessageQDef_t os_messageQ_def_##name = \
{ (queue_sz), sizeof (type) }

Create a Message Queue Definition.

Аргументы
namename of the queue.
queue_szmaximum number of messages in the queue.
typedata type of a single message element (for debugger).
Заметки
CAN BE CHANGED: The parameter to osMessageQDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 605

#define osMutex (   name)    &os_mutex_def_##name

Access a Mutex defintion.

Аргументы
namename of the mutex object.
Заметки
CAN BE CHANGED: The parameter to osMutex shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 469

#define osMutexDef (   name)    osMutexDef_t os_mutex_def_##name = { 0 }

Define a Mutex.

Аргументы
namename of the mutex object.
Заметки
CAN BE CHANGED: The parameter to osMutexDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 461

#define osPool (   name)    &os_pool_def_##name

Access a Memory Pool definition.

Аргументы
namename of the memory pool
Заметки
CAN BE CHANGED: The parameter to osPool shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 560

#define osPoolDef (   name,
  no,
  type 
)
Макроопределение:
osPoolDef_t os_pool_def_##name = \
{ (no), sizeof(type), NULL }

Define a Memory Pool.

Аргументы
namename of the memory pool.
nomaximum number of objects (elements) in the memory pool.
typedata type of a single object (element).
Заметки
CAN BE CHANGED: The parameter to osPoolDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 551

#define osSemaphore (   name)    &os_semaphore_def_##name

Access a Semaphore definition.

Аргументы
namename of the semaphore object.
Заметки
CAN BE CHANGED: The parameter to osSemaphore shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 512

#define osSemaphoreDef (   name)    osSemaphoreDef_t os_semaphore_def_##name = { 0 }

Define a Semaphore object.

Аргументы
namename of the semaphore object.
Заметки
CAN BE CHANGED: The parameter to osSemaphoreDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 504

#define osThread (   name)    &os_thread_def_##name

Access a Thread defintion.

Аргументы
namename of the thread definition object.
Заметки
CAN BE CHANGED: The parameter to osThread shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 317

#define osThreadDef (   name,
  priority,
  instances,
  stacksz 
)
Макроопределение:
osThreadDef_t os_thread_def_##name = \
{ (name), (priority), (instances), (stacksz) }

Create a Thread Definition with function, priority, and stack requirements.

Аргументы
namename of the thread function.
priorityinitial priority of the thread function.
instancesnumber of possible thread instances.
stackszstack size (in bytes) requirements for the thread function.
Заметки
CAN BE CHANGED: The parameters to osThreadDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 308

#define osTimer (   name)    &os_timer_def_##name

Access a Timer definition.

Аргументы
namename of the timer object.
Заметки
CAN BE CHANGED: The parameter to osTimer shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 396

#define osTimerDef (   name,
  function 
)
Макроопределение:
osTimerDef_t os_timer_def_##name = \
{ (function) }

Define a Timer object.

Аргументы
namename of the timer object.
functionname of the timer call back function.
Заметки
CAN BE CHANGED: The parameter to osTimerDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 387

#define osWaitForever   0xFFFFFFFF

Timeout value.

Заметки
MUST REMAIN UNCHANGED: osWaitForever shall be consistent in every CMSIS-RTOS. wait forever timeout value

См. определение в файле cmsis_os.h строка 143

Типы

typedef void(* os_pthread)(void const *argument)

Entry point of a thread.

Заметки
MUST REMAIN UNCHANGED: os_pthread shall be consistent in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 175

typedef void(* os_ptimer)(void const *argument)

Entry point of a timer call back function.

Заметки
MUST REMAIN UNCHANGED: os_ptimer shall be consistent in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 179

typedef struct os_mailQ_def osMailQDef_t

Definition structure for mail queue.

Заметки
CAN BE CHANGED: os_mailQ_def is implementation specific in every CMSIS-RTOS.
typedef struct os_mailQ_cb* osMailQId

Mail ID identifies the mail queue (pointer to a mail queue control block).

Заметки
CAN BE CHANGED: os_mailQ_cb is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 209

Definition structure for message queue.

Заметки
CAN BE CHANGED: os_messageQ_def is implementation specific in every CMSIS-RTOS.
typedef struct os_messageQ_cb* osMessageQId

Message ID identifies the message queue (pointer to a message queue control block).

Заметки
CAN BE CHANGED: os_messageQ_cb is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 205

typedef struct os_mutex_def osMutexDef_t

Mutex Definition structure contains setup information for a mutex.

Заметки
CAN BE CHANGED: os_mutex_def is implementation specific in every CMSIS-RTOS.
typedef struct os_mutex_cb* osMutexId

Mutex ID identifies the mutex (pointer to a mutex control block).

Заметки
CAN BE CHANGED: os_mutex_cb is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 193

typedef struct os_pool_def osPoolDef_t

Definition structure for memory block allocation.

Заметки
CAN BE CHANGED: os_pool_def is implementation specific in every CMSIS-RTOS.
typedef struct os_pool_cb* osPoolId

Pool ID identifies the memory pool (pointer to a memory pool control block).

Заметки
CAN BE CHANGED: os_pool_cb is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 201

Semaphore Definition structure contains setup information for a semaphore.

Заметки
CAN BE CHANGED: os_semaphore_def is implementation specific in every CMSIS-RTOS.
typedef struct os_semaphore_cb* osSemaphoreId

Semaphore ID identifies the semaphore (pointer to a semaphore control block).

Заметки
CAN BE CHANGED: os_semaphore_cb is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 197

typedef struct os_thread_def osThreadDef_t

Thread Definition structure contains startup information of a thread.

Заметки
CAN BE CHANGED: os_thread_def is implementation specific in every CMSIS-RTOS.
typedef struct os_thread_cb* osThreadId

Thread ID identifies the thread (pointer to a thread control block).

Заметки
CAN BE CHANGED: os_thread_cb is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 185

typedef struct os_timer_def osTimerDef_t

Timer Definition structure contains timer parameters.

Заметки
CAN BE CHANGED: os_timer_def is implementation specific in every CMSIS-RTOS.
typedef struct os_timer_cb* osTimerId

Timer ID identifies the timer (pointer to a timer control block).

Заметки
CAN BE CHANGED: os_timer_cb is implementation specific in every CMSIS-RTOS.

См. определение в файле cmsis_os.h строка 189

Перечисления

Timer type value for the timer definition.

Заметки
MUST REMAIN UNCHANGED: os_timer_type shall be consistent in every CMSIS-RTOS.
Элементы перечислений:
osTimerOnce 

one-shot timer

osTimerPeriodic 

repeating timer

См. определение в файле cmsis_os.h строка 168

enum osPriority

Priority used for thread control.

Заметки
MUST REMAIN UNCHANGED: osPriority shall be consistent in every CMSIS-RTOS.
Элементы перечислений:
osPriorityIdle 

priority: idle (lowest)

osPriorityLow 

priority: low

osPriorityBelowNormal 

priority: below normal

osPriorityNormal 

priority: normal (default)

osPriorityAboveNormal 

priority: above normal

osPriorityHigh 

priority: high

osPriorityRealtime 

priority: realtime (highest)

osPriorityError 

system cannot determine priority or thread has illegal priority

См. определение в файле cmsis_os.h строка 130

enum osStatus

Status code values returned by CMSIS-RTOS functions.

Заметки
MUST REMAIN UNCHANGED: osStatus shall be consistent in every CMSIS-RTOS.
Элементы перечислений:
osOK 

function completed; no event occurred.

osEventSignal 

function completed; signal event occurred.

osEventMessage 

function completed; message event occurred.

osEventMail 

function completed; mail event occurred.

osEventTimeout 

function completed; timeout occurred.

osErrorParameter 

parameter error: a mandatory parameter was missing or specified an incorrect object.

osErrorResource 

resource not available: a specified resource was not available.

osErrorTimeoutResource 

resource not available within given time: a specified resource was not available within the timeout period.

osErrorISR 

not allowed in ISR context: the function cannot be called from interrupt service routines.

osErrorISRRecursive 

function called multiple times from ISR with same object.

osErrorPriority 

system cannot determine priority or thread has illegal priority.

osErrorNoMemory 

system is out of memory: it was impossible to allocate or reserve memory for the operation.

osErrorValue 

value of a parameter is out of range.

osErrorOS 

unspecified RTOS error: run-time error but no other error message fits.

os_status_reserved 

prevent from enum down-size compiler optimization.

См. определение в файле cmsis_os.h строка 147

Функции

osStatus osDelay ( uint32_t  millisec)

Wait for Timeout (Time Delay)

Аргументы
[in]millisectime delay value
Возвращает
status code that indicates the execution status of the function.
int32_t osKernelRunning ( void  )

Check if the RTOS kernel is already started.

Заметки
MUST REMAIN UNCHANGED: osKernelRunning shall be consistent in every CMSIS-RTOS.
Возвращает
0 RTOS is not started, 1 RTOS is started.
osStatus osKernelStart ( osThreadDef_t thread_def,
void *  argument 
)

Start the RTOS Kernel with executing the specified thread.

Аргументы
[in]thread_defthread definition referenced with osThread.
[in]argumentpointer that is passed to the thread function as start argument.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osKernelStart shall be consistent in every CMSIS-RTOS.
void* osMailAlloc ( osMailQId  queue_id,
uint32_t  millisec 
)

Allocate a memory block from a mail.

Аргументы
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisectimeout value or 0 in case of no time-out
Возвращает
pointer to memory block that can be filled with mail or NULL in case error.
Заметки
MUST REMAIN UNCHANGED: osMailAlloc shall be consistent in every CMSIS-RTOS.
void* osMailCAlloc ( osMailQId  queue_id,
uint32_t  millisec 
)

Allocate a memory block from a mail and set memory block to zero.

Аргументы
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisectimeout value or 0 in case of no time-out
Возвращает
pointer to memory block that can shall filled with mail or NULL in case error.
Заметки
MUST REMAIN UNCHANGED: osMailCAlloc shall be consistent in every CMSIS-RTOS.
osMailQId osMailCreate ( osMailQDef_t queue_def,
osThreadId  thread_id 
)

Create and Initialize mail queue.

Аргументы
[in]queue_defreference to the mail queue definition obtain with osMailQ
[in]thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Возвращает
mail queue ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osMailCreate shall be consistent in every CMSIS-RTOS.
osStatus osMailFree ( osMailQId  queue_id,
void *  mail 
)

Free a memory block from a mail.

Аргументы
[in]queue_idmail queue ID obtained with osMailCreate.
[in]mailpointer to the memory block that was obtained with osMailGet.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osMailFree shall be consistent in every CMSIS-RTOS.
osEvent osMailGet ( osMailQId  queue_id,
uint32_t  millisec 
)

Get a mail from a queue.

Аргументы
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisectimeout value or 0 in case of no time-out
Возвращает
event that contains mail information or error code.
Заметки
MUST REMAIN UNCHANGED: osMailGet shall be consistent in every CMSIS-RTOS.
osStatus osMailPut ( osMailQId  queue_id,
void *  mail 
)

Put a mail to a queue.

Аргументы
[in]queue_idmail queue ID obtained with osMailCreate.
[in]mailmemory block previously allocated with osMailAlloc or osMailCAlloc.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osMailPut shall be consistent in every CMSIS-RTOS.
osMessageQId osMessageCreate ( osMessageQDef_t queue_def,
osThreadId  thread_id 
)

Create and Initialize a Message Queue.

Аргументы
[in]queue_defqueue definition referenced with osMessageQ.
[in]thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Возвращает
message queue ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osMessageCreate shall be consistent in every CMSIS-RTOS.
osEvent osMessageGet ( osMessageQId  queue_id,
uint32_t  millisec 
)

Get a Message or Wait for a Message from a Queue.

Аргументы
[in]queue_idmessage queue ID obtained with osMessageCreate.
[in]millisectimeout value or 0 in case of no time-out.
Возвращает
event information that includes status code.
Заметки
MUST REMAIN UNCHANGED: osMessageGet shall be consistent in every CMSIS-RTOS.
osStatus osMessagePut ( osMessageQId  queue_id,
uint32_t  info,
uint32_t  millisec 
)

Put a Message to a Queue.

Аргументы
[in]queue_idmessage queue ID obtained with osMessageCreate.
[in]infomessage information.
[in]millisectimeout value or 0 in case of no time-out.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osMessagePut shall be consistent in every CMSIS-RTOS.
osMutexId osMutexCreate ( osMutexDef_t mutex_def)

Create and Initialize a Mutex object.

Аргументы
[in]mutex_defmutex definition referenced with osMutex.
Возвращает
mutex ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osMutexCreate shall be consistent in every CMSIS-RTOS.
osStatus osMutexRelease ( osMutexId  mutex_id)

Release a Mutex that was obtained by osMutexWait.

Аргументы
[in]mutex_idmutex ID obtained by osMutexCreate.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osMutexRelease shall be consistent in every CMSIS-RTOS.
osStatus osMutexWait ( osMutexId  mutex_id,
uint32_t  millisec 
)

Wait until a Mutex becomes available.

Аргументы
[in]mutex_idmutex ID obtained by osMutexCreate.
[in]millisectimeout value or 0 in case of no time-out.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osMutexWait shall be consistent in every CMSIS-RTOS.
void* osPoolAlloc ( osPoolId  pool_id)

Allocate a memory block from a memory pool.

Аргументы
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
Возвращает
address of the allocated memory block or NULL in case of no memory available.
Заметки
MUST REMAIN UNCHANGED: osPoolAlloc shall be consistent in every CMSIS-RTOS.
void* osPoolCAlloc ( osPoolId  pool_id)

Allocate a memory block from a memory pool and set memory block to zero.

Аргументы
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
Возвращает
address of the allocated memory block or NULL in case of no memory available.
Заметки
MUST REMAIN UNCHANGED: osPoolCAlloc shall be consistent in every CMSIS-RTOS.
osPoolId osPoolCreate ( osPoolDef_t pool_def)

Create and Initialize a memory pool.

Аргументы
[in]pool_defmemory pool definition referenced with osPool.
Возвращает
memory pool ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osPoolCreate shall be consistent in every CMSIS-RTOS.
osStatus osPoolFree ( osPoolId  pool_id,
void *  block 
)

Return an allocated memory block back to a specific memory pool.

Аргументы
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
[in]blockaddress of the allocated memory block that is returned to the memory pool.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osPoolFree shall be consistent in every CMSIS-RTOS.
osSemaphoreId osSemaphoreCreate ( osSemaphoreDef_t semaphore_def,
int32_t  count 
)

Create and Initialize a Semaphore object used for managing resources.

Аргументы
[in]semaphore_defsemaphore definition referenced with osSemaphore.
[in]countnumber of available resources.
Возвращает
semaphore ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
osStatus osSemaphoreRelease ( osSemaphoreId  semaphore_id)

Release a Semaphore token.

Аргументы
[in]semaphore_idsemaphore object referenced with osSemaphore.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
int32_t osSemaphoreWait ( osSemaphoreId  semaphore_id,
uint32_t  millisec 
)

Wait until a Semaphore token becomes available.

Аргументы
[in]semaphore_idsemaphore object referenced with osSemaphore.
[in]millisectimeout value or 0 in case of no time-out.
Возвращает
number of available tokens, or -1 in case of incorrect parameters.
Заметки
MUST REMAIN UNCHANGED: osSemaphoreWait shall be consistent in every CMSIS-RTOS.
int32_t osSignalClear ( osThreadId  thread_id,
int32_t  signal 
)

Clear the specified Signal Flags of an active thread.

Аргументы
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]signalspecifies the signal flags of the thread that shall be cleared.
Возвращает
previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
Заметки
MUST REMAIN UNCHANGED: osSignalClear shall be consistent in every CMSIS-RTOS.
int32_t osSignalGet ( osThreadId  thread_id)

Get Signal Flags status of an active thread.

Аргументы
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Возвращает
previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
Заметки
MUST REMAIN UNCHANGED: osSignalGet shall be consistent in every CMSIS-RTOS.
int32_t osSignalSet ( osThreadId  thread_id,
int32_t  signal 
)

Set the specified Signal Flags of an active thread.

Аргументы
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]signalspecifies the signal flags of the thread that should be set.
Возвращает
previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
Заметки
MUST REMAIN UNCHANGED: osSignalSet shall be consistent in every CMSIS-RTOS.
osEvent osSignalWait ( int32_t  signals,
uint32_t  millisec 
)

Wait for one or more Signal Flags to become signaled for the current RUNNING thread.

Аргументы
[in]signalswait until all specified signal flags set or 0 for any single signal flag.
[in]millisectimeout value or 0 in case of no time-out.
Возвращает
event flag information or error code.
Заметки
MUST REMAIN UNCHANGED: osSignalWait shall be consistent in every CMSIS-RTOS.
osThreadId osThreadCreate ( osThreadDef_t thread_def,
void *  argument 
)

Create a thread and add it to Active Threads and set it to state READY.

Аргументы
[in]thread_defthread definition referenced with osThread.
[in]argumentpointer that is passed to the thread function as start argument.
Возвращает
thread ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osThreadCreate shall be consistent in every CMSIS-RTOS.
osThreadId osThreadGetId ( void  )

Return the thread ID of the current running thread.

Возвращает
thread ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osThreadGetId shall be consistent in every CMSIS-RTOS.
osPriority osThreadGetPriority ( osThreadId  thread_id)

Get current priority of an active thread.

Аргументы
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Возвращает
current priority value of the thread function.
Заметки
MUST REMAIN UNCHANGED: osThreadGetPriority shall be consistent in every CMSIS-RTOS.
osStatus osThreadSetPriority ( osThreadId  thread_id,
osPriority  priority 
)

Change priority of an active thread.

Аргументы
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]prioritynew priority value for the thread function.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osThreadSetPriority shall be consistent in every CMSIS-RTOS.
osStatus osThreadTerminate ( osThreadId  thread_id)

Terminate execution of a thread and remove it from Active Threads.

Аргументы
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osThreadTerminate shall be consistent in every CMSIS-RTOS.
osStatus osThreadYield ( void  )

Pass control to next thread that is in state READY.

Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osThreadYield shall be consistent in every CMSIS-RTOS.
osTimerId osTimerCreate ( osTimerDef_t timer_def,
os_timer_type  type,
void *  argument 
)

Create a timer.

Аргументы
[in]timer_deftimer object referenced with osTimer.
[in]typeosTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
[in]argumentargument to the timer call back function.
Возвращает
timer ID for reference by other functions or NULL in case of error.
Заметки
MUST REMAIN UNCHANGED: osTimerCreate shall be consistent in every CMSIS-RTOS.
osStatus osTimerStart ( osTimerId  timer_id,
uint32_t  millisec 
)

Start or restart a timer.

Аргументы
[in]timer_idtimer ID obtained by osTimerCreate.
[in]millisectime delay value of the timer.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osTimerStart shall be consistent in every CMSIS-RTOS.
osStatus osTimerStop ( osTimerId  timer_id)

Stop the timer.

Аргументы
[in]timer_idtimer ID obtained by osTimerCreate.
Возвращает
status code that indicates the execution status of the function.
Заметки
MUST REMAIN UNCHANGED: osTimerStop shall be consistent in every CMSIS-RTOS.
osEvent osWait ( uint32_t  millisec)

Wait for Signal, Message, Mail, or Timeout.

Аргументы
[in]millisectimeout value or 0 in case of no time-out
Возвращает
event that contains signal, message, or mail information or error code.
Заметки
MUST REMAIN UNCHANGED: osWait shall be consistent in every CMSIS-RTOS.