STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
Data Structures | Macros | Typedefs | Enumerations | Functions
cmsis_os.h File Reference

Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specific to FreeRTOS. More...

#include <stdint.h>
#include <stddef.h>
#include "core_cmFunc.h"
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "queue.h"
#include "semphr.h"
#include "event_groups.h"

Go to the source code of this file.

Data Structures

struct  os_thread_def
 
struct  os_timer_def
 
struct  os_mutex_def
 
struct  os_semaphore_def
 
struct  os_pool_def
 
struct  os_messageQ_def
 
struct  os_mailQ_def
 
struct  osEvent
 

Macros

#define _CMSIS_OS_H
 
#define osCMSIS   0x10002
 API version (main [31:16] .sub [15:0]) More...
 
#define osCMSIS_KERNEL   0x10000
 RTOS identification and version (main [31:16] .sub [15:0]) More...
 
#define osKernelSystemId   "KERNEL V1.00"
 RTOS identification string. More...
 
#define osFeature_MainThread   1
 main thread 1=main can be thread, 0=not available More...
 
#define osFeature_Pool   1
 Memory Pools: 1=available, 0=not available. More...
 
#define osFeature_MailQ   1
 Mail Queues: 1=available, 0=not available. More...
 
#define osFeature_MessageQ   1
 Message Queues: 1=available, 0=not available. More...
 
#define osFeature_Signals   8
 maximum number of Signal Flags available per thread More...
 
#define osFeature_Semaphore   1
 osFeature_Semaphore function: 1=available, 0=not available More...
 
#define osFeature_Wait   0
 osWait function: 1=available, 0=not available More...
 
#define osFeature_SysTick   1
 osKernelSysTick functions: 1=available, 0=not available More...
 
#define osWaitForever   0xFFFFFFFF
 wait forever timeout value More...
 
#define osKernelSysTickFrequency   (configTICK_RATE_HZ)
 
#define osKernelSysTickMicroSec(microsec)   (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)
 
#define osThreadDef(name, thread, priority, instances, stacksz)
 
#define osThread(name)   &os_thread_def_##name
 
#define osTimerDef(name, function)
 
#define osTimer(name)   &os_timer_def_##name
 
#define osMutexDef(name)   const osMutexDef_t os_mutex_def_##name = { 0 }
 
#define osMutex(name)   &os_mutex_def_##name
 
#define osSemaphoreDef(name)   const osSemaphoreDef_t os_semaphore_def_##name = { 0 }
 
#define osSemaphore(name)   &os_semaphore_def_##name
 
#define osPoolDef(name, no, type)
 Define a Memory Pool. More...
 
#define osPool(name)   &os_pool_def_##name
 Access a Memory Pool definition. More...
 
#define osMessageQDef(name, queue_sz, type)
 Create a Message Queue Definition. More...
 
#define osMessageQ(name)   &os_messageQ_def_##name
 Access a Message Queue Definition. More...
 
#define osMailQDef(name, queue_sz, type)
 Create a Mail Queue Definition. More...
 
#define osMailQ(name)   &os_mailQ_def_##name
 Access a Mail Queue Definition. More...
 

Typedefs

typedef void(* os_pthread) (void const *argument)
 
typedef void(* os_ptimer) (void const *argument)
 
typedef TaskHandle_t osThreadId
 
typedef TimerHandle_t osTimerId
 
typedef SemaphoreHandle_t osMutexId
 
typedef SemaphoreHandle_t osSemaphoreId
 
typedef struct os_pool_cbosPoolId
 
typedef QueueHandle_t osMessageQId
 
typedef struct os_mailQ_cbosMailQId
 
typedef struct os_thread_def osThreadDef_t
 
typedef struct os_timer_def osTimerDef_t
 
typedef struct os_mutex_def osMutexDef_t
 
typedef struct os_semaphore_def osSemaphoreDef_t
 
typedef struct os_pool_def osPoolDef_t
 
typedef struct os_messageQ_def osMessageQDef_t
 
typedef struct os_mailQ_def osMailQDef_t
 

Enumerations

enum  osPriority {
  osPriorityIdle = -3, osPriorityLow = -2, osPriorityBelowNormal = -1, osPriorityNormal = 0,
  osPriorityAboveNormal = +1, osPriorityHigh = +2, osPriorityRealtime = +3, osPriorityError = 0x84
}
 
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
}
 
enum  os_timer_type { osTimerOnce = 0, osTimerPeriodic = 1 }
 

Functions

osStatus osKernelInitialize (void)
 
osStatus osKernelStart (void)
 Start the RTOS Kernel with executing the specified thread. More...
 
int32_t osKernelRunning (void)
 Check if the RTOS kernel is already started. More...
 
uint32_t osKernelSysTick (void)
 Get the value of the Kernel SysTick timer. More...
 
osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument)
 Create a thread and add it to Active Threads and set it to state READY. More...
 
osThreadId osThreadGetId (void)
 Return the thread ID of the current running thread. More...
 
osStatus osThreadTerminate (osThreadId thread_id)
 Terminate execution of a thread and remove it from Active Threads. More...
 
osStatus osThreadYield (void)
 Pass control to next thread that is in state READY. More...
 
osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority)
 Change priority of an active thread. More...
 
osPriority osThreadGetPriority (osThreadId thread_id)
 Get current priority of an active thread. More...
 
