STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
cmsis_os.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------
2  * $Date: 5. February 2013
3  * $Revision: V1.02
4  *
5  * Project: CMSIS-RTOS API
6  * Title: cmsis_os.h header file
7  *
8  * Version 0.02
9  * Initial Proposal Phase
10  * Version 0.03
11  * osKernelStart added, optional feature: main started as thread
12  * osSemaphores have standard behavior
13  * osTimerCreate does not start the timer, added osTimerStart
14  * osThreadPass is renamed to osThreadYield
15  * Version 1.01
16  * Support for C++ interface
17  * - const attribute removed from the osXxxxDef_t typedef's
18  * - const attribute added to the osXxxxDef macros
19  * Added: osTimerDelete, osMutexDelete, osSemaphoreDelete
20  * Added: osKernelInitialize
21  * Version 1.02
22  * Control functions for short timeouts in microsecond resolution:
23  * Added: osKernelSysTick, osKernelSysTickFrequency, osKernelSysTickMicroSec
24  * Removed: osSignalGet
25  *
26  *
27  *----------------------------------------------------------------------------
28  *
29  * Portions Copyright © 2016 STMicroelectronics International N.V. All rights reserved.
30  * Portions Copyright (c) 2013 ARM LIMITED
31  * All rights reserved.
32  * Redistribution and use in source and binary forms, with or without
33  * modification, are permitted provided that the following conditions are met:
34  * - Redistributions of source code must retain the above copyright
35  * notice, this list of conditions and the following disclaimer.
36  * - Redistributions in binary form must reproduce the above copyright
37  * notice, this list of conditions and the following disclaimer in the
38  * documentation and/or other materials provided with the distribution.
39  * - Neither the name of ARM nor the names of its contributors may be used
40  * to endorse or promote products derived from this software without
41  * specific prior written permission.
42  *
43  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
44  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46  * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
47  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
48  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
49  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
50  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
53  * POSSIBILITY OF SUCH DAMAGE.
54  *---------------------------------------------------------------------------*/
55 
101  #if defined ( __CC_ARM )
102  #define __ASM __asm
103  #define __INLINE __inline
104  #define __STATIC_INLINE static __inline
105 #elif defined ( __ICCARM__ )
106  #define __ASM __asm
107  #define __INLINE inline
108  #define __STATIC_INLINE static inline
109 #elif defined ( __GNUC__ )
110  #define __ASM __asm
111  #define __INLINE inline
112  #define __STATIC_INLINE static inline
113 #endif
114 
115 #include <stdint.h>
116 #include <stddef.h>
117 #include "core_cmFunc.h"
118 
119 #include "FreeRTOS.h"
120 #include "task.h"
121 #include "timers.h"
122 #include "queue.h"
123 #include "semphr.h"
124 #include "event_groups.h"
125 
203 #ifndef _CMSIS_OS_H
204 #define _CMSIS_OS_H
205 
207 #define osCMSIS 0x10002
208 
209 #define osCMSIS_KERNEL 0x10000
211 
212 #define osKernelSystemId "KERNEL V1.00"
214 
215 #define osFeature_MainThread 1
217 #define osFeature_Pool 1
218 #define osFeature_MailQ 1
219 #define osFeature_MessageQ 1
220 #define osFeature_Signals 8
221 #define osFeature_Semaphore 1
222 #define osFeature_Wait 0
223 #define osFeature_SysTick 1
224 
225 #ifdef __cplusplus
226 extern "C"
227 {
228 #endif
229 
230 
231 // ==== Enumeration, structures, defines ====
232 
235 typedef enum {
244 } osPriority;
245 
248 #define osWaitForever 0xFFFFFFFF
249 
250 typedef enum {
253  osOK = 0,
254  osEventSignal = 0x08,
255  osEventMessage = 0x10,
256  osEventMail = 0x20,
257  osEventTimeout = 0x40,
261  osErrorISR = 0x82,
265  osErrorValue = 0x86,
266  osErrorOS = 0xFF,
267  os_status_reserved = 0x7FFFFFFF
268 } osStatus;
269 
270 #if ( INCLUDE_eTaskGetState == 1 )
271 /* Thread state returned by osThreadGetState */
272 typedef enum {
273  osThreadRunning = 0x0, /* A thread is querying the state of itself, so must be running. */
274  osThreadReady = 0x1 , /* The thread being queried is in a read or pending ready list. */
275  osThreadBlocked = 0x2, /* The thread being queried is in the Blocked state. */
276  osThreadSuspended = 0x3, /* The thread being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
277  osThreadDeleted = 0x4, /* The thread being queried has been deleted, but its TCB has not yet been freed. */
278  osThreadError = 0x7FFFFFFF
279 } osThreadState;
280 #endif /* INCLUDE_eTaskGetState */
281 
284 typedef enum {
287 } os_timer_type;
288 
291 typedef void (*os_pthread) (void const *argument);
292 
295 typedef void (*os_ptimer) (void const *argument);
296 
297 // >>> the following data type definitions may shall adapted towards a specific RTOS
298 
302 
306 
310 
314 
317 typedef struct os_pool_cb *osPoolId;
318 
322 
325 typedef struct os_mailQ_cb *osMailQId;
326 
327 
330 typedef struct os_thread_def {
331  char *name;
334  uint32_t instances;
335  uint32_t stacksize;
336 } osThreadDef_t;
337 
340 typedef struct os_timer_def {
342 } osTimerDef_t;
343 
346 typedef struct os_mutex_def {
347  uint32_t dummy;
348 } osMutexDef_t;
349 
352 typedef struct os_semaphore_def {
353  uint32_t dummy;
355 
358 typedef struct os_pool_def {
359  uint32_t pool_sz;
360  uint32_t item_sz;
361  void *pool;
362 } osPoolDef_t;
363 
366 typedef struct os_messageQ_def {
367  uint32_t queue_sz;
368  uint32_t item_sz;
369  //void *pool; ///< memory array for messages
371 
374 typedef struct os_mailQ_def {
375  uint32_t queue_sz;
376  uint32_t item_sz;
377  struct os_mailQ_cb **cb;
378 } osMailQDef_t;
379 
383 typedef struct {
385  union {
386  uint32_t v;
387  void *p;
388  int32_t signals;
389  } value;
390  union {
391  osMailQId mail_id;
392  osMessageQId message_id;
393  } def;
394 } osEvent;
395 
396 
397 // ==== Kernel Control Functions ====
398 
403 
407 osStatus osKernelStart (void);
408 
412 int32_t osKernelRunning(void);
413 
414 #if (defined (osFeature_SysTick) && (osFeature_SysTick != 0)) // System Timer available
415 
419 uint32_t osKernelSysTick (void);
420 
423 #define osKernelSysTickFrequency (configTICK_RATE_HZ)
424 
428 #define osKernelSysTickMicroSec(microsec) (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)
429 
430 #endif // System Timer available
431 
432 // ==== Thread Management ====
433 
441 #if defined (osObjectsExternal) // object is external
442 #define osThreadDef(name, thread, priority, instances, stacksz) \
443 extern const osThreadDef_t os_thread_def_##name
444 #else // define the object
445 #define osThreadDef(name, thread, priority, instances, stacksz) \
446 const osThreadDef_t os_thread_def_##name = \
447 { #name, (thread), (priority), (instances), (stacksz) }
448 #endif
449 
454 #define osThread(name) \
455 &os_thread_def_##name
456 
462 osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument);
463 
467 osThreadId osThreadGetId (void);
468 
473 osStatus osThreadTerminate (osThreadId thread_id);
474 
478 osStatus osThreadYield (void);
479 
485 osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority);
486 
491 osPriority osThreadGetPriority (osThreadId thread_id);
492 
493 
494 // ==== Generic Wait Functions ====
495 
499 osStatus osDelay (uint32_t millisec);
500 
501 #if (defined (osFeature_Wait) && (osFeature_Wait != 0)) // Generic Wait available
502 
507 osEvent osWait (uint32_t millisec);
508 
509 #endif // Generic Wait available
510 
511 
512 // ==== Timer Management Functions ====
518 #if defined (osObjectsExternal) // object is external
519 #define osTimerDef(name, function) \
520 extern const osTimerDef_t os_timer_def_##name
521 #else // define the object
522 #define osTimerDef(name, function) \
523 const osTimerDef_t os_timer_def_##name = \
524 { (function) }
525 #endif
526 
531 #define osTimer(name) \
532 &os_timer_def_##name
533 
540 osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument);
541 
547 osStatus osTimerStart (osTimerId timer_id, uint32_t millisec);
548 
553 osStatus osTimerStop (osTimerId timer_id);
554 
559 osStatus osTimerDelete (osTimerId timer_id);
560 
561 
562 // ==== Signal Management ====
563 
569 int32_t osSignalSet (osThreadId thread_id, int32_t signals);
570 
576 int32_t osSignalClear (osThreadId thread_id, int32_t signals);
577 
583 osEvent osSignalWait (int32_t signals, uint32_t millisec);
584 
585 
586 // ==== Mutex Management ====
587 
592 #if defined (osObjectsExternal) // object is external
593 #define osMutexDef(name) \
594 extern const osMutexDef_t os_mutex_def_##name
595 #else // define the object
596 #define osMutexDef(name) \
597 const osMutexDef_t os_mutex_def_##name = { 0 }
598 #endif
599 
604 #define osMutex(name) \
605 &os_mutex_def_##name
606 
611 osMutexId osMutexCreate (const osMutexDef_t *mutex_def);
612 
618 osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec);
619 
624 osStatus osMutexRelease (osMutexId mutex_id);
625 
630 osStatus osMutexDelete (osMutexId mutex_id);
631 
632 
633 // ==== Semaphore Management Functions ====
634 
635 #if (defined (osFeature_Semaphore) && (osFeature_Semaphore != 0)) // Semaphore available
636 
641 #if defined (osObjectsExternal) // object is external
642 #define osSemaphoreDef(name) \
643 extern const osSemaphoreDef_t os_semaphore_def_##name
644 #else // define the object
645 #define osSemaphoreDef(name) \
646 const osSemaphoreDef_t os_semaphore_def_##name = { 0 }
647 #endif
648 
653 #define osSemaphore(name) \
654 &os_semaphore_def_##name
655 
661 osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count);
662 
668 int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec);
669 
674 osStatus osSemaphoreRelease (osSemaphoreId semaphore_id);
675 
680 osStatus osSemaphoreDelete (osSemaphoreId semaphore_id);
681 
682 #endif // Semaphore available
683 
684 
685 // ==== Memory Pool Management Functions ====
686 
687 #if (defined (osFeature_Pool) && (osFeature_Pool != 0)) // Memory Pool Management available
688 
695 #if defined (osObjectsExternal) // object is external
696 #define osPoolDef(name, no, type) \
697 extern const osPoolDef_t os_pool_def_##name
698 #else // define the object
699 #define osPoolDef(name, no, type) \
700 const osPoolDef_t os_pool_def_##name = \
701 { (no), sizeof(type), NULL }
702 #endif
703 
708 #define osPool(name) \
709 &os_pool_def_##name
710 
715 osPoolId osPoolCreate (const osPoolDef_t *pool_def);
716 
721 void *osPoolAlloc (osPoolId pool_id);
722 
727 void *osPoolCAlloc (osPoolId pool_id);
728 
734 osStatus osPoolFree (osPoolId pool_id, void *block);
735 
736 #endif // Memory Pool Management available
737 
738 
739 // ==== Message Queue Management Functions ====
740 
741 #if (defined (osFeature_MessageQ) && (osFeature_MessageQ != 0)) // Message Queues available
742 
749 #if defined (osObjectsExternal) // object is external
750 #define osMessageQDef(name, queue_sz, type) \
751 extern const osMessageQDef_t os_messageQ_def_##name
752 #else // define the object
753 #define osMessageQDef(name, queue_sz, type) \
754 const osMessageQDef_t os_messageQ_def_##name = \
755 { (queue_sz), sizeof (type) }
756 #endif
757 
762 #define osMessageQ(name) \
763 &os_messageQ_def_##name
764 
770 osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id);
771 
778 osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec);
779 
785 osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec);
786 
787 #endif // Message Queues available
788 
789 
790 // ==== Mail Queue Management Functions ====
791 
792 #if (defined (osFeature_MailQ) && (osFeature_MailQ != 0)) // Mail Queues available
793 
800 #if defined (osObjectsExternal) // object is external
801 #define osMailQDef(name, queue_sz, type) \
802 extern struct os_mailQ_cb *os_mailQ_cb_##name \
803 extern osMailQDef_t os_mailQ_def_##name
804 #else // define the object
805 #define osMailQDef(name, queue_sz, type) \
806 struct os_mailQ_cb *os_mailQ_cb_##name; \
807 const osMailQDef_t os_mailQ_def_##name = \
808 { (queue_sz), sizeof (type), (&os_mailQ_cb_##name) }
809 #endif
810 
815 #define osMailQ(name) \
816 &os_mailQ_def_##name
817 
823 osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id);
824 
830 void *osMailAlloc (osMailQId queue_id, uint32_t millisec);
831 
837 void *osMailCAlloc (osMailQId queue_id, uint32_t millisec);
838 
844 osStatus osMailPut (osMailQId queue_id, void *mail);
845 
851 osEvent osMailGet (osMailQId queue_id, uint32_t millisec);
852 
858 osStatus osMailFree (osMailQId queue_id, void *mail);
859 
860 #endif // Mail Queues available
861 
862 /*************************** Additional specific APIs to Free RTOS ************/
868 void osSystickHandler(void);
869 
870 #if ( INCLUDE_eTaskGetState == 1 )
871 
876 osThreadState osThreadGetState(osThreadId thread_id);
877 #endif /* INCLUDE_eTaskGetState */
878 
879 #if ( INCLUDE_eTaskGetState == 1 )
880 
886 osStatus osThreadIsSuspended(osThreadId thread_id);
887 
888 #endif /* INCLUDE_eTaskGetState */
889 
895 osStatus osThreadSuspend (osThreadId thread_id);
896 
902 osStatus osThreadResume (osThreadId thread_id);
903 
909 
915 
924 osStatus osDelayUntil (uint32_t *PreviousWakeTime, uint32_t millisec);
925 
933 osStatus osThreadList (uint8_t *buffer);
934 
941 osEvent osMessagePeek (osMessageQId queue_id, uint32_t millisec);
942 
948 osMutexId osRecursiveMutexCreate (const osMutexDef_t *mutex_def);
949 
955 osStatus osRecursiveMutexRelease (osMutexId mutex_id);
956 
963 osStatus osRecursiveMutexWait (osMutexId mutex_id, uint32_t millisec);
964 
965 #ifdef __cplusplus
966 }
967 #endif
968 
969 #endif // _CMSIS_OS_H
osStatus osThreadSetPriority(osThreadId thread_id, osPriority priority)
Change priority of an active thread.
Definition: cmsis_os.c:267
uint32_t item_sz
size of an item
Definition: cmsis_os.h:360
CMSIS Cortex-M Core Function Access Header File.
uint32_t v
message as 32-bit value
Definition: cmsis_os.h:386
resource not available: a specified resource was not available.
Definition: cmsis_os.h:259
struct os_mailQ_cb * osMailQId
Definition: cmsis_os.h:325
function completed; signal event occurred.
Definition: cmsis_os.h:254
struct os_mailQ_cb ** cb
Definition: cmsis_os.h:377
int32_t signals
signal flags
Definition: cmsis_os.h:388
osStatus osSemaphoreDelete(osSemaphoreId semaphore_id)
Delete a Semaphore.
Definition: cmsis_os.c:747
struct os_thread_def osThreadDef_t
osPriority tpriority
initial thread priority
Definition: cmsis_os.h:333
priority: below normal
Definition: cmsis_os.h:238
system cannot determine priority or thread has illegal priority.
Definition: cmsis_os.h:263
value of a parameter is out of range.
Definition: cmsis_os.h:265
system is out of memory: it was impossible to allocate or reserve memory for the operation.
Definition: cmsis_os.h:264
void(* os_pthread)(void const *argument)
Definition: cmsis_os.h:291
uint32_t item_sz
size of an item
Definition: cmsis_os.h:376
uint32_t pool_sz
number of items (elements) in the pool
Definition: cmsis_os.h:359
function completed; no error or event occurred.
Definition: cmsis_os.h:253
priority: low
Definition: cmsis_os.h:237
priority: realtime (highest)
Definition: cmsis_os.h:242
osStatus osRecursiveMutexWait(osMutexId mutex_id, uint32_t millisec)
Release a Recursive Mutex.
Definition: cmsis_os.c:1490
function completed; message event occurred.
Definition: cmsis_os.h:255
osStatus osThreadTerminate(osThreadId thread_id)
Terminate execution of a thread and remove it from Active Threads.
Definition: cmsis_os.c:238
osStatus osThreadSuspend(osThreadId thread_id)
Suspend execution of a thread.
Definition: cmsis_os.c:1309
os_pthread pthread
start address of thread function
Definition: cmsis_os.h:332
struct os_mailQ_def osMailQDef_t
osStatus osMailPut(osMailQId queue_id, void *mail)
Put a mail to a queue.
Definition: cmsis_os.c:1134
one-shot timer
Definition: cmsis_os.h:285
osStatus osKernelInitialize(void)
unspecified RTOS error: run-time error but no other error message fits.
Definition: cmsis_os.h:266
parameter error: a mandatory parameter was missing or specified an incorrect object.
Definition: cmsis_os.h:258
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
Definition: cmsis_os.c:936
void * osPoolCAlloc(osPoolId pool_id)
Allocate a memory block from a memory pool and set memory block to zero.
Definition: cmsis_os.c:873
struct os_mutex_def osMutexDef_t
uint32_t instances
maximum number of instances of that thread function
Definition: cmsis_os.h:334
void * p
message or mail as void pointer
Definition: cmsis_os.h:387
priority: high
Definition: cmsis_os.h:241
void * osMailAlloc(osMailQId queue_id, uint32_t millisec)
Allocate a memory block from a mail.
Definition: cmsis_os.c:1091
osMailQId mail_id
mail id obtained by osMailCreate
Definition: cmsis_os.h:391
osEvent osMessagePeek(osMessageQId queue_id, uint32_t millisec)
Receive an item from a queue without removing the item from the queue.
Definition: cmsis_os.c:1413
struct os_messageQ_def osMessageQDef_t
osStatus osMutexRelease(osMutexId mutex_id)
Release a Mutex that was obtained by osMutexWait.
Definition: cmsis_os.c:610
uint32_t osKernelSysTick(void)
Get the value of the Kernel SysTick timer.
Definition: cmsis_os.c:186
osStatus osThreadSuspendAll(void)
Suspend execution of a all active threads.
Definition: cmsis_os.c:1349
int32_t osKernelRunning(void)
Check if the RTOS kernel is already started.
Definition: cmsis_os.c:167
int32_t osSignalClear(osThreadId thread_id, int32_t signals)
osStatus status
status code: event or error information
Definition: cmsis_os.h:384
void osSystickHandler(void)
Handles the tick increment.
Definition: cmsis_os.c:1239
osStatus osDelay(uint32_t millisec)
Wait for Timeout (Time Delay)
Definition: cmsis_os.c:305
priority: normal (default)
Definition: cmsis_os.h:239
osStatus osMutexWait(osMutexId mutex_id, uint32_t millisec)
Wait until a Mutex becomes available.
Definition: cmsis_os.c:570
osMailQId osMailCreate(const osMailQDef_t *queue_def, osThreadId thread_id)
Create and Initialize mail queue.
Definition: cmsis_os.c:1052
osStatus osRecursiveMutexRelease(osMutexId mutex_id)
Release a Recursive Mutex.
Definition: cmsis_os.c:1469
repeating timer
Definition: cmsis_os.h:286
void * osPoolAlloc(osPoolId pool_id)
Allocate a memory block from a memory pool.
Definition: cmsis_os.c:829
SemaphoreHandle_t osSemaphoreId
Definition: cmsis_os.h:313
SemaphoreHandle_t osMutexId
Definition: cmsis_os.h:309
osStatus osMailFree(osMailQId queue_id, void *mail)
Free a memory block from a mail.
Definition: cmsis_os.c:1223
struct os_timer_def osTimerDef_t
osMessageQId message_id
message id obtained by osMessageCreate
Definition: cmsis_os.h:392
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
Definition: cmsis_os.c:951
function completed; timeout occurred.
Definition: cmsis_os.h:257
osStatus osThreadList(uint8_t *buffer)
Lists all the current threads, along with their current state and stack usage high water mark...
Definition: cmsis_os.c:1399
struct os_pool_cb * osPoolId
Definition: cmsis_os.h:317
void * TaskHandle_t
Definition: task.h:103
not allowed in ISR context: the function cannot be called from interrupt service routines.
Definition: cmsis_os.h:261
void * QueueHandle_t
Definition: queue.h:88
priority: idle (lowest)
Definition: cmsis_os.h:236
osPriority osThreadGetPriority(osThreadId thread_id)
Get current priority of an active thread.
Definition: cmsis_os.c:283
resource not available within given time: a specified resource was not available within the timeout p...
Definition: cmsis_os.h:260
QueueHandle_t osMessageQId
Definition: cmsis_os.h:321
osStatus osTimerStart(osTimerId timer_id, uint32_t millisec)
Start or restart a timer.
Definition: cmsis_os.c:360
int32_t osSignalSet(osThreadId thread_id, int32_t signals)
Set the specified Signal Flags of an active thread.
Definition: cmsis_os.c:458
os_ptimer ptimer
start address of a timer function
Definition: cmsis_os.h:341
priority: above normal
Definition: cmsis_os.h:240
uint32_t item_sz
size of an item
Definition: cmsis_os.h:368
osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument)
Create a thread and add it to Active Threads and set it to state READY.
Definition: cmsis_os.c:204
osSemaphoreId osSemaphoreCreate(const osSemaphoreDef_t *semaphore_def, int32_t count)
Create and Initialize a Semaphore object used for managing resources.
Definition: cmsis_os.c:656
uint32_t queue_sz
number of elements in the queue
Definition: cmsis_os.h:367
osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec)
Get a Message or Wait for a Message from a Queue.
Definition: cmsis_os.c:983
osEvent osSignalWait(int32_t signals, uint32_t millisec)
Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
Definition: cmsis_os.c:500
uint32_t queue_sz
number of elements in the queue
Definition: cmsis_os.h:375
TimerHandle_t osTimerId
Definition: cmsis_os.h:305
uint32_t dummy
dummy value.
Definition: cmsis_os.h:347
uint32_t dummy
dummy value.
Definition: cmsis_os.h:353
osStatus osTimerDelete(osTimerId timer_id)
Delete a timer.
Definition: cmsis_os.c:428
osMutexId osMutexCreate(const osMutexDef_t *mutex_def)
Create and Initialize a Mutex object.
Definition: cmsis_os.c:554
uint32_t stacksize
stack size requirements in bytes; 0 is default stack size
Definition: cmsis_os.h:335
osStatus osMutexDelete(osMutexId mutex_id)
Delete a Mutex.
Definition: cmsis_os.c:634
int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec)
Wait until a Semaphore token becomes available.
Definition: cmsis_os.c:680
void * osMailCAlloc(osMailQId queue_id, uint32_t millisec)
Allocate a memory block from a mail and set memory block to zero.
Definition: cmsis_os.c:1113
osMutexId osRecursiveMutexCreate(const osMutexDef_t *mutex_def)
Create and Initialize a Recursive Mutex.
Definition: cmsis_os.c:1454
char * name
Thread name.
Definition: cmsis_os.h:331
prevent from enum down-size compiler optimization.
Definition: cmsis_os.h:267
osTimerId osTimerCreate(const osTimerDef_t *timer_def, os_timer_type type, void *argument)
Create a timer.
Definition: cmsis_os.c:340
void * pool
pointer to memory for pool
Definition: cmsis_os.h:361
struct os_pool_def osPoolDef_t
osEvent osMailGet(osMailQId queue_id, uint32_t millisec)
Get a mail from a queue.
Definition: cmsis_os.c:1167
void(* os_ptimer)(void const *argument)
Definition: cmsis_os.h:295
osStatus osTimerStop(osTimerId timer_id)
Stop a timer.
Definition: cmsis_os.c:399
osThreadId osThreadGetId(void)
Return the thread ID of the current running thread.
Definition: cmsis_os.c:223
osStatus osThreadResumeAll(void)
Resume execution of a all suspended threads.
Definition: cmsis_os.c:1360
osStatus osDelayUntil(uint32_t *PreviousWakeTime, uint32_t millisec)
Delay a task until a specified time.
Definition: cmsis_os.c:1377
struct os_semaphore_def osSemaphoreDef_t
osStatus osSemaphoreRelease(osSemaphoreId semaphore_id)
Release a Semaphore token.
Definition: cmsis_os.c:720
osStatus
Definition: cmsis_os.h:252
void * TimerHandle_t
Definition: timers.h:118
osStatus osThreadYield(void)
Pass control to next thread that is in state READY.
Definition: cmsis_os.c:253
function called multiple times from ISR with same object.
Definition: cmsis_os.h:262
osStatus osKernelStart(void)
Start the RTOS Kernel with executing the specified thread.
Definition: cmsis_os.c:152
function completed; mail event occurred.
Definition: cmsis_os.h:256
osStatus osThreadResume(osThreadId thread_id)
Resume execution of a suspended thread.
Definition: cmsis_os.c:1325
osPoolId osPoolCreate(const osPoolDef_t *pool_def)
Create and Initialize a memory pool.
Definition: cmsis_os.c:784
QueueHandle_t SemaphoreHandle_t
Definition: semphr.h:79
TaskHandle_t osThreadId
Definition: cmsis_os.h:301
osPriority
Definition: cmsis_os.h:235
os_timer_type
Definition: cmsis_os.h:284
osStatus osPoolFree(osPoolId pool_id, void *block)
Return an allocated memory block back to a specific memory pool.
Definition: cmsis_os.c:892
system cannot determine priority or thread has illegal priority
Definition: cmsis_os.h:243