CMSIS2000
0.0.7
|
Go to the source code of this file.
Data Structures | |
struct | os_mailQ_def |
Definition structure for mail queue. More... | |
struct | os_messageQ_def |
Definition structure for message queue. More... | |
struct | os_mutex_def |
Mutex Definition structure contains setup information for a mutex. More... | |
struct | os_pool_def |
Definition structure for memory block allocation. More... | |
struct | os_semaphore_def |
Semaphore Definition structure contains setup information for a semaphore. More... | |
struct | os_thread_def |
Thread Definition structure contains startup information of a thread. More... | |
struct | os_timer_def |
Timer Definition structure contains timer parameters. More... | |
struct | osEvent |
Event structure contains detailed information about an event. More... |
Macros | |
#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. |
Typedefs | |
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). |
Enumerations | |
enum | os_timer_type { osTimerOnce = 0, osTimerPeriodic = 1 } |
Timer type value for the timer definition. More... | |
enum | osPriority { osPriorityIdle = -3, osPriorityLow = -2, osPriorityBelowNormal = -1, osPriorityNormal = 0, osPriorityAboveNormal = +1, osPriorityHigh = +2, osPriorityRealtime = +3, osPriorityError = 0x84 } |
Priority used for thread control. More... | |
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. More... |
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])
Definition at line 100 of file cmsis_os.h.
#define osCMSIS_KERNEL 0x10000 |
RTOS identification and version (main [31:16] .sub [15:0])
Definition at line 103 of file cmsis_os.h.
#define osFeature_MailQ 1 |
Mail Queues: 1=available, 0=not available.
Definition at line 111 of file cmsis_os.h.
#define osFeature_MainThread 1 |
main thread 1=main can be thread, 0=not available
Definition at line 109 of file cmsis_os.h.
#define osFeature_MessageQ 1 |
Message Queues: 1=available, 0=not available.
Definition at line 112 of file cmsis_os.h.
#define osFeature_Pool 1 |
Memory Pools: 1=available, 0=not available.
Definition at line 110 of file cmsis_os.h.
#define osFeature_Semaphore 30 |
maximum count for SemaphoreInit function
Definition at line 114 of file cmsis_os.h.
#define osFeature_Signals 8 |
maximum number of Signal Flags available per thread
Definition at line 113 of file cmsis_os.h.
#define osFeature_Wait 1 |
osWait function: 1=available, 0=not available
Definition at line 115 of file cmsis_os.h.
#define osKernelSystemId "KERNEL V1.00" |
RTOS identification string.
Definition at line 106 of file cmsis_os.h.
#define osMailQ | ( | name | ) | &os_mailQ_def_##name |
Access a Mail Queue Definition.
name | name of the queue |
Definition at line 665 of file cmsis_os.h.
#define osMailQDef | ( | name, | |
queue_sz, | |||
type | |||
) |
Create a Mail Queue Definition.
name | name of the queue |
queue_sz | maximum number of messages in queue |
type | data type of a single message element |
Definition at line 656 of file cmsis_os.h.
#define osMessageQ | ( | name | ) | &os_messageQ_def_##name |
Access a Message Queue Definition.
name | name of the queue |
Definition at line 614 of file cmsis_os.h.
#define osMessageQDef | ( | name, | |
queue_sz, | |||
type | |||
) |
Create a Message Queue Definition.
name | name of the queue. |
queue_sz | maximum number of messages in the queue. |
type | data type of a single message element (for debugger). |
Definition at line 605 of file cmsis_os.h.
#define osMutex | ( | name | ) | &os_mutex_def_##name |
Access a Mutex defintion.
name | name of the mutex object. |
Definition at line 469 of file cmsis_os.h.
#define osMutexDef | ( | name | ) | osMutexDef_t os_mutex_def_##name = { 0 } |
Define a Mutex.
name | name of the mutex object. |
Definition at line 461 of file cmsis_os.h.
#define osPool | ( | name | ) | &os_pool_def_##name |
Access a Memory Pool definition.
name | name of the memory pool |
Definition at line 560 of file cmsis_os.h.
#define osPoolDef | ( | name, | |
no, | |||
type | |||
) |
Define a Memory Pool.
name | name of the memory pool. |
no | maximum number of objects (elements) in the memory pool. |
type | data type of a single object (element). |
Definition at line 551 of file cmsis_os.h.
#define osSemaphore | ( | name | ) | &os_semaphore_def_##name |
Access a Semaphore definition.
name | name of the semaphore object. |
Definition at line 512 of file cmsis_os.h.
#define osSemaphoreDef | ( | name | ) | osSemaphoreDef_t os_semaphore_def_##name = { 0 } |
Define a Semaphore object.
name | name of the semaphore object. |
Definition at line 504 of file cmsis_os.h.
#define osThread | ( | name | ) | &os_thread_def_##name |
Access a Thread defintion.
name | name of the thread definition object. |
Definition at line 317 of file cmsis_os.h.
#define osThreadDef | ( | name, | |
priority, | |||
instances, | |||
stacksz | |||
) |
Create a Thread Definition with function, priority, and stack requirements.
name | name of the thread function. |
priority | initial priority of the thread function. |
instances | number of possible thread instances. |
stacksz | stack size (in bytes) requirements for the thread function. |
Definition at line 308 of file cmsis_os.h.
#define osTimer | ( | name | ) | &os_timer_def_##name |
Access a Timer definition.
name | name of the timer object. |
Definition at line 396 of file cmsis_os.h.
#define osTimerDef | ( | name, | |
function | |||
) |
Define a Timer object.
name | name of the timer object. |
function | name of the timer call back function. |
Definition at line 387 of file cmsis_os.h.
#define osWaitForever 0xFFFFFFFF |
Timeout value.
Definition at line 143 of file cmsis_os.h.
typedef void(* os_pthread)(void const *argument) |
Entry point of a thread.
Definition at line 175 of file cmsis_os.h.
typedef void(* os_ptimer)(void const *argument) |
Entry point of a timer call back function.
Definition at line 179 of file cmsis_os.h.
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).
Definition at line 209 of file cmsis_os.h.
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).
Definition at line 205 of file cmsis_os.h.
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).
Definition at line 193 of file cmsis_os.h.
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).
Definition at line 201 of file cmsis_os.h.
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).
Definition at line 197 of file cmsis_os.h.
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).
Definition at line 185 of file cmsis_os.h.
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).
Definition at line 189 of file cmsis_os.h.
enum os_timer_type |
Timer type value for the timer definition.
Definition at line 168 of file cmsis_os.h.
enum osPriority |
Priority used for thread control.
Definition at line 130 of file cmsis_os.h.
enum osStatus |
Status code values returned by CMSIS-RTOS functions.
Definition at line 147 of file cmsis_os.h.
Wait for Timeout (Time Delay)
[in] | millisec | time delay value |
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.
[in] | thread_def | thread definition referenced with osThread. |
[in] | argument | pointer that is passed to the thread function as start argument. |
Allocate a memory block from a mail.
[in] | queue_id | mail queue ID obtained with osMailCreate. |
[in] | millisec | timeout value or 0 in case of no time-out |
Allocate a memory block from a mail and set memory block to zero.
[in] | queue_id | mail queue ID obtained with osMailCreate. |
[in] | millisec | timeout value or 0 in case of no time-out |
osMailQId osMailCreate | ( | osMailQDef_t * | queue_def, |
osThreadId | thread_id | ||
) |
Create and Initialize mail queue.
[in] | queue_def | reference to the mail queue definition obtain with osMailQ |
[in] | thread_id | thread ID (obtained by osThreadCreate or osThreadGetId) or NULL. |
Free a memory block from a mail.
[in] | queue_id | mail queue ID obtained with osMailCreate. |
[in] | pointer to the memory block that was obtained with osMailGet. |
Get a mail from a queue.
[in] | queue_id | mail queue ID obtained with osMailCreate. |
[in] | millisec | timeout value or 0 in case of no time-out |
Put a mail to a queue.
[in] | queue_id | mail queue ID obtained with osMailCreate. |
[in] | memory block previously allocated with osMailAlloc or osMailCAlloc. |
osMessageQId osMessageCreate | ( | osMessageQDef_t * | queue_def, |
osThreadId | thread_id | ||
) |
Create and Initialize a Message Queue.
[in] | queue_def | queue definition referenced with osMessageQ. |
[in] | thread_id | thread ID (obtained by osThreadCreate or osThreadGetId) or NULL. |
osEvent osMessageGet | ( | osMessageQId | queue_id, |
uint32_t | millisec | ||
) |
Get a Message or Wait for a Message from a Queue.
[in] | queue_id | message queue ID obtained with osMessageCreate. |
[in] | millisec | timeout value or 0 in case of no time-out. |
osStatus osMessagePut | ( | osMessageQId | queue_id, |
uint32_t | info, | ||
uint32_t | millisec | ||
) |
Put a Message to a Queue.
[in] | queue_id | message queue ID obtained with osMessageCreate. |
[in] | info | message information. |
[in] | millisec | timeout value or 0 in case of no time-out. |
osMutexId osMutexCreate | ( | osMutexDef_t * | mutex_def | ) |
Create and Initialize a Mutex object.
[in] | mutex_def | mutex definition referenced with osMutex. |
Release a Mutex that was obtained by osMutexWait.
[in] | mutex_id | mutex ID obtained by osMutexCreate. |
Wait until a Mutex becomes available.
[in] | mutex_id | mutex ID obtained by osMutexCreate. |
[in] | millisec | timeout value or 0 in case of no time-out. |
void* osPoolAlloc | ( | osPoolId | pool_id | ) |
Allocate a memory block from a memory pool.
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
void* osPoolCAlloc | ( | osPoolId | pool_id | ) |
Allocate a memory block from a memory pool and set memory block to zero.
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
osPoolId osPoolCreate | ( | osPoolDef_t * | pool_def | ) |
Create and Initialize a memory pool.
[in] | pool_def | memory pool definition referenced with osPool. |
Return an allocated memory block back to a specific memory pool.
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
[in] | block | address of the allocated memory block that is returned to the memory pool. |
osSemaphoreId osSemaphoreCreate | ( | osSemaphoreDef_t * | semaphore_def, |
int32_t | count | ||
) |
Create and Initialize a Semaphore object used for managing resources.
[in] | semaphore_def | semaphore definition referenced with osSemaphore. |
[in] | count | number of available resources. |
osStatus osSemaphoreRelease | ( | osSemaphoreId | semaphore_id | ) |
Release a Semaphore token.
[in] | semaphore_id | semaphore object referenced with osSemaphore. |
int32_t osSemaphoreWait | ( | osSemaphoreId | semaphore_id, |
uint32_t | millisec | ||
) |
Wait until a Semaphore token becomes available.
[in] | semaphore_id | semaphore object referenced with osSemaphore. |
[in] | millisec | timeout value or 0 in case of no time-out. |
int32_t osSignalClear | ( | osThreadId | thread_id, |
int32_t | signal | ||
) |
Clear the specified Signal Flags of an active thread.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | signal | specifies the signal flags of the thread that shall be cleared. |
int32_t osSignalGet | ( | osThreadId | thread_id | ) |
Get Signal Flags status of an active thread.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
int32_t osSignalSet | ( | osThreadId | thread_id, |
int32_t | signal | ||
) |
Set the specified Signal Flags of an active thread.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | signal | specifies the signal flags of the thread that should be set. |
Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
[in] | signals | wait until all specified signal flags set or 0 for any single signal flag. |
[in] | millisec | timeout value or 0 in case of no time-out. |
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_def | thread definition referenced with osThread. |
[in] | argument | pointer that is passed to the thread function as start argument. |
osThreadId osThreadGetId | ( | void | ) |
Return the thread ID of the current running thread.
osPriority osThreadGetPriority | ( | osThreadId | thread_id | ) |
Get current priority of an active thread.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
osStatus osThreadSetPriority | ( | osThreadId | thread_id, |
osPriority | priority | ||
) |
Change priority of an active thread.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | priority | new priority value for the thread function. |
osStatus osThreadTerminate | ( | osThreadId | thread_id | ) |
Terminate execution of a thread and remove it from Active Threads.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
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.
[in] | timer_def | timer object referenced with osTimer. |
[in] | type | osTimerOnce for one-shot or osTimerPeriodic for periodic behavior. |
[in] | argument | argument to the timer call back function. |
Start or restart a timer.
[in] | timer_id | timer ID obtained by osTimerCreate. |
[in] | millisec | time delay value of the timer. |
Stop the timer.
[in] | timer_id | timer ID obtained by osTimerCreate. |