osStatus osDelay (uint32_t millisec)
 Wait for Timeout (Time Delay) More...
 
osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument)
 Create a timer. More...
 
osStatus osTimerStart (osTimerId timer_id, uint32_t millisec)
 Start or restart a timer. More...
 
osStatus osTimerStop (osTimerId timer_id)
 Stop a timer. More...
 
osStatus osTimerDelete (osTimerId timer_id)
 Delete a timer. More...
 
int32_t osSignalSet (osThreadId thread_id, int32_t signals)
 Set the specified Signal Flags of an active thread. More...
 
int32_t osSignalClear (osThreadId thread_id, int32_t signals)
 
osEvent osSignalWait (int32_t signals, uint32_t millisec)
 Wait for one or more Signal Flags to become signaled for the current RUNNING thread. More...
 
osMutexId osMutexCreate (const osMutexDef_t *mutex_def)
 Create and Initialize a Mutex object. More...
 
osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec)
 Wait until a Mutex becomes available. More...
 
osStatus osMutexRelease (osMutexId mutex_id)
 Release a Mutex that was obtained by osMutexWait. More...
 
osStatus osMutexDelete (osMutexId mutex_id)
 Delete a Mutex. More...
 
osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count)
 Create and Initialize a Semaphore object used for managing resources. More...
 
int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec)
 Wait until a Semaphore token becomes available. More...
 
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
 Release a Semaphore token. More...
 
osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)
 Delete a Semaphore. More...
 
osPoolId osPoolCreate (const osPoolDef_t *pool_def)
 Create and Initialize a memory pool. More...
 
void * osPoolAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool. More...
 
void * osPoolCAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool and set memory block to zero. More...
 
osStatus osPoolFree (osPoolId pool_id, void *block)
 Return an allocated memory block back to a specific memory pool. More...
 
osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize a Message Queue. More...
 
osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec)
 Put a Message to a Queue. More...
 
osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec)
 Get a Message or Wait for a Message from a Queue. More...
 
osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize mail queue. More...
 
void * osMailAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail. More...
 
void * osMailCAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail and set memory block to zero. More...
 
osStatus osMailPut (osMailQId queue_id, void *mail)
 Put a mail to a queue. More...
 
osEvent osMailGet (osMailQId queue_id, uint32_t millisec)
 Get a mail from a queue. More...
 
osStatus osMailFree (osMailQId queue_id, void *mail)
 Free a memory block from a mail. More...
 
void osSystickHandler (void)
 Handles the tick increment. More...
 
osStatus osThreadSuspend (osThreadId thread_id)
 Suspend execution of a thread. More...
 
osStatus osThreadResume (osThreadId thread_id)
 Resume execution of a suspended thread. More...
 
osStatus osThreadSuspendAll (void)
 Suspend execution of a all active threads. More...
 
osStatus osThreadResumeAll (void)
 Resume execution of a all suspended threads. More...
 
osStatus osDelayUntil (uint32_t *PreviousWakeTime, uint32_t millisec)
 Delay a task until a specified time. More...
 
osStatus osThreadList (uint8_t *buffer)
 Lists all the current threads, along with their current state and stack usage high water mark. More...
 
osEvent osMessagePeek (osMessageQId queue_id, uint32_t millisec)
 Receive an item from a queue without removing the item from the queue. More...
 
osMutexId osRecursiveMutexCreate (const osMutexDef_t *mutex_def)
 Create and Initialize a Recursive Mutex. More...
 
osStatus osRecursiveMutexRelease (osMutexId mutex_id)
 Release a Recursive Mutex. More...
 
osStatus osRecursiveMutexWait (osMutexId mutex_id, uint32_t millisec)
 Release a Recursive Mutex. More...
 

Detailed Description

Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specific to FreeRTOS.

Author
MCD Application Team
Date
22-January-2016
Attention

Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met:

  1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission.
  4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics.
  5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license.

THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file cmsis_os.h.

Macro Definition Documentation

#define _CMSIS_OS_H

Definition at line 204 of file cmsis_os.h.

#define osCMSIS   0x10002

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

Note
MUST REMAIN UNCHANGED: osCMSIS identifies the CMSIS-RTOS API version.

Definition at line 207 of file cmsis_os.h.

#define osCMSIS_KERNEL   0x10000

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

Note
CAN BE CHANGED: osCMSIS_KERNEL identifies the underlying RTOS kernel and version number.

Definition at line 210 of file cmsis_os.h.

#define osFeature_MailQ   1

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

Definition at line 218 of file cmsis_os.h.

#define osFeature_MainThread   1

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

Note
MUST REMAIN UNCHANGED: osFeature_xxx shall be consistent in every CMSIS-RTOS.

Definition at line 216 of file cmsis_os.h.

#define osFeature_MessageQ   1

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

Definition at line 219 of file cmsis_os.h.

#define osFeature_Pool   1

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

Definition at line 217 of file cmsis_os.h.

#define osFeature_Semaphore   1

osFeature_Semaphore function: 1=available, 0=not available

Definition at line 221 of file cmsis_os.h.

#define osFeature_Signals   8

maximum number of Signal Flags available per thread

Definition at line 220 of file cmsis_os.h.

#define osFeature_SysTick   1

osKernelSysTick functions: 1=available, 0=not available

Definition at line 223 of file cmsis_os.h.

#define osFeature_Wait   0

