ProjetoBB

Dependencies:   F7_Ethernet WebSocketClient mbed mcp3008

Fork of Nucleo_F746ZG_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sat Jun 18 10:49:12 2016 +0000
Revision:
0:f9b6112278fe
Ethernet for the NUCLEO STM32F746 Board Testprogram uses DHCP and NTP to set the clock

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:f9b6112278fe 1 /* ----------------------------------------------------------------------
DieterGraef 0:f9b6112278fe 2 * Copyright (C) 2015 ARM Limited. All rights reserved.
DieterGraef 0:f9b6112278fe 3 *
DieterGraef 0:f9b6112278fe 4 * $Date: 5. June 2012
DieterGraef 0:f9b6112278fe 5 * $Revision: V1.01
DieterGraef 0:f9b6112278fe 6 *
DieterGraef 0:f9b6112278fe 7 * Project: CMSIS-RTOS API
DieterGraef 0:f9b6112278fe 8 * Title: cmsis_os.h RTX header file
DieterGraef 0:f9b6112278fe 9 *
DieterGraef 0:f9b6112278fe 10 * Version 0.02
DieterGraef 0:f9b6112278fe 11 * Initial Proposal Phase
DieterGraef 0:f9b6112278fe 12 * Version 0.03
DieterGraef 0:f9b6112278fe 13 * osKernelStart added, optional feature: main started as thread
DieterGraef 0:f9b6112278fe 14 * osSemaphores have standard behavior
DieterGraef 0:f9b6112278fe 15 * osTimerCreate does not start the timer, added osTimerStart
DieterGraef 0:f9b6112278fe 16 * osThreadPass is renamed to osThreadYield
DieterGraef 0:f9b6112278fe 17 * Version 1.01
DieterGraef 0:f9b6112278fe 18 * Support for C++ interface
DieterGraef 0:f9b6112278fe 19 * - const attribute removed from the osXxxxDef_t typedef's
DieterGraef 0:f9b6112278fe 20 * - const attribute added to the osXxxxDef macros
DieterGraef 0:f9b6112278fe 21 * Added: osTimerDelete, osMutexDelete, osSemaphoreDelete
DieterGraef 0:f9b6112278fe 22 * Added: osKernelInitialize
DieterGraef 0:f9b6112278fe 23 * -------------------------------------------------------------------- */
DieterGraef 0:f9b6112278fe 24
DieterGraef 0:f9b6112278fe 25 /**
DieterGraef 0:f9b6112278fe 26 \page cmsis_os_h Header File Template: cmsis_os.h
DieterGraef 0:f9b6112278fe 27
DieterGraef 0:f9b6112278fe 28 The file \b cmsis_os.h is a template header file for a CMSIS-RTOS compliant Real-Time Operating System (RTOS).
DieterGraef 0:f9b6112278fe 29 Each RTOS that is compliant with CMSIS-RTOS shall provide a specific \b cmsis_os.h header file that represents
DieterGraef 0:f9b6112278fe 30 its implementation.
DieterGraef 0:f9b6112278fe 31
DieterGraef 0:f9b6112278fe 32 The file cmsis_os.h contains:
DieterGraef 0:f9b6112278fe 33 - CMSIS-RTOS API function definitions
DieterGraef 0:f9b6112278fe 34 - struct definitions for parameters and return types
DieterGraef 0:f9b6112278fe 35 - status and priority values used by CMSIS-RTOS API functions
DieterGraef 0:f9b6112278fe 36 - macros for defining threads and other kernel objects
DieterGraef 0:f9b6112278fe 37
DieterGraef 0:f9b6112278fe 38
DieterGraef 0:f9b6112278fe 39 <b>Name conventions and header file modifications</b>
DieterGraef 0:f9b6112278fe 40
DieterGraef 0:f9b6112278fe 41 All definitions are prefixed with \b os to give an unique name space for CMSIS-RTOS functions.
DieterGraef 0:f9b6112278fe 42 Definitions that are prefixed \b os_ are not used in the application code but local to this header file.
DieterGraef 0:f9b6112278fe 43 All definitions and functions that belong to a module are grouped and have a common prefix, i.e. \b osThread.
DieterGraef 0:f9b6112278fe 44
DieterGraef 0:f9b6112278fe 45 Definitions that are marked with <b>CAN BE CHANGED</b> can be adapted towards the needs of the actual CMSIS-RTOS implementation.
DieterGraef 0:f9b6112278fe 46 These definitions can be specific to the underlying RTOS kernel.
DieterGraef 0:f9b6112278fe 47
DieterGraef 0:f9b6112278fe 48 Definitions that are marked with <b>MUST REMAIN UNCHANGED</b> cannot be altered. Otherwise the CMSIS-RTOS implementation is no longer
DieterGraef 0:f9b6112278fe 49 compliant to the standard. Note that some functions are optional and need not to be provided by every CMSIS-RTOS implementation.
DieterGraef 0:f9b6112278fe 50
DieterGraef 0:f9b6112278fe 51
DieterGraef 0:f9b6112278fe 52 <b>Function calls from interrupt service routines</b>
DieterGraef 0:f9b6112278fe 53
DieterGraef 0:f9b6112278fe 54 The following CMSIS-RTOS functions can be called from threads and interrupt service routines (ISR):
DieterGraef 0:f9b6112278fe 55 - \ref osSignalSet
DieterGraef 0:f9b6112278fe 56 - \ref osSemaphoreRelease
DieterGraef 0:f9b6112278fe 57 - \ref osPoolAlloc, \ref osPoolCAlloc, \ref osPoolFree
DieterGraef 0:f9b6112278fe 58 - \ref osMessagePut, \ref osMessageGet
DieterGraef 0:f9b6112278fe 59 - \ref osMailAlloc, \ref osMailCAlloc, \ref osMailGet, \ref osMailPut, \ref osMailFree
DieterGraef 0:f9b6112278fe 60
DieterGraef 0:f9b6112278fe 61 Functions that cannot be called from an ISR are verifying the interrupt status and return in case that they are called
DieterGraef 0:f9b6112278fe 62 from an ISR context the status code \b osErrorISR. In some implementations this condition might be caught using the HARD FAULT vector.
DieterGraef 0:f9b6112278fe 63
DieterGraef 0:f9b6112278fe 64 Some CMSIS-RTOS implementations support CMSIS-RTOS function calls from multiple ISR at the same time.
DieterGraef 0:f9b6112278fe 65 If this is impossible, the CMSIS-RTOS rejects calls by nested ISR functions with the status code \b osErrorISRRecursive.
DieterGraef 0:f9b6112278fe 66
DieterGraef 0:f9b6112278fe 67
DieterGraef 0:f9b6112278fe 68 <b>Define and reference object definitions</b>
DieterGraef 0:f9b6112278fe 69
DieterGraef 0:f9b6112278fe 70 With <b>\#define osObjectsExternal</b> objects are defined as external symbols. This allows to create a consistent header file
DieterGraef 0:f9b6112278fe 71 that is used throughout a project as shown below:
DieterGraef 0:f9b6112278fe 72
DieterGraef 0:f9b6112278fe 73 <i>Header File</i>
DieterGraef 0:f9b6112278fe 74 \code
DieterGraef 0:f9b6112278fe 75 #include <cmsis_os.h> // CMSIS RTOS header file
DieterGraef 0:f9b6112278fe 76
DieterGraef 0:f9b6112278fe 77 // Thread definition
DieterGraef 0:f9b6112278fe 78 extern void thread_sample (void const *argument); // function prototype
DieterGraef 0:f9b6112278fe 79 osThreadDef (thread_sample, osPriorityBelowNormal, 1, 100);
DieterGraef 0:f9b6112278fe 80
DieterGraef 0:f9b6112278fe 81 // Pool definition
DieterGraef 0:f9b6112278fe 82 osPoolDef(MyPool, 10, long);
DieterGraef 0:f9b6112278fe 83 \endcode
DieterGraef 0:f9b6112278fe 84
DieterGraef 0:f9b6112278fe 85
DieterGraef 0:f9b6112278fe 86 This header file defines all objects when included in a C/C++ source file. When <b>\#define osObjectsExternal</b> is
DieterGraef 0:f9b6112278fe 87 present before the header file, the objects are defined as external symbols. A single consistent header file can therefore be
DieterGraef 0:f9b6112278fe 88 used throughout the whole project.
DieterGraef 0:f9b6112278fe 89
DieterGraef 0:f9b6112278fe 90 <i>Example</i>
DieterGraef 0:f9b6112278fe 91 \code
DieterGraef 0:f9b6112278fe 92 #include "osObjects.h" // Definition of the CMSIS-RTOS objects
DieterGraef 0:f9b6112278fe 93 \endcode
DieterGraef 0:f9b6112278fe 94
DieterGraef 0:f9b6112278fe 95 \code
DieterGraef 0:f9b6112278fe 96 #define osObjectExternal // Objects will be defined as external symbols
DieterGraef 0:f9b6112278fe 97 #include "osObjects.h" // Reference to the CMSIS-RTOS objects
DieterGraef 0:f9b6112278fe 98 \endcode
DieterGraef 0:f9b6112278fe 99
DieterGraef 0:f9b6112278fe 100 */
DieterGraef 0:f9b6112278fe 101
DieterGraef 0:f9b6112278fe 102 #ifndef _CMSIS_OS_H
DieterGraef 0:f9b6112278fe 103 #define _CMSIS_OS_H
DieterGraef 0:f9b6112278fe 104
DieterGraef 0:f9b6112278fe 105 /// \note MUST REMAIN UNCHANGED: \b osCMSIS identifies the CMSIS-RTOS API version.
DieterGraef 0:f9b6112278fe 106 #define osCMSIS 0x10001 ///< API version (main [31:16] .sub [15:0])
DieterGraef 0:f9b6112278fe 107
DieterGraef 0:f9b6112278fe 108 /// \note CAN BE CHANGED: \b osCMSIS_KERNEL identifies the underlying RTOS kernel and version number.
DieterGraef 0:f9b6112278fe 109 #define osCMSIS_RTX ((4<<16)|61) ///< RTOS identification and version (main [31:16] .sub [15:0])
DieterGraef 0:f9b6112278fe 110
DieterGraef 0:f9b6112278fe 111 /// \note MUST REMAIN UNCHANGED: \b osKernelSystemId shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 112 #define osKernelSystemId "RTX V4.61" ///< RTOS identification string
DieterGraef 0:f9b6112278fe 113
DieterGraef 0:f9b6112278fe 114
DieterGraef 0:f9b6112278fe 115 #define CMSIS_OS_RTX
DieterGraef 0:f9b6112278fe 116
DieterGraef 0:f9b6112278fe 117 // The stack space occupied is mainly dependent on the underling C standard library
DieterGraef 0:f9b6112278fe 118 #if defined(TOOLCHAIN_GCC) || defined(TOOLCHAIN_ARM_STD) || defined(TOOLCHAIN_IAR)
DieterGraef 0:f9b6112278fe 119 # define WORDS_STACK_SIZE 512
DieterGraef 0:f9b6112278fe 120 #elif defined(TOOLCHAIN_ARM_MICRO)
DieterGraef 0:f9b6112278fe 121 # define WORDS_STACK_SIZE 128
DieterGraef 0:f9b6112278fe 122 #endif
DieterGraef 0:f9b6112278fe 123
DieterGraef 0:f9b6112278fe 124 #define DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
DieterGraef 0:f9b6112278fe 125
DieterGraef 0:f9b6112278fe 126
DieterGraef 0:f9b6112278fe 127 /// \note MUST REMAIN UNCHANGED: \b osFeature_xxx shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 128 #define osFeature_MainThread 1 ///< main thread 1=main can be thread, 0=not available
DieterGraef 0:f9b6112278fe 129 #define osFeature_Pool 1 ///< Memory Pools: 1=available, 0=not available
DieterGraef 0:f9b6112278fe 130 #define osFeature_MailQ 1 ///< Mail Queues: 1=available, 0=not available
DieterGraef 0:f9b6112278fe 131 #define osFeature_MessageQ 1 ///< Message Queues: 1=available, 0=not available
DieterGraef 0:f9b6112278fe 132 #define osFeature_Signals 16 ///< maximum number of Signal Flags available per thread
DieterGraef 0:f9b6112278fe 133 #define osFeature_Semaphore 65535 ///< maximum count for \ref osSemaphoreCreate function
DieterGraef 0:f9b6112278fe 134 #define osFeature_Wait 0 ///< osWait function: 1=available, 0=not available
DieterGraef 0:f9b6112278fe 135
DieterGraef 0:f9b6112278fe 136 #if defined (__CC_ARM)
DieterGraef 0:f9b6112278fe 137 #define os_InRegs __value_in_regs // Compiler specific: force struct in registers
DieterGraef 0:f9b6112278fe 138 #elif defined (__ICCARM__)
DieterGraef 0:f9b6112278fe 139 #define os_InRegs __value_in_regs // Compiler specific: force struct in registers
DieterGraef 0:f9b6112278fe 140 #else
DieterGraef 0:f9b6112278fe 141 #define os_InRegs
DieterGraef 0:f9b6112278fe 142 #endif
DieterGraef 0:f9b6112278fe 143
DieterGraef 0:f9b6112278fe 144 #include <stdint.h>
DieterGraef 0:f9b6112278fe 145 #include <stddef.h>
DieterGraef 0:f9b6112278fe 146
DieterGraef 0:f9b6112278fe 147 #ifdef __cplusplus
DieterGraef 0:f9b6112278fe 148 extern "C"
DieterGraef 0:f9b6112278fe 149 {
DieterGraef 0:f9b6112278fe 150 #endif
DieterGraef 0:f9b6112278fe 151
DieterGraef 0:f9b6112278fe 152 #include "os_tcb.h"
DieterGraef 0:f9b6112278fe 153
DieterGraef 0:f9b6112278fe 154 // ==== Enumeration, structures, defines ====
DieterGraef 0:f9b6112278fe 155
DieterGraef 0:f9b6112278fe 156 /// Priority used for thread control.
DieterGraef 0:f9b6112278fe 157 /// \note MUST REMAIN UNCHANGED: \b osPriority shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 158 typedef enum {
DieterGraef 0:f9b6112278fe 159 osPriorityIdle = -3, ///< priority: idle (lowest)
DieterGraef 0:f9b6112278fe 160 osPriorityLow = -2, ///< priority: low
DieterGraef 0:f9b6112278fe 161 osPriorityBelowNormal = -1, ///< priority: below normal
DieterGraef 0:f9b6112278fe 162 osPriorityNormal = 0, ///< priority: normal (default)
DieterGraef 0:f9b6112278fe 163 osPriorityAboveNormal = +1, ///< priority: above normal
DieterGraef 0:f9b6112278fe 164 osPriorityHigh = +2, ///< priority: high
DieterGraef 0:f9b6112278fe 165 osPriorityRealtime = +3, ///< priority: realtime (highest)
DieterGraef 0:f9b6112278fe 166 osPriorityError = 0x84 ///< system cannot determine priority or thread has illegal priority
DieterGraef 0:f9b6112278fe 167 } osPriority;
DieterGraef 0:f9b6112278fe 168
DieterGraef 0:f9b6112278fe 169 /// Timeout value.
DieterGraef 0:f9b6112278fe 170 /// \note MUST REMAIN UNCHANGED: \b osWaitForever shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 171 #define osWaitForever 0xFFFFFFFF ///< wait forever timeout value
DieterGraef 0:f9b6112278fe 172
DieterGraef 0:f9b6112278fe 173 /// Status code values returned by CMSIS-RTOS functions.
DieterGraef 0:f9b6112278fe 174 /// \note MUST REMAIN UNCHANGED: \b osStatus shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 175 typedef enum {
DieterGraef 0:f9b6112278fe 176 osOK = 0, ///< function completed; no error or event occurred.
DieterGraef 0:f9b6112278fe 177 osEventSignal = 0x08, ///< function completed; signal event occurred.
DieterGraef 0:f9b6112278fe 178 osEventMessage = 0x10, ///< function completed; message event occurred.
DieterGraef 0:f9b6112278fe 179 osEventMail = 0x20, ///< function completed; mail event occurred.
DieterGraef 0:f9b6112278fe 180 osEventTimeout = 0x40, ///< function completed; timeout occurred.
DieterGraef 0:f9b6112278fe 181 osErrorParameter = 0x80, ///< parameter error: a mandatory parameter was missing or specified an incorrect object.
DieterGraef 0:f9b6112278fe 182 osErrorResource = 0x81, ///< resource not available: a specified resource was not available.
DieterGraef 0:f9b6112278fe 183 osErrorTimeoutResource = 0xC1, ///< resource not available within given time: a specified resource was not available within the timeout period.
DieterGraef 0:f9b6112278fe 184 osErrorISR = 0x82, ///< not allowed in ISR context: the function cannot be called from interrupt service routines.
DieterGraef 0:f9b6112278fe 185 osErrorISRRecursive = 0x83, ///< function called multiple times from ISR with same object.
DieterGraef 0:f9b6112278fe 186 osErrorPriority = 0x84, ///< system cannot determine priority or thread has illegal priority.
DieterGraef 0:f9b6112278fe 187 osErrorNoMemory = 0x85, ///< system is out of memory: it was impossible to allocate or reserve memory for the operation.
DieterGraef 0:f9b6112278fe 188 osErrorValue = 0x86, ///< value of a parameter is out of range.
DieterGraef 0:f9b6112278fe 189 osErrorOS = 0xFF, ///< unspecified RTOS error: run-time error but no other error message fits.
DieterGraef 0:f9b6112278fe 190 os_status_reserved = 0x7FFFFFFF ///< prevent from enum down-size compiler optimization.
DieterGraef 0:f9b6112278fe 191 } osStatus;
DieterGraef 0:f9b6112278fe 192
DieterGraef 0:f9b6112278fe 193
DieterGraef 0:f9b6112278fe 194 /// Timer type value for the timer definition.
DieterGraef 0:f9b6112278fe 195 /// \note MUST REMAIN UNCHANGED: \b os_timer_type shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 196 typedef enum {
DieterGraef 0:f9b6112278fe 197 osTimerOnce = 0, ///< one-shot timer
DieterGraef 0:f9b6112278fe 198 osTimerPeriodic = 1 ///< repeating timer
DieterGraef 0:f9b6112278fe 199 } os_timer_type;
DieterGraef 0:f9b6112278fe 200
DieterGraef 0:f9b6112278fe 201 /// Entry point of a thread.
DieterGraef 0:f9b6112278fe 202 /// \note MUST REMAIN UNCHANGED: \b os_pthread shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 203 typedef void (*os_pthread) (void const *argument);
DieterGraef 0:f9b6112278fe 204
DieterGraef 0:f9b6112278fe 205 /// Entry point of a timer call back function.
DieterGraef 0:f9b6112278fe 206 /// \note MUST REMAIN UNCHANGED: \b os_ptimer shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 207 typedef void (*os_ptimer) (void const *argument);
DieterGraef 0:f9b6112278fe 208
DieterGraef 0:f9b6112278fe 209 // >>> the following data type definitions may shall adapted towards a specific RTOS
DieterGraef 0:f9b6112278fe 210
DieterGraef 0:f9b6112278fe 211 /// Thread ID identifies the thread (pointer to a thread control block).
DieterGraef 0:f9b6112278fe 212 /// \note CAN BE CHANGED: \b os_thread_cb is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 213 typedef struct os_thread_cb *osThreadId;
DieterGraef 0:f9b6112278fe 214
DieterGraef 0:f9b6112278fe 215 /// Timer ID identifies the timer (pointer to a timer control block).
DieterGraef 0:f9b6112278fe 216 /// \note CAN BE CHANGED: \b os_timer_cb is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 217 typedef struct os_timer_cb *osTimerId;
DieterGraef 0:f9b6112278fe 218
DieterGraef 0:f9b6112278fe 219 /// Mutex ID identifies the mutex (pointer to a mutex control block).
DieterGraef 0:f9b6112278fe 220 /// \note CAN BE CHANGED: \b os_mutex_cb is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 221 typedef struct os_mutex_cb *osMutexId;
DieterGraef 0:f9b6112278fe 222
DieterGraef 0:f9b6112278fe 223 /// Semaphore ID identifies the semaphore (pointer to a semaphore control block).
DieterGraef 0:f9b6112278fe 224 /// \note CAN BE CHANGED: \b os_semaphore_cb is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 225 typedef struct os_semaphore_cb *osSemaphoreId;
DieterGraef 0:f9b6112278fe 226
DieterGraef 0:f9b6112278fe 227 /// Pool ID identifies the memory pool (pointer to a memory pool control block).
DieterGraef 0:f9b6112278fe 228 /// \note CAN BE CHANGED: \b os_pool_cb is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 229 typedef struct os_pool_cb *osPoolId;
DieterGraef 0:f9b6112278fe 230
DieterGraef 0:f9b6112278fe 231 /// Message ID identifies the message queue (pointer to a message queue control block).
DieterGraef 0:f9b6112278fe 232 /// \note CAN BE CHANGED: \b os_messageQ_cb is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 233 typedef struct os_messageQ_cb *osMessageQId;
DieterGraef 0:f9b6112278fe 234
DieterGraef 0:f9b6112278fe 235 /// Mail ID identifies the mail queue (pointer to a mail queue control block).
DieterGraef 0:f9b6112278fe 236 /// \note CAN BE CHANGED: \b os_mailQ_cb is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 237 typedef struct os_mailQ_cb *osMailQId;
DieterGraef 0:f9b6112278fe 238
DieterGraef 0:f9b6112278fe 239
DieterGraef 0:f9b6112278fe 240 /// Thread Definition structure contains startup information of a thread.
DieterGraef 0:f9b6112278fe 241 /// \note CAN BE CHANGED: \b os_thread_def is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 242 typedef struct os_thread_def {
DieterGraef 0:f9b6112278fe 243 os_pthread pthread; ///< start address of thread function
DieterGraef 0:f9b6112278fe 244 osPriority tpriority; ///< initial thread priority
DieterGraef 0:f9b6112278fe 245 uint32_t stacksize; ///< stack size requirements in bytes
DieterGraef 0:f9b6112278fe 246 uint32_t *stack_pointer; ///< pointer to the stack memory block
DieterGraef 0:f9b6112278fe 247 struct OS_TCB tcb;
DieterGraef 0:f9b6112278fe 248 } osThreadDef_t;
DieterGraef 0:f9b6112278fe 249
DieterGraef 0:f9b6112278fe 250 /// Timer Definition structure contains timer parameters.
DieterGraef 0:f9b6112278fe 251 /// \note CAN BE CHANGED: \b os_timer_def is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 252 typedef struct os_timer_def {
DieterGraef 0:f9b6112278fe 253 os_ptimer ptimer; ///< start address of a timer function
DieterGraef 0:f9b6112278fe 254 void *timer; ///< pointer to internal data
DieterGraef 0:f9b6112278fe 255 } osTimerDef_t;
DieterGraef 0:f9b6112278fe 256
DieterGraef 0:f9b6112278fe 257 /// Mutex Definition structure contains setup information for a mutex.
DieterGraef 0:f9b6112278fe 258 /// \note CAN BE CHANGED: \b os_mutex_def is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 259 typedef struct os_mutex_def {
DieterGraef 0:f9b6112278fe 260 void *mutex; ///< pointer to internal data
DieterGraef 0:f9b6112278fe 261 } osMutexDef_t;
DieterGraef 0:f9b6112278fe 262
DieterGraef 0:f9b6112278fe 263 /// Semaphore Definition structure contains setup information for a semaphore.
DieterGraef 0:f9b6112278fe 264 /// \note CAN BE CHANGED: \b os_semaphore_def is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 265 typedef struct os_semaphore_def {
DieterGraef 0:f9b6112278fe 266 void *semaphore; ///< pointer to internal data
DieterGraef 0:f9b6112278fe 267 } osSemaphoreDef_t;
DieterGraef 0:f9b6112278fe 268
DieterGraef 0:f9b6112278fe 269 /// Definition structure for memory block allocation.
DieterGraef 0:f9b6112278fe 270 /// \note CAN BE CHANGED: \b os_pool_def is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 271 typedef struct os_pool_def {
DieterGraef 0:f9b6112278fe 272 uint32_t pool_sz; ///< number of items (elements) in the pool
DieterGraef 0:f9b6112278fe 273 uint32_t item_sz; ///< size of an item
DieterGraef 0:f9b6112278fe 274 void *pool; ///< pointer to memory for pool
DieterGraef 0:f9b6112278fe 275 } osPoolDef_t;
DieterGraef 0:f9b6112278fe 276
DieterGraef 0:f9b6112278fe 277 /// Definition structure for message queue.
DieterGraef 0:f9b6112278fe 278 /// \note CAN BE CHANGED: \b os_messageQ_def is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 279 typedef struct os_messageQ_def {
DieterGraef 0:f9b6112278fe 280 uint32_t queue_sz; ///< number of elements in the queue
DieterGraef 0:f9b6112278fe 281 void *pool; ///< memory array for messages
DieterGraef 0:f9b6112278fe 282 } osMessageQDef_t;
DieterGraef 0:f9b6112278fe 283
DieterGraef 0:f9b6112278fe 284 /// Definition structure for mail queue.
DieterGraef 0:f9b6112278fe 285 /// \note CAN BE CHANGED: \b os_mailQ_def is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 286 typedef struct os_mailQ_def {
DieterGraef 0:f9b6112278fe 287 uint32_t queue_sz; ///< number of elements in the queue
DieterGraef 0:f9b6112278fe 288 uint32_t item_sz; ///< size of an item
DieterGraef 0:f9b6112278fe 289 void *pool; ///< memory array for mail
DieterGraef 0:f9b6112278fe 290 } osMailQDef_t;
DieterGraef 0:f9b6112278fe 291
DieterGraef 0:f9b6112278fe 292 /// Event structure contains detailed information about an event.
DieterGraef 0:f9b6112278fe 293 /// \note MUST REMAIN UNCHANGED: \b os_event shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 294 /// However the struct may be extended at the end.
DieterGraef 0:f9b6112278fe 295 typedef struct {
DieterGraef 0:f9b6112278fe 296 osStatus status; ///< status code: event or error information
DieterGraef 0:f9b6112278fe 297 union {
DieterGraef 0:f9b6112278fe 298 uint32_t v; ///< message as 32-bit value
DieterGraef 0:f9b6112278fe 299 void *p; ///< message or mail as void pointer
DieterGraef 0:f9b6112278fe 300 int32_t signals; ///< signal flags
DieterGraef 0:f9b6112278fe 301 } value; ///< event value
DieterGraef 0:f9b6112278fe 302 union {
DieterGraef 0:f9b6112278fe 303 osMailQId mail_id; ///< mail id obtained by \ref osMailCreate
DieterGraef 0:f9b6112278fe 304 osMessageQId message_id; ///< message id obtained by \ref osMessageCreate
DieterGraef 0:f9b6112278fe 305 } def; ///< event definition
DieterGraef 0:f9b6112278fe 306 } osEvent;
DieterGraef 0:f9b6112278fe 307
DieterGraef 0:f9b6112278fe 308
DieterGraef 0:f9b6112278fe 309 // ==== Kernel Control Functions ====
DieterGraef 0:f9b6112278fe 310
DieterGraef 0:f9b6112278fe 311 /// Initialize the RTOS Kernel for creating objects.
DieterGraef 0:f9b6112278fe 312 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 313 /// \note MUST REMAIN UNCHANGED: \b osKernelInitialize shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 314 osStatus osKernelInitialize (void);
DieterGraef 0:f9b6112278fe 315
DieterGraef 0:f9b6112278fe 316 /// Start the RTOS Kernel.
DieterGraef 0:f9b6112278fe 317 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 318 /// \note MUST REMAIN UNCHANGED: \b osKernelStart shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 319 osStatus osKernelStart (void);
DieterGraef 0:f9b6112278fe 320
DieterGraef 0:f9b6112278fe 321 /// Check if the RTOS kernel is already started.
DieterGraef 0:f9b6112278fe 322 /// \note MUST REMAIN UNCHANGED: \b osKernelRunning shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 323 /// \return 0 RTOS is not started, 1 RTOS is started.
DieterGraef 0:f9b6112278fe 324 int32_t osKernelRunning(void);
DieterGraef 0:f9b6112278fe 325
DieterGraef 0:f9b6112278fe 326
DieterGraef 0:f9b6112278fe 327 // ==== Thread Management ====
DieterGraef 0:f9b6112278fe 328
DieterGraef 0:f9b6112278fe 329 /// Create a Thread Definition with function, priority, and stack requirements.
DieterGraef 0:f9b6112278fe 330 /// \param name name of the thread function.
DieterGraef 0:f9b6112278fe 331 /// \param priority initial priority of the thread function.
DieterGraef 0:f9b6112278fe 332 /// \param stacksz stack size (in bytes) requirements for the thread function.
DieterGraef 0:f9b6112278fe 333 /// \note CAN BE CHANGED: The parameters to \b osThreadDef shall be consistent but the
DieterGraef 0:f9b6112278fe 334 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 335 #if defined (osObjectsExternal) // object is external
DieterGraef 0:f9b6112278fe 336 #define osThreadDef(name, priority, stacksz) \
DieterGraef 0:f9b6112278fe 337 extern osThreadDef_t os_thread_def_##name
DieterGraef 0:f9b6112278fe 338 #else // define the object
DieterGraef 0:f9b6112278fe 339 #define osThreadDef(name, priority, stacksz) \
DieterGraef 0:f9b6112278fe 340 uint32_t os_thread_def_stack_##name [stacksz / sizeof(uint32_t)]; \
DieterGraef 0:f9b6112278fe 341 osThreadDef_t os_thread_def_##name = \
DieterGraef 0:f9b6112278fe 342 { (name), (priority), (stacksz), (os_thread_def_stack_##name)}
DieterGraef 0:f9b6112278fe 343 #endif
DieterGraef 0:f9b6112278fe 344
DieterGraef 0:f9b6112278fe 345 /// Access a Thread definition.
DieterGraef 0:f9b6112278fe 346 /// \param name name of the thread definition object.
DieterGraef 0:f9b6112278fe 347 /// \note CAN BE CHANGED: The parameter to \b osThread shall be consistent but the
DieterGraef 0:f9b6112278fe 348 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 349 #define osThread(name) \
DieterGraef 0:f9b6112278fe 350 &os_thread_def_##name
DieterGraef 0:f9b6112278fe 351
DieterGraef 0:f9b6112278fe 352 /// Create a thread and add it to Active Threads and set it to state READY.
DieterGraef 0:f9b6112278fe 353 /// \param[in] thread_def thread definition referenced with \ref osThread.
DieterGraef 0:f9b6112278fe 354 /// \param[in] argument pointer that is passed to the thread function as start argument.
DieterGraef 0:f9b6112278fe 355 /// \return thread ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 356 /// \note MUST REMAIN UNCHANGED: \b osThreadCreate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 357 osThreadId osThreadCreate (osThreadDef_t *thread_def, void *argument);
DieterGraef 0:f9b6112278fe 358
DieterGraef 0:f9b6112278fe 359 /// Return the thread ID of the current running thread.
DieterGraef 0:f9b6112278fe 360 /// \return thread ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 361 /// \note MUST REMAIN UNCHANGED: \b osThreadGetId shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 362 osThreadId osThreadGetId (void);
DieterGraef 0:f9b6112278fe 363
DieterGraef 0:f9b6112278fe 364 /// Terminate execution of a thread and remove it from Active Threads.
DieterGraef 0:f9b6112278fe 365 /// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
DieterGraef 0:f9b6112278fe 366 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 367 /// \note MUST REMAIN UNCHANGED: \b osThreadTerminate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 368 osStatus osThreadTerminate (osThreadId thread_id);
DieterGraef 0:f9b6112278fe 369
DieterGraef 0:f9b6112278fe 370 /// Pass control to next thread that is in state \b READY.
DieterGraef 0:f9b6112278fe 371 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 372 /// \note MUST REMAIN UNCHANGED: \b osThreadYield shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 373 osStatus osThreadYield (void);
DieterGraef 0:f9b6112278fe 374
DieterGraef 0:f9b6112278fe 375 /// Change priority of an active thread.
DieterGraef 0:f9b6112278fe 376 /// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
DieterGraef 0:f9b6112278fe 377 /// \param[in] priority new priority value for the thread function.
DieterGraef 0:f9b6112278fe 378 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 379 /// \note MUST REMAIN UNCHANGED: \b osThreadSetPriority shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 380 osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority);
DieterGraef 0:f9b6112278fe 381
DieterGraef 0:f9b6112278fe 382 /// Get current priority of an active thread.
DieterGraef 0:f9b6112278fe 383 /// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
DieterGraef 0:f9b6112278fe 384 /// \return current priority value of the thread function.
DieterGraef 0:f9b6112278fe 385 /// \note MUST REMAIN UNCHANGED: \b osThreadGetPriority shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 386 osPriority osThreadGetPriority (osThreadId thread_id);
DieterGraef 0:f9b6112278fe 387
DieterGraef 0:f9b6112278fe 388
DieterGraef 0:f9b6112278fe 389 // ==== Generic Wait Functions ====
DieterGraef 0:f9b6112278fe 390
DieterGraef 0:f9b6112278fe 391 /// Wait for Timeout (Time Delay).
DieterGraef 0:f9b6112278fe 392 /// \param[in] millisec time delay value
DieterGraef 0:f9b6112278fe 393 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 394 osStatus osDelay (uint32_t millisec);
DieterGraef 0:f9b6112278fe 395
DieterGraef 0:f9b6112278fe 396 #if (defined (osFeature_Wait) && (osFeature_Wait != 0)) // Generic Wait available
DieterGraef 0:f9b6112278fe 397
DieterGraef 0:f9b6112278fe 398 /// Wait for Signal, Message, Mail, or Timeout.
DieterGraef 0:f9b6112278fe 399 /// \param[in] millisec timeout value or 0 in case of no time-out
DieterGraef 0:f9b6112278fe 400 /// \return event that contains signal, message, or mail information or error code.
DieterGraef 0:f9b6112278fe 401 /// \note MUST REMAIN UNCHANGED: \b osWait shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 402 os_InRegs osEvent osWait (uint32_t millisec);
DieterGraef 0:f9b6112278fe 403
DieterGraef 0:f9b6112278fe 404 #endif // Generic Wait available
DieterGraef 0:f9b6112278fe 405
DieterGraef 0:f9b6112278fe 406
DieterGraef 0:f9b6112278fe 407 // ==== Timer Management Functions ====
DieterGraef 0:f9b6112278fe 408 /// Define a Timer object.
DieterGraef 0:f9b6112278fe 409 /// \param name name of the timer object.
DieterGraef 0:f9b6112278fe 410 /// \param function name of the timer call back function.
DieterGraef 0:f9b6112278fe 411 /// \note CAN BE CHANGED: The parameter to \b osTimerDef shall be consistent but the
DieterGraef 0:f9b6112278fe 412 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 413 #if defined (osObjectsExternal) // object is external
DieterGraef 0:f9b6112278fe 414 #define osTimerDef(name, function) \
DieterGraef 0:f9b6112278fe 415 extern osTimerDef_t os_timer_def_##name
DieterGraef 0:f9b6112278fe 416 #else // define the object
DieterGraef 0:f9b6112278fe 417 #define osTimerDef(name, function) \
DieterGraef 0:f9b6112278fe 418 uint32_t os_timer_cb_##name[5]; \
DieterGraef 0:f9b6112278fe 419 osTimerDef_t os_timer_def_##name = \
DieterGraef 0:f9b6112278fe 420 { (function), (os_timer_cb_##name) }
DieterGraef 0:f9b6112278fe 421 #endif
DieterGraef 0:f9b6112278fe 422
DieterGraef 0:f9b6112278fe 423 /// Access a Timer definition.
DieterGraef 0:f9b6112278fe 424 /// \param name name of the timer object.
DieterGraef 0:f9b6112278fe 425 /// \note CAN BE CHANGED: The parameter to \b osTimer shall be consistent but the
DieterGraef 0:f9b6112278fe 426 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 427 #define osTimer(name) \
DieterGraef 0:f9b6112278fe 428 &os_timer_def_##name
DieterGraef 0:f9b6112278fe 429
DieterGraef 0:f9b6112278fe 430 /// Create a timer.
DieterGraef 0:f9b6112278fe 431 /// \param[in] timer_def timer object referenced with \ref osTimer.
DieterGraef 0:f9b6112278fe 432 /// \param[in] type osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
DieterGraef 0:f9b6112278fe 433 /// \param[in] argument argument to the timer call back function.
DieterGraef 0:f9b6112278fe 434 /// \return timer ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 435 /// \note MUST REMAIN UNCHANGED: \b osTimerCreate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 436 osTimerId osTimerCreate (osTimerDef_t *timer_def, os_timer_type type, void *argument);
DieterGraef 0:f9b6112278fe 437
DieterGraef 0:f9b6112278fe 438 /// Start or restart a timer.
DieterGraef 0:f9b6112278fe 439 /// \param[in] timer_id timer ID obtained by \ref osTimerCreate.
DieterGraef 0:f9b6112278fe 440 /// \param[in] millisec time delay value of the timer.
DieterGraef 0:f9b6112278fe 441 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 442 /// \note MUST REMAIN UNCHANGED: \b osTimerStart shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 443 osStatus osTimerStart (osTimerId timer_id, uint32_t millisec);
DieterGraef 0:f9b6112278fe 444
DieterGraef 0:f9b6112278fe 445 /// Stop the timer.
DieterGraef 0:f9b6112278fe 446 /// \param[in] timer_id timer ID obtained by \ref osTimerCreate.
DieterGraef 0:f9b6112278fe 447 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 448 /// \note MUST REMAIN UNCHANGED: \b osTimerStop shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 449 osStatus osTimerStop (osTimerId timer_id);
DieterGraef 0:f9b6112278fe 450
DieterGraef 0:f9b6112278fe 451 /// Delete a timer that was created by \ref osTimerCreate.
DieterGraef 0:f9b6112278fe 452 /// \param[in] timer_id timer ID obtained by \ref osTimerCreate.
DieterGraef 0:f9b6112278fe 453 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 454 /// \note MUST REMAIN UNCHANGED: \b osTimerDelete shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 455 osStatus osTimerDelete (osTimerId timer_id);
DieterGraef 0:f9b6112278fe 456
DieterGraef 0:f9b6112278fe 457
DieterGraef 0:f9b6112278fe 458 // ==== Signal Management ====
DieterGraef 0:f9b6112278fe 459
DieterGraef 0:f9b6112278fe 460 /// Set the specified Signal Flags of an active thread.
DieterGraef 0:f9b6112278fe 461 /// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
DieterGraef 0:f9b6112278fe 462 /// \param[in] signals specifies the signal flags of the thread that should be set.
DieterGraef 0:f9b6112278fe 463 /// \return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
DieterGraef 0:f9b6112278fe 464 /// \note MUST REMAIN UNCHANGED: \b osSignalSet shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 465 int32_t osSignalSet (osThreadId thread_id, int32_t signals);
DieterGraef 0:f9b6112278fe 466
DieterGraef 0:f9b6112278fe 467 /// Clear the specified Signal Flags of an active thread.
DieterGraef 0:f9b6112278fe 468 /// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
DieterGraef 0:f9b6112278fe 469 /// \param[in] signals specifies the signal flags of the thread that shall be cleared.
DieterGraef 0:f9b6112278fe 470 /// \return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
DieterGraef 0:f9b6112278fe 471 /// \note MUST REMAIN UNCHANGED: \b osSignalClear shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 472 int32_t osSignalClear (osThreadId thread_id, int32_t signals);
DieterGraef 0:f9b6112278fe 473
DieterGraef 0:f9b6112278fe 474 /// Get Signal Flags status of an active thread.
DieterGraef 0:f9b6112278fe 475 /// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
DieterGraef 0:f9b6112278fe 476 /// \return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
DieterGraef 0:f9b6112278fe 477 /// \note MUST REMAIN UNCHANGED: \b osSignalGet shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 478 int32_t osSignalGet (osThreadId thread_id);
DieterGraef 0:f9b6112278fe 479
DieterGraef 0:f9b6112278fe 480 /// Wait for one or more Signal Flags to become signaled for the current \b RUNNING thread.
DieterGraef 0:f9b6112278fe 481 /// \param[in] signals wait until all specified signal flags set or 0 for any single signal flag.
DieterGraef 0:f9b6112278fe 482 /// \param[in] millisec timeout value or 0 in case of no time-out.
DieterGraef 0:f9b6112278fe 483 /// \return event flag information or error code.
DieterGraef 0:f9b6112278fe 484 /// \note MUST REMAIN UNCHANGED: \b osSignalWait shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 485 os_InRegs osEvent osSignalWait (int32_t signals, uint32_t millisec);
DieterGraef 0:f9b6112278fe 486
DieterGraef 0:f9b6112278fe 487
DieterGraef 0:f9b6112278fe 488 // ==== Mutex Management ====
DieterGraef 0:f9b6112278fe 489
DieterGraef 0:f9b6112278fe 490 /// Define a Mutex.
DieterGraef 0:f9b6112278fe 491 /// \param name name of the mutex object.
DieterGraef 0:f9b6112278fe 492 /// \note CAN BE CHANGED: The parameter to \b osMutexDef shall be consistent but the
DieterGraef 0:f9b6112278fe 493 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 494 #if defined (osObjectsExternal) // object is external
DieterGraef 0:f9b6112278fe 495 #define osMutexDef(name) \
DieterGraef 0:f9b6112278fe 496 extern osMutexDef_t os_mutex_def_##name
DieterGraef 0:f9b6112278fe 497 #else // define the object
DieterGraef 0:f9b6112278fe 498 #define osMutexDef(name) \
DieterGraef 0:f9b6112278fe 499 uint32_t os_mutex_cb_##name[3]; \
DieterGraef 0:f9b6112278fe 500 osMutexDef_t os_mutex_def_##name = { (os_mutex_cb_##name) }
DieterGraef 0:f9b6112278fe 501 #endif
DieterGraef 0:f9b6112278fe 502
DieterGraef 0:f9b6112278fe 503 /// Access a Mutex definition.
DieterGraef 0:f9b6112278fe 504 /// \param name name of the mutex object.
DieterGraef 0:f9b6112278fe 505 /// \note CAN BE CHANGED: The parameter to \b osMutex shall be consistent but the
DieterGraef 0:f9b6112278fe 506 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 507 #define osMutex(name) \
DieterGraef 0:f9b6112278fe 508 &os_mutex_def_##name
DieterGraef 0:f9b6112278fe 509
DieterGraef 0:f9b6112278fe 510 /// Create and Initialize a Mutex object.
DieterGraef 0:f9b6112278fe 511 /// \param[in] mutex_def mutex definition referenced with \ref osMutex.
DieterGraef 0:f9b6112278fe 512 /// \return mutex ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 513 /// \note MUST REMAIN UNCHANGED: \b osMutexCreate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 514 osMutexId osMutexCreate (osMutexDef_t *mutex_def);
DieterGraef 0:f9b6112278fe 515
DieterGraef 0:f9b6112278fe 516 /// Wait until a Mutex becomes available.
DieterGraef 0:f9b6112278fe 517 /// \param[in] mutex_id mutex ID obtained by \ref osMutexCreate.
DieterGraef 0:f9b6112278fe 518 /// \param[in] millisec timeout value or 0 in case of no time-out.
DieterGraef 0:f9b6112278fe 519 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 520 /// \note MUST REMAIN UNCHANGED: \b osMutexWait shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 521 osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec);
DieterGraef 0:f9b6112278fe 522
DieterGraef 0:f9b6112278fe 523 /// Release a Mutex that was obtained by \ref osMutexWait.
DieterGraef 0:f9b6112278fe 524 /// \param[in] mutex_id mutex ID obtained by \ref osMutexCreate.
DieterGraef 0:f9b6112278fe 525 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 526 /// \note MUST REMAIN UNCHANGED: \b osMutexRelease shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 527 osStatus osMutexRelease (osMutexId mutex_id);
DieterGraef 0:f9b6112278fe 528
DieterGraef 0:f9b6112278fe 529 /// Delete a Mutex that was created by \ref osMutexCreate.
DieterGraef 0:f9b6112278fe 530 /// \param[in] mutex_id mutex ID obtained by \ref osMutexCreate.
DieterGraef 0:f9b6112278fe 531 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 532 /// \note MUST REMAIN UNCHANGED: \b osMutexDelete shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 533 osStatus osMutexDelete (osMutexId mutex_id);
DieterGraef 0:f9b6112278fe 534
DieterGraef 0:f9b6112278fe 535
DieterGraef 0:f9b6112278fe 536 // ==== Semaphore Management Functions ====
DieterGraef 0:f9b6112278fe 537
DieterGraef 0:f9b6112278fe 538 #if (defined (osFeature_Semaphore) && (osFeature_Semaphore != 0)) // Semaphore available
DieterGraef 0:f9b6112278fe 539
DieterGraef 0:f9b6112278fe 540 /// Define a Semaphore object.
DieterGraef 0:f9b6112278fe 541 /// \param name name of the semaphore object.
DieterGraef 0:f9b6112278fe 542 /// \note CAN BE CHANGED: The parameter to \b osSemaphoreDef shall be consistent but the
DieterGraef 0:f9b6112278fe 543 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 544 #if defined (osObjectsExternal) // object is external
DieterGraef 0:f9b6112278fe 545 #define osSemaphoreDef(name) \
DieterGraef 0:f9b6112278fe 546 extern osSemaphoreDef_t os_semaphore_def_##name
DieterGraef 0:f9b6112278fe 547 #else // define the object
DieterGraef 0:f9b6112278fe 548 #define osSemaphoreDef(name) \
DieterGraef 0:f9b6112278fe 549 uint32_t os_semaphore_cb_##name[2]; \
DieterGraef 0:f9b6112278fe 550 osSemaphoreDef_t os_semaphore_def_##name = { (os_semaphore_cb_##name) }
DieterGraef 0:f9b6112278fe 551 #endif
DieterGraef 0:f9b6112278fe 552
DieterGraef 0:f9b6112278fe 553 /// Access a Semaphore definition.
DieterGraef 0:f9b6112278fe 554 /// \param name name of the semaphore object.
DieterGraef 0:f9b6112278fe 555 /// \note CAN BE CHANGED: The parameter to \b osSemaphore shall be consistent but the
DieterGraef 0:f9b6112278fe 556 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 557 #define osSemaphore(name) \
DieterGraef 0:f9b6112278fe 558 &os_semaphore_def_##name
DieterGraef 0:f9b6112278fe 559
DieterGraef 0:f9b6112278fe 560 /// Create and Initialize a Semaphore object used for managing resources.
DieterGraef 0:f9b6112278fe 561 /// \param[in] semaphore_def semaphore definition referenced with \ref osSemaphore.
DieterGraef 0:f9b6112278fe 562 /// \param[in] count number of available resources.
DieterGraef 0:f9b6112278fe 563 /// \return semaphore ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 564 /// \note MUST REMAIN UNCHANGED: \b osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 565 osSemaphoreId osSemaphoreCreate (osSemaphoreDef_t *semaphore_def, int32_t count);
DieterGraef 0:f9b6112278fe 566
DieterGraef 0:f9b6112278fe 567 /// Wait until a Semaphore token becomes available.
DieterGraef 0:f9b6112278fe 568 /// \param[in] semaphore_id semaphore object referenced with \ref osSemaphoreCreate.
DieterGraef 0:f9b6112278fe 569 /// \param[in] millisec timeout value or 0 in case of no time-out.
DieterGraef 0:f9b6112278fe 570 /// \return number of available tokens, or -1 in case of incorrect parameters.
DieterGraef 0:f9b6112278fe 571 /// \note MUST REMAIN UNCHANGED: \b osSemaphoreWait shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 572 int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec);
DieterGraef 0:f9b6112278fe 573
DieterGraef 0:f9b6112278fe 574 /// Release a Semaphore token.
DieterGraef 0:f9b6112278fe 575 /// \param[in] semaphore_id semaphore object referenced with \ref osSemaphoreCreate.
DieterGraef 0:f9b6112278fe 576 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 577 /// \note MUST REMAIN UNCHANGED: \b osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 578 osStatus osSemaphoreRelease (osSemaphoreId semaphore_id);
DieterGraef 0:f9b6112278fe 579
DieterGraef 0:f9b6112278fe 580 /// Delete a Semaphore that was created by \ref osSemaphoreCreate.
DieterGraef 0:f9b6112278fe 581 /// \param[in] semaphore_id semaphore object referenced with \ref osSemaphoreCreate.
DieterGraef 0:f9b6112278fe 582 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 583 /// \note MUST REMAIN UNCHANGED: \b osSemaphoreDelete shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 584 osStatus osSemaphoreDelete (osSemaphoreId semaphore_id);
DieterGraef 0:f9b6112278fe 585
DieterGraef 0:f9b6112278fe 586 #endif // Semaphore available
DieterGraef 0:f9b6112278fe 587
DieterGraef 0:f9b6112278fe 588
DieterGraef 0:f9b6112278fe 589 // ==== Memory Pool Management Functions ====
DieterGraef 0:f9b6112278fe 590
DieterGraef 0:f9b6112278fe 591 #if (defined (osFeature_Pool) && (osFeature_Pool != 0)) // Memory Pool Management available
DieterGraef 0:f9b6112278fe 592
DieterGraef 0:f9b6112278fe 593 /// \brief Define a Memory Pool.
DieterGraef 0:f9b6112278fe 594 /// \param name name of the memory pool.
DieterGraef 0:f9b6112278fe 595 /// \param no maximum number of blocks (objects) in the memory pool.
DieterGraef 0:f9b6112278fe 596 /// \param type data type of a single block (object).
DieterGraef 0:f9b6112278fe 597 /// \note CAN BE CHANGED: The parameter to \b osPoolDef shall be consistent but the
DieterGraef 0:f9b6112278fe 598 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 599 #if defined (osObjectsExternal) // object is external
DieterGraef 0:f9b6112278fe 600 #define osPoolDef(name, no, type) \
DieterGraef 0:f9b6112278fe 601 extern osPoolDef_t os_pool_def_##name
DieterGraef 0:f9b6112278fe 602 #else // define the object
DieterGraef 0:f9b6112278fe 603 #define osPoolDef(name, no, type) \
DieterGraef 0:f9b6112278fe 604 uint32_t os_pool_m_##name[3+((sizeof(type)+3)/4)*(no)]; \
DieterGraef 0:f9b6112278fe 605 osPoolDef_t os_pool_def_##name = \
DieterGraef 0:f9b6112278fe 606 { (no), sizeof(type), (os_pool_m_##name) }
DieterGraef 0:f9b6112278fe 607 #endif
DieterGraef 0:f9b6112278fe 608
DieterGraef 0:f9b6112278fe 609 /// \brief Access a Memory Pool definition.
DieterGraef 0:f9b6112278fe 610 /// \param name name of the memory pool
DieterGraef 0:f9b6112278fe 611 /// \note CAN BE CHANGED: The parameter to \b osPool shall be consistent but the
DieterGraef 0:f9b6112278fe 612 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 613 #define osPool(name) \
DieterGraef 0:f9b6112278fe 614 &os_pool_def_##name
DieterGraef 0:f9b6112278fe 615
DieterGraef 0:f9b6112278fe 616 /// Create and Initialize a memory pool.
DieterGraef 0:f9b6112278fe 617 /// \param[in] pool_def memory pool definition referenced with \ref osPool.
DieterGraef 0:f9b6112278fe 618 /// \return memory pool ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 619 /// \note MUST REMAIN UNCHANGED: \b osPoolCreate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 620 osPoolId osPoolCreate (osPoolDef_t *pool_def);
DieterGraef 0:f9b6112278fe 621
DieterGraef 0:f9b6112278fe 622 /// Allocate a memory block from a memory pool.
DieterGraef 0:f9b6112278fe 623 /// \param[in] pool_id memory pool ID obtain referenced with \ref osPoolCreate.
DieterGraef 0:f9b6112278fe 624 /// \return address of the allocated memory block or NULL in case of no memory available.
DieterGraef 0:f9b6112278fe 625 /// \note MUST REMAIN UNCHANGED: \b osPoolAlloc shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 626 void *osPoolAlloc (osPoolId pool_id);
DieterGraef 0:f9b6112278fe 627
DieterGraef 0:f9b6112278fe 628 /// Allocate a memory block from a memory pool and set memory block to zero.
DieterGraef 0:f9b6112278fe 629 /// \param[in] pool_id memory pool ID obtain referenced with \ref osPoolCreate.
DieterGraef 0:f9b6112278fe 630 /// \return address of the allocated memory block or NULL in case of no memory available.
DieterGraef 0:f9b6112278fe 631 /// \note MUST REMAIN UNCHANGED: \b osPoolCAlloc shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 632 void *osPoolCAlloc (osPoolId pool_id);
DieterGraef 0:f9b6112278fe 633
DieterGraef 0:f9b6112278fe 634 /// Return an allocated memory block back to a specific memory pool.
DieterGraef 0:f9b6112278fe 635 /// \param[in] pool_id memory pool ID obtain referenced with \ref osPoolCreate.
DieterGraef 0:f9b6112278fe 636 /// \param[in] block address of the allocated memory block that is returned to the memory pool.
DieterGraef 0:f9b6112278fe 637 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 638 /// \note MUST REMAIN UNCHANGED: \b osPoolFree shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 639 osStatus osPoolFree (osPoolId pool_id, void *block);
DieterGraef 0:f9b6112278fe 640
DieterGraef 0:f9b6112278fe 641 #endif // Memory Pool Management available
DieterGraef 0:f9b6112278fe 642
DieterGraef 0:f9b6112278fe 643
DieterGraef 0:f9b6112278fe 644 // ==== Message Queue Management Functions ====
DieterGraef 0:f9b6112278fe 645
DieterGraef 0:f9b6112278fe 646 #if (defined (osFeature_MessageQ) && (osFeature_MessageQ != 0)) // Message Queues available
DieterGraef 0:f9b6112278fe 647
DieterGraef 0:f9b6112278fe 648 /// \brief Create a Message Queue Definition.
DieterGraef 0:f9b6112278fe 649 /// \param name name of the queue.
DieterGraef 0:f9b6112278fe 650 /// \param queue_sz maximum number of messages in the queue.
DieterGraef 0:f9b6112278fe 651 /// \param type data type of a single message element (for debugger).
DieterGraef 0:f9b6112278fe 652 /// \note CAN BE CHANGED: The parameter to \b osMessageQDef shall be consistent but the
DieterGraef 0:f9b6112278fe 653 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 654 #if defined (osObjectsExternal) // object is external
DieterGraef 0:f9b6112278fe 655 #define osMessageQDef(name, queue_sz, type) \
DieterGraef 0:f9b6112278fe 656 extern osMessageQDef_t os_messageQ_def_##name
DieterGraef 0:f9b6112278fe 657 #else // define the object
DieterGraef 0:f9b6112278fe 658 #define osMessageQDef(name, queue_sz, type) \
DieterGraef 0:f9b6112278fe 659 uint32_t os_messageQ_q_##name[4+(queue_sz)]; \
DieterGraef 0:f9b6112278fe 660 osMessageQDef_t os_messageQ_def_##name = \
DieterGraef 0:f9b6112278fe 661 { (queue_sz), (os_messageQ_q_##name) }
DieterGraef 0:f9b6112278fe 662 #endif
DieterGraef 0:f9b6112278fe 663
DieterGraef 0:f9b6112278fe 664 /// \brief Access a Message Queue Definition.
DieterGraef 0:f9b6112278fe 665 /// \param name name of the queue
DieterGraef 0:f9b6112278fe 666 /// \note CAN BE CHANGED: The parameter to \b osMessageQ shall be consistent but the
DieterGraef 0:f9b6112278fe 667 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 668 #define osMessageQ(name) \
DieterGraef 0:f9b6112278fe 669 &os_messageQ_def_##name
DieterGraef 0:f9b6112278fe 670
DieterGraef 0:f9b6112278fe 671 /// Create and Initialize a Message Queue.
DieterGraef 0:f9b6112278fe 672 /// \param[in] queue_def queue definition referenced with \ref osMessageQ.
DieterGraef 0:f9b6112278fe 673 /// \param[in] thread_id thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.
DieterGraef 0:f9b6112278fe 674 /// \return message queue ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 675 /// \note MUST REMAIN UNCHANGED: \b osMessageCreate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 676 osMessageQId osMessageCreate (osMessageQDef_t *queue_def, osThreadId thread_id);
DieterGraef 0:f9b6112278fe 677
DieterGraef 0:f9b6112278fe 678 /// Put a Message to a Queue.
DieterGraef 0:f9b6112278fe 679 /// \param[in] queue_id message queue ID obtained with \ref osMessageCreate.
DieterGraef 0:f9b6112278fe 680 /// \param[in] info message information.
DieterGraef 0:f9b6112278fe 681 /// \param[in] millisec timeout value or 0 in case of no time-out.
DieterGraef 0:f9b6112278fe 682 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 683 /// \note MUST REMAIN UNCHANGED: \b osMessagePut shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 684 osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec);
DieterGraef 0:f9b6112278fe 685
DieterGraef 0:f9b6112278fe 686 /// Get a Message or Wait for a Message from a Queue.
DieterGraef 0:f9b6112278fe 687 /// \param[in] queue_id message queue ID obtained with \ref osMessageCreate.
DieterGraef 0:f9b6112278fe 688 /// \param[in] millisec timeout value or 0 in case of no time-out.
DieterGraef 0:f9b6112278fe 689 /// \return event information that includes status code.
DieterGraef 0:f9b6112278fe 690 /// \note MUST REMAIN UNCHANGED: \b osMessageGet shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 691 os_InRegs osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec);
DieterGraef 0:f9b6112278fe 692
DieterGraef 0:f9b6112278fe 693 #endif // Message Queues available
DieterGraef 0:f9b6112278fe 694
DieterGraef 0:f9b6112278fe 695
DieterGraef 0:f9b6112278fe 696 // ==== Mail Queue Management Functions ====
DieterGraef 0:f9b6112278fe 697
DieterGraef 0:f9b6112278fe 698 #if (defined (osFeature_MailQ) && (osFeature_MailQ != 0)) // Mail Queues available
DieterGraef 0:f9b6112278fe 699
DieterGraef 0:f9b6112278fe 700 /// \brief Create a Mail Queue Definition.
DieterGraef 0:f9b6112278fe 701 /// \param name name of the queue
DieterGraef 0:f9b6112278fe 702 /// \param queue_sz maximum number of messages in queue
DieterGraef 0:f9b6112278fe 703 /// \param type data type of a single message element
DieterGraef 0:f9b6112278fe 704 /// \note CAN BE CHANGED: The parameter to \b osMailQDef shall be consistent but the
DieterGraef 0:f9b6112278fe 705 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 706 #if defined (osObjectsExternal) // object is external
DieterGraef 0:f9b6112278fe 707 #define osMailQDef(name, queue_sz, type) \
DieterGraef 0:f9b6112278fe 708 extern osMailQDef_t os_mailQ_def_##name
DieterGraef 0:f9b6112278fe 709 #else // define the object
DieterGraef 0:f9b6112278fe 710 #define osMailQDef(name, queue_sz, type) \
DieterGraef 0:f9b6112278fe 711 uint32_t os_mailQ_q_##name[4+(queue_sz)]; \
DieterGraef 0:f9b6112278fe 712 uint32_t os_mailQ_m_##name[3+((sizeof(type)+3)/4)*(queue_sz)]; \
DieterGraef 0:f9b6112278fe 713 void * os_mailQ_p_##name[2] = { (os_mailQ_q_##name), os_mailQ_m_##name }; \
DieterGraef 0:f9b6112278fe 714 osMailQDef_t os_mailQ_def_##name = \
DieterGraef 0:f9b6112278fe 715 { (queue_sz), sizeof(type), (os_mailQ_p_##name) }
DieterGraef 0:f9b6112278fe 716 #endif
DieterGraef 0:f9b6112278fe 717
DieterGraef 0:f9b6112278fe 718 /// \brief Access a Mail Queue Definition.
DieterGraef 0:f9b6112278fe 719 /// \param name name of the queue
DieterGraef 0:f9b6112278fe 720 /// \note CAN BE CHANGED: The parameter to \b osMailQ shall be consistent but the
DieterGraef 0:f9b6112278fe 721 /// macro body is implementation specific in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 722 #define osMailQ(name) \
DieterGraef 0:f9b6112278fe 723 &os_mailQ_def_##name
DieterGraef 0:f9b6112278fe 724
DieterGraef 0:f9b6112278fe 725 /// Create and Initialize mail queue.
DieterGraef 0:f9b6112278fe 726 /// \param[in] queue_def reference to the mail queue definition obtain with \ref osMailQ
DieterGraef 0:f9b6112278fe 727 /// \param[in] thread_id thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.
DieterGraef 0:f9b6112278fe 728 /// \return mail queue ID for reference by other functions or NULL in case of error.
DieterGraef 0:f9b6112278fe 729 /// \note MUST REMAIN UNCHANGED: \b osMailCreate shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 730 osMailQId osMailCreate (osMailQDef_t *queue_def, osThreadId thread_id);
DieterGraef 0:f9b6112278fe 731
DieterGraef 0:f9b6112278fe 732 /// Allocate a memory block from a mail.
DieterGraef 0:f9b6112278fe 733 /// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
DieterGraef 0:f9b6112278fe 734 /// \param[in] millisec timeout value or 0 in case of no time-out
DieterGraef 0:f9b6112278fe 735 /// \return pointer to memory block that can be filled with mail or NULL in case of error.
DieterGraef 0:f9b6112278fe 736 /// \note MUST REMAIN UNCHANGED: \b osMailAlloc shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 737 void *osMailAlloc (osMailQId queue_id, uint32_t millisec);
DieterGraef 0:f9b6112278fe 738
DieterGraef 0:f9b6112278fe 739 /// Allocate a memory block from a mail and set memory block to zero.
DieterGraef 0:f9b6112278fe 740 /// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
DieterGraef 0:f9b6112278fe 741 /// \param[in] millisec timeout value or 0 in case of no time-out
DieterGraef 0:f9b6112278fe 742 /// \return pointer to memory block that can be filled with mail or NULL in case of error.
DieterGraef 0:f9b6112278fe 743 /// \note MUST REMAIN UNCHANGED: \b osMailCAlloc shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 744 void *osMailCAlloc (osMailQId queue_id, uint32_t millisec);
DieterGraef 0:f9b6112278fe 745
DieterGraef 0:f9b6112278fe 746 /// Put a mail to a queue.
DieterGraef 0:f9b6112278fe 747 /// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
DieterGraef 0:f9b6112278fe 748 /// \param[in] mail memory block previously allocated with \ref osMailAlloc or \ref osMailCAlloc.
DieterGraef 0:f9b6112278fe 749 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 750 /// \note MUST REMAIN UNCHANGED: \b osMailPut shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 751 osStatus osMailPut (osMailQId queue_id, void *mail);
DieterGraef 0:f9b6112278fe 752
DieterGraef 0:f9b6112278fe 753 /// Get a mail from a queue.
DieterGraef 0:f9b6112278fe 754 /// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
DieterGraef 0:f9b6112278fe 755 /// \param[in] millisec timeout value or 0 in case of no time-out
DieterGraef 0:f9b6112278fe 756 /// \return event that contains mail information or error code.
DieterGraef 0:f9b6112278fe 757 /// \note MUST REMAIN UNCHANGED: \b osMailGet shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 758 os_InRegs osEvent osMailGet (osMailQId queue_id, uint32_t millisec);
DieterGraef 0:f9b6112278fe 759
DieterGraef 0:f9b6112278fe 760 /// Free a memory block from a mail.
DieterGraef 0:f9b6112278fe 761 /// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
DieterGraef 0:f9b6112278fe 762 /// \param[in] mail pointer to the memory block that was obtained with \ref osMailGet.
DieterGraef 0:f9b6112278fe 763 /// \return status code that indicates the execution status of the function.
DieterGraef 0:f9b6112278fe 764 /// \note MUST REMAIN UNCHANGED: \b osMailFree shall be consistent in every CMSIS-RTOS.
DieterGraef 0:f9b6112278fe 765 osStatus osMailFree (osMailQId queue_id, void *mail);
DieterGraef 0:f9b6112278fe 766
DieterGraef 0:f9b6112278fe 767 #endif // Mail Queues available
DieterGraef 0:f9b6112278fe 768
DieterGraef 0:f9b6112278fe 769
DieterGraef 0:f9b6112278fe 770 #ifdef __cplusplus
DieterGraef 0:f9b6112278fe 771 }
DieterGraef 0:f9b6112278fe 772 #endif
DieterGraef 0:f9b6112278fe 773
DieterGraef 0:f9b6112278fe 774 #endif // _CMSIS_OS_H