1/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
2// ==== Generic Definitions ====
3/**
4\addtogroup CMSIS_RTOS_Definitions Generic Definitions
5\ingroup CMSIS_RTOS
6\brief Constants and enumerations used by many CMSIS-RTOS2 functions.
7\details The following constants and enumerations are used by many CMSIS-RTOS2 function calls.
8@{
9*/
10/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
11/**
12\typedef osStatus_t
13\details
14The \b osStatus_t enumeration defines the event status and error codes that are returned by many CMSIS-RTOS2 functions.
15
16\var osStatus_t::osOK
17
18\var osStatus_t::osError
19
20\var osStatus_t::osErrorTimeout
21
22\var osStatus_t::osErrorResource
23
24\var osStatus_t::osErrorParameter
25
26\var osStatus_t::osErrorNoMemory
27
28\var osStatus_t::osErrorISR
29
30\var osStatus_t::osErrorSafetyClass
31
32\var osStatus_t::osStatusReserved
33
34*/
35
36/**
37\def osWaitForever
38\details A special \ref CMSIS_RTOS_TimeOutValue that informs the RTOS to wait infinite until a resource becomes available.
39It applies to the following functions:
40 - \ref osDelay : \copybrief osDelay
41 - \ref osThreadFlagsWait : \copybrief osThreadFlagsWait
42 - \ref osEventFlagsWait : \copybrief osEventFlagsWait
43 - \ref osMutexAcquire : \copybrief osMutexAcquire
44 - \ref osSemaphoreAcquire : \copybrief osSemaphoreAcquire
45 - \ref osMemoryPoolAlloc : \copybrief osMemoryPoolAlloc
46 - \ref osMessageQueuePut : \copybrief osMessageQueuePut
47 - \ref osMessageQueueGet : \copybrief osMessageQueueGet
48*/
49
50/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
51/**
52\def osFlagsWaitAny
53
54Reference:
55 - \ref osEventFlagsWait
56 - \ref osThreadFlagsWait
57*/
58/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
59/**
60\def osFlagsWaitAll
61
62Reference:
63 - \ref osEventFlagsWait
64 - \ref osThreadFlagsWait
65*/
66/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
67/**
68\def osFlagsNoClear
69
70Reference:
71 - \ref osEventFlagsWait
72 - \ref osThreadFlagsWait
73*/
74
75/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
76/**
77\def osSafetyClass(n)
78\param         n        safety class value.
79\brief  Safety class value in attribute bit field format.
80\details
81
82The preprocessor macro \b osSafetyClass constructs attribute bitmask with safety class bits set to \a n.
83
84<b>Code Example:</b>
85\code
86/* Event Flags object attributes */
87const osEventFlagsAttr_t ef_attr = {
88  .name       = "EventFlags1",    // human readable object name
89  .attr_bits  = osSafetyClass(2U) // assign object to safety class 2
90};
91\endcode
92*/
93
94/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
95/**
96\def osSafetyWithSameClass
97\details
98Definition for RTOS objects with the same safety class. Can be used as mode argument in the following functions:
99 - \ref osThreadSuspendClass : \copybrief osThreadSuspendClass
100 - \ref osThreadResumeClass : \copybrief osThreadResumeClass
101 - \ref osKernelDestroyClass : \copybrief osKernelDestroyClass
102
103\def osSafetyWithLowerClass
104\details
105Definition for RTOS objects with lower safety class.  Can be used as mode argument in the following functions:
106 - \ref osThreadSuspendClass : \copybrief osThreadSuspendClass
107 - \ref osThreadResumeClass : \copybrief osThreadResumeClass
108 - \ref osKernelDestroyClass : \copybrief osKernelDestroyClass
109*/
110
111/// @}
112/**
113\addtogroup flags_error_codes Flags Functions Error Codes
114\ingroup CMSIS_RTOS_Definitions
115\brief Constants used by \ref CMSIS_RTOS_ThreadFlagsMgmt and \ref CMSIS_RTOS_EventFlags to return error codes.
116\details In case of an error, flags functions (\ref CMSIS_RTOS_ThreadFlagsMgmt and
117\ref CMSIS_RTOS_EventFlags) return error codes. To indicate that an error has occurred, the highest bit of
118the return value is be set. You can check the exact error using the codes shown below.
119@{
120*/
121/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
122/**
123\def osFlagsErrorUnknown
124\details Generic error. It is returned when no other error can be applied.
125
126Reference:
127 - \ref osThreadFlagsSet
128 - \ref osThreadFlagsClear
129 - \ref osThreadFlagsWait
130 - \ref osEventFlagsSet
131 - \ref osEventFlagsClear
132 - \ref osEventFlagsWait
133*/
134
135/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
136/**
137\def osFlagsErrorTimeout
138\details This error is returned if a timeout was specified and the specified flags were not set, when the
139timeout occurred.
140
141Reference:
142 - \ref osThreadFlagsSet
143 - \ref osThreadFlagsClear
144 - \ref osThreadFlagsWait
145 - \ref osEventFlagsSet
146 - \ref osEventFlagsClear
147 - \ref osEventFlagsWait
148*/
149
150/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
151/**
152\def osFlagsErrorResource
153\details This error is returned when you try to get a flag that was not set \a and timeout 0 was
154specified. Is also returned when the specified object identifier is corrupt or invalid.
155
156Reference:
157 - \ref osThreadFlagsSet
158 - \ref osThreadFlagsClear
159 - \ref osThreadFlagsWait
160 - \ref osEventFlagsSet
161 - \ref osEventFlagsClear
162 - \ref osEventFlagsWait
163*/
164
165/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
166/**
167\def osFlagsErrorParameter
168\details This error is returned when a given parameter is wrong.
169
170Reference:
171 - \ref osThreadFlagsSet
172 - \ref osThreadFlagsClear
173 - \ref osThreadFlagsWait
174 - \ref osEventFlagsSet
175 - \ref osEventFlagsClear
176 - \ref osEventFlagsWait
177*/
178
179/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
180/**
181\def osFlagsErrorISR
182\details This error is returned when a non-ISR-callable function was called from an ISR.
183
184Reference:
185 - \ref osThreadFlagsSet
186 - \ref osThreadFlagsClear
187 - \ref osThreadFlagsWait
188 - \ref osEventFlagsSet
189 - \ref osEventFlagsClear
190 - \ref osEventFlagsWait
191*/
192
193/**
194@}
195*/
196