osWait function: 1=available, 0=not available

Definition at line 222 of file cmsis_os.h.

#define osKernelSystemId   "KERNEL V1.00"

RTOS identification string.

Note
MUST REMAIN UNCHANGED: osKernelSystemId shall be consistent in every CMSIS-RTOS.

Definition at line 213 of file cmsis_os.h.

#define osKernelSysTickFrequency   (configTICK_RATE_HZ)

The RTOS kernel system timer frequency in Hz

Note
Reflects the system timer setting and is typically defined in a configuration file.

Definition at line 423 of file cmsis_os.h.

#define osKernelSysTickMicroSec (   microsec)    (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)

Convert a microseconds value to a RTOS kernel system timer value.

Parameters
microsectime value in microseconds.
Returns
time value normalized to the osKernelSysTickFrequency

Definition at line 428 of file cmsis_os.h.

#define osMailQ (   name)    &os_mailQ_def_##name

Access a Mail Queue Definition.

Parameters
namename of the queue
Note
CAN BE CHANGED: The parameter to osMailQ shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 815 of file cmsis_os.h.

#define osMailQDef (   name,
  queue_sz,
  type 
)
Value:
struct os_mailQ_cb *os_mailQ_cb_##name; \
const osMailQDef_t os_mailQ_def_##name = \
{ (queue_sz), sizeof (type), (&os_mailQ_cb_##name) }

Create a Mail Queue Definition.

Parameters
namename of the queue
queue_szmaximum number of messages in queue
typedata type of a single message element
Note
CAN BE CHANGED: The parameter to osMailQDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 805 of file cmsis_os.h.

#define osMessageQ (   name)    &os_messageQ_def_##name

Access a Message Queue Definition.

Parameters
namename of the queue
Note
CAN BE CHANGED: The parameter to osMessageQ shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 762 of file cmsis_os.h.

#define osMessageQDef (   name,
  queue_sz,
  type 
)
Value:
const osMessageQDef_t os_messageQ_def_##name = \
{ (queue_sz), sizeof (type) }

Create a Message Queue Definition.

Parameters
namename of the queue.
queue_szmaximum number of messages in the queue.
typedata type of a single message element (for debugger).
Note
CAN BE CHANGED: The parameter to osMessageQDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 753 of file cmsis_os.h.

#define osMutex (   name)    &os_mutex_def_##name

Access a Mutex definition.

Parameters
namename of the mutex object.
Note
CAN BE CHANGED: The parameter to osMutex shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 604 of file cmsis_os.h.

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

Define a Mutex.

Parameters
namename of the mutex object.
Note
CAN BE CHANGED: The parameter to osMutexDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 596 of file cmsis_os.h.

#define osPool (   name)    &os_pool_def_##name

Access a Memory Pool definition.

Parameters
namename of the memory pool
Note
CAN BE CHANGED: The parameter to osPool shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 708 of file cmsis_os.h.

#define osPoolDef (   name,
  no,
  type 
)
Value:
const osPoolDef_t os_pool_def_##name = \
{ (no), sizeof(type), NULL }
#define NULL
Definition: usbd_def.h:53

Define a Memory Pool.

Parameters
namename of the memory pool.
nomaximum number of blocks (objects) in the memory pool.
typedata type of a single block (object).
Note
CAN BE CHANGED: The parameter to osPoolDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 699 of file cmsis_os.h.

#define osSemaphore (   name)    &os_semaphore_def_##name

Access a Semaphore definition.

Parameters
namename of the semaphore object.
Note
CAN BE CHANGED: The parameter to osSemaphore shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 653 of file cmsis_os.h.

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

Define a Semaphore object.

Parameters
namename of the semaphore object.
Note
CAN BE CHANGED: The parameter to osSemaphoreDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 645 of file cmsis_os.h.

#define osThread (   name)    &os_thread_def_##name

Access a Thread definition.

Parameters
namename of the thread definition object.
Note
CAN BE CHANGED: The parameter to osThread shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 454 of file cmsis_os.h.

#define osThreadDef (   name,
  thread,
  priority,
  instances,
  stacksz 
)
Value:
const osThreadDef_t os_thread_def_##name = \
{ #name, (thread), (priority), (instances), (stacksz) }

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

Parameters
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.
Note
CAN BE CHANGED: The parameters to osThreadDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 445 of file cmsis_os.h.

#define osTimer (   name)    &os_timer_def_##name

Access a Timer definition.

Parameters
namename of the timer object.
Note
CAN BE CHANGED: The parameter to osTimer shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 531 of file cmsis_os.h.

#define osTimerDef (   name,
  function 
)
Value:
const osTimerDef_t os_timer_def_##name = \
{ (function) }

Define a Timer object.

Parameters
namename of the timer object.
functionname of the timer call back function.
Note
CAN BE CHANGED: The parameter to osTimerDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.

Definition at line 522 of file cmsis_os.h.

#define osWaitForever   0xFFFFFFFF

wait forever timeout value

Timeout value.

Note
MUST REMAIN UNCHANGED: osWaitForever shall be consistent in every CMSIS-RTOS.

Definition at line 248 of file cmsis_os.h.

Typedef Documentation

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

Entry point of a thread.

Note
MUST REMAIN UNCHANGED: os_pthread shall be consistent in every CMSIS-RTOS.

Definition at line 291 of file cmsis_os.h.

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

Entry point of a timer call back function.

