ChibiOS/HAL  6.1.0
osal.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 /**
18  * @file osal.h
19  * @brief OSAL module header.
20  *
21  * @addtogroup OSAL
22  * @{
23  */
24 
25 #ifndef OSAL_H
26 #define OSAL_H
27 
28 #include <stddef.h>
29 #include <stdint.h>
30 #include <stdbool.h>
31 
32 /*===========================================================================*/
33 /* Module constants. */
34 /*===========================================================================*/
35 
36 /**
37  * @name Common constants
38  * @{
39  */
40 #if !defined(FALSE) || defined(__DOXYGEN__)
41 #define FALSE 0
42 #endif
43 
44 #if !defined(TRUE) || defined(__DOXYGEN__)
45 #define TRUE 1
46 #endif
47 
48 #define OSAL_SUCCESS false
49 #define OSAL_FAILED true
50 /** @} */
51 
52 /**
53  * @name Messages
54  * @{
55  */
56 #define MSG_OK (msg_t)0
57 #define MSG_TIMEOUT (msg_t)-1
58 #define MSG_RESET (msg_t)-2
59 /** @} */
60 
61 
62 /**
63  * @name Special time constants
64  * @{
65  */
66 #define TIME_IMMEDIATE ((sysinterval_t)0)
67 #define TIME_INFINITE ((sysinterval_t)-1)
68 /** @} */
69 
70 /**
71  * @name Systick modes.
72  * @{
73  */
74 #define OSAL_ST_MODE_NONE 0
75 #define OSAL_ST_MODE_PERIODIC 1
76 #define OSAL_ST_MODE_FREERUNNING 2
77 /** @} */
78 
79 /**
80  * @name Systick parameters.
81  * @{
82  */
83 /**
84  * @brief Size in bits of the @p systick_t type.
85  */
86 #define OSAL_ST_RESOLUTION 32
87 
88 /**
89  * @brief Required systick frequency or resolution.
90  */
91 #define OSAL_ST_FREQUENCY 1000
92 
93 /**
94  * @brief Systick mode required by the underlying OS.
95  */
96 #define OSAL_ST_MODE OSAL_ST_MODE_PERIODIC
97 /** @} */
98 
99 /**
100  * @name IRQ-related constants
101  * @{
102  */
103 /**
104  * @brief Total priority levels.
105  * @brief Implementation not mandatory.
106  */
107 #define OSAL_IRQ_PRIORITY_LEVELS 16U
108 
109 /**
110  * @brief Highest IRQ priority for HAL drivers.
111  * @brief Implementation not mandatory.
112  */
113 #define OSAL_IRQ_MAXIMUM_PRIORITY 0U
114 /** @} */
115 
116 /*===========================================================================*/
117 /* Module pre-compile time settings. */
118 /*===========================================================================*/
119 
120 /**
121  * @brief Enables OSAL assertions.
122  */
123 #if !defined(OSAL_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__)
124 #define OSAL_DBG_ENABLE_ASSERTS FALSE
125 #endif
126 
127 /**
128  * @brief Enables OSAL functions parameters checks.
129  */
130 #if !defined(OSAL_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__)
131 #define OSAL_DBG_ENABLE_CHECKS FALSE
132 #endif
133 
134 /*===========================================================================*/
135 /* Derived constants and error checks. */
136 /*===========================================================================*/
137 
138 #if !(OSAL_ST_MODE == OSAL_ST_MODE_NONE) && \
139  !(OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC) && \
140  !(OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING)
141 #error "invalid OSAL_ST_MODE setting in osal.h"
142 #endif
143 
144 #if (OSAL_ST_RESOLUTION != 16) && (OSAL_ST_RESOLUTION != 32)
145 #error "invalid OSAL_ST_RESOLUTION, must be 16 or 32"
146 #endif
147 
148 /*===========================================================================*/
149 /* Module data structures and types. */
150 /*===========================================================================*/
151 
152 /**
153  * @brief Type of a system status word.
154  */
155 typedef uint32_t syssts_t;
156 
157 /**
158  * @brief Type of a message.
159  */
160 typedef int32_t msg_t;
161 
162 /**
163  * @brief Type of system time counter.
164  */
165 typedef uint32_t systime_t;
166 
167 /**
168  * @brief Type of system time interval.
169  */
170 typedef uint32_t sysinterval_t;
171 
172 /**
173  * @brief Type of realtime counter.
174  */
175 typedef uint32_t rtcnt_t;
176 
177 /**
178  * @brief Type of a thread reference.
179  */
180 typedef void * thread_reference_t;
181 
182 /**
183  * @brief Type of an event flags mask.
184  */
185 typedef uint32_t eventflags_t;
186 
187 /**
188  * @brief Type of an event flags object.
189  * @note The content of this structure is not part of the API and should
190  * not be relied upon. Implementers may define this structure in
191  * an entirely different way.
192  * @note Retrieval and clearing of the flags are not defined in this
193  * API and are implementation-dependent.
194  */
196 
197 /**
198  * @brief Type of an event source callback.
199  * @note This type is not part of the OSAL API and is provided
200  * exclusively as an example and for convenience.
201  */
202 typedef void (*eventcallback_t)(event_source_t *esp);
203 
204 /**
205  * @brief Events source object.
206  * @note The content of this structure is not part of the API and should
207  * not be relied upon. Implementers may define this structure in
208  * an entirely different way.
209  * @note Retrieval and clearing of the flags are not defined in this
210  * API and are implementation-dependent.
211  */
212 struct event_source {
213  volatile eventflags_t flags; /**< @brief Stored event flags. */
214  eventcallback_t cb; /**< @brief Event source callback. */
215  void *param; /**< @brief User defined field. */
216 };
217 
218 /**
219  * @brief Type of a mutex.
220  * @note If the OS does not support mutexes or there is no OS then them
221  * mechanism can be simulated.
222  */
223 typedef uint32_t mutex_t;
224 
225 /**
226  * @brief Type of a thread queue.
227  * @details A thread queue is a queue of sleeping threads, queued threads
228  * can be dequeued one at time or all together.
229  * @note If the OSAL is implemented on a bare metal machine without RTOS
230  * then the queue can be implemented as a single thread reference.
231  */
232 typedef struct {
235 
236 /*===========================================================================*/
237 /* Module macros. */
238 /*===========================================================================*/
239 
240 /**
241  * @name Debug related macros
242  * @{
243  */
244 /**
245  * @brief Condition assertion.
246  * @details If the condition check fails then the OSAL panics with a
247  * message and halts.
248  * @note The condition is tested only if the @p OSAL_ENABLE_ASSERTIONS
249  * switch is enabled.
250  * @note The remark string is not currently used except for putting a
251  * comment in the code about the assertion.
252  *
253  * @param[in] c the condition to be verified to be true
254  * @param[in] remark a remark string
255  *
256  * @api
257  */
258 #define osalDbgAssert(c, remark) do { \
259  /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant by design.*/ \
260  if (OSAL_DBG_ENABLE_ASSERTS != FALSE) { \
261  if (!(c)) { \
262  /*lint -restore*/ \
263  osalSysHalt(__func__); \
264  } \
265  } \
266 } while (false)
267 
268 /**
269  * @brief Function parameters check.
270  * @details If the condition check fails then the OSAL panics and halts.
271  * @note The condition is tested only if the @p OSAL_ENABLE_CHECKS switch
272  * is enabled.
273  *
274  * @param[in] c the condition to be verified to be true
275  *
276  * @api
277  */
278 #define osalDbgCheck(c) do { \
279  /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant by design.*/ \
280  if (OSAL_DBG_ENABLE_CHECKS != FALSE) { \
281  if (!(c)) { \
282  /*lint -restore*/ \
283  osalSysHalt(__func__); \
284  } \
285  } \
286 } while (false)
287 
288 /**
289  * @brief I-Class state check.
290  * @note Implementation is optional.
291  */
292 #define osalDbgCheckClassI()
293 
294 /**
295  * @brief S-Class state check.
296  * @note Implementation is optional.
297  */
298 #define osalDbgCheckClassS()
299 /** @} */
300 
301 /**
302  * @name IRQ service routines wrappers
303  * @{
304  */
305 /**
306  * @brief Priority level verification macro.
307  */
308 #define OSAL_IRQ_IS_VALID_PRIORITY(n) \
309  (((n) >= OSAL_IRQ_MAXIMUM_PRIORITY) && ((n) < OSAL_IRQ_PRIORITY_LEVELS))
310 
311 /**
312  * @brief IRQ prologue code.
313  * @details This macro must be inserted at the start of all IRQ handlers.
314  */
315 #define OSAL_IRQ_PROLOGUE()
316 
317 /**
318  * @brief IRQ epilogue code.
319  * @details This macro must be inserted at the end of all IRQ handlers.
320  */
321 #define OSAL_IRQ_EPILOGUE()
322 
323 /**
324  * @brief IRQ handler function declaration.
325  * @details This macro hides the details of an ISR function declaration.
326  *
327  * @param[in] id a vector name as defined in @p vectors.s
328  */
329 #define OSAL_IRQ_HANDLER(id) void id(void)
330 /** @} */
331 
332 /**
333  * @name Time conversion utilities
334  * @{
335  */
336 /**
337  * @brief Seconds to system ticks.
338  * @details Converts from seconds to system ticks number.
339  * @note The result is rounded upward to the next tick boundary.
340  *
341  * @param[in] secs number of seconds
342  * @return The number of ticks.
343  *
344  * @api
345  */
346 #define OSAL_S2I(secs) \
347  ((sysinterval_t)((uint32_t)(secs) * (uint32_t)OSAL_ST_FREQUENCY))
348 
349 /**
350  * @brief Milliseconds to system ticks.
351  * @details Converts from milliseconds to system ticks number.
352  * @note The result is rounded upward to the next tick boundary.
353  *
354  * @param[in] msecs number of milliseconds
355  * @return The number of ticks.
356  *
357  * @api
358  */
359 #define OSAL_MS2I(msecs) \
360  ((sysinterval_t)((((((uint32_t)(msecs)) * \
361  ((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) / 1000UL) + 1UL))
362 
363 /**
364  * @brief Microseconds to system ticks.
365  * @details Converts from microseconds to system ticks number.
366  * @note The result is rounded upward to the next tick boundary.
367  *
368  * @param[in] usecs number of microseconds
369  * @return The number of ticks.
370  *
371  * @api
372  */
373 #define OSAL_US2I(usecs) \
374  ((sysinterval_t)((((((uint32_t)(usecs)) * \
375  ((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) / 1000000UL) + 1UL))
376 /** @} */
377 
378 /**
379  * @name Time conversion utilities for the realtime counter
380  * @{
381  */
382 /**
383  * @brief Seconds to realtime counter.
384  * @details Converts from seconds to realtime counter cycles.
385  * @note The macro assumes that @p freq >= @p 1.
386  *
387  * @param[in] freq clock frequency, in Hz, of the realtime counter
388  * @param[in] sec number of seconds
389  * @return The number of cycles.
390  *
391  * @api
392  */
393 #define OSAL_S2RTC(freq, sec) ((freq) * (sec))
394 
395 /**
396  * @brief Milliseconds to realtime counter.
397  * @details Converts from milliseconds to realtime counter cycles.
398  * @note The result is rounded upward to the next millisecond boundary.
399  * @note The macro assumes that @p freq >= @p 1000.
400  *
401  * @param[in] freq clock frequency, in Hz, of the realtime counter
402  * @param[in] msec number of milliseconds
403  * @return The number of cycles.
404  *
405  * @api
406  */
407 #define OSAL_MS2RTC(freq, msec) (rtcnt_t)((((freq) + 999UL) / 1000UL) * (msec))
408 
409 /**
410  * @brief Microseconds to realtime counter.
411  * @details Converts from microseconds to realtime counter cycles.
412  * @note The result is rounded upward to the next microsecond boundary.
413  * @note The macro assumes that @p freq >= @p 1000000.
414  *
415  * @param[in] freq clock frequency, in Hz, of the realtime counter
416  * @param[in] usec number of microseconds
417  * @return The number of cycles.
418  *
419  * @api
420  */
421 #define OSAL_US2RTC(freq, usec) (rtcnt_t)((((freq) + 999999UL) / 1000000UL) * (usec))
422 /** @} */
423 
424 /**
425  * @name Sleep macros using absolute time
426  * @{
427  */
428 /**
429  * @brief Delays the invoking thread for the specified number of seconds.
430  * @note The specified time is rounded up to a value allowed by the real
431  * system tick clock.
432  * @note The maximum specifiable value is implementation dependent.
433  *
434  * @param[in] secs time in seconds, must be different from zero
435  *
436  * @api
437  */
438 #define osalThreadSleepSeconds(secs) osalThreadSleep(OSAL_S2I(secs))
439 
440 /**
441  * @brief Delays the invoking thread for the specified number of
442  * milliseconds.
443  * @note The specified time is rounded up to a value allowed by the real
444  * system tick clock.
445  * @note The maximum specifiable value is implementation dependent.
446  *
447  * @param[in] msecs time in milliseconds, must be different from zero
448  *
449  * @api
450  */
451 #define osalThreadSleepMilliseconds(msecs) osalThreadSleep(OSAL_MS2I(msecs))
452 
453 /**
454  * @brief Delays the invoking thread for the specified number of
455  * microseconds.
456  * @note The specified time is rounded up to a value allowed by the real
457  * system tick clock.
458  * @note The maximum specifiable value is implementation dependent.
459  *
460  * @param[in] usecs time in microseconds, must be different from zero
461  *
462  * @api
463  */
464 #define osalThreadSleepMicroseconds(usecs) osalThreadSleep(OSAL_US2I(usecs))
465 /** @} */
466 
467 /*===========================================================================*/
468 /* External declarations. */
469 /*===========================================================================*/
470 
471 extern const char *osal_halt_msg;
472 
473 #ifdef __cplusplus
474 extern "C" {
475 #endif
476  void osalInit(void);
477  void osalSysHalt(const char *reason);
478  void osalSysPolledDelayX(rtcnt_t cycles);
479  void osalOsTimerHandlerI(void);
480  void osalOsRescheduleS(void);
482  void osalThreadSleepS(sysinterval_t time);
483  void osalThreadSleep(sysinterval_t time);
495  void *param);
496  void osalMutexLock(mutex_t *mp);
497  void osalMutexUnlock(mutex_t *mp);
498 #ifdef __cplusplus
499 }
500 #endif
501 
502 /*===========================================================================*/
503 /* Module inline functions. */
504 /*===========================================================================*/
505 
506 /**
507  * @brief Disables interrupts globally.
508  *
509  * @special
510  */
511 static inline void osalSysDisable(void) {
512 
513 }
514 
515 /**
516  * @brief Enables interrupts globally.
517  *
518  * @special
519  */
520 static inline void osalSysEnable(void) {
521 
522 }
523 
524 /**
525  * @brief Enters a critical zone from thread context.
526  * @note This function cannot be used for reentrant critical zones.
527  *
528  * @special
529  */
530 static inline void osalSysLock(void) {
531 
532 }
533 
534 /**
535  * @brief Leaves a critical zone from thread context.
536  * @note This function cannot be used for reentrant critical zones.
537  *
538  * @special
539  */
540 static inline void osalSysUnlock(void) {
541 
542 }
543 
544 /**
545  * @brief Enters a critical zone from ISR context.
546  * @note This function cannot be used for reentrant critical zones.
547  *
548  * @special
549  */
550 static inline void osalSysLockFromISR(void) {
551 
552 }
553 
554 /**
555  * @brief Leaves a critical zone from ISR context.
556  * @note This function cannot be used for reentrant critical zones.
557  *
558  * @special
559  */
560 static inline void osalSysUnlockFromISR(void) {
561 
562 }
563 
564 /**
565  * @brief Returns the execution status and enters a critical zone.
566  * @details This functions enters into a critical zone and can be called
567  * from any context. Because its flexibility it is less efficient
568  * than @p chSysLock() which is preferable when the calling context
569  * is known.
570  * @post The system is in a critical zone.
571  *
572  * @return The previous system status, the encoding of this
573  * status word is architecture-dependent and opaque.
574  *
575  * @xclass
576  */
577 static inline syssts_t osalSysGetStatusAndLockX(void) {
578 
579  return (syssts_t)0;
580 }
581 
582 /**
583  * @brief Restores the specified execution status and leaves a critical zone.
584  * @note A call to @p chSchRescheduleS() is automatically performed
585  * if exiting the critical zone and if not in ISR context.
586  *
587  * @param[in] sts the system status to be restored.
588  *
589  * @xclass
590  */
591 static inline void osalSysRestoreStatusX(syssts_t sts) {
592 
593  (void)sts;
594 }
595 
596 /**
597  * @brief Adds an interval to a system time returning a system time.
598  *
599  * @param[in] systime base system time
600  * @param[in] interval interval to be added
601  * @return The new system time.
602  *
603  * @xclass
604  */
605 static inline systime_t osalTimeAddX(systime_t systime,
606  sysinterval_t interval) {
607 
608  return systime + (systime_t)interval;
609 }
610 
611 /**
612  * @brief Subtracts two system times returning an interval.
613  *
614  * @param[in] start first system time
615  * @param[in] end second system time
616  * @return The interval representing the time difference.
617  *
618  * @xclass
619  */
620 static inline sysinterval_t osalTimeDiffX(systime_t start, systime_t end) {
621 
622  return (sysinterval_t)((systime_t)(end - start));
623 }
624 
625 /**
626  * @brief Checks if the specified time is within the specified time window.
627  * @note When start==end then the function returns always true because the
628  * whole time range is specified.
629  * @note This function can be called from any context.
630  *
631  * @param[in] time the time to be verified
632  * @param[in] start the start of the time window (inclusive)
633  * @param[in] end the end of the time window (non inclusive)
634  * @retval true current time within the specified time window.
635  * @retval false current time not within the specified time window.
636  *
637  * @xclass
638  */
639 static inline bool osalTimeIsInRangeX(systime_t time,
640  systime_t start,
641  systime_t end) {
642 
643  return (bool)((time - start) < (end - start));
644 }
645 
646 /**
647  * @brief Initializes a threads queue object.
648  *
649  * @param[out] tqp pointer to the threads queue object
650  *
651  * @init
652  */
653 static inline void osalThreadQueueObjectInit(threads_queue_t *tqp) {
654 
655  osalDbgCheck(tqp != NULL);
656 }
657 
658 /**
659  * @brief Initializes an event source object.
660  *
661  * @param[out] esp pointer to the event source object
662  *
663  * @init
664  */
665 static inline void osalEventObjectInit(event_source_t *esp) {
666 
667  osalDbgCheck(esp != NULL);
668 
669  esp->flags = (eventflags_t)0;
670  esp->cb = NULL;
671  esp->param = NULL;
672 }
673 
674 /**
675  * @brief Initializes s @p mutex_t object.
676  *
677  * @param[out] mp pointer to the @p mutex_t object
678  *
679  * @init
680  */
681 static inline void osalMutexObjectInit(mutex_t *mp) {
682 
683  osalDbgCheck(mp != NULL);
684 
685  *mp = 0;
686 }
687 
688 #endif /* OSAL_H */
689 
690 /** @} */
static void osalMutexObjectInit(mutex_t *mp)
Initializes s mutex_t object.
Definition: osal.h:681
uint32_t eventflags_t
Type of an event flags mask.
Definition: osal.h:185
msg_t osalThreadSuspendS(thread_reference_t *trp)
Sends the current thread sleeping and sets a reference variable.
Definition: osal.c:185
void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg)
Dequeues and wakes up all threads from the queue.
Definition: osal.c:309
void osalThreadSleep(sysinterval_t time)
Suspends the invoking thread for the specified time.
Definition: osal.c:170
void osalSysHalt(const char *reason)
System halt with error message.
Definition: osal.c:77
static sysinterval_t osalTimeDiffX(systime_t start, systime_t end)
Subtracts two system times returning an interval.
Definition: osal.h:620
Events source object.
Definition: osal.h:212
void osalOsTimerHandlerI(void)
System timer handler.
Definition: osal.c:105
static void osalSysDisable(void)
Disables interrupts globally.
Definition: osal.h:511
static void osalSysLockFromISR(void)
Enters a critical zone from ISR context.
Definition: osal.h:550
void osalMutexLock(mutex_t *mp)
Locks the specified mutex.
Definition: osal.c:384
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
Definition: osal.h:540
void osalOsRescheduleS(void)
Checks if a reschedule is required and performs it.
Definition: osal.c:119
static void osalEventObjectInit(event_source_t *esp)
Initializes an event source object.
Definition: osal.h:665
uint32_t systime_t
Type of system time counter.
Definition: osal.h:165
static syssts_t osalSysGetStatusAndLockX(void)
Returns the execution status and enters a critical zone.
Definition: osal.h:577
void osalSysPolledDelayX(rtcnt_t cycles)
Polled delay.
Definition: osal.c:94
int32_t msg_t
Type of a message.
Definition: osal.h:160
void osalEventBroadcastFlagsI(event_source_t *esp, eventflags_t flags)
Add flags to an event source object.
Definition: osal.c:323
Type of a thread queue.
Definition: osal.h:232
void osalEventBroadcastFlags(event_source_t *esp, eventflags_t flags)
Add flags to an event source object.
Definition: osal.c:341
uint32_t syssts_t
Type of a system status word.
Definition: osal.h:155
static bool osalTimeIsInRangeX(systime_t time, systime_t start, systime_t end)
Checks if the specified time is within the specified time window.
Definition: osal.h:639
void osalThreadSleepS(sysinterval_t time)
Suspends the invoking thread for the specified time.
Definition: osal.c:153
static systime_t osalTimeAddX(systime_t systime, sysinterval_t interval)
Adds an interval to a system time returning a system time.
Definition: osal.h:605
void(* eventcallback_t)(event_source_t *esp)
Type of an event source callback.
Definition: osal.h:202
uint32_t rtcnt_t
Type of realtime counter.
Definition: osal.h:175
#define osalDbgCheck(c)
Function parameters check.
Definition: osal.h:278
void osalEventSetCallback(event_source_t *esp, eventcallback_t cb, void *param)
Event callback setup.
Definition: osal.c:365
static void osalSysUnlockFromISR(void)
Leaves a critical zone from ISR context.
Definition: osal.h:560
volatile eventflags_t flags
Stored event flags.
Definition: osal.h:213
uint32_t sysinterval_t
Type of system time interval.
Definition: osal.h:170
systime_t osalOsGetSystemTimeX(void)
Current system time.
Definition: osal.c:136
void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg)
Dequeues and wakes up one thread from the queue, if any.
Definition: osal.c:294
void osalInit(void)
OSAL module initialization.
Definition: osal.c:63
msg_t osalThreadEnqueueTimeoutS(threads_queue_t *tqp, sysinterval_t timeout)
Enqueues the caller thread.
Definition: osal.c:277
static void osalSysRestoreStatusX(syssts_t sts)
Restores the specified execution status and leaves a critical zone.
Definition: osal.h:591
void * param
User defined field.
Definition: osal.h:215
msg_t osalThreadSuspendTimeoutS(thread_reference_t *trp, sysinterval_t timeout)
Sends the current thread sleeping and sets a reference variable.
Definition: osal.c:211
void * thread_reference_t
Type of a thread reference.
Definition: osal.h:180
void osalThreadResumeS(thread_reference_t *trp, msg_t msg)
Wakes up a thread waiting on a thread reference object.
Definition: osal.c:247
static void osalSysLock(void)
Enters a critical zone from thread context.
Definition: osal.h:530
const char * osal_halt_msg
Pointer to a halt error message.
Definition: osal.c:40
eventcallback_t cb
Event source callback.
Definition: osal.h:214
void osalMutexUnlock(mutex_t *mp)
Unlocks the specified mutex.
Definition: osal.c:404
void osalThreadResumeI(thread_reference_t *trp, msg_t msg)
Wakes up a thread waiting on a thread reference object.
Definition: osal.c:230
uint32_t mutex_t
Type of a mutex.
Definition: osal.h:223
static void osalSysEnable(void)
Enables interrupts globally.
Definition: osal.h:520
static void osalThreadQueueObjectInit(threads_queue_t *tqp)
Initializes a threads queue object.
Definition: osal.h:653