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 |
| #define | osCMSIS_KERNEL 0x00010000 |
| #define | osFeature_MailQ 1 |
| #define | osFeature_MainThread 0 |
| #define | osFeature_MessageQ 1 |
| #define | osFeature_Pool 1 |
| #define | osFeature_Semaphore 30 |
| #define | osFeature_Signals 8 |
| #define | osFeature_SysTick 1 |
| #define | osFeature_Wait 1 |
| #define | osKernelSystemId "µOS++" |
| #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 |
Definition at line 98 of file cmsis_os.h.
| #define osCMSIS_KERNEL 0x00010000 |
Definition at line 101 of file cmsis_os.h.
| #define osFeature_MailQ 1 |
Mail Queues: 1=available, 0=not available.
Definition at line 109 of file cmsis_os.h.
| #define osFeature_MainThread 0 |
Definition at line 107 of file cmsis_os.h.
| #define osFeature_MessageQ 1 |
Message Queues: 1=available, 0=not available.
Definition at line 110 of file cmsis_os.h.
| #define osFeature_Pool 1 |
Memory Pools: 1=available, 0=not available.
Definition at line 108 of file cmsis_os.h.
| #define osFeature_Semaphore 30 |
Maximum count for osSemaphoreCreate function.
Definition at line 112 of file cmsis_os.h.
| #define osFeature_Signals 8 |
Maximum number of Signal Flags available per thread.
Definition at line 111 of file cmsis_os.h.
| #define osFeature_SysTick 1 |
osKernelSysTick functions: 1=available, 0=not available.
Definition at line 114 of file cmsis_os.h.
| #define osFeature_Wait 1 |
osWait function: 1=available, 0=not available.
Definition at line 113 of file cmsis_os.h.
| #define osKernelSystemId "µOS++" |
Definition at line 104 of file cmsis_os.h.
| #define osKernelSysTickFrequency (OS_INTEGER_SYSTICK_FREQUENCY_HZ) |
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 447 of file cmsis_os.h.
| #define osKernelSysTickMicroSec | ( | microsec | ) | (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000) |
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 460 of file cmsis_os.h.
| #define osMailQ | ( | name | ) | &os_mailQ_def_##name |
| name | name of the queue. |
Definition at line 1247 of file cmsis_os.h.
| #define osMailQAllocatedDef | ( | name, | |
| items, | |||
| type | |||
| ) |
| name | name of the queue. |
| items | maximum number of messages in queue. |
| type | data type of a single message element. |
Definition at line 1187 of file cmsis_os.h.
| #define osMailQDef | ( | name, | |
| items, | |||
| type | |||
| ) | osMailQAllocatedDef(name, items, type) |
Definition at line 1236 of file cmsis_os.h.
| #define osMailQStaticDef | ( | name, | |
| items, | |||
| type | |||
| ) |
Definition at line 1210 of file cmsis_os.h.
| #define osMessageQ | ( | name | ) | &os_messageQ_def_##name |
| name | name of the queue. |
Access to the message queue definition for the function osMessageCreate.
Definition at line 1123 of file cmsis_os.h.
| #define osMessageQAllocatedDef | ( | name, | |
| items, | |||
| type | |||
| ) |
| 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 1076 of file cmsis_os.h.
| #define osMessageQDef | ( | name, | |
| items, | |||
| type | |||
| ) | osMessageQAllocatedDef(name, items, type) |
Definition at line 1109 of file cmsis_os.h.
| #define osMessageQStaticDef | ( | name, | |
| items, | |||
| type | |||
| ) |
Definition at line 1088 of file cmsis_os.h.
| #define osMutex | ( | name | ) | &os_mutex_def_##name |
| name | name of the mutex object. |
Provides osMutexCreate access to the mutex object definition.
Definition at line 803 of file cmsis_os.h.
| #define osMutexDef | ( | name | ) |
| name | name of the mutex object. |
Define a mutex object that is referenced by osMutex.
Definition at line 784 of file cmsis_os.h.
| #define osPool | ( | name | ) | &os_pool_def_##name |
| name | name of the memory pool. |
Definition at line 1009 of file cmsis_os.h.
| #define osPoolAllocatedDef | ( | name, | |
| items, | |||
| type | |||
| ) |
| 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 966 of file cmsis_os.h.
| #define osPoolDef | ( | name, | |
| items, | |||
| type | |||
| ) | osPoolAllocatedDef(name, items, type) |
Definition at line 998 of file cmsis_os.h.
| #define osPoolStaticDef | ( | name, | |
| items, | |||
| type | |||
| ) |
Definition at line 979 of file cmsis_os.h.
| #define osSemaphore | ( | name | ) | &os_semaphore_def_##name |
| name | name of the semaphore object. |
Definition at line 893 of file cmsis_os.h.
| #define osSemaphoreDef | ( | name | ) |
| name | name of the semaphore object. |
Definition at line 876 of file cmsis_os.h.
| #define osThread | ( | name | ) | &os_thread_def_##name |
| name | name of the thread definition object. |
Access to the thread definition for the function osThreadCreate.
Definition at line 531 of file cmsis_os.h.
| #define osThreadAllocatedDef | ( | name, | |
| priority, | |||
| instances, | |||
| stacksz | |||
| ) |
| 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 485 of file cmsis_os.h.
| #define osThreadDef | ( | name, | |
| priority, | |||
| instances, | |||
| stacksz | |||
| ) | osThreadAllocatedDef(name, priority, instances, stacksz) |
Definition at line 517 of file cmsis_os.h.
| #define osThreadStaticDef | ( | name, | |
| priority, | |||
| instances, | |||
| stacksz | |||
| ) |
Definition at line 499 of file cmsis_os.h.
| #define osTimer | ( | name | ) | &os_timer_def_##name |
| name | name of the timer object. |
Provide access to the timer definition for the function osTimerCreate.
Definition at line 676 of file cmsis_os.h.
| #define osTimerDef | ( | name, | |
| function | |||
| ) |
| name | name of the timer object. |
| function | name of the timer call back function. |
Define the attributes of a timer object.
Definition at line 654 of file cmsis_os.h.
| #define osWaitForever 0xFFFFFFFF |
Definition at line 147 of file cmsis_os.h.
| typedef struct os_mail_queue_s os_mail_queue_t |
| typedef void(* os_pthread) (void const *argument) |
Definition at line 186 of file cmsis_os.h.
| typedef void(* os_ptimer) (void const *argument) |
Definition at line 193 of file cmsis_os.h.
| typedef os_mail_queue_t osMailQ |
Definition at line 221 of file cmsis_os.h.
| typedef struct os_mailQ_def osMailQDef_t |
Definition at line 263 of file cmsis_os.h.
| typedef os_mqueue_t osMessageQ |
Definition at line 212 of file cmsis_os.h.
| typedef os_mqueue_attr_t osMessageQAttr |
Definition at line 213 of file cmsis_os.h.
| typedef struct os_messageQ_def osMessageQDef_t |
| typedef osMessageQ* osMessageQId |
Definition at line 257 of file cmsis_os.h.
| typedef os_mutex_t osMutex |
Definition at line 203 of file cmsis_os.h.
| typedef os_mutex_attr_t osMutexAttr |
Definition at line 204 of file cmsis_os.h.
| typedef struct os_mutex_def osMutexDef_t |
Definition at line 239 of file cmsis_os.h.
| typedef os_mempool_t osPool |
Definition at line 209 of file cmsis_os.h.
| typedef os_mempool_attr_t osPoolAttr |
Definition at line 210 of file cmsis_os.h.
| typedef struct os_pool_def osPoolDef_t |
Definition at line 251 of file cmsis_os.h.
| typedef os_semaphore_t osSemaphore |
Definition at line 206 of file cmsis_os.h.
| typedef os_semaphore_attr_t osSemaphoreAttr |
Definition at line 207 of file cmsis_os.h.
| typedef struct os_semaphore_def osSemaphoreDef_t |
| typedef osSemaphore* osSemaphoreId |
Definition at line 245 of file cmsis_os.h.
| typedef os_thread_t osThread |
Definition at line 197 of file cmsis_os.h.
| typedef os_thread_attr_t osThreadAttr |
Definition at line 198 of file cmsis_os.h.
| typedef struct os_thread_def osThreadDef_t |
| typedef osThread* osThreadId |
Definition at line 227 of file cmsis_os.h.
| typedef os_timer_t osTimer |
Definition at line 200 of file cmsis_os.h.
| typedef os_timer_attr_t osTimerAttr |
Definition at line 201 of file cmsis_os.h.
| typedef struct os_timer_def osTimerDef_t |
Definition at line 233 of file cmsis_os.h.
| enum os_timer_type |
| Enumerator | |
|---|---|
| osTimerOnce | One-shot timer. |
| osTimerPeriodic | Repeating timer. |
Definition at line 176 of file cmsis_os.h.
| enum osPriority |
Priority used for thread control.
Definition at line 131 of file cmsis_os.h.
| enum osStatus |
Definition at line 153 of file cmsis_os.h.
| osStatus osDelay | ( | uint32_t | millisec | ) |
| [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 3734 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), osErrorISR, osErrorOS, osEventTimeout, os::rtos::clock::sleep_for(), os::rtos::sysclock, and os::rtos::clock_systick::ticks_cast().
| osStatus osKernelInitialize | ( | void | ) |
| 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 3409 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), os::rtos::scheduler::initialize(), osErrorISR, and osOK.
| int32_t osKernelRunning | ( | void | ) |
| 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 3446 of file os-c-wrapper.cpp.
References os::rtos::scheduler::started().
| 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 3431 of file os-c-wrapper.cpp.
References os::rtos::scheduler::start().
| uint32_t osKernelSysTick | ( | void | ) |
| void * osMailAlloc | ( | osMailQId | mail_id, |
| uint32_t | millisec | ||
| ) |
| [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 | ||
| ) |
| [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 | ||
| ) |
| [in] | mail_def | reference to the mail queue definition obtain with osMailQ. |
| [in] | thread_id | thread ID (obtained by osThreadCreate or osThreadGetId) or NULL. |
| [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. |
| [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. |
| [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 | ||
| ) |
| [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 | ||
| ) |
| [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 | ||
| ) |
| [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 | ) |
| [in] | mutex_def | mutex definition referenced with osMutex. |
Create and initialise a mutex object instance.
Definition at line 4099 of file os-c-wrapper.cpp.
References os_mutex_def::data, os::rtos::interrupts::in_handler_mode(), os::rtos::mutex::protocol::inherit, os::rtos::mutex::attributes::mx_protocol, os::rtos::mutex::attributes::mx_type, os_mutex_def::name, and os::rtos::mutex::type::recursive.
| [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 4248 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), osErrorISR, osErrorParameter, and osOK.
| [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 4209 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), os::rtos::result::ok, osErrorISR, osErrorOS, osErrorParameter, osErrorResource, and osOK.
| [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 4139 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), os::rtos::result::ok, osErrorISR, osErrorOS, osErrorParameter, osErrorResource, osErrorTimeoutResource, osOK, osWaitForever, and os::rtos::clock_systick::ticks_cast().
| void * osPoolAlloc | ( | osPoolId | pool_id | ) |
| [in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
| void * osPoolCAlloc | ( | osPoolId | pool_id | ) |
| [in] | pool_id | memory pool ID obtain referenced with osPoolCreate. |
| osPoolId osPoolCreate | ( | const osPoolDef_t * | pool_def | ) |
| [in] | pool_def | memory pool definition referenced with osPool. |
| [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 | ||
| ) |
| [in] | semaphore_def | semaphore definition referenced with osSemaphore. |
| [in] | count | number of available resources. |
| osStatus osSemaphoreDelete | ( | osSemaphoreId | semaphore_id | ) |
| [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 | ) |
| [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 | ||
| ) |
| [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 | ||
| ) |
| [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 3970 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode().
| int32_t osSignalSet | ( | osThreadId | thread_id, |
| int32_t | signals | ||
| ) |
| [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 3946 of file os-c-wrapper.cpp.
| osEvent osSignalWait | ( | int32_t | signals, |
| uint32_t | millisec | ||
| ) |
| [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 4023 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), os::rtos::result::ok, osErrorISR, osErrorOS, osErrorValue, osEventSignal, osEventTimeout, osOK, osWaitForever, osEvent::signals, osEvent::status, os::rtos::clock_systick::ticks_cast(), and osEvent::value.
| osThreadId osThreadCreate | ( | const osThreadDef_t * | thread_def, |
| void * | args | ||
| ) |
| [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 3493 of file os-c-wrapper.cpp.
References os_thread_def::data, os::rtos::thread::state::destroyed, os::rtos::interrupts::in_handler_mode(), os_thread_def::instances, os_thread_def::name, osPriorityError, os_thread_def::pthread, os_thread_def::stack, os_thread_def::stacksize, os::rtos::thread::attributes::th_priority, os::rtos::thread::attributes::th_stack_address, os::rtos::thread::attributes::th_stack_size_bytes, os_thread_def::tpriority, and os::rtos::thread::state::undefined.
| osThreadId osThreadGetId | ( | void | ) |
Get the thread ID of the current running thread.
Definition at line 3561 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode().
| osPriority osThreadGetPriority | ( | osThreadId | thread_id | ) |
| [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 3699 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), and osPriorityError.
| osStatus osThreadSetPriority | ( | osThreadId | thread_id, |
| osPriority | 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 3645 of file os-c-wrapper.cpp.
References os::rtos::thread::state::destroyed, os::rtos::interrupts::in_handler_mode(), os::rtos::result::ok, osErrorISR, osErrorOS, osErrorParameter, osErrorResource, osErrorValue, osOK, osPriorityError, and os::rtos::thread::state::undefined.
| osStatus osThreadTerminate | ( | osThreadId | thread_id | ) |
| [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 3583 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), kill(), osErrorISR, osErrorParameter, osErrorResource, osOK, and os::rtos::thread::state::undefined.
| osStatus osThreadYield | ( | void | ) |
| 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 3624 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), osErrorISR, osOK, and this_thread::yield().
| osTimerId osTimerCreate | ( | const osTimerDef_t * | timer_def, |
| os_timer_type | type, | ||
| void * | args | ||
| ) |
| [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 3822 of file os-c-wrapper.cpp.
References os_timer_def::data, os::rtos::interrupts::in_handler_mode(), os_timer_def::name, os_timer_def::ptimer, and os::rtos::timer::attributes::tm_type.
| [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 3920 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), osErrorISR, osErrorParameter, and osOK.
| [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 3856 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), os::rtos::result::ok, osErrorISR, osErrorOS, osErrorParameter, osOK, and os::rtos::clock_systick::ticks_cast().
| [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 3886 of file os-c-wrapper.cpp.
References os::rtos::interrupts::in_handler_mode(), os::rtos::result::ok, osErrorISR, osErrorOS, osErrorParameter, osErrorResource, and osOK.
| osEvent osWait | ( | uint32_t | millisec | ) |
| [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. |