Note
MUST REMAIN UNCHANGED: os_ptimer shall be consistent in every CMSIS-RTOS.

Definition at line 295 of file cmsis_os.h.

typedef struct os_mailQ_def osMailQDef_t

Definition structure for mail queue.

Note
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).

Note
CAN BE CHANGED: os_mailQ_cb is implementation specific in every CMSIS-RTOS.

Definition at line 325 of file cmsis_os.h.

Definition structure for message queue.

Note
CAN BE CHANGED: os_messageQ_def is implementation specific in every CMSIS-RTOS.

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

Note
CAN BE CHANGED: os_messageQ_cb is implementation specific in every CMSIS-RTOS.

Definition at line 321 of file cmsis_os.h.

typedef struct os_mutex_def osMutexDef_t

Mutex Definition structure contains setup information for a mutex.

Note
CAN BE CHANGED: os_mutex_def is implementation specific in every CMSIS-RTOS.

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

Note
CAN BE CHANGED: os_mutex_cb is implementation specific in every CMSIS-RTOS.

Definition at line 309 of file cmsis_os.h.

typedef struct os_pool_def osPoolDef_t

Definition structure for memory block allocation.

Note
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).

Note
CAN BE CHANGED: os_pool_cb is implementation specific in every CMSIS-RTOS.

Definition at line 317 of file cmsis_os.h.

Semaphore Definition structure contains setup information for a semaphore.

Note
CAN BE CHANGED: os_semaphore_def is implementation specific in every CMSIS-RTOS.

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

Note
CAN BE CHANGED: os_semaphore_cb is implementation specific in every CMSIS-RTOS.

Definition at line 313 of file cmsis_os.h.

typedef struct os_thread_def osThreadDef_t

Thread Definition structure contains startup information of a thread.

Note
CAN BE CHANGED: os_thread_def is implementation specific in every CMSIS-RTOS.

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

Note
CAN BE CHANGED: os_thread_cb is implementation specific in every CMSIS-RTOS.

Definition at line 301 of file cmsis_os.h.

typedef struct os_timer_def osTimerDef_t

Timer Definition structure contains timer parameters.

Note
CAN BE CHANGED: os_timer_def is implementation specific in every CMSIS-RTOS.

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

Note
CAN BE CHANGED: os_timer_cb is implementation specific in every CMSIS-RTOS.

Definition at line 305 of file cmsis_os.h.

Enumeration Type Documentation

Timer type value for the timer definition.

Note
MUST REMAIN UNCHANGED: os_timer_type shall be consistent in every CMSIS-RTOS.
Enumerator
osTimerOnce 

one-shot timer

osTimerPeriodic 

repeating timer

Definition at line 284 of file cmsis_os.h.

enum osPriority

Priority used for thread control.

Note
MUST REMAIN UNCHANGED: osPriority shall be consistent in every CMSIS-RTOS.
Enumerator
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

Definition at line 235 of file cmsis_os.h.

enum osStatus

Status code values returned by CMSIS-RTOS functions.

Note
MUST REMAIN UNCHANGED: osStatus shall be consistent in every CMSIS-RTOS.
Enumerator
osOK 

function completed; no error or 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.

Definition at line 252 of file cmsis_os.h.

Function Documentation

osStatus osDelay ( uint32_t  millisec)

Wait for Timeout (Time Delay)

Wait for Timeout (Time Delay).

Parameters
[in]millisectime delay value
Returns
status code that indicates the execution status of the function.
Parameters
millisectime delay value
Return values
statuscode that indicates the execution status of the function.

Definition at line 305 of file cmsis_os.c.

osStatus osDelayUntil ( uint32_t *  PreviousWakeTime,
uint32_t  millisec 
)

Delay a task until a specified time.

Parameters
PreviousWakeTimePointer to a variable that holds the time at which the task was last unblocked. PreviousWakeTime must be initialised with the current time prior to its first use (PreviousWakeTime = osKernelSysTick() )
millisectime delay value
Return values
statuscode that indicates the execution status of the function.

Definition at line 1377 of file cmsis_os.c.

osStatus osKernelInitialize ( void  )

Initialize the RTOS Kernel for creating objects.

Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osKernelInitialize shall be consistent in every CMSIS-RTOS.
int32_t osKernelRunning ( void  )

Check if the RTOS kernel is already started.

Check if the RTOS kernel is already started.

Note
MUST REMAIN UNCHANGED: osKernelRunning shall be consistent in every CMSIS-RTOS.
Returns
0 RTOS is not started, 1 RTOS is started.
Parameters
None
Return values
(0)RTOS is not started (1) RTOS is started (-1) if this feature is disabled in FreeRTOSConfig.h
Note
MUST REMAIN UNCHANGED: osKernelRunning shall be consistent in every CMSIS-RTOS.

Definition at line 167 of file cmsis_os.c.

osStatus osKernelStart ( void  )

Start the RTOS Kernel with executing the specified thread.

Start the RTOS Kernel.

Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osKernelStart shall be consistent in every CMSIS-RTOS.
Parameters
thread_defthread definition referenced with osThread.
argumentpointer that is passed to the thread function as start argument.
Return values
statuscode that indicates the execution status of the function
Note
MUST REMAIN UNCHANGED: osKernelStart shall be consistent in every CMSIS-RTOS.

Definition at line 152 of file cmsis_os.c.

