1 /*
2  * Copyright (c) 2013-2021 Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the License); you may
7  * not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * -----------------------------------------------------------------------------
19  *
20  * Project:     CMSIS-RTOS RTX
21  * Title:       RTX Event Recorder definitions
22  *
23  * -----------------------------------------------------------------------------
24  */
25 
26 #ifndef RTX_EVR_H_
27 #define RTX_EVR_H_
28 
29 #include "rtx_os.h"                     // RTX OS definitions
30 
31 // Initial Thread configuration covered also Thread Flags and Generic Wait
32 #ifndef   OS_EVR_THFLAGS
33 #define   OS_EVR_THFLAGS        OS_EVR_THREAD
34 #endif
35 #ifndef   OS_EVR_WAIT
36 #define   OS_EVR_WAIT           OS_EVR_THREAD
37 #endif
38 
39 #ifdef   _RTE_
40 #include "RTE_Components.h"
41 #endif
42 
43 #ifdef    RTE_Compiler_EventRecorder
44 
45 //lint -emacro((835,845),EventID) [MISRA Note 13]
46 
47 #include "EventRecorder.h"
48 #include "EventRecorderConf.h"
49 
50 #if ((defined(OS_EVR_INIT) && (OS_EVR_INIT != 0)) || (EVENT_TIMESTAMP_SOURCE == 2))
51 #ifndef EVR_RTX_KERNEL_GET_STATE_DISABLE
52 #define EVR_RTX_KERNEL_GET_STATE_DISABLE
53 #endif
54 #endif
55 
56 #if (EVENT_TIMESTAMP_SOURCE == 2)
57 #ifndef EVR_RTX_KERNEL_GET_SYS_TIMER_COUNT_DISABLE
58 #define EVR_RTX_KERNEL_GET_SYS_TIMER_COUNT_DISABLE
59 #endif
60 #ifndef EVR_RTX_KERNEL_GET_SYS_TIMER_FREQ_DISABLE
61 #define EVR_RTX_KERNEL_GET_SYS_TIMER_FREQ_DISABLE
62 #endif
63 #endif
64 
65 /// RTOS component number
66 #define EvtRtxMemoryNo                  (0xF0U)
67 #define EvtRtxKernelNo                  (0xF1U)
68 #define EvtRtxThreadNo                  (0xF2U)
69 #define EvtRtxThreadFlagsNo             (0xF4U)
70 #define EvtRtxWaitNo                    (0xF3U)
71 #define EvtRtxTimerNo                   (0xF6U)
72 #define EvtRtxEventFlagsNo              (0xF5U)
73 #define EvtRtxMutexNo                   (0xF7U)
74 #define EvtRtxSemaphoreNo               (0xF8U)
75 #define EvtRtxMemoryPoolNo              (0xF9U)
76 #define EvtRtxMessageQueueNo            (0xFAU)
77 
78 #endif  // RTE_Compiler_EventRecorder
79 
80 
81 /// Extended Status codes
82 #define osRtxErrorKernelNotReady        (-7)
83 #define osRtxErrorKernelNotRunning      (-8)
84 #define osRtxErrorInvalidControlBlock   (-9)
85 #define osRtxErrorInvalidDataMemory     (-10)
86 #define osRtxErrorInvalidThreadStack    (-11)
87 #define osRtxErrorInvalidPriority       (-12)
88 #define osRtxErrorThreadNotJoinable     (-13)
89 #define osRtxErrorMutexNotOwned         (-14)
90 #define osRtxErrorMutexNotLocked        (-15)
91 #define osRtxErrorMutexLockLimit        (-16)
92 #define osRtxErrorSemaphoreCountLimit   (-17)
93 #define osRtxErrorTZ_InitContext_S      (-18)
94 #define osRtxErrorTZ_AllocContext_S     (-19)
95 #define osRtxErrorTZ_FreeContext_S      (-20)
96 #define osRtxErrorTZ_LoadContext_S      (-21)
97 #define osRtxErrorTZ_SaveContext_S      (-22)
98 
99 
100 //  ==== Memory Events ====
101 
102 /**
103   \brief  Event on memory initialization (Op)
104   \param[in]  mem           pointer to memory pool.
105   \param[in]  size          size of a memory pool in bytes.
106   \param[in]  result        execution status: 1 - success, 0 - failure.
107 */
108 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMORY != 0) && !defined(EVR_RTX_MEMORY_INIT_DISABLE))
109 extern void EvrRtxMemoryInit (void *mem, uint32_t size, uint32_t result);
110 #else
111 #define EvrRtxMemoryInit(mem, size, result)
112 #endif
113 
114 /**
115   \brief  Event on memory allocate (Op)
116   \param[in]  mem           pointer to memory pool.
117   \param[in]  size          size of a memory block in bytes.
118   \param[in]  type          memory block type: 0 - generic, 1 - control block.
119   \param[in]  block         pointer to allocated memory block or NULL in case of no memory is available.
120 */
121 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMORY != 0) && !defined(EVR_RTX_MEMORY_ALLOC_DISABLE))
122 extern void EvrRtxMemoryAlloc (void *mem, uint32_t size, uint32_t type, void *block);
123 #else
124 #define EvrRtxMemoryAlloc(mem, size, type, block)
125 #endif
126 
127 /**
128   \brief  Event on memory free (Op)
129   \param[in]  mem           pointer to memory pool.
130   \param[in]  block         memory block to be returned to the memory pool.
131   \param[in]  result        execution status: 1 - success, 0 - failure.
132 */
133 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMORY != 0) && !defined(EVR_RTX_MEMORY_FREE_DISABLE))
134 extern void EvrRtxMemoryFree (void *mem, void *block, uint32_t result);
135 #else
136 #define EvrRtxMemoryFree(mem, block, result)
137 #endif
138 
139 /**
140   \brief  Event on memory block initialization (Op)
141   \param[in]  mp_info       memory pool info.
142   \param[in]  block_count   maximum number of memory blocks in memory pool.
143   \param[in]  block_size    size of a memory block in bytes.
144   \param[in]  block_mem     pointer to memory for block storage.
145 */
146 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMORY != 0) && !defined(EVR_RTX_MEMORY_BLOCK_INIT_DISABLE))
147 extern void EvrRtxMemoryBlockInit (osRtxMpInfo_t *mp_info, uint32_t block_count, uint32_t block_size, void *block_mem);
148 #else
149 #define EvrRtxMemoryBlockInit(mp_info, block_count, block_size, block_mem)
150 #endif
151 
152 /**
153   \brief  Event on memory block alloc (Op)
154   \param[in]  mp_info       memory pool info.
155   \param[in]  block         address of the allocated memory block or NULL in case of no memory is available.
156 */
157 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMORY != 0) && !defined(EVR_RTX_MEMORY_BLOCK_ALLOC_DISABLE))
158 extern void EvrRtxMemoryBlockAlloc (osRtxMpInfo_t *mp_info, void *block);
159 #else
160 #define EvrRtxMemoryBlockAlloc(mp_info, block)
161 #endif
162 
163 /**
164   \brief  Event on memory block free (Op)
165   \param[in]  mp_info       memory pool info.
166   \param[in]  block         address of the allocated memory block to be returned to the memory pool.
167   \param[in]  status        extended execution status.
168 */
169 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMORY != 0) && !defined(EVR_RTX_MEMORY_BLOCK_FREE_DISABLE))
170 extern void EvrRtxMemoryBlockFree (osRtxMpInfo_t *mp_info, void *block, int32_t status);
171 #else
172 #define EvrRtxMemoryBlockFree(mp_info, block, status)
173 #endif
174 
175 
176 //  ==== Kernel Events ====
177 
178 /**
179   \brief  Event on RTOS kernel error (Error)
180   \param[in]  status        extended execution status.
181 */
182 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_ERROR_DISABLE))
183 extern void EvrRtxKernelError (int32_t status);
184 #else
185 #define EvrRtxKernelError(status)
186 #endif
187 
188 /**
189   \brief  Event on RTOS kernel initialize (API)
190 */
191 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_INITIALIZE_DISABLE))
192 extern void EvrRtxKernelInitialize (void);
193 #else
194 #define EvrRtxKernelInitialize()
195 #endif
196 
197 /**
198   \brief  Event on successful RTOS kernel initialize (Op)
199 */
200 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_INITIALIZED_DISABLE))
201 extern void EvrRtxKernelInitialized (void);
202 #else
203 #define EvrRtxKernelInitialized()
204 #endif
205 
206 /**
207   \brief  Event on RTOS kernel information retrieve (API)
208   \param[in]  version       pointer to buffer for retrieving version information.
209   \param[in]  id_buf        pointer to buffer for retrieving kernel identification string.
210   \param[in]  id_size       size of buffer for kernel identification string.
211 */
212 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_GET_INFO_DISABLE))
213 extern void EvrRtxKernelGetInfo (osVersion_t *version, char *id_buf, uint32_t id_size);
214 #else
215 #define EvrRtxKernelGetInfo(version, id_buf, id_size)
216 #endif
217 
218 /**
219   \brief  Event on successful RTOS kernel information retrieve (Op)
220   \param[in]  version       pointer to buffer for retrieving version information.
221   \param[in]  id_buf        pointer to buffer for retrieving kernel identification string.
222   \param[in]  id_size       size of buffer for kernel identification string.
223 */
224 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_INFO_RETRIEVED_DISABLE))
225 extern void EvrRtxKernelInfoRetrieved (const osVersion_t *version, const char *id_buf, uint32_t id_size);
226 #else
227 #define EvrRtxKernelInfoRetrieved(version, id_buf, id_size)
228 #endif
229 
230 /**
231   \brief  Event on current RTOS Kernel state retrieve (API)
232   \param[in]  state         current RTOS Kernel state.
233 */
234 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_GET_STATE_DISABLE))
235 extern void EvrRtxKernelGetState (osKernelState_t state);
236 #else
237 #define EvrRtxKernelGetState(state)
238 #endif
239 
240 /**
241   \brief  Event on RTOS Kernel scheduler start (API)
242 */
243 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_START_DISABLE))
244 extern void EvrRtxKernelStart (void);
245 #else
246 #define EvrRtxKernelStart()
247 #endif
248 
249 /**
250   \brief  Event on successful RTOS Kernel scheduler start (Op)
251 */
252 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_STARTED_DISABLE))
253 extern void EvrRtxKernelStarted (void);
254 #else
255 #define EvrRtxKernelStarted()
256 #endif
257 
258 /**
259   \brief  Event on RTOS Kernel scheduler lock (API)
260 */
261 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_LOCK_DISABLE))
262 extern void EvrRtxKernelLock (void);
263 #else
264 #define EvrRtxKernelLock()
265 #endif
266 
267 /**
268   \brief  Event on successful RTOS Kernel scheduler lock (Op)
269   \param[in]  lock          previous lock state (1 - locked, 0 - not locked).
270 */
271 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_LOCKED_DISABLE))
272 extern void EvrRtxKernelLocked (int32_t lock);
273 #else
274 #define EvrRtxKernelLocked(lock)
275 #endif
276 
277 /**
278   \brief  Event on RTOS Kernel scheduler unlock (API)
279 */
280 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_UNLOCK_DISABLE))
281 extern void EvrRtxKernelUnlock (void);
282 #else
283 #define EvrRtxKernelUnlock()
284 #endif
285 
286 /**
287   \brief  Event on successful RTOS Kernel scheduler unlock (Op)
288   \param[in]  lock          previous lock state (1 - locked, 0 - not locked).
289 */
290 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_UNLOCKED_DISABLE))
291 extern void EvrRtxKernelUnlocked (int32_t lock);
292 #else
293 #define EvrRtxKernelUnlocked(lock)
294 #endif
295 
296 /**
297   \brief  Event on RTOS Kernel scheduler lock state restore (API)
298   \param[in]  lock          lock state obtained by \ref osKernelLock or \ref osKernelUnlock.
299 */
300 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_RESTORE_LOCK_DISABLE))
301 extern void EvrRtxKernelRestoreLock (int32_t lock);
302 #else
303 #define EvrRtxKernelRestoreLock(lock)
304 #endif
305 
306 /**
307   \brief  Event on successful RTOS Kernel scheduler lock state restore (Op)
308   \param[in]  lock          new lock state (1 - locked, 0 - not locked).
309 */
310 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_LOCK_RESTORED_DISABLE))
311 extern void EvrRtxKernelLockRestored (int32_t lock);
312 #else
313 #define EvrRtxKernelLockRestored(lock)
314 #endif
315 
316 /**
317   \brief  Event on RTOS Kernel scheduler suspend (API)
318 */
319 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_SUSPEND_DISABLE))
320 extern void EvrRtxKernelSuspend (void);
321 #else
322 #define EvrRtxKernelSuspend()
323 #endif
324 
325 /**
326   \brief  Event on successful RTOS Kernel scheduler suspend (Op)
327   \param[in]  sleep_ticks   time in ticks, for how long the system can sleep or power-down.
328 */
329 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_SUSPENDED_DISABLE))
330 extern void EvrRtxKernelSuspended (uint32_t sleep_ticks);
331 #else
332 #define EvrRtxKernelSuspended(sleep_ticks)
333 #endif
334 
335 /**
336   \brief  Event on RTOS Kernel scheduler resume (API)
337   \param[in]  sleep_ticks   time in ticks, for how long the system was in sleep or power-down mode.
338 */
339 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_RESUME_DISABLE))
340 extern void EvrRtxKernelResume (uint32_t sleep_ticks);
341 #else
342 #define EvrRtxKernelResume(sleep_ticks)
343 #endif
344 
345 /**
346   \brief  Event on successful RTOS Kernel scheduler resume (Op)
347 */
348 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_RESUMED_DISABLE))
349 extern void EvrRtxKernelResumed (void);
350 #else
351 #define EvrRtxKernelResumed()
352 #endif
353 
354 /**
355   \brief  Event on RTOS kernel tick count retrieve (API)
356   \param[in]  count         RTOS kernel current tick count.
357 */
358 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_GET_TICK_COUNT_DISABLE))
359 extern void EvrRtxKernelGetTickCount (uint32_t count);
360 #else
361 #define EvrRtxKernelGetTickCount(count)
362 #endif
363 
364 /**
365   \brief  Event on RTOS kernel tick frequency retrieve (API)
366   \param[in]  freq          frequency of the kernel tick.
367 */
368 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_GET_TICK_FREQ_DISABLE))
369 extern void EvrRtxKernelGetTickFreq (uint32_t freq);
370 #else
371 #define EvrRtxKernelGetTickFreq(freq)
372 #endif
373 
374 /**
375   \brief  Event on RTOS kernel system timer count retrieve (API)
376   \param[in]  count         RTOS kernel current system timer count as 32-bit value.
377 */
378 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_GET_SYS_TIMER_COUNT_DISABLE))
379 extern void EvrRtxKernelGetSysTimerCount (uint32_t count);
380 #else
381 #define EvrRtxKernelGetSysTimerCount(count)
382 #endif
383 
384 /**
385   \brief  Event on RTOS kernel system timer frequency retrieve (API)
386   \param[in]  freq          frequency of the system timer.
387 */
388 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_GET_SYS_TIMER_FREQ_DISABLE))
389 extern void EvrRtxKernelGetSysTimerFreq (uint32_t freq);
390 #else
391 #define EvrRtxKernelGetSysTimerFreq(freq)
392 #endif
393 
394 /**
395   \brief  Event on RTOS kernel system error (Error)
396   \param[in]  code          error code.
397   \param[in]  object_id     object that caused the error.
398 */
399 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_KERNEL != 0) && !defined(EVR_RTX_KERNEL_ERROR_NOTIFY_DISABLE))
400 extern void EvrRtxKernelErrorNotify (uint32_t code, void *object_id);
401 #else
402 #define EvrRtxKernelErrorNotify(code, object_id)
403 #endif
404 
405 
406 //  ==== Thread Events ====
407 
408 /**
409   \brief  Event on thread error (Error)
410   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId or NULL when ID is unknown.
411   \param[in]  status        extended execution status.
412 */
413 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_ERROR_DISABLE))
414 extern void EvrRtxThreadError (osThreadId_t thread_id, int32_t status);
415 #else
416 #define EvrRtxThreadError(thread_id, status)
417 #endif
418 
419 /**
420   \brief  Event on thread create and intialize (API)
421   \param[in]  func          thread function.
422   \param[in]  argument      pointer that is passed to the thread function as start argument.
423   \param[in]  attr          thread attributes.
424 */
425 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_NEW_DISABLE))
426 extern void EvrRtxThreadNew (osThreadFunc_t func, void *argument, const osThreadAttr_t *attr);
427 #else
428 #define EvrRtxThreadNew(func, argument, attr)
429 #endif
430 
431 /**
432   \brief  Event on successful thread create (Op)
433   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
434   \param[in]  thread_addr   thread entry address.
435   \param[in]  name          pointer to thread object name.
436 */
437 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_CREATED_DISABLE))
438 extern void EvrRtxThreadCreated (osThreadId_t thread_id, uint32_t thread_addr, const char *name);
439 #else
440 #define EvrRtxThreadCreated(thread_id, thread_addr, name)
441 #endif
442 
443 /**
444   \brief  Event on thread name retrieve (API)
445   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
446   \param[in]  name          pointer to thread object name.
447 */
448 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_GET_NAME_DISABLE))
449 extern void EvrRtxThreadGetName (osThreadId_t thread_id, const char *name);
450 #else
451 #define EvrRtxThreadGetName(thread_id, name)
452 #endif
453 
454 /**
455   \brief  Event on current running thread ID retrieve (API)
456   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
457 */
458 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_GET_ID_DISABLE))
459 extern void EvrRtxThreadGetId (osThreadId_t thread_id);
460 #else
461 #define EvrRtxThreadGetId(thread_id)
462 #endif
463 
464 /**
465   \brief  Event on thread state retrieve (API)
466   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
467   \param[in]  state         current thread state of the specified thread.
468 */
469 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_GET_STATE_DISABLE))
470 extern void EvrRtxThreadGetState (osThreadId_t thread_id, osThreadState_t state);
471 #else
472 #define EvrRtxThreadGetState(thread_id, state)
473 #endif
474 
475 /**
476   \brief  Event on thread stack size retrieve (API)
477   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
478   \param[in]  stack_size    stack size in bytes.
479 */
480 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_GET_STACK_SIZE_DISABLE))
481 extern void EvrRtxThreadGetStackSize (osThreadId_t thread_id, uint32_t stack_size);
482 #else
483 #define EvrRtxThreadGetStackSize(thread_id, stack_size)
484 #endif
485 
486 /**
487   \brief  Event on available stack space retrieve (API)
488   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
489   \param[in]  stack_space   remaining stack space in bytes.
490 */
491 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_GET_STACK_SPACE_DISABLE))
492 extern void EvrRtxThreadGetStackSpace (osThreadId_t thread_id, uint32_t stack_space);
493 #else
494 #define EvrRtxThreadGetStackSpace(thread_id, stack_space)
495 #endif
496 
497 /**
498   \brief  Event on thread priority set (API)
499   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
500   \param[in]  priority      new priority value for the thread function.
501 */
502 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_SET_PRIORITY_DISABLE))
503 extern void EvrRtxThreadSetPriority (osThreadId_t thread_id, osPriority_t priority);
504 #else
505 #define EvrRtxThreadSetPriority(thread_id, priority)
506 #endif
507 
508 /**
509   \brief  Event on thread priority updated (Op)
510   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
511   \param[in]  priority      new priority value for the thread function.
512 */
513 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_PRIORITY_UPDATED_DISABLE))
514 extern void EvrRtxThreadPriorityUpdated (osThreadId_t thread_id, osPriority_t priority);
515 #else
516 #define EvrRtxThreadPriorityUpdated(thread_id, priority)
517 #endif
518 
519 /**
520   \brief  Event on thread priority retrieve (API)
521   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
522   \param[in]  priority      current priority value of the specified thread.
523 */
524 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_GET_PRIORITY_DISABLE))
525 extern void EvrRtxThreadGetPriority (osThreadId_t thread_id, osPriority_t priority);
526 #else
527 #define EvrRtxThreadGetPriority(thread_id, priority)
528 #endif
529 
530 /**
531   \brief  Event on thread yield (API)
532 */
533 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_YIELD_DISABLE))
534 extern void EvrRtxThreadYield (void);
535 #else
536 #define EvrRtxThreadYield()
537 #endif
538 
539 /**
540   \brief  Event on thread suspend (API)
541   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
542 */
543 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_SUSPEND_DISABLE))
544 extern void EvrRtxThreadSuspend (osThreadId_t thread_id);
545 #else
546 #define EvrRtxThreadSuspend(thread_id)
547 #endif
548 
549 /**
550   \brief  Event on successful thread suspend (Op)
551   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
552 */
553 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_SUSPENDED_DISABLE))
554 extern void EvrRtxThreadSuspended (osThreadId_t thread_id);
555 #else
556 #define EvrRtxThreadSuspended(thread_id)
557 #endif
558 
559 /**
560   \brief  Event on thread resume (API)
561   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
562 */
563 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_RESUME_DISABLE))
564 extern void EvrRtxThreadResume (osThreadId_t thread_id);
565 #else
566 #define EvrRtxThreadResume(thread_id)
567 #endif
568 
569 /**
570   \brief  Event on successful thread resume (Op)
571   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
572 */
573 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_RESUMED_DISABLE))
574 extern void EvrRtxThreadResumed (osThreadId_t thread_id);
575 #else
576 #define EvrRtxThreadResumed(thread_id)
577 #endif
578 
579 /**
580   \brief  Event on thread detach (API)
581   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
582 */
583 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_DETACH_DISABLE))
584 extern void EvrRtxThreadDetach (osThreadId_t thread_id);
585 #else
586 #define EvrRtxThreadDetach(thread_id)
587 #endif
588 
589 /**
590   \brief  Event on successful thread detach (Op)
591   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
592 */
593 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_DETACHED_DISABLE))
594 extern void EvrRtxThreadDetached (osThreadId_t thread_id);
595 #else
596 #define EvrRtxThreadDetached(thread_id)
597 #endif
598 
599 /**
600   \brief  Event on thread join (API)
601   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
602 */
603 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_JOIN_DISABLE))
604 extern void EvrRtxThreadJoin (osThreadId_t thread_id);
605 #else
606 #define EvrRtxThreadJoin(thread_id)
607 #endif
608 
609 /**
610   \brief  Event on pending thread join (Op)
611   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
612 */
613 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_JOIN_PENDING_DISABLE))
614 extern void EvrRtxThreadJoinPending (osThreadId_t thread_id);
615 #else
616 #define EvrRtxThreadJoinPending(thread_id)
617 #endif
618 
619 /**
620   \brief  Event on successful thread join (Op)
621   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
622 */
623 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_JOINED_DISABLE))
624 extern void EvrRtxThreadJoined (osThreadId_t thread_id);
625 #else
626 #define EvrRtxThreadJoined(thread_id)
627 #endif
628 
629 /**
630   \brief  Event on thread execution block (Detail)
631   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
632   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
633 */
634 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_BLOCKED_DISABLE))
635 extern void EvrRtxThreadBlocked (osThreadId_t thread_id, uint32_t timeout);
636 #else
637 #define EvrRtxThreadBlocked(thread_id, timeout)
638 #endif
639 
640 /**
641   \brief  Event on thread execution unblock (Detail)
642   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
643   \param[in]  ret_val       extended execution status of the thread.
644 */
645 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_UNBLOCKED_DISABLE))
646 extern void EvrRtxThreadUnblocked (osThreadId_t thread_id, uint32_t ret_val);
647 #else
648 #define EvrRtxThreadUnblocked(thread_id, ret_val)
649 #endif
650 
651 /**
652   \brief  Event on running thread pre-emption (Detail)
653   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
654 */
655 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_PREEMPTED_DISABLE))
656 extern void EvrRtxThreadPreempted (osThreadId_t thread_id);
657 #else
658 #define EvrRtxThreadPreempted(thread_id)
659 #endif
660 
661 /**
662   \brief  Event on running thread switch (Op)
663   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
664 */
665 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_SWITCHED_DISABLE))
666 extern void EvrRtxThreadSwitched (osThreadId_t thread_id);
667 #else
668 #define EvrRtxThreadSwitched(thread_id)
669 #endif
670 
671 /**
672   \brief  Event on thread exit (API)
673 */
674 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_EXIT_DISABLE))
675 extern void EvrRtxThreadExit (void);
676 #else
677 #define EvrRtxThreadExit()
678 #endif
679 
680 /**
681   \brief  Event on thread terminate (API)
682   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
683 */
684 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_TERMINATE_DISABLE))
685 extern void EvrRtxThreadTerminate (osThreadId_t thread_id);
686 #else
687 #define EvrRtxThreadTerminate(thread_id)
688 #endif
689 
690 /**
691   \brief  Event on successful thread terminate (Op)
692   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
693 */
694 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_DESTROYED_DISABLE))
695 extern void EvrRtxThreadDestroyed (osThreadId_t thread_id);
696 #else
697 #define EvrRtxThreadDestroyed(thread_id)
698 #endif
699 
700 /**
701   \brief  Event on active thread count retrieve (API)
702   \param[in]  count         number of active threads.
703 */
704 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_GET_COUNT_DISABLE))
705 extern void EvrRtxThreadGetCount (uint32_t count);
706 #else
707 #define EvrRtxThreadGetCount(count)
708 #endif
709 
710 /**
711   \brief  Event on active threads enumerate (API)
712   \param[in]  thread_array  pointer to array for retrieving thread IDs.
713   \param[in]  array_items   maximum number of items in array for retrieving thread IDs.
714   \param[in]  count         number of enumerated threads.
715 */
716 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THREAD != 0) && !defined(EVR_RTX_THREAD_ENUMERATE_DISABLE))
717 extern void EvrRtxThreadEnumerate (osThreadId_t *thread_array, uint32_t array_items, uint32_t count);
718 #else
719 #define EvrRtxThreadEnumerate(thread_array, array_items, count)
720 #endif
721 
722 
723 //  ==== Thread Flags Events ====
724 
725 /**
726   \brief  Event on thread flags error (Error)
727   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId or NULL when ID is unknown.
728   \param[in]  status        extended execution status.
729 */
730 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_ERROR_DISABLE))
731 extern void EvrRtxThreadFlagsError (osThreadId_t thread_id, int32_t status);
732 #else
733 #define EvrRtxThreadFlagsError(thread_id, status)
734 #endif
735 
736 /**
737   \brief  Event on thread flags set (API)
738   \param[in]   thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
739   \param[in]   flags         flags of the thread that shall be set.
740 */
741 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_SET_DISABLE))
742 extern void EvrRtxThreadFlagsSet (osThreadId_t thread_id, uint32_t flags);
743 #else
744 #define EvrRtxThreadFlagsSet(thread_id, flags)
745 #endif
746 
747 /**
748   \brief  Event on successful thread flags set (Op)
749   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
750   \param[in]  thread_flags  thread flags after setting.
751 */
752 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_SET_DONE_DISABLE))
753 extern void EvrRtxThreadFlagsSetDone (osThreadId_t thread_id, uint32_t thread_flags);
754 #else
755 #define EvrRtxThreadFlagsSetDone(thread_id, thread_flags)
756 #endif
757 
758 /**
759   \brief  Event on thread flags clear (API)
760   \param[in]  flags         flags of the thread that shall be cleared.
761 */
762 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_CLEAR_DISABLE))
763 extern void EvrRtxThreadFlagsClear (uint32_t flags);
764 #else
765 #define EvrRtxThreadFlagsClear(flags)
766 #endif
767 
768 /**
769   \brief  Event on successful thread flags clear (Op)
770   \param[in]  thread_flags  thread flags before clearing.
771 */
772 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_CLEAR_DONE_DISABLE))
773 extern void EvrRtxThreadFlagsClearDone (uint32_t thread_flags);
774 #else
775 #define EvrRtxThreadFlagsClearDone(thread_flags)
776 #endif
777 
778 /**
779   \brief  Event on thread flags retrieve (API)
780   \param[in]  thread_flags  current thread flags.
781 */
782 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_GET_DISABLE))
783 extern void EvrRtxThreadFlagsGet (uint32_t thread_flags);
784 #else
785 #define EvrRtxThreadFlagsGet(thread_flags)
786 #endif
787 
788 /**
789   \brief  Event on wait for thread flags (API)
790   \param[in]  flags         flags to wait for.
791   \param[in]  options       flags options (osFlagsXxxx).
792   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
793 */
794 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_WAIT_DISABLE))
795 extern void EvrRtxThreadFlagsWait (uint32_t flags, uint32_t options, uint32_t timeout);
796 #else
797 #define EvrRtxThreadFlagsWait(flags, options, timeout)
798 #endif
799 
800 /**
801   \brief  Event on pending wait for thread flags (Op)
802   \param[in]  flags         flags to wait for.
803   \param[in]  options       flags options (osFlagsXxxx).
804   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
805 */
806 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_WAIT_PENDING_DISABLE))
807 extern void EvrRtxThreadFlagsWaitPending (uint32_t flags, uint32_t options, uint32_t timeout);
808 #else
809 #define EvrRtxThreadFlagsWaitPending(flags, options, timeout)
810 #endif
811 
812 /**
813   \brief  Event on wait timeout for thread flags (Op)
814   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
815 */
816 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_WAIT_TIMEOUT_DISABLE))
817 extern void EvrRtxThreadFlagsWaitTimeout (osThreadId_t thread_id);
818 #else
819 #define EvrRtxThreadFlagsWaitTimeout(thread_id)
820 #endif
821 
822 /**
823   \brief  Event on successful wait for thread flags (Op)
824   \param[in]  flags         flags to wait for.
825   \param[in]  options       flags options (osFlagsXxxx).
826   \param[in]  thread_flags  thread flags before clearing.
827   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
828 */
829 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_WAIT_COMPLETED_DISABLE))
830 extern void EvrRtxThreadFlagsWaitCompleted (uint32_t flags, uint32_t options, uint32_t thread_flags, osThreadId_t thread_id);
831 #else
832 #define EvrRtxThreadFlagsWaitCompleted(flags, options, thread_flags, thread_id)
833 #endif
834 
835 /**
836   \brief  Event on unsuccessful wait for thread flags (Op)
837   \param[in]  flags         flags to wait for.
838   \param[in]  options       flags options (osFlagsXxxx).
839 */
840 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_THFLAGS != 0) && !defined(EVR_RTX_THREAD_FLAGS_WAIT_NOT_COMPLETED_DISABLE))
841 extern void EvrRtxThreadFlagsWaitNotCompleted (uint32_t flags, uint32_t options);
842 #else
843 #define EvrRtxThreadFlagsWaitNotCompleted(flags, options)
844 #endif
845 
846 
847 //  ==== Generic Wait Events ====
848 
849 /**
850   \brief  Event on delay error (Error)
851   \param[in]  status        extended execution status.
852 */
853 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_WAIT != 0) && !defined(EVR_RTX_DELAY_ERROR_DISABLE))
854 extern void EvrRtxDelayError (int32_t status);
855 #else
856 #define EvrRtxDelayError(status)
857 #endif
858 
859 /**
860   \brief  Event on delay for specified time (API)
861   \param[in]  ticks         \ref CMSIS_RTOS_TimeOutValue "time ticks" value.
862 */
863 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_WAIT != 0) && !defined(EVR_RTX_DELAY_DISABLE))
864 extern void EvrRtxDelay (uint32_t ticks);
865 #else
866 #define EvrRtxDelay(ticks)
867 #endif
868 
869 /**
870   \brief  Event on delay until specified time (API)
871   \param[in]  ticks         absolute time in ticks.
872 */
873 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_WAIT != 0) && !defined(EVR_RTX_DELAY_UNTIL_DISABLE))
874 extern void EvrRtxDelayUntil (uint32_t ticks);
875 #else
876 #define EvrRtxDelayUntil(ticks)
877 #endif
878 
879 /**
880   \brief  Event on delay started (Op)
881   \param[in]  ticks         \ref CMSIS_RTOS_TimeOutValue "time ticks" value.
882 */
883 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_WAIT != 0) && !defined(EVR_RTX_DELAY_STARTED_DISABLE))
884 extern void EvrRtxDelayStarted (uint32_t ticks);
885 #else
886 #define EvrRtxDelayStarted(ticks)
887 #endif
888 
889 /**
890   \brief  Event on delay until specified time started (Op)
891   \param[in]  ticks         \ref CMSIS_RTOS_TimeOutValue "time ticks" value.
892 */
893 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_WAIT != 0) && !defined(EVR_RTX_DELAY_UNTIL_STARTED_DISABLE))
894 extern void EvrRtxDelayUntilStarted (uint32_t ticks);
895 #else
896 #define EvrRtxDelayUntilStarted(ticks)
897 #endif
898 
899 /**
900   \brief  Event on delay completed (Op)
901   \param[in]  thread_id     thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
902 */
903 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_WAIT != 0) && !defined(EVR_RTX_DELAY_COMPLETED_DISABLE))
904 extern void EvrRtxDelayCompleted (osThreadId_t thread_id);
905 #else
906 #define EvrRtxDelayCompleted(thread_id)
907 #endif
908 
909 
910 //  ==== Timer Events ====
911 
912 /**
913   \brief  Event on timer error (Error)
914   \param[in]  timer_id      timer ID obtained by \ref osTimerNew or NULL when ID is unknown.
915   \param[in]  status        extended execution status.
916 */
917 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_ERROR_DISABLE))
918 extern void EvrRtxTimerError (osTimerId_t timer_id, int32_t status);
919 #else
920 #define EvrRtxTimerError(timer_id, status)
921 #endif
922 
923 /**
924   \brief  Event on timer callback call (Op)
925   \param[in]  func          start address of a timer call back function.
926   \param[in]  argument      argument to the timer call back function.
927 */
928 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_CALLBACK_DISABLE))
929 extern void EvrRtxTimerCallback (osTimerFunc_t func, void *argument);
930 #else
931 #define EvrRtxTimerCallback(func, argument)
932 #endif
933 
934 /**
935   \brief  Event on timer create and initialize (API)
936   \param[in]  func          start address of a timer call back function.
937   \param[in]  type          osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
938   \param[in]  argument      argument to the timer call back function.
939   \param[in]  attr          timer attributes.
940 */
941 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_NEW_DISABLE))
942 extern void EvrRtxTimerNew (osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr);
943 #else
944 #define EvrRtxTimerNew(func, type, argument, attr)
945 #endif
946 
947 /**
948   \brief  Event on successful timer create (Op)
949   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
950   \param[in]  name          pointer to timer object name.
951 */
952 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_CREATED_DISABLE))
953 extern void EvrRtxTimerCreated (osTimerId_t timer_id, const char *name);
954 #else
955 #define EvrRtxTimerCreated(timer_id, name)
956 #endif
957 
958 /**
959   \brief  Event on timer name retrieve (API)
960   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
961   \param[in]  name          pointer to timer object name.
962 */
963 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_GET_NAME_DISABLE))
964 extern void EvrRtxTimerGetName (osTimerId_t timer_id, const char *name);
965 #else
966 #define EvrRtxTimerGetName(timer_id, name)
967 #endif
968 
969 /**
970   \brief  Event on timer start (API)
971   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
972   \param[in]  ticks         \ref CMSIS_RTOS_TimeOutValue "time ticks" value of the timer.
973 */
974 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_START_DISABLE))
975 extern void EvrRtxTimerStart (osTimerId_t timer_id, uint32_t ticks);
976 #else
977 #define EvrRtxTimerStart(timer_id, ticks)
978 #endif
979 
980 /**
981   \brief  Event on successful timer start (Op)
982   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
983 */
984 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_STARTED_DISABLE))
985 extern void EvrRtxTimerStarted (osTimerId_t timer_id);
986 #else
987 #define EvrRtxTimerStarted(timer_id)
988 #endif
989 
990 /**
991   \brief  Event on timer stop (API)
992   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
993 */
994 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_STOP_DISABLE))
995 extern void EvrRtxTimerStop (osTimerId_t timer_id);
996 #else
997 #define EvrRtxTimerStop(timer_id)
998 #endif
999 
1000 /**
1001   \brief  Event on successful timer stop (Op)
1002   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
1003 */
1004 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_STOPPED_DISABLE))
1005 extern void EvrRtxTimerStopped (osTimerId_t timer_id);
1006 #else
1007 #define EvrRtxTimerStopped(timer_id)
1008 #endif
1009 
1010 /**
1011   \brief  Event on timer running state check (API)
1012   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
1013   \param[in]  running       running state: 0 not running, 1 running.
1014 */
1015 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_IS_RUNNING_DISABLE))
1016 extern void EvrRtxTimerIsRunning (osTimerId_t timer_id, uint32_t running);
1017 #else
1018 #define EvrRtxTimerIsRunning(timer_id, running)
1019 #endif
1020 
1021 /**
1022   \brief  Event on timer delete (API)
1023   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
1024 */
1025 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_DELETE_DISABLE))
1026 extern void EvrRtxTimerDelete (osTimerId_t timer_id);
1027 #else
1028 #define EvrRtxTimerDelete(timer_id)
1029 #endif
1030 
1031 /**
1032   \brief  Event on successful timer delete (Op)
1033   \param[in]  timer_id      timer ID obtained by \ref osTimerNew.
1034 */
1035 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_TIMER != 0) && !defined(EVR_RTX_TIMER_DESTROYED_DISABLE))
1036 extern void EvrRtxTimerDestroyed (osTimerId_t timer_id);
1037 #else
1038 #define EvrRtxTimerDestroyed(timer_id)
1039 #endif
1040 
1041 
1042 //  ==== Event Flags Events ====
1043 
1044 /**
1045   \brief  Event on event flags error (Error)
1046   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew or NULL when ID is unknown.
1047   \param[in]  status        extended execution status.
1048 */
1049 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_ERROR_DISABLE))
1050 extern void EvrRtxEventFlagsError (osEventFlagsId_t ef_id, int32_t status);
1051 #else
1052 #define EvrRtxEventFlagsError(ef_id, status)
1053 #endif
1054 
1055 /**
1056   \brief  Event on event flags create and initialize (API)
1057   \param[in]  attr          event flags attributes.
1058 */
1059 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_NEW_DISABLE))
1060 extern void EvrRtxEventFlagsNew (const osEventFlagsAttr_t *attr);
1061 #else
1062 #define EvrRtxEventFlagsNew(attr)
1063 #endif
1064 
1065 /**
1066   \brief  Event on successful event flags create (Op)
1067   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1068   \param[in]  name          pointer to event flags object name.
1069 */
1070 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_CREATED_DISABLE))
1071 extern void EvrRtxEventFlagsCreated (osEventFlagsId_t ef_id, const char *name);
1072 #else
1073 #define EvrRtxEventFlagsCreated(ef_id, name)
1074 #endif
1075 
1076 /**
1077   \brief  Event on event flags name retrieve (API)
1078   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1079   \param[in]  name          pointer to event flags object name.
1080 */
1081 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_GET_NAME_DISABLE))
1082 extern void EvrRtxEventFlagsGetName (osEventFlagsId_t ef_id, const char *name);
1083 #else
1084 #define EvrRtxEventFlagsGetName(ef_id, name)
1085 #endif
1086 
1087 /**
1088   \brief  Event on event flags set (API)
1089   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1090   \param[in]  flags         flags that shall be set.
1091 */
1092 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_SET_DISABLE))
1093 extern void EvrRtxEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags);
1094 #else
1095 #define EvrRtxEventFlagsSet(ef_id, flags)
1096 #endif
1097 
1098 /**
1099   \brief  Event on successful event flags set (Op)
1100   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1101   \param[in]  event_flags   event flags after setting.
1102 */
1103 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_SET_DONE_DISABLE))
1104 extern void EvrRtxEventFlagsSetDone (osEventFlagsId_t ef_id, uint32_t event_flags);
1105 #else
1106 #define EvrRtxEventFlagsSetDone(ef_id, event_flags)
1107 #endif
1108 
1109 /**
1110   \brief  Event on event flags clear (API)
1111   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1112   \param[in]  flags         flags that shall be cleared.
1113 */
1114 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_CLEAR_DISABLE))
1115 extern void EvrRtxEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags);
1116 #else
1117 #define EvrRtxEventFlagsClear(ef_id, flags)
1118 #endif
1119 
1120 /**
1121   \brief  Event on successful event flags clear (Op)
1122   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1123   \param[in]  event_flags   event flags before clearing.
1124 */
1125 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_CLEAR_DONE_DISABLE))
1126 extern void EvrRtxEventFlagsClearDone (osEventFlagsId_t ef_id, uint32_t event_flags);
1127 #else
1128 #define EvrRtxEventFlagsClearDone(ef_id, event_flags)
1129 #endif
1130 
1131 /**
1132   \brief  Event on event flags retrieve (API)
1133   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1134   \param[in]  event_flags   current event flags.
1135 */
1136 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_GET_DISABLE))
1137 extern void EvrRtxEventFlagsGet (osEventFlagsId_t ef_id, uint32_t event_flags);
1138 #else
1139 #define EvrRtxEventFlagsGet(ef_id, event_flags)
1140 #endif
1141 
1142 /**
1143   \brief  Event on wait for event flags (API)
1144   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1145   \param[in]  flags         flags to wait for.
1146   \param[in]  options       flags options (osFlagsXxxx).
1147   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1148 */
1149 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_WAIT_DISABLE))
1150 extern void EvrRtxEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout);
1151 #else
1152 #define EvrRtxEventFlagsWait(ef_id, flags, options, timeout)
1153 #endif
1154 
1155 /**
1156   \brief  Event on pending wait for event flags (Op)
1157   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1158   \param[in]  flags         flags to wait for.
1159   \param[in]  options       flags options (osFlagsXxxx).
1160   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1161 */
1162 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_WAIT_PENDING_DISABLE))
1163 extern void EvrRtxEventFlagsWaitPending (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout);
1164 #else
1165 #define EvrRtxEventFlagsWaitPending(ef_id, flags, options, timeout)
1166 #endif
1167 
1168 /**
1169   \brief  Event on wait timeout for event flags (Op)
1170   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1171 */
1172 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_WAIT_TIMEOUT_DISABLE))
1173 extern void EvrRtxEventFlagsWaitTimeout (osEventFlagsId_t ef_id);
1174 #else
1175 #define EvrRtxEventFlagsWaitTimeout(ef_id)
1176 #endif
1177 
1178 /**
1179   \brief  Event on successful wait for event flags (Op)
1180   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1181   \param[in]  flags         flags to wait for.
1182   \param[in]  options       flags options (osFlagsXxxx).
1183   \param[in]  event_flags   event flags before clearing or 0 if specified flags have not been set.
1184 */
1185 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_WAIT_COMPLETED_DISABLE))
1186 extern void EvrRtxEventFlagsWaitCompleted (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t event_flags);
1187 #else
1188 #define EvrRtxEventFlagsWaitCompleted(ef_id, flags, options, event_flags)
1189 #endif
1190 
1191 /**
1192   \brief  Event on unsuccessful wait for event flags (Op)
1193   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1194   \param[in]  flags         flags to wait for.
1195   \param[in]  options       flags options (osFlagsXxxx).
1196 */
1197 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_WAIT_NOT_COMPLETED_DISABLE))
1198 extern void EvrRtxEventFlagsWaitNotCompleted (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options);
1199 #else
1200 #define EvrRtxEventFlagsWaitNotCompleted(ef_id, flags, options)
1201 #endif
1202 
1203 /**
1204   \brief  Event on event flags delete (API)
1205   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1206 */
1207 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_DELETE_DISABLE))
1208 extern void EvrRtxEventFlagsDelete (osEventFlagsId_t ef_id);
1209 #else
1210 #define EvrRtxEventFlagsDelete(ef_id)
1211 #endif
1212 
1213 /**
1214   \brief  Event on successful event flags delete (Op)
1215   \param[in]  ef_id         event flags ID obtained by \ref osEventFlagsNew.
1216 */
1217 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_EVFLAGS != 0) && !defined(EVR_RTX_EVENT_FLAGS_DESTROYED_DISABLE))
1218 extern void EvrRtxEventFlagsDestroyed (osEventFlagsId_t ef_id);
1219 #else
1220 #define EvrRtxEventFlagsDestroyed(ef_id)
1221 #endif
1222 
1223 
1224 //  ==== Mutex Events ====
1225 
1226 /**
1227   \brief  Event on mutex error (Error)
1228   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew or NULL when ID is unknown.
1229   \param[in]  status    extended execution status.
1230 */
1231 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_ERROR_DISABLE))
1232 extern void EvrRtxMutexError (osMutexId_t mutex_id, int32_t status);
1233 #else
1234 #define EvrRtxMutexError(mutex_id, status)
1235 #endif
1236 
1237 /**
1238   \brief  Event on mutex create and initialize (API)
1239   \param[in]  attr      mutex attributes.
1240 */
1241 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_NEW_DISABLE))
1242 extern void EvrRtxMutexNew (const osMutexAttr_t *attr);
1243 #else
1244 #define EvrRtxMutexNew(attr)
1245 #endif
1246 
1247 /**
1248   \brief  Event on successful mutex create (Op)
1249   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1250   \param[in]  name      pointer to mutex object name.
1251 */
1252 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_CREATED_DISABLE))
1253 extern void EvrRtxMutexCreated (osMutexId_t mutex_id, const char *name);
1254 #else
1255 #define EvrRtxMutexCreated(mutex_id, name)
1256 #endif
1257 
1258 /**
1259   \brief  Event on mutex name retrieve (API)
1260   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1261   \param[in]  name      pointer to mutex object name.
1262 */
1263 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_GET_NAME_DISABLE))
1264 extern void EvrRtxMutexGetName (osMutexId_t mutex_id, const char *name);
1265 #else
1266 #define EvrRtxMutexGetName(mutex_id, name)
1267 #endif
1268 
1269 /**
1270   \brief  Event on mutex acquire (API)
1271   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1272   \param[in]  timeout   \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1273 */
1274 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_ACQUIRE_DISABLE))
1275 extern void EvrRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout);
1276 #else
1277 #define EvrRtxMutexAcquire(mutex_id, timeout)
1278 #endif
1279 
1280 /**
1281   \brief  Event on pending mutex acquire (Op)
1282   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1283   \param[in]  timeout   \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1284 */
1285 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_ACQUIRE_PENDING_DISABLE))
1286 extern void EvrRtxMutexAcquirePending (osMutexId_t mutex_id, uint32_t timeout);
1287 #else
1288 #define EvrRtxMutexAcquirePending(mutex_id, timeout)
1289 #endif
1290 
1291 /**
1292   \brief  Event on mutex acquire timeout (Op)
1293   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1294 */
1295 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_ACQUIRE_TIMEOUT_DISABLE))
1296 extern void EvrRtxMutexAcquireTimeout (osMutexId_t mutex_id);
1297 #else
1298 #define EvrRtxMutexAcquireTimeout(mutex_id)
1299 #endif
1300 
1301 /**
1302   \brief  Event on successful mutex acquire (Op)
1303   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1304   \param[in]  lock      current number of times mutex object is locked.
1305 */
1306 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_ACQUIRED_DISABLE))
1307 extern void EvrRtxMutexAcquired (osMutexId_t mutex_id, uint32_t lock);
1308 #else
1309 #define EvrRtxMutexAcquired(mutex_id, lock)
1310 #endif
1311 
1312 /**
1313   \brief  Event on unsuccessful mutex acquire (Op)
1314   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1315 */
1316 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_NOT_ACQUIRED_DISABLE))
1317 extern void EvrRtxMutexNotAcquired (osMutexId_t mutex_id);
1318 #else
1319 #define EvrRtxMutexNotAcquired(mutex_id)
1320 #endif
1321 
1322 /**
1323   \brief  Event on mutex release (API)
1324   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1325 */
1326 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_RELEASE_DISABLE))
1327 extern void EvrRtxMutexRelease (osMutexId_t mutex_id);
1328 #else
1329 #define EvrRtxMutexRelease(mutex_id)
1330 #endif
1331 
1332 /**
1333   \brief  Event on successful mutex release (Op)
1334   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1335   \param[in]  lock      current number of times mutex object is locked.
1336 */
1337 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_RELEASED_DISABLE))
1338 extern void EvrRtxMutexReleased (osMutexId_t mutex_id, uint32_t lock);
1339 #else
1340 #define EvrRtxMutexReleased(mutex_id, lock)
1341 #endif
1342 
1343 /**
1344   \brief  Event on mutex owner retrieve (API)
1345   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1346   \param[in]  thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.
1347 */
1348 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_GET_OWNER_DISABLE))
1349 extern void EvrRtxMutexGetOwner (osMutexId_t mutex_id, osThreadId_t thread_id);
1350 #else
1351 #define EvrRtxMutexGetOwner(mutex_id, thread_id)
1352 #endif
1353 
1354 /**
1355   \brief  Event on mutex delete (API)
1356   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1357 */
1358 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_DELETE_DISABLE))
1359 extern void EvrRtxMutexDelete (osMutexId_t mutex_id);
1360 #else
1361 #define EvrRtxMutexDelete(mutex_id)
1362 #endif
1363 
1364 /**
1365   \brief  Event on successful mutex delete (Op)
1366   \param[in]  mutex_id  mutex ID obtained by \ref osMutexNew.
1367 */
1368 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MUTEX != 0) && !defined(EVR_RTX_MUTEX_DESTROYED_DISABLE))
1369 extern void EvrRtxMutexDestroyed (osMutexId_t mutex_id);
1370 #else
1371 #define EvrRtxMutexDestroyed(mutex_id)
1372 #endif
1373 
1374 
1375 //  ==== Semaphore Events ====
1376 
1377 /**
1378   \brief  Event on semaphore error (Error)
1379   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew or NULL when ID is unknown.
1380   \param[in]  status        extended execution status.
1381 */
1382 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_ERROR_DISABLE))
1383 extern void EvrRtxSemaphoreError (osSemaphoreId_t semaphore_id, int32_t status);
1384 #else
1385 #define EvrRtxSemaphoreError(semaphore_id, status)
1386 #endif
1387 
1388 /**
1389   \brief  Event on semaphore create and initialize (API)
1390   \param[in]  max_count     maximum number of available tokens.
1391   \param[in]  initial_count initial number of available tokens.
1392   \param[in]  attr          semaphore attributes.
1393 */
1394 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_NEW_DISABLE))
1395 extern void EvrRtxSemaphoreNew (uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr);
1396 #else
1397 #define EvrRtxSemaphoreNew(max_count, initial_count, attr)
1398 #endif
1399 
1400 /**
1401   \brief  Event on successful semaphore create (Op)
1402   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1403   \param[in]  name          pointer to semaphore object name.
1404 */
1405 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_CREATED_DISABLE))
1406 extern void EvrRtxSemaphoreCreated (osSemaphoreId_t semaphore_id, const char *name);
1407 #else
1408 #define EvrRtxSemaphoreCreated(semaphore_id, name)
1409 #endif
1410 
1411 /**
1412   \brief  Event on semaphore name retrieve (API)
1413   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1414   \param[in]  name          pointer to semaphore object name.
1415 */
1416 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_GET_NAME_DISABLE))
1417 extern void EvrRtxSemaphoreGetName (osSemaphoreId_t semaphore_id, const char *name);
1418 #else
1419 #define EvrRtxSemaphoreGetName(semaphore_id, name)
1420 #endif
1421 
1422 /**
1423   \brief  Event on semaphore acquire (API)
1424   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1425   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1426 */
1427 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_ACQUIRE_DISABLE))
1428 extern void EvrRtxSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout);
1429 #else
1430 #define EvrRtxSemaphoreAcquire(semaphore_id, timeout)
1431 #endif
1432 
1433 /**
1434   \brief  Event on pending semaphore acquire (Op)
1435   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1436   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1437 */
1438 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_ACQUIRE_PENDING_DISABLE))
1439 extern void EvrRtxSemaphoreAcquirePending (osSemaphoreId_t semaphore_id, uint32_t timeout);
1440 #else
1441 #define EvrRtxSemaphoreAcquirePending(semaphore_id, timeout)
1442 #endif
1443 
1444 /**
1445   \brief  Event on semaphore acquire timeout (Op)
1446   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1447 */
1448 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_ACQUIRE_TIMEOUT_DISABLE))
1449 extern void EvrRtxSemaphoreAcquireTimeout (osSemaphoreId_t semaphore_id);
1450 #else
1451 #define EvrRtxSemaphoreAcquireTimeout(semaphore_id)
1452 #endif
1453 
1454 /**
1455   \brief  Event on successful semaphore acquire (Op)
1456   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1457   \param[in]  tokens        number of available tokens.
1458 */
1459 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_ACQUIRED_DISABLE))
1460 extern void EvrRtxSemaphoreAcquired (osSemaphoreId_t semaphore_id, uint32_t tokens);
1461 #else
1462 #define EvrRtxSemaphoreAcquired(semaphore_id, tokens)
1463 #endif
1464 
1465 /**
1466   \brief  Event on unsuccessful semaphore acquire (Op)
1467   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1468 */
1469 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_NOT_ACQUIRED_DISABLE))
1470 extern void EvrRtxSemaphoreNotAcquired (osSemaphoreId_t semaphore_id);
1471 #else
1472 #define EvrRtxSemaphoreNotAcquired(semaphore_id)
1473 #endif
1474 
1475 /**
1476   \brief  Event on semaphore release (API)
1477   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1478 */
1479 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_RELEASE_DISABLE))
1480 extern void EvrRtxSemaphoreRelease (osSemaphoreId_t semaphore_id);
1481 #else
1482 #define EvrRtxSemaphoreRelease(semaphore_id)
1483 #endif
1484 
1485 /**
1486   \brief  Event on successful semaphore release (Op)
1487   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1488   \param[in]  tokens        number of available tokens.
1489 */
1490 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_RELEASED_DISABLE))
1491 extern void EvrRtxSemaphoreReleased (osSemaphoreId_t semaphore_id, uint32_t tokens);
1492 #else
1493 #define EvrRtxSemaphoreReleased(semaphore_id, tokens)
1494 #endif
1495 
1496 /**
1497   \brief  Event on semaphore token count retrieval (API)
1498   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1499   \param[in]  count         current number of available tokens.
1500 */
1501 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_GET_COUNT_DISABLE))
1502 extern void EvrRtxSemaphoreGetCount (osSemaphoreId_t semaphore_id, uint32_t count);
1503 #else
1504 #define EvrRtxSemaphoreGetCount(semaphore_id, count)
1505 #endif
1506 
1507 /**
1508   \brief  Event on semaphore delete (API)
1509   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1510 */
1511 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_DELETE_DISABLE))
1512 extern void EvrRtxSemaphoreDelete (osSemaphoreId_t semaphore_id);
1513 #else
1514 #define EvrRtxSemaphoreDelete(semaphore_id)
1515 #endif
1516 
1517 /**
1518   \brief  Event on successful semaphore delete (Op)
1519   \param[in]  semaphore_id  semaphore ID obtained by \ref osSemaphoreNew.
1520 */
1521 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_SEMAPHORE != 0) && !defined(EVR_RTX_SEMAPHORE_DESTROYED_DISABLE))
1522 extern void EvrRtxSemaphoreDestroyed (osSemaphoreId_t semaphore_id);
1523 #else
1524 #define EvrRtxSemaphoreDestroyed(semaphore_id)
1525 #endif
1526 
1527 
1528 //  ==== Memory Pool Events ====
1529 
1530 /**
1531   \brief  Event on memory pool error (Error)
1532   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew or NULL when ID is unknown.
1533   \param[in]  status        extended execution status.
1534 */
1535 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_ERROR_DISABLE))
1536 extern void EvrRtxMemoryPoolError (osMemoryPoolId_t mp_id, int32_t status);
1537 #else
1538 #define EvrRtxMemoryPoolError(mp_id, status)
1539 #endif
1540 
1541 /**
1542   \brief  Event on memory pool create and initialize (API)
1543   \param[in]  block_count   maximum number of memory blocks in memory pool.
1544   \param[in]  block_size    memory block size in bytes.
1545   \param[in]  attr          memory pool attributes; NULL: default values.
1546 */
1547 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_NEW_DISABLE))
1548 extern void EvrRtxMemoryPoolNew (uint32_t block_count, uint32_t block_size, const osMemoryPoolAttr_t *attr);
1549 #else
1550 #define EvrRtxMemoryPoolNew(block_count, block_size, attr)
1551 #endif
1552 
1553 /**
1554   \brief  Event on successful memory pool create (Op)
1555   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1556   \param[in]  name          pointer to memory pool object name.
1557 */
1558 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_CREATED_DISABLE))
1559 extern void EvrRtxMemoryPoolCreated (osMemoryPoolId_t mp_id, const char *name);
1560 #else
1561 #define EvrRtxMemoryPoolCreated(mp_id, name)
1562 #endif
1563 
1564 /**
1565   \brief  Event on memory pool name retrieve (API)
1566   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1567   \param[in]  name          pointer to memory pool object name.
1568 */
1569 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_GET_NAME_DISABLE))
1570 extern void EvrRtxMemoryPoolGetName (osMemoryPoolId_t mp_id, const char *name);
1571 #else
1572 #define EvrRtxMemoryPoolGetName(mp_id, name)
1573 #endif
1574 
1575 /**
1576   \brief  Event on memory pool allocation (API)
1577   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1578   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1579 */
1580 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_ALLOC_DISABLE))
1581 extern void EvrRtxMemoryPoolAlloc (osMemoryPoolId_t mp_id, uint32_t timeout);
1582 #else
1583 #define EvrRtxMemoryPoolAlloc(mp_id, timeout)
1584 #endif
1585 
1586 /**
1587   \brief  Event on pending memory pool allocation (Op)
1588   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1589   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1590 */
1591 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_ALLOC_PENDING_DISABLE))
1592 extern void EvrRtxMemoryPoolAllocPending (osMemoryPoolId_t mp_id, uint32_t timeout);
1593 #else
1594 #define EvrRtxMemoryPoolAllocPending(mp_id, timeout)
1595 #endif
1596 
1597 /**
1598   \brief  Event on memory pool allocation timeout (Op)
1599   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1600 */
1601 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_ALLOC_TIMEOUT_DISABLE))
1602 extern void EvrRtxMemoryPoolAllocTimeout (osMemoryPoolId_t mp_id);
1603 #else
1604 #define EvrRtxMemoryPoolAllocTimeout(mp_id)
1605 #endif
1606 
1607 /**
1608   \brief  Event on successful memory pool allocation (Op)
1609   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1610   \param[in]  block         address of the allocated memory block.
1611 */
1612 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_ALLOCATED_DISABLE))
1613 extern void EvrRtxMemoryPoolAllocated (osMemoryPoolId_t mp_id, void *block);
1614 #else
1615 #define EvrRtxMemoryPoolAllocated(mp_id, block)
1616 #endif
1617 
1618 /**
1619   \brief  Event on unsuccessful memory pool allocation (Op)
1620   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1621 */
1622 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_ALLOC_FAILED_DISABLE))
1623 extern void EvrRtxMemoryPoolAllocFailed (osMemoryPoolId_t mp_id);
1624 #else
1625 #define EvrRtxMemoryPoolAllocFailed(mp_id)
1626 #endif
1627 
1628 /**
1629   \brief  Event on memory pool free (API)
1630   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1631   \param[in]  block         address of the allocated memory block to be returned to the memory pool.
1632 */
1633 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_FREE_DISABLE))
1634 extern void EvrRtxMemoryPoolFree (osMemoryPoolId_t mp_id, void *block);
1635 #else
1636 #define EvrRtxMemoryPoolFree(mp_id, block)
1637 #endif
1638 
1639 /**
1640   \brief  Event on successful memory pool free (Op)
1641   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1642   \param[in]  block         address of the allocated memory block to be returned to the memory pool.
1643 */
1644 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_DEALLOCATED_DISABLE))
1645 extern void EvrRtxMemoryPoolDeallocated (osMemoryPoolId_t mp_id, void *block);
1646 #else
1647 #define EvrRtxMemoryPoolDeallocated(mp_id, block)
1648 #endif
1649 
1650 /**
1651   \brief  Event on unsuccessful memory pool free (Op)
1652   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1653   \param[in]  block         address of the allocated memory block to be returned to the memory pool.
1654 */
1655 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_FREE_FAILED_DISABLE))
1656 extern void EvrRtxMemoryPoolFreeFailed (osMemoryPoolId_t mp_id, void *block);
1657 #else
1658 #define EvrRtxMemoryPoolFreeFailed(mp_id, block)
1659 #endif
1660 
1661 /**
1662   \brief  Event on memory pool capacity retrieve (API)
1663   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1664   \param[in]  capacity      maximum number of memory blocks.
1665 */
1666 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_GET_CAPACITY_DISABLE))
1667 extern void EvrRtxMemoryPoolGetCapacity (osMemoryPoolId_t mp_id, uint32_t capacity);
1668 #else
1669 #define EvrRtxMemoryPoolGetCapacity(mp_id, capacity)
1670 #endif
1671 
1672 /**
1673   \brief  Event on memory pool block size retrieve (API)
1674   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1675   \param[in]  block_size    memory block size in bytes.
1676 */
1677 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_GET_BLOCK_SZIE_DISABLE))
1678 extern void EvrRtxMemoryPoolGetBlockSize (osMemoryPoolId_t mp_id, uint32_t block_size);
1679 #else
1680 #define EvrRtxMemoryPoolGetBlockSize(mp_id, block_size)
1681 #endif
1682 
1683 /**
1684   \brief  Event on used memory pool blocks retrieve (API)
1685   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1686   \param[in]  count         number of memory blocks used.
1687 */
1688 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_GET_COUNT_DISABLE))
1689 extern void EvrRtxMemoryPoolGetCount (osMemoryPoolId_t mp_id, uint32_t count);
1690 #else
1691 #define EvrRtxMemoryPoolGetCount(mp_id, count)
1692 #endif
1693 
1694 /**
1695   \brief  Event on available memory pool blocks retrieve (API)
1696   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1697   \param[in]  space         number of memory blocks available.
1698 */
1699 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_GET_SPACE_DISABLE))
1700 extern void EvrRtxMemoryPoolGetSpace (osMemoryPoolId_t mp_id, uint32_t space);
1701 #else
1702 #define EvrRtxMemoryPoolGetSpace(mp_id, space)
1703 #endif
1704 
1705 /**
1706   \brief  Event on memory pool delete (API)
1707   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1708 */
1709 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_DELETE_DISABLE))
1710 extern void EvrRtxMemoryPoolDelete (osMemoryPoolId_t mp_id);
1711 #else
1712 #define EvrRtxMemoryPoolDelete(mp_id)
1713 #endif
1714 
1715 /**
1716   \brief  Event on successful memory pool delete (Op)
1717   \param[in]  mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
1718 */
1719 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MEMPOOL != 0) && !defined(EVR_RTX_MEMORY_POOL_DESTROYED_DISABLE))
1720 extern void EvrRtxMemoryPoolDestroyed (osMemoryPoolId_t mp_id);
1721 #else
1722 #define EvrRtxMemoryPoolDestroyed(mp_id)
1723 #endif
1724 
1725 
1726 //  ==== Message Queue Events ====
1727 
1728 /**
1729   \brief  Event on message queue error (Error)
1730   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew or NULL when ID is unknown.
1731   \param[in]  status        extended execution status.
1732 */
1733 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_ERROR_DISABLE))
1734 extern void EvrRtxMessageQueueError (osMessageQueueId_t mq_id, int32_t status);
1735 #else
1736 #define EvrRtxMessageQueueError(mq_id, status)
1737 #endif
1738 
1739 /**
1740   \brief  Event on message queue create and initialization (API)
1741   \param[in]  msg_count     maximum number of messages in queue.
1742   \param[in]  msg_size      maximum message size in bytes.
1743   \param[in]  attr          message queue attributes; NULL: default values.
1744 */
1745 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_NEW_DISABLE))
1746 extern void EvrRtxMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr);
1747 #else
1748 #define EvrRtxMessageQueueNew(msg_count, msg_size, attr)
1749 #endif
1750 
1751 /**
1752   \brief  Event on successful message queue create (Op)
1753   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1754   \param[in]  name          pointer to message queue object name.
1755 */
1756 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_CREATED_DISABLE))
1757 extern void EvrRtxMessageQueueCreated (osMessageQueueId_t mq_id, const char *name);
1758 #else
1759 #define EvrRtxMessageQueueCreated(mq_id, name)
1760 #endif
1761 
1762 /**
1763   \brief  Event on message queue name retrieve(API)
1764   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1765   \param[in]  name          pointer to message queue object name.
1766 */
1767 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_NAME_DISABLE))
1768 extern void EvrRtxMessageQueueGetName (osMessageQueueId_t mq_id, const char *name);
1769 #else
1770 #define EvrRtxMessageQueueGetName(mq_id, name)
1771 #endif
1772 
1773 /**
1774   \brief  Event on message put (API)
1775   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1776   \param[in]  msg_ptr       pointer to buffer with message to put into a queue.
1777   \param[in]  msg_prio      message priority.
1778   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1779 */
1780 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_PUT_DISABLE))
1781 extern void EvrRtxMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout);
1782 #else
1783 #define EvrRtxMessageQueuePut(mq_id, msg_ptr, msg_prio, timeout)
1784 #endif
1785 
1786 /**
1787   \brief  Event on pending message put (Op)
1788   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1789   \param[in]  msg_ptr       pointer to buffer with message to put into a queue.
1790   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1791 */
1792 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_PUT_PENDING_DISABLE))
1793 extern void EvrRtxMessageQueuePutPending (osMessageQueueId_t mq_id, const void *msg_ptr, uint32_t timeout);
1794 #else
1795 #define EvrRtxMessageQueuePutPending(mq_id, msg_ptr, timeout)
1796 #endif
1797 
1798 /**
1799   \brief  Event on message put timeout (Op)
1800   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1801 */
1802 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_PUT_TIMEOUT_DISABLE))
1803 extern void EvrRtxMessageQueuePutTimeout (osMessageQueueId_t mq_id);
1804 #else
1805 #define EvrRtxMessageQueuePutTimeout(mq_id)
1806 #endif
1807 
1808 /**
1809   \brief  Event on pending message insert (Op)
1810   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1811   \param[in]  msg_ptr       pointer to buffer with message to put into a queue.
1812 */
1813 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_INSERT_PENDING_DISABLE))
1814 extern void EvrRtxMessageQueueInsertPending (osMessageQueueId_t mq_id, const void *msg_ptr);
1815 #else
1816 #define EvrRtxMessageQueueInsertPending(mq_id, msg_ptr)
1817 #endif
1818 
1819 /**
1820   \brief  Event on successful message insert (Op)
1821   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1822   \param[in]  msg_ptr       pointer to buffer with message to put into a queue.
1823 */
1824 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_INSERTED_DISABLE))
1825 extern void EvrRtxMessageQueueInserted (osMessageQueueId_t mq_id, const void *msg_ptr);
1826 #else
1827 #define EvrRtxMessageQueueInserted(mq_id, msg_ptr)
1828 #endif
1829 
1830 /**
1831   \brief  Event on unsuccessful message insert (Op)
1832   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1833   \param[in]  msg_ptr       pointer to buffer with message to put into a queue.
1834 */
1835 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_NOT_INSERTED_DISABLE))
1836 extern void EvrRtxMessageQueueNotInserted (osMessageQueueId_t mq_id, const void *msg_ptr);
1837 #else
1838 #define EvrRtxMessageQueueNotInserted(mq_id, msg_ptr)
1839 #endif
1840 
1841 /**
1842   \brief  Event on message get (API)
1843   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1844   \param[in]  msg_ptr       pointer to buffer for message to get from a queue.
1845   \param[in]  msg_prio      message priority.
1846   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1847 */
1848 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_DISABLE))
1849 extern void EvrRtxMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout);
1850 #else
1851 #define EvrRtxMessageQueueGet(mq_id, msg_ptr, msg_prio, timeout)
1852 #endif
1853 
1854 /**
1855   \brief  Event on pending message get (Op)
1856   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1857   \param[in]  msg_ptr       pointer to buffer for message to get from a queue.
1858   \param[in]  timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
1859 */
1860 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_PENDING_DISABLE))
1861 extern void EvrRtxMessageQueueGetPending (osMessageQueueId_t mq_id, void *msg_ptr, uint32_t timeout);
1862 #else
1863 #define EvrRtxMessageQueueGetPending(mq_id, msg_ptr, timeout)
1864 #endif
1865 
1866 /**
1867   \brief  Event on message get timeout (Op)
1868   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1869 */
1870 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_TIMEOUT_DISABLE))
1871 extern void EvrRtxMessageQueueGetTimeout (osMessageQueueId_t mq_id);
1872 #else
1873 #define EvrRtxMessageQueueGetTimeout(mq_id)
1874 #endif
1875 
1876 /**
1877   \brief  Event on successful message get (Op)
1878   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1879   \param[in]  msg_ptr       pointer to buffer for message to get from a queue.
1880 */
1881 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_RETRIEVED_DISABLE))
1882 extern void EvrRtxMessageQueueRetrieved (osMessageQueueId_t mq_id, void *msg_ptr);
1883 #else
1884 #define EvrRtxMessageQueueRetrieved(mq_id, msg_ptr)
1885 #endif
1886 
1887 /**
1888   \brief  Event on unsuccessful message get (Op)
1889   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1890   \param[in]  msg_ptr       pointer to buffer for message to get from a queue.
1891 */
1892 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_NOT_RETRIEVED_DISABLE))
1893 extern void EvrRtxMessageQueueNotRetrieved (osMessageQueueId_t mq_id, void *msg_ptr);
1894 #else
1895 #define EvrRtxMessageQueueNotRetrieved(mq_id, msg_ptr)
1896 #endif
1897 
1898 /**
1899   \brief  Event on message queue capacity retrieve (API)
1900   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1901   \param[in]  capacity      maximum number of messages.
1902 */
1903 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_CAPACITY_DISABLE))
1904 extern void EvrRtxMessageQueueGetCapacity (osMessageQueueId_t mq_id, uint32_t capacity);
1905 #else
1906 #define EvrRtxMessageQueueGetCapacity(mq_id, capacity)
1907 #endif
1908 
1909 /**
1910   \brief  Event on message queue message size retrieve (API)
1911   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1912   \param[in]  msg_size      maximum message size in bytes.
1913 */
1914 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_MSG_SIZE_DISABLE))
1915 extern void EvrRtxMessageQueueGetMsgSize (osMessageQueueId_t mq_id, uint32_t msg_size);
1916 #else
1917 #define EvrRtxMessageQueueGetMsgSize(mq_id, msg_size)
1918 #endif
1919 
1920 /**
1921   \brief  Event on message queue message count retrieve (API)
1922   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1923   \param[in]  count         number of queued messages.
1924 */
1925 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_COUNT_DISABLE))
1926 extern void EvrRtxMessageQueueGetCount (osMessageQueueId_t mq_id, uint32_t count);
1927 #else
1928 #define EvrRtxMessageQueueGetCount(mq_id, count)
1929 #endif
1930 
1931 /**
1932   \brief  Event on message queue message slots retrieve (API)
1933   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1934   \param[in]  space         number of available slots for messages.
1935 */
1936 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_GET_SPACE_DISABLE))
1937 extern void EvrRtxMessageQueueGetSpace (osMessageQueueId_t mq_id, uint32_t space);
1938 #else
1939 #define EvrRtxMessageQueueGetSpace(mq_id, space)
1940 #endif
1941 
1942 /**
1943   \brief  Event on message queue reset (API)
1944   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1945 */
1946 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_RESET_DISABLE))
1947 extern void EvrRtxMessageQueueReset (osMessageQueueId_t mq_id);
1948 #else
1949 #define EvrRtxMessageQueueReset(mq_id)
1950 #endif
1951 
1952 /**
1953   \brief  Event on successful message queue reset (Op)
1954   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1955 */
1956 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_RESET_DONE_DISABLE))
1957 extern void EvrRtxMessageQueueResetDone (osMessageQueueId_t mq_id);
1958 #else
1959 #define EvrRtxMessageQueueResetDone(mq_id)
1960 #endif
1961 
1962 /**
1963   \brief  Event on message queue delete (API)
1964   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1965 */
1966 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_DELETE_DISABLE))
1967 extern void EvrRtxMessageQueueDelete (osMessageQueueId_t mq_id);
1968 #else
1969 #define EvrRtxMessageQueueDelete(mq_id)
1970 #endif
1971 
1972 /**
1973   \brief  Event on successful message queue delete (Op)
1974   \param[in]  mq_id         message queue ID obtained by \ref osMessageQueueNew.
1975 */
1976 #if (!defined(EVR_RTX_DISABLE) && (OS_EVR_MSGQUEUE != 0) && !defined(EVR_RTX_MESSAGE_QUEUE_DESTROYED_DISABLE))
1977 extern void EvrRtxMessageQueueDestroyed (osMessageQueueId_t mq_id);
1978 #else
1979 #define EvrRtxMessageQueueDestroyed(mq_id)
1980 #endif
1981 
1982 
1983 #endif  // RTX_EVR_H_
1984