Go to the source code of this file.
Classes | |
struct | os_mail_queue_s |
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 0x00010002 |
API version (main [31:16] .sub [15:0]) | |
#define | osCMSIS_KERNEL 0x00010000 |
RTOS identification and version (main [31:16] .sub [15:0]) | |
#define | osFeature_MailQ 1 |
Mail Queues: 1=available, 0=not available. | |
#define | osFeature_MainThread 0 |
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 osSemaphoreCreate function | |
#define | osFeature_Signals 8 |
maximum number of Signal Flags available per thread | |
#define | osFeature_SysTick 1 |
osKernelSysTick functions: 1=available, 0=not available | |
#define | osFeature_Wait 1 |
osWait function: 1=available, 0=not available | |
#define | osKernelSystemId "µOS++" |
RTOS identification string. | |
#define | osKernelSysTickFrequency (OS_INTEGER_SYSTICK_FREQUENCY_HZ) |
The RTOS kernel system timer frequency. | |
#define | osKernelSysTickMicroSec(microsec) (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000) |
Convert a microseconds value to ticks. | |
#define | osMailQ(name) &os_mailQ_def_##name |
Access a mail queue definition. | |
#define | osMailQAllocatedDef(name, items, type) |
Create a mail queue definition. | |
#define | osMailQDef(name, items, type) osMailQAllocatedDef(name, items, type) |
#define | osMailQStaticDef(name, items, type) |
#define | osMessageQ(name) &os_messageQ_def_##name |
Access a Message Queue. | |
#define | osMessageQAllocatedDef(name, items, type) |
Create a Message Queue Definition. | |
#define | osMessageQDef(name, items, type) osMessageQAllocatedDef(name, items, type) |
#define | osMessageQStaticDef(name, items, type) |
#define | osMutex(name) &os_mutex_def_##name |
Access a mutex. | |
#define | osMutexDef(name) |
Define a mutex. | |
#define | osPool(name) &os_pool_def_##name |
Access a Memory Pool definition. | |
#define | osPoolAllocatedDef(name, items, type) |
Define a Memory Pool. | |
#define | osPoolDef(name, items, type) osPoolAllocatedDef(name, items, type) |
#define | osPoolStaticDef(name, items, type) |
#define | osSemaphore(name) &os_semaphore_def_##name |
Access a Semaphore definition. | |
#define | osSemaphoreDef(name) |
Define a Semaphore object. | |
#define | osThread(name) &os_thread_def_##name |
Access a Thread definition. | |
#define | osThreadAllocatedDef(name, priority, instances, stacksz) |
Create a Thread Definition. | |
#define | osThreadDef(name, priority, instances, stacksz) osThreadAllocatedDef(name, priority, instances, stacksz) |
#define | osThreadStaticDef(name, priority, instances, stacksz) |
#define | osTimer(name) &os_timer_def_##name |
Access the timer. | |
#define | osTimerDef(name, function) |
Define timer. | |
#define | osWaitForever 0xFFFFFFFF |
Timeout value. | |
Typedefs | |
typedef struct os_mail_queue_s | os_mail_queue_t |
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 os_mail_queue_t | osMailQ |
typedef struct os_mailQ_def | osMailQDef_t |
Definition structure for mail queue. | |
typedef osMailQ * | osMailQId |
Mail ID identifies the mail queue (pointer to a mail queue control block). | |
typedef os_mqueue_t | osMessageQ |
typedef os_mqueue_attr_t | osMessageQAttr |
typedef struct os_messageQ_def | osMessageQDef_t |
Definition structure for message queue. | |
typedef osMessageQ * | osMessageQId |
Message ID identifies the message queue (pointer to a message queue control block). | |
typedef os_mutex_t | osMutex |
typedef os_mutex_attr_t | osMutexAttr |
typedef struct os_mutex_def | osMutexDef_t |
Mutex definition structure contains setup information for a mutex. | |
typedef osMutex * | osMutexId |
Mutex ID identifies the mutex (pointer to a mutex control block). | |
typedef os_mempool_t | osPool |
typedef os_mempool_attr_t | osPoolAttr |
typedef struct os_pool_def | osPoolDef_t |
Definition structure for memory block allocation. | |
typedef osPool * | osPoolId |
Pool ID identifies the memory pool (pointer to a memory pool control block). | |
typedef os_semaphore_t | osSemaphore |
typedef os_semaphore_attr_t | osSemaphoreAttr |
typedef struct os_semaphore_def | osSemaphoreDef_t |
Semaphore definition structure contains setup information for a semaphore. | |
typedef osSemaphore * | osSemaphoreId |
Semaphore ID identifies the semaphore (pointer to a semaphore control block). | |
typedef os_thread_t | osThread |
typedef os_thread_attr_t | osThreadAttr |
typedef struct os_thread_def | osThreadDef_t |
Thread definition structure contains startup information of a thread. | |
typedef osThread * | osThreadId |
Thread ID identifies the thread (pointer to a thread control block). | |
typedef os_timer_t | osTimer |
typedef os_timer_attr_t | osTimerAttr |
typedef struct os_timer_def | osTimerDef_t |
Timer definition structure contains timer parameters. | |
typedef osTimer * | osTimerId |
Timer ID identifies the timer (pointer to a timer control block). | |
Enumerations | |
enum | os_timer_type { osTimerOnce = os_timer_once , osTimerPeriodic = os_timer_periodic } |
Timer type value for the timer definition. More... | |
enum | osPriority { osPriorityIdle = os_thread_priority_idle , osPriorityLow = os_thread_priority_low , osPriorityBelowNormal = os_thread_priority_below_normal , osPriorityNormal = os_thread_priority_normal , osPriorityAboveNormal = os_thread_priority_above_normal , osPriorityHigh = os_thread_priority_high , osPriorityRealtime = os_thread_priority_realtime , osPriorityError = os_thread_priority_error } |
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) |
Time Delay. | |
osStatus | osKernelInitialize (void) |
Initialize the RTOS. | |
int32_t | osKernelRunning (void) |
Check if the RTOS scheduler is started. | |
osStatus | osKernelStart (void) |
uint32_t | osKernelSysTick (void) |
Get the system timer counter. | |
void * | osMailAlloc (osMailQId mail_id, uint32_t millisec) |
Allocate a memory block from a mail. | |
void * | osMailCAlloc (osMailQId mail_id, uint32_t millisec) |
Allocate and clear a memory block from a mail. | |
osMailQId | osMailCreate (const osMailQDef_t *mail_def, osThreadId thread_id) |
Create a mail queue. | |
osStatus | osMailFree (osMailQId mail_id, void *mail) |
Free a memory block from a mail. | |
osEvent | osMailGet (osMailQId mail_id, uint32_t millisec) |
Get a mail from a queue. | |
osStatus | osMailPut (osMailQId mail_id, void *mail) |
Put a mail to a queue. | |
osMessageQId | osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id) |
Create 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 (const osMutexDef_t *mutex_def) |
Create a mutex. | |
osStatus | osMutexDelete (osMutexId mutex_id) |
Delete the mutex. | |
osStatus | osMutexRelease (osMutexId mutex_id) |
Release the mutex. | |
osStatus | osMutexWait (osMutexId mutex_id, uint32_t millisec) |
Wait for mutex. | |
void * | osPoolAlloc (osPoolId pool_id) |
Allocate a memory block. | |
void * | osPoolCAlloc (osPoolId pool_id) |
Allocate and clear a memory block. | |
osPoolId | osPoolCreate (const osPoolDef_t *pool_def) |
Create a memory pool. | |
osStatus | osPoolFree (osPoolId pool_id, void *block) |
Free a memory block. | |
osSemaphoreId | osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count) |
Create a semaphore. | |
osStatus | osSemaphoreDelete (osSemaphoreId semaphore_id) |
Delete the semaphore. | |
osStatus | osSemaphoreRelease (osSemaphoreId semaphore_id) |
Release the semaphore. | |
int32_t | osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec) |
Wait until a Semaphore token becomes available. | |
int32_t | osSignalClear (osThreadId thread_id, int32_t signals) |
Clear the specified Signal Flags of an active thread. | |
int32_t | osSignalSet (osThreadId thread_id, int32_t signals) |
Set signal flags. | |
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 (const osThreadDef_t *thread_def, void *args) |
Create a thread. | |
osThreadId | osThreadGetId (void) |
Get the current thread. | |
osPriority | osThreadGetPriority (osThreadId thread_id) |
Get thread priority. | |
osStatus | osThreadSetPriority (osThreadId thread_id, osPriority priority) |
Change thread priority. | |
osStatus | osThreadTerminate (osThreadId thread_id) |
Terminate a thread. | |
osStatus | osThreadYield (void) |
Yield control. | |
osTimerId | osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *args) |
Create a timer. | |
osStatus | osTimerDelete (osTimerId timer_id) |
Delete the timer. | |
osStatus | osTimerStart (osTimerId timer_id, uint32_t millisec) |
Start the timer. | |
osStatus | osTimerStop (osTimerId timer_id) |
Stop the timer. | |
osEvent | osWait (uint32_t millisec) |
Wait for Signal, Message, Mail, or Timeout. | |
#define osCMSIS 0x00010002 |
API version (main [31:16] .sub [15:0])
Definition at line 103 of file cmsis_os.h.
#define osCMSIS_KERNEL 0x00010000 |
RTOS identification and version (main [31:16] .sub [15:0])
Definition at line 106 of file cmsis_os.h.
#define osFeature_MailQ 1 |
Mail Queues: 1=available, 0=not available.
Definition at line 114 of file cmsis_os.h.
#define osFeature_MainThread 0 |
main thread 1=main can be thread, 0=not available
Definition at line 112 of file cmsis_os.h.
#define osFeature_MessageQ 1 |
Message Queues: 1=available, 0=not available.
Definition at line 115 of file cmsis_os.h.
#define osFeature_Pool 1 |
Memory Pools: 1=available, 0=not available.
Definition at line 113 of file cmsis_os.h.
#define osFeature_Semaphore 30 |
maximum count for osSemaphoreCreate function
Definition at line 117 of file cmsis_os.h.
#define osFeature_Signals 8 |
maximum number of Signal Flags available per thread
Definition at line 116 of file cmsis_os.h.
#define osFeature_SysTick 1 |
osKernelSysTick functions: 1=available, 0=not available
Definition at line 119 of file cmsis_os.h.
#define osFeature_Wait 1 |
osWait function: 1=available, 0=not available
Definition at line 118 of file cmsis_os.h.
#define osKernelSystemId "µOS++" |
RTOS identification string.
Definition at line 109 of file cmsis_os.h.
#define osKernelSysTickFrequency (OS_INTEGER_SYSTICK_FREQUENCY_HZ) |
The RTOS kernel system timer frequency.
Specifies the frequency of the Kernel SysTick timer in Hz. The value is typically use to scale a time value and is for example used in osKernelSysTickMicroSec.
Definition at line 444 of file cmsis_os.h.
#define osKernelSysTickMicroSec | ( | microsec | ) | (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000) |
Convert a microseconds value to ticks.
Allows to scale a microsecond value to the frequency of the Kernel SysTick timer. This macro is typically used to check for short timeouts in polling loops.
microsec | time value in microseconds. |
Definition at line 457 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 1244 of file cmsis_os.h.
#define osMailQAllocatedDef | ( | name, | |
items, | |||
type | |||
) |
Create a mail queue definition.
name | name of the queue. |
items | maximum number of messages in queue. |
type | data type of a single message element. |
Definition at line 1184 of file cmsis_os.h.
#define osMailQDef | ( | name, | |
items, | |||
type | |||
) | osMailQAllocatedDef(name, items, type) |
Definition at line 1233 of file cmsis_os.h.
#define osMailQStaticDef | ( | name, | |
items, | |||
type | |||
) |
Definition at line 1207 of file cmsis_os.h.
#define osMessageQ | ( | name | ) | &os_messageQ_def_##name |
Access a Message Queue.
name | name of the queue. |
Access to the message queue definition for the function osMessageCreate.
Definition at line 1120 of file cmsis_os.h.
#define osMessageQAllocatedDef | ( | name, | |
items, | |||
type | |||
) |
Create a Message Queue Definition.
name | name of the queue. |
items | maximum number of messages in the queue. |
type | data type of a single message element (for debugger). |
Definition at line 1073 of file cmsis_os.h.
#define osMessageQDef | ( | name, | |
items, | |||
type | |||
) | osMessageQAllocatedDef(name, items, type) |
Definition at line 1106 of file cmsis_os.h.
#define osMessageQStaticDef | ( | name, | |
items, | |||
type | |||
) |
Definition at line 1085 of file cmsis_os.h.
#define osMutex | ( | name | ) | &os_mutex_def_##name |
Access a mutex.
name | name of the mutex object. |
Provides osMutexCreate access to the mutex object definition.
Definition at line 800 of file cmsis_os.h.
#define osMutexDef | ( | name | ) |
Define a mutex.
name | name of the mutex object. |
Define a mutex object that is referenced by osMutex.
Definition at line 781 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 1006 of file cmsis_os.h.
#define osPoolAllocatedDef | ( | name, | |
items, | |||
type | |||
) |
Define a Memory Pool.
name | name of the memory pool. |
items | maximum number of blocks (objects) in the memory pool. |
type | data type of a single block (object). |
Definition at line 963 of file cmsis_os.h.
#define osPoolDef | ( | name, | |
items, | |||
type | |||
) | osPoolAllocatedDef(name, items, type) |
Definition at line 995 of file cmsis_os.h.
#define osPoolStaticDef | ( | name, | |
items, | |||
type | |||
) |
Definition at line 976 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 890 of file cmsis_os.h.
#define osSemaphoreDef | ( | name | ) |
Define a Semaphore object.
name | name of the semaphore object. |
Definition at line 873 of file cmsis_os.h.
#define osThread | ( | name | ) | &os_thread_def_##name |
Access a Thread definition.
name | name of the thread definition object. |
Access to the thread definition for the function osThreadCreate.
Definition at line 528 of file cmsis_os.h.
#define osThreadAllocatedDef | ( | name, | |
priority, | |||
instances, | |||
stacksz | |||
) |
Create a Thread Definition.
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. |
Define the attributes of a thread functions that can be created by the function osThreadCreate using osThread.
Definition at line 482 of file cmsis_os.h.
#define osThreadDef | ( | name, | |
priority, | |||
instances, | |||
stacksz | |||
) | osThreadAllocatedDef(name, priority, instances, stacksz) |
Definition at line 514 of file cmsis_os.h.
#define osThreadStaticDef | ( | name, | |
priority, | |||
instances, | |||
stacksz | |||
) |
Definition at line 496 of file cmsis_os.h.
#define osTimer | ( | name | ) | &os_timer_def_##name |
Access the timer.
name | name of the timer object. |
Provide access to the timer definition for the function osTimerCreate.
Definition at line 673 of file cmsis_os.h.
#define osTimerDef | ( | name, | |
function | |||
) |
Define timer.
name | name of the timer object. |
function | name of the timer call back function. |
Define the attributes of a timer object.
Definition at line 651 of file cmsis_os.h.
#define osWaitForever 0xFFFFFFFF |
Timeout value.
Definition at line 152 of file cmsis_os.h.
typedef struct os_mail_queue_s os_mail_queue_t |
typedef void(* os_pthread) (void const *argument) |
Entry point of a thread.
Definition at line 191 of file cmsis_os.h.
typedef void(* os_ptimer) (void const *argument) |
Entry point of a timer call back function.
Definition at line 198 of file cmsis_os.h.
typedef os_mail_queue_t osMailQ |
Definition at line 226 of file cmsis_os.h.
typedef struct os_mailQ_def osMailQDef_t |
Definition structure for mail queue.
Mail ID identifies the mail queue (pointer to a mail queue control block).
Definition at line 268 of file cmsis_os.h.
typedef os_mqueue_t osMessageQ |
Definition at line 217 of file cmsis_os.h.
typedef os_mqueue_attr_t osMessageQAttr |
Definition at line 218 of file cmsis_os.h.
typedef struct os_messageQ_def osMessageQDef_t |
Definition structure for message queue.
typedef osMessageQ* osMessageQId |
Message ID identifies the message queue (pointer to a message queue control block).
Definition at line 262 of file cmsis_os.h.
typedef os_mutex_t osMutex |
Definition at line 208 of file cmsis_os.h.
typedef os_mutex_attr_t osMutexAttr |
Definition at line 209 of file cmsis_os.h.
typedef struct os_mutex_def osMutexDef_t |
Mutex definition structure contains setup information for a mutex.
Mutex ID identifies the mutex (pointer to a mutex control block).
Definition at line 244 of file cmsis_os.h.
typedef os_mempool_t osPool |
Definition at line 214 of file cmsis_os.h.
typedef os_mempool_attr_t osPoolAttr |
Definition at line 215 of file cmsis_os.h.
typedef struct os_pool_def osPoolDef_t |
Definition structure for memory block allocation.
Pool ID identifies the memory pool (pointer to a memory pool control block).
Definition at line 256 of file cmsis_os.h.
typedef os_semaphore_t osSemaphore |
Definition at line 211 of file cmsis_os.h.
typedef os_semaphore_attr_t osSemaphoreAttr |
Definition at line 212 of file cmsis_os.h.
typedef struct os_semaphore_def osSemaphoreDef_t |
Semaphore definition structure contains setup information for a semaphore.
typedef osSemaphore* osSemaphoreId |
Semaphore ID identifies the semaphore (pointer to a semaphore control block).
Definition at line 250 of file cmsis_os.h.
typedef os_thread_t osThread |
Definition at line 202 of file cmsis_os.h.
typedef os_thread_attr_t osThreadAttr |
Definition at line 203 of file cmsis_os.h.
typedef struct os_thread_def osThreadDef_t |
Thread definition structure contains startup information of a thread.
typedef osThread* osThreadId |
Thread ID identifies the thread (pointer to a thread control block).
Definition at line 232 of file cmsis_os.h.
typedef os_timer_t osTimer |
Definition at line 205 of file cmsis_os.h.
typedef os_timer_attr_t osTimerAttr |
Definition at line 206 of file cmsis_os.h.
typedef struct os_timer_def osTimerDef_t |
Timer definition structure contains timer parameters.
Timer ID identifies the timer (pointer to a timer control block).
Definition at line 238 of file cmsis_os.h.
enum os_timer_type |
Timer type value for the timer definition.
Enumerator | |
---|---|
osTimerOnce | one-shot timer |
osTimerPeriodic | repeating timer |
Definition at line 181 of file cmsis_os.h.
enum osPriority |
Priority used for thread control.
Definition at line 136 of file cmsis_os.h.
enum osStatus |
Status code values returned by CMSIS-RTOS functions.
Definition at line 158 of file cmsis_os.h.
osStatus osDelay | ( | uint32_t | millisec | ) |
Time Delay.
[in] | millisec | Timeout value "time delay" value. |
osEventTimeout | The time delay is executed. |
osErrorISR | osDelay() cannot be called from interrupt service routines. |
Wait for a specified time period in millisec.
The millisec value specifies the number of timer ticks and is therefore an upper bound. The exact time delay depends on the actual time elapsed since the last timer tick.
For a value of 1, the system waits until the next timer tick occurs. That means that the actual time delay may be up to one timer tick less.
Definition at line 3490 of file os-c-wrapper.cpp.
osStatus osKernelInitialize | ( | void | ) |
Initialize the RTOS.
osOK | The RTOS kernel was initialised. |
osErrorISR | The function cannot be invoked from Interrupt Service Routines. |
Initialise of the RTOS Kernel to allow peripheral setup and creation of other RTOS objects with the functions:
The RTOS scheduler does not start thread switching until the function osKernelStart is called.
Definition at line 3178 of file os-c-wrapper.cpp.
int32_t osKernelRunning | ( | void | ) |
Check if the RTOS scheduler is started.
0 | The RTOS is not started. |
1 | The RTOS is started. |
Identifies if the RTOS scheduler is started. For systems with the option to start the main function as a thread this allows you to identify that the RTOS scheduler is already running.
Definition at line 3215 of file os-c-wrapper.cpp.
osStatus osKernelStart | ( | void | ) |
Start the RTOS scheduler.
osOK | The RTOS scheduler has been successfully started. |
osErrorISR | The function cannot be invoked from Interrupt Service Routines. |
Start the RTOS Kernel and begin thread switching.
Definition at line 3200 of file os-c-wrapper.cpp.
uint32_t osKernelSysTick | ( | void | ) |
Get the system timer counter.
void * osMailAlloc | ( | osMailQId | mail_id, |
uint32_t | millisec | ||
) |
Allocate a memory block from a mail.
[in] | mail_id | mail queue ID obtained with osMailCreate. |
[in] | millisec | Timeout value or 0 in case of no time-out. |
void * osMailCAlloc | ( | osMailQId | mail_id, |
uint32_t | millisec | ||
) |
Allocate and clear a memory block from a mail.
[in] | mail_id | mail queue ID obtained with osMailCreate. |
[in] | millisec | Timeout value or 0 in case of no time-out. |
osMailQId osMailCreate | ( | const osMailQDef_t * | mail_def, |
osThreadId | thread_id | ||
) |
Create a mail queue.
[in] | mail_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] | mail_id | mail queue ID obtained with osMailCreate. |
[in] | pointer to the memory block that was obtained with osMailGet. |
osOK | The mail block is released. |
osErrorValue | Mail block does not belong to the mail queue pool. |
osErrorParameter | The value to the parameter queue_id is incorrect. |
Get a mail from a queue.
[in] | mail_id | mail queue ID obtained with osMailCreate. |
[in] | millisec | Timeout value or 0 in case of no time-out. |
osOK | No mail is available in the queue and no timeout was specified. |
osEventTimeout | No mail has arrived during the given timeout period. |
osEventMail | Mail received, value.p contains the pointer to mail content. |
osErrorParameter | A parameter is invalid or outside of a permitted range. |
Put a mail to a queue.
[in] | mail_id | mail queue ID obtained with osMailCreate. |
[in] | memory block previously allocated with osMailAlloc or osMailCAlloc. |
osOK | The message is put into the queue. |
osErrorValue | Mail was previously not allocated as memory slot. |
osErrorParameter | A parameter is invalid or outside of a permitted range. |
osMessageQId osMessageCreate | ( | const osMessageQDef_t * | queue_def, |
osThreadId | thread_id | ||
) |
Create 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. |
osOK | No message is available in the queue and no timeout was specified. |
osEventTimeout | No message has arrived during the given timeout period. |
osEventMessage | Message received, value.p contains the pointer to message. |
osErrorParameter | A parameter is invalid or outside of a permitted range. |
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. |
osOK | The message is put into the queue. |
osErrorResource | no memory in the queue was available. |
osErrorTimeoutResource | no memory in the queue was available during the given time limit. |
osErrorParameter | a parameter is invalid or outside of a permitted range. status code that indicates the execution status of the function. |
osMutexId osMutexCreate | ( | const osMutexDef_t * | mutex_def | ) |
Create a mutex.
[in] | mutex_def | mutex definition referenced with osMutex. |
Create and initialise a mutex object instance.
Definition at line 3843 of file os-c-wrapper.cpp.
Delete the mutex.
[in] | mutex_id | mutex ID obtained by osMutexCreate. |
osOK | The mutex object has been deleted. |
osErrorISR | osMutexDelete cannot be called from interrupt service routines. |
osErrorResource | All tokens have already been released. |
osErrorParameter | The parameter mutex_id is incorrect. |
Delete a mutex object instance. The function releases internal memory obtained for mutex handling. After this call the mutex_id is no longer valid and cannot be used. The mutex may be created again using the function osMutexCreate.
Definition at line 3991 of file os-c-wrapper.cpp.
Release the mutex.
[in] | mutex_id | mutex ID obtained by osMutexCreate. |
osOK | The mutex has been correctly released. |
osErrorResource | The mutex was not obtained before. |
osErrorParameter | The parameter mutex_id is incorrect. |
osErrorISR | osMutexRelease cannot be called from interrupt service routines. |
Release a mutex that was obtained with osMutexWait. Other threads that currently wait for the same mutex will be now put into the state READY.
Definition at line 3952 of file os-c-wrapper.cpp.
Wait for mutex.
[in] | mutex_id | mutex ID obtained by osMutexCreate. |
[in] | millisec | Timeout value or 0 in case of no time-out. |
osOK | The mutex has been obtain. |
osErrorTimeoutResource | the mutex could not be obtained in the given time. |
osErrorResource | The mutex could not be obtained when no timeout was specified. |
osErrorParameter | The parameter mutex_id is incorrect. |
osErrorISR | osMutexWait cannot be called from interrupt service routines. |
Wait until a mutex becomes available. If no other thread has obtained the mutex, the function instantly returns and blocks the mutex object.
The argument millisec specifies how long the system waits for a mutex. While the system waits the thread that is calling this function is put into the state WAITING. The millisec timeout can have the following values:
Definition at line 3883 of file os-c-wrapper.cpp.
void * osPoolAlloc | ( | osPoolId | pool_id | ) |
Allocate a memory block.
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
void * osPoolCAlloc | ( | osPoolId | pool_id | ) |
Allocate and clear a memory block.
[in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
osPoolId osPoolCreate | ( | const osPoolDef_t * | pool_def | ) |
Create a memory pool.
[in] | pool_def | memory pool definition referenced with osPool. |
Free a memory block.
[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. |
osOK | The memory block is released. |
osErrorValue | The block does not belong to the memory pool. |
osErrorParameter | A parameter is invalid or outside of a permitted range. |
osSemaphoreId osSemaphoreCreate | ( | const osSemaphoreDef_t * | semaphore_def, |
int32_t | count | ||
) |
Create a semaphore.
[in] | semaphore_def | semaphore definition referenced with osSemaphore. |
[in] | count | number of available resources. |
osStatus osSemaphoreDelete | ( | osSemaphoreId | semaphore_id | ) |
Delete the semaphore.
[in] | semaphore_id | semaphore object referenced with osSemaphoreCreate. |
osOK | The semaphore object has been deleted. |
osErrorISR | osSemaphoreDelete cannot be called from interrupt service routines. |
osErrorResource | The semaphore object could not be deleted. |
osErrorParameter | The parameter semaphore_id is incorrect. |
osStatus osSemaphoreRelease | ( | osSemaphoreId | semaphore_id | ) |
Release the semaphore.
[in] | semaphore_id | semaphore object referenced with osSemaphoreCreate. |
osOK | The semaphore has been released. |
osErrorResource | All tokens have already been released. |
osErrorParameter | The parameter semaphore_id is incorrect. |
int32_t osSemaphoreWait | ( | osSemaphoreId | semaphore_id, |
uint32_t | millisec | ||
) |
Wait until a Semaphore token becomes available.
[in] | semaphore_id | semaphore object referenced with osSemaphoreCreate. |
[in] | millisec | Timeout value or 0 in case of no time-out. |
int32_t osSignalClear | ( | osThreadId | thread_id, |
int32_t | signals | ||
) |
Clear the specified Signal Flags of an active thread.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | signals | specifies the signal flags of the thread that shall be cleared. |
Clear the signal flags of an active thread.
Definition at line 3717 of file os-c-wrapper.cpp.
int32_t osSignalSet | ( | osThreadId | thread_id, |
int32_t | signals | ||
) |
Set signal flags.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | signals | specifies the signal flags of the thread that should be set. |
Set the signal flags of an active thread.
Definition at line 3693 of file os-c-wrapper.cpp.
osEvent osSignalWait | ( | int32_t | signals, |
uint32_t | millisec | ||
) |
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. |
osOK | No signal received when the timeout value millisec was 0. |
osEventTimeout | Signal not occurred within timeout. |
osEventSignal | Signal occurred, value.signals contains the signal flags; these signal flags are cleared. |
osErrorValue | The value signals is outside of the permitted range. |
osErrorISR | osSignalWait cannot be called from interrupt service routines. |
Suspend the execution of the current RUNNING thread until all specified signal flags with the parameter signals are set. When the parameter signals is 0 the current RUNNING thread is suspended until any signal is set. When these signal flags are already set, the function returns instantly. Otherwise the thread is put into the state WAITING. Signal flags that are reported as event are automatically cleared.
The argument millisec specifies how long the system waits for the specified signal flags. While the system waits the tread calling this function is put into the state WAITING. The timeout value can have the following values:
Definition at line 3767 of file os-c-wrapper.cpp.
osThreadId osThreadCreate | ( | const osThreadDef_t * | thread_def, |
void * | args | ||
) |
Create a thread.
[in] | thread_def | Thread definition referenced with osThread. |
[in] | args | Pointer that is passed to the thread function as start argument. |
Find a free slot in the array of thread definitions and initialise the thread.
Start the thread function by adding it to the Active Threads list and set it to state READY. The thread function receives the argument pointer as function argument when the function is started. When the priority of the created thread function is higher than the current RUNNING thread, the created thread function starts instantly and becomes the new RUNNING thread.
Definition at line 3262 of file os-c-wrapper.cpp.
osThreadId osThreadGetId | ( | void | ) |
Get the current thread.
Get the thread ID of the current running thread.
Definition at line 3317 of file os-c-wrapper.cpp.
osPriority osThreadGetPriority | ( | osThreadId | thread_id | ) |
Get thread priority.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
Get the priority of an active thread. In case of a failure the value osPriorityError is returned.
Definition at line 3455 of file os-c-wrapper.cpp.
osStatus osThreadSetPriority | ( | osThreadId | thread_id, |
osPriority | priority | ||
) |
Change thread priority.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | priority | new priority value for the thread function. |
osOK | The priority of the specified thread has been successfully changed. |
osErrorParameter | thread_id is incorrect. |
osErrorValue | incorrect priority value. |
osErrorResource | thread_id refers to a thread that is not an active thread. |
osErrorISR | osThreadSetPriority cannot be called from interrupt service routines. |
Change the priority of a running thread. There is no need for an extra yield after it, if the priorities require, there is an implicit reschedule.
Definition at line 3401 of file os-c-wrapper.cpp.
osStatus osThreadTerminate | ( | osThreadId | thread_id | ) |
Terminate a thread.
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
osOK | The specified thread has been successfully terminated. |
osErrorParameter | thread_id is incorrect. |
osErrorResource | thread_id refers to a thread that is not an active thread. |
osErrorISR | osThreadTerminate cannot be called from interrupt service routines. |
Remove the thread function from the active thread list. If the thread is currently RUNNING the execution will stop.
Definition at line 3339 of file os-c-wrapper.cpp.
osStatus osThreadYield | ( | void | ) |
Yield control.
osOK | The function has been correctly executed. |
osErrorISR | The function cannot be called from interrupt service routines. |
Pass control to the next thread that is in state READY. If there is no other thread in the state READY, the current thread continues execution and no thread switching occurs.
Definition at line 3380 of file os-c-wrapper.cpp.
osTimerId osTimerCreate | ( | const osTimerDef_t * | timer_def, |
os_timer_type | type, | ||
void * | args | ||
) |
Create a timer.
[in] | timer_def | Timer object referenced with osTimer. |
[in] | type | osTimerOnce for one-shot or osTimerPeriodic for periodic behavior. |
[in] | args | Argument to the timer call back function. |
Create a one-shot or periodic timer and associate it with a callback function argument. The timer is initially stopped and must be started with osTimerStart()
.
Definition at line 3575 of file os-c-wrapper.cpp.
Delete the timer.
[in] | timer_id | timer ID obtained by osTimerCreate. |
osOK | The specified timer has been deleted. |
osErrorISR | osTimerDelete cannot be called from interrupt service routines. |
osErrorParameter | timer_id is incorrect. |
Delete the timer object that was created by osTimerCreate.
Definition at line 3667 of file os-c-wrapper.cpp.
Start the timer.
[in] | timer_id | timer ID obtained by osTimerCreate. |
[in] | millisec | Timeout value "time delay" value of the timer. |
osOK | The specified timer has been started or restarted. |
osErrorISR | osTimerStart cannot be called from interrupt service routines. |
osErrorParameter | timer_id is incorrect. |
Start or restart the timer.
Definition at line 3604 of file os-c-wrapper.cpp.
Stop the timer.
[in] | timer_id | timer ID obtained by osTimerCreate. |
osOK | the specified timer has been stopped. |
osErrorISR | osTimerStop cannot be called from interrupt service routines. |
osErrorParameter | timer_id is incorrect. |
osErrorResource | the timer is not started. |
Definition at line 3633 of file os-c-wrapper.cpp.
osEvent osWait | ( | uint32_t | millisec | ) |
Wait for Signal, Message, Mail, or Timeout.
[in] | millisec | Timeout value or 0 in case of no time-out. |
osEventSignal | A signal event occurred and is returned. |
osEventMessage | A message event occurred and is returned. |
osEventMail | A mail event occurred and is returned. |
osEventTimeout | The time delay is executed. |
osErrorISR | osWait() cannot be called from interrupt service routines. |