uint32_t osKernelSysTick ( void  )

Get the value of the Kernel SysTick timer.

Get the RTOS kernel system timer counter

Note
MUST REMAIN UNCHANGED: osKernelSysTick shall be consistent in every CMSIS-RTOS.
Returns
RTOS kernel system timer as 32-bit value
Parameters
None
Return values
None
Note
MUST REMAIN UNCHANGED: osKernelSysTick shall be consistent in every CMSIS-RTOS.

Definition at line 186 of file cmsis_os.c.

void* osMailAlloc ( osMailQId  queue_id,
uint32_t  millisec 
)

Allocate a memory block from a mail.

Allocate a memory block from a mail.

Parameters
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisectimeout value or 0 in case of no time-out
Returns
pointer to memory block that can be filled with mail or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMailAlloc shall be consistent in every CMSIS-RTOS.
Parameters
queue_idmail queue ID obtained with osMailCreate.
millisectimeout value or 0 in case of no time-out.
Return values
pointerto memory block that can be filled with mail or NULL in case error.
Note
MUST REMAIN UNCHANGED: osMailAlloc shall be consistent in every CMSIS-RTOS.

Definition at line 1091 of file cmsis_os.c.

void* osMailCAlloc ( osMailQId  queue_id,
uint32_t  millisec 
)

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

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

Parameters
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisectimeout value or 0 in case of no time-out
Returns
pointer to memory block that can be filled with mail or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMailCAlloc shall be consistent in every CMSIS-RTOS.
Parameters
queue_idmail queue ID obtained with osMailCreate.
millisectimeout value or 0 in case of no time-out.
Return values
pointerto memory block that can be filled with mail or NULL in case error.
Note
MUST REMAIN UNCHANGED: osMailCAlloc shall be consistent in every CMSIS-RTOS.

Definition at line 1113 of file cmsis_os.c.

osMailQId osMailCreate ( const osMailQDef_t queue_def,
osThreadId  thread_id 
)

Create and Initialize mail queue.

Create and Initialize mail queue.

Parameters
[in]queue_defreference to the mail queue definition obtain with osMailQ
[in]thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Returns
mail queue ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMailCreate shall be consistent in every CMSIS-RTOS.
Parameters
queue_defreference to the mail queue definition obtain with osMailQ
thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Return values
mailqueue ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMailCreate shall be consistent in every CMSIS-RTOS.

Definition at line 1052 of file cmsis_os.c.

osStatus osMailFree ( osMailQId  queue_id,
void *  mail 
)

Free a memory block from a mail.

Free a memory block from a mail.

Parameters
[in]queue_idmail queue ID obtained with osMailCreate.
[in]mailpointer to the memory block that was obtained with osMailGet.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMailFree shall be consistent in every CMSIS-RTOS.
Parameters
queue_idmail queue ID obtained with osMailCreate.
mailpointer to the memory block that was obtained with osMailGet.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMailFree shall be consistent in every CMSIS-RTOS.

Definition at line 1223 of file cmsis_os.c.

osEvent osMailGet ( osMailQId  queue_id,
uint32_t  millisec 
)

Get a mail from a queue.

Get a mail from a queue.

Parameters
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisectimeout value or 0 in case of no time-out
Returns
event that contains mail information or error code.
Note
MUST REMAIN UNCHANGED: osMailGet shall be consistent in every CMSIS-RTOS.
Parameters
queue_idmail queue ID obtained with osMailCreate.
millisectimeout value or 0 in case of no time-out
Return values
eventthat contains mail information or error code.
Note
MUST REMAIN UNCHANGED: osMailGet shall be consistent in every CMSIS-RTOS.

Definition at line 1167 of file cmsis_os.c.

osStatus osMailPut ( osMailQId  queue_id,
void *  mail 
)

Put a mail to a queue.

Put a mail to a queue.

Parameters
[in]queue_idmail queue ID obtained with osMailCreate.
[in]mailmemory block previously allocated with osMailAlloc or osMailCAlloc.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMailPut shall be consistent in every CMSIS-RTOS.
Parameters
queue_idmail queue ID obtained with osMailCreate.
mailmemory block previously allocated with osMailAlloc or osMailCAlloc.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMailPut shall be consistent in every CMSIS-RTOS.

Definition at line 1134 of file cmsis_os.c.

osMessageQId osMessageCreate ( const osMessageQDef_t queue_def,
osThreadId  thread_id 
)

Create and Initialize a Message Queue.

Create and Initialize a Message Queue.

Parameters
[in]queue_defqueue definition referenced with osMessageQ.
[in]thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Returns
message queue ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMessageCreate shall be consistent in every CMSIS-RTOS.
Parameters
queue_defqueue definition referenced with osMessageQ.
thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Return values
messagequeue ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMessageCreate shall be consistent in every CMSIS-RTOS.

Definition at line 936 of file cmsis_os.c.

osEvent osMessageGet ( osMessageQId  queue_id,
uint32_t  millisec 
)

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

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

Parameters
[in]queue_idmessage queue ID obtained with osMessageCreate.
[in]millisectimeout value or 0 in case of no time-out.
Returns
event information that includes status code.
Note
MUST REMAIN UNCHANGED: osMessageGet shall be consistent in every CMSIS-RTOS.
Parameters
queue_idmessage queue ID obtained with osMessageCreate.
millisectimeout value or 0 in case of no time-out.
Return values
eventinformation that includes status code.
Note
MUST REMAIN UNCHANGED: osMessageGet shall be consistent in every CMSIS-RTOS.

Definition at line 983 of file cmsis_os.c.

osEvent osMessagePeek ( osMessageQId  queue_id,
uint32_t  millisec 
)

Receive an item from a queue without removing the item from the queue.

Parameters
queue_idmessage queue ID obtained with osMessageCreate.
millisectimeout value or 0 in case of no time-out.
Return values
eventinformation that includes status code.

Definition at line 1413 of file cmsis_os.c.

osStatus osMessagePut ( osMessageQId  queue_id,
uint32_t  info,
uint32_t  millisec 
)

Put a Message to a Queue.

Put a Message to a Queue.

Parameters
[in]queue_idmessage queue ID obtained with osMessageCreate.
[in]infomessage information.
[in]millisectimeout value or 0 in case of no time-out.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMessagePut shall be consistent in every CMSIS-RTOS.
Parameters
queue_idmessage queue ID obtained with osMessageCreate.
infomessage information.
millisectimeout value or 0 in case of no time-out.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMessagePut shall be consistent in every CMSIS-RTOS.

Definition at line 951 of file cmsis_os.c.

osMutexId osMutexCreate ( const osMutexDef_t mutex_def)

Create and Initialize a Mutex object.

Create and Initialize a Mutex object.

Parameters
[in]mutex_defmutex definition referenced with osMutex.
Returns
mutex ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMutexCreate shall be consistent in every CMSIS-RTOS.
Parameters
mutex_defmutex definition referenced with osMutex.
Return values
mutexID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMutexCreate shall be consistent in every CMSIS-RTOS.

Definition at line 554 of file cmsis_os.c.

osStatus osMutexDelete ( osMutexId  mutex_id)

Delete a Mutex.

Delete a Mutex that was created by osMutexCreate.

Parameters
[in]mutex_idmutex ID obtained by osMutexCreate.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexDelete shall be consistent in every CMSIS-RTOS.
Parameters
mutex_idmutex ID obtained by osMutexCreate.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexDelete shall be consistent in every CMSIS-RTOS.

Definition at line 634 of file cmsis_os.c.

osStatus osMutexRelease ( osMutexId  mutex_id)

Release a Mutex that was obtained by osMutexWait.

Release a Mutex that was obtained by osMutexWait.

Parameters
[in]mutex_idmutex ID obtained by osMutexCreate.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexRelease shall be consistent in every CMSIS-RTOS.
Parameters
mutex_idmutex ID obtained by osMutexCreate.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexRelease shall be consistent in every CMSIS-RTOS.

Definition at line 610 of file cmsis_os.c.

osStatus osMutexWait ( osMutexId  mutex_id,
uint32_t  millisec 
)

Wait until a Mutex becomes available.

Wait until a Mutex becomes available.

Parameters
[in]mutex_idmutex ID obtained by osMutexCreate.
[in]millisectimeout value or 0 in case of no time-out.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexWait shall be consistent in every CMSIS-RTOS.
Parameters
mutex_idmutex ID obtained by osMutexCreate.
millisectimeout value or 0 in case of no time-out.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexWait shall be consistent in every CMSIS-RTOS.

Definition at line 570 of file cmsis_os.c.

void* osPoolAlloc ( osPoolId  pool_id)

Allocate a memory block from a memory pool.

Allocate a memory block from a memory pool.

Parameters
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
Returns
address of the allocated memory block or NULL in case of no memory available.
Note
MUST REMAIN UNCHANGED: osPoolAlloc shall be consistent in every CMSIS-RTOS.
Parameters
pool_idmemory pool ID obtain referenced with osPoolCreate.
Return values
addressof the allocated memory block or NULL in case of no memory available.
Note
MUST REMAIN UNCHANGED: osPoolAlloc shall be consistent in every CMSIS-RTOS.

Definition at line 829 of file cmsis_os.c.

void* osPoolCAlloc ( osPoolId  pool_id)

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

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

Parameters
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
Returns
address of the allocated memory block or NULL in case of no memory available.
Note
MUST REMAIN UNCHANGED: osPoolCAlloc shall be consistent in every CMSIS-RTOS.
Parameters
pool_idmemory pool ID obtain referenced with osPoolCreate.
Return values
addressof the allocated memory block or NULL in case of no memory available.
Note
MUST REMAIN UNCHANGED: osPoolCAlloc shall be consistent in every CMSIS-RTOS.

Definition at line 873 of file cmsis_os.c.

osPoolId osPoolCreate ( const osPoolDef_t pool_def)

Create and Initialize a memory pool.

Create and Initialize a memory pool.

Parameters
[in]pool_defmemory pool definition referenced with osPool.
Returns
memory pool ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osPoolCreate shall be consistent in every CMSIS-RTOS.
Parameters
pool_defmemory pool definition referenced with osPool.
Return values
memorypool ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osPoolCreate shall be consistent in every CMSIS-RTOS.

Definition at line 784 of file cmsis_os.c.

osStatus osPoolFree ( osPoolId  pool_id,
void *  block 
)

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

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

Parameters
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
[in]blockaddress of the allocated memory block that is returned to the memory pool.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osPoolFree shall be consistent in every CMSIS-RTOS.
Parameters
pool_idmemory pool ID obtain referenced with osPoolCreate.
blockaddress of the allocated memory block that is returned to the memory pool.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osPoolFree shall be consistent in every CMSIS-RTOS.

Definition at line 892 of file cmsis_os.c.

osMutexId osRecursiveMutexCreate ( const osMutexDef_t mutex_def)

Create and Initialize a Recursive Mutex.

Parameters
mutex_defmutex definition referenced with osMutex.
Return values
mutexID for reference by other functions or NULL in case of error..

Definition at line 1454 of file cmsis_os.c.

osStatus osRecursiveMutexRelease ( osMutexId  mutex_id)

Release a Recursive Mutex.

Parameters
mutex_idmutex ID obtained by osRecursiveMutexCreate.
Return values
statuscode that indicates the execution status of the function.

Definition at line 1469 of file cmsis_os.c.

osStatus osRecursiveMutexWait ( osMutexId  mutex_id,
uint32_t  millisec 
)

Release a Recursive Mutex.

Parameters
mutex_idmutex ID obtained by osRecursiveMutexCreate.
millisectimeout value or 0 in case of no time-out.
Return values
statuscode that indicates the execution status of the function.

Definition at line 1490 of file cmsis_os.c.

osSemaphoreId osSemaphoreCreate ( const osSemaphoreDef_t semaphore_def,
int32_t  count 
)

Create and Initialize a Semaphore object used for managing resources.

Create and Initialize a Semaphore object used for managing resources.

Parameters
[in]semaphore_defsemaphore definition referenced with osSemaphore.
[in]countnumber of available resources.
Returns
semaphore ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
Parameters
semaphore_defsemaphore definition referenced with osSemaphore.
countnumber of available resources.
Return values
semaphoreID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osSemaphoreCreate shall be consistent in every CMSIS-RTOS.

Definition at line 656 of file cmsis_os.c.

osStatus osSemaphoreDelete ( osSemaphoreId  semaphore_id)

Delete a Semaphore.

Delete a Semaphore that was created by osSemaphoreCreate.

Parameters
[in]semaphore_idsemaphore object referenced with osSemaphoreCreate.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osSemaphoreDelete shall be consistent in every CMSIS-RTOS.
Parameters
semaphore_idsemaphore object referenced with osSemaphore.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osSemaphoreDelete shall be consistent in every CMSIS-RTOS.

Definition at line 747 of file cmsis_os.c.

osStatus osSemaphoreRelease ( osSemaphoreId  semaphore_id)

Release a Semaphore token.

Release a Semaphore token.

Parameters
[in]semaphore_idsemaphore object referenced with osSemaphoreCreate.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
Parameters
semaphore_idsemaphore object referenced with osSemaphore.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osSemaphoreRelease shall be consistent in every CMSIS-RTOS.

Definition at line 720 of file cmsis_os.c.

int32_t osSemaphoreWait ( osSemaphoreId  semaphore_id,
uint32_t  millisec 
)

Wait until a Semaphore token becomes available.

Wait until a Semaphore token becomes available.

Parameters
[in]semaphore_idsemaphore object referenced with osSemaphoreCreate.
[in]millisectimeout value or 0 in case of no time-out.
Returns
number of available tokens, or -1 in case of incorrect parameters.
Note
MUST REMAIN UNCHANGED: osSemaphoreWait shall be consistent in every CMSIS-RTOS.
Parameters
semaphore_idsemaphore object referenced with osSemaphore.
millisectimeout value or 0 in case of no time-out.
Return values
numberof available tokens, or -1 in case of incorrect parameters.
Note
MUST REMAIN UNCHANGED: osSemaphoreWait shall be consistent in every CMSIS-RTOS.

Definition at line 680 of file cmsis_os.c.

int32_t osSignalClear ( osThreadId  thread_id,
int32_t  signals 
)

Clear the specified Signal Flags of an active thread.

Parameters
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]signalsspecifies the signal flags of the thread that shall be cleared.
Returns
previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
Note
MUST REMAIN UNCHANGED: osSignalClear 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.

Set the specified Signal Flags of an active thread.

Parameters
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]signalsspecifies the signal flags of the thread that should be set.
Returns
osOK if successful, osErrorOS if failed.
Note
MUST REMAIN UNCHANGED: osSignalSet shall be consistent in every CMSIS-RTOS.
Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
signalsspecifies the signal flags of the thread that should be set.
Return values
osOKif successful, osErrorOS if failed .
Note
MUST REMAIN UNCHANGED: osSignalSet shall be consistent in every CMSIS-RTOS.

Definition at line 458 of file cmsis_os.c.

osEvent osSignalWait ( int32_t  signals,
uint32_t  millisec 
)

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

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

Parameters
[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.
Returns
event flag information or error code.
Note
MUST REMAIN UNCHANGED: osSignalWait shall be consistent in every CMSIS-RTOS.
Parameters
signalswait until all specified signal flags set or 0 for any single signal flag.
millisectimeout value or 0 in case of no time-out.
Return values
eventflag information or error code.
Note
MUST REMAIN UNCHANGED: osSignalWait shall be consistent in every CMSIS-RTOS.

Definition at line 500 of file cmsis_os.c.

void osSystickHandler ( void  )

Handles the tick increment.

Parameters
none.
Return values
none.

Definition at line 1239 of file cmsis_os.c.

osThreadId osThreadCreate ( const osThreadDef_t thread_def,
void *  argument 
)

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

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

Parameters
[in]thread_defthread definition referenced with osThread.
[in]argumentpointer that is passed to the thread function as start argument.
Returns
thread ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osThreadCreate shall be consistent in every CMSIS-RTOS.
Parameters
thread_defthread definition referenced with osThread.
argumentpointer that is passed to the thread function as start argument.
Return values
threadID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osThreadCreate shall be consistent in every CMSIS-RTOS.

Definition at line 204 of file cmsis_os.c.

osThreadId osThreadGetId ( void  )

Return the thread ID of the current running thread.

Return the thread ID of the current running thread.

Returns
thread ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osThreadGetId shall be consistent in every CMSIS-RTOS.
Return values
threadID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osThreadGetId shall be consistent in every CMSIS-RTOS.

Definition at line 223 of file cmsis_os.c.

osPriority osThreadGetPriority ( osThreadId  thread_id)

Get current priority of an active thread.

Get current priority of an active thread.

Parameters
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Returns
current priority value of the thread function.
Note
MUST REMAIN UNCHANGED: osThreadGetPriority shall be consistent in every CMSIS-RTOS.
Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
currentpriority value of the thread function.
Note
MUST REMAIN UNCHANGED: osThreadGetPriority shall be consistent in every CMSIS-RTOS.

Definition at line 283 of file cmsis_os.c.

osStatus osThreadList ( uint8_t *  buffer)

Lists all the current threads, along with their current state and stack usage high water mark.

Parameters
bufferA buffer into which the above mentioned details will be written
Return values
statuscode that indicates the execution status of the function.

Definition at line 1399 of file cmsis_os.c.

osStatus osThreadResume ( osThreadId  thread_id)

Resume execution of a suspended thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
statuscode that indicates the execution status of the function.

Definition at line 1325 of file cmsis_os.c.

osStatus osThreadResumeAll ( void  )

Resume execution of a all suspended threads.

Return values
statuscode that indicates the execution status of the function.

Definition at line 1360 of file cmsis_os.c.

osStatus osThreadSetPriority ( osThreadId  thread_id,
osPriority  priority 
)

Change priority of an active thread.

Change priority of an active thread.

Parameters
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]prioritynew priority value for the thread function.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadSetPriority shall be consistent in every CMSIS-RTOS.
Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
prioritynew priority value for the thread function.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadSetPriority shall be consistent in every CMSIS-RTOS.

Definition at line 267 of file cmsis_os.c.

osStatus osThreadSuspend ( osThreadId  thread_id)

Suspend execution of a thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
statuscode that indicates the execution status of the function.

Definition at line 1309 of file cmsis_os.c.

osStatus osThreadSuspendAll ( void  )

Suspend execution of a all active threads.

Return values
statuscode that indicates the execution status of the function.

Definition at line 1349 of file cmsis_os.c.

osStatus osThreadTerminate ( osThreadId  thread_id)

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

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

Parameters
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadTerminate shall be consistent in every CMSIS-RTOS.
Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadTerminate shall be consistent in every CMSIS-RTOS.

Definition at line 238 of file cmsis_os.c.

osStatus osThreadYield ( void  )

Pass control to next thread that is in state READY.

Pass control to next thread that is in state READY.

Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadYield shall be consistent in every CMSIS-RTOS.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadYield shall be consistent in every CMSIS-RTOS.

Definition at line 253 of file cmsis_os.c.

osTimerId osTimerCreate ( const osTimerDef_t timer_def,
os_timer_type  type,
void *  argument 
)

Create a timer.

Create a timer.

Parameters
[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.
Returns
timer ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osTimerCreate shall be consistent in every CMSIS-RTOS.
Parameters
timer_deftimer object referenced with osTimer.
typeosTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
argumentargument to the timer call back function.
Return values
timerID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osTimerCreate shall be consistent in every CMSIS-RTOS.

Definition at line 340 of file cmsis_os.c.

osStatus osTimerDelete ( osTimerId  timer_id)

Delete a timer.

Delete a timer that was created by osTimerCreate.

Parameters
[in]timer_idtimer ID obtained by osTimerCreate.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osTimerDelete shall be consistent in every CMSIS-RTOS.
Parameters
timer_idtimer ID obtained by osTimerCreate
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osTimerDelete shall be consistent in every CMSIS-RTOS.

Definition at line 428 of file cmsis_os.c.

osStatus osTimerStart ( osTimerId  timer_id,
uint32_t  millisec 
)

Start or restart a timer.

Start or restart a timer.

Parameters
[in]timer_idtimer ID obtained by osTimerCreate.
[in]millisectime delay value of the timer.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osTimerStart shall be consistent in every CMSIS-RTOS.
Parameters
timer_idtimer ID obtained by osTimerCreate.
millisectime delay value of the timer.
Return values
statuscode that indicates the execution status of the function
Note
MUST REMAIN UNCHANGED: osTimerStart shall be consistent in every CMSIS-RTOS.

Definition at line 360 of file cmsis_os.c.

osStatus osTimerStop ( osTimerId  timer_id)

Stop a timer.

Stop the timer.

Parameters
[in]timer_idtimer ID obtained by osTimerCreate.
Returns
status code that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osTimerStop shall be consistent in every CMSIS-RTOS.
Parameters
timer_idtimer ID obtained by osTimerCreate
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osTimerStop shall be consistent in every CMSIS-RTOS.

Definition at line 399 of file cmsis_os.c.