diff options
Diffstat (limited to 'os/kernel/include/events.h')
-rw-r--r-- | os/kernel/include/events.h | 74 |
1 files changed, 42 insertions, 32 deletions
diff --git a/os/kernel/include/events.h b/os/kernel/include/events.h index 0cc4032b8..b333e07c5 100644 --- a/os/kernel/include/events.h +++ b/os/kernel/include/events.h @@ -18,8 +18,9 @@ */
/**
- * @file events.h
- * @brief Events macros and structures.
+ * @file events.h
+ * @brief Events macros and structures.
+ *
* @addtogroup events
* @{
*/
@@ -32,27 +33,30 @@ typedef struct EventListener EventListener;
/**
- * @brief Event Listener structure.
+ * @brief Event Listener structure.
*/
struct EventListener {
- EventListener *el_next; /**< Next Event Listener registered on
- the Event Source.*/
- Thread *el_listener; /**< Thread interested in the Event
- Source.*/
- eventmask_t el_mask; /**< Event flags mask associated by the
- thread to the Event Source.*/
+ EventListener *el_next; /**< @brief Next Event Listener
+ registered on the Event
+ Source. */
+ Thread *el_listener; /**< @brief Thread interested in the
+ Event Source. */
+ eventmask_t el_mask; /**< @brief Event flags mask associated
+ by the thread to the Event
+ Source. */
};
/**
- * @brief Event Source structure.
+ * @brief Event Source structure.
*/
typedef struct EventSource {
- EventListener *es_next; /**< First Event Listener registered on
- the Event Source.*/
+ EventListener *es_next; /**< @brief First Event Listener
+ registered on the Event
+ Source. */
} EventSource;
/**
- * @brief Data part of a static event source initializer.
+ * @brief Data part of a static event source initializer.
* @details This macro should be used when statically initializing an event
* source that is part of a bigger structure.
* @param name the name of the event source variable
@@ -60,10 +64,11 @@ typedef struct EventSource { #define _EVENTSOURCE_DATA(name) {(void *)(&name)}
/**
- * @brief Static event source initializer.
+ * @brief Static event source initializer.
* @details Statically initialized event sources require no explicit
* initialization using @p chEvtInit().
- * @param name the name of the event source variable
+ *
+ * @param name the name of the event source variable
*/
#define EVENTSOURCE_DECL(name) EventSource name = _EVENTSOURCE_DATA(name)
@@ -74,36 +79,41 @@ typedef struct EventSource { #define EVENT_MASK(eid) (1 << (eid))
/**
- * Registers an Event Listener on an Event Source.
- * @param esp pointer to the @p EventSource structure
- * @param elp pointer to the @p EventListener structure
- * @param eid numeric identifier assigned to the Event Listener. The identifier
- * is used as index for the event callback function.
- * The value must range between zero and the size, in bit, of the
- * @p eventid_t type minus one.
- * @note Multiple Event Listeners can use the same event identifier, the
- * listener will share the callback function.
+ * @brief Registers an Event Listener on an Event Source.
+ * @note Multiple Event Listeners can use the same event identifier, the
+ * listener will share the callback function.
+ *
+ * @param[in] esp pointer to the @p EventSource structure
+ * @param[out] elp pointer to the @p EventListener structure
+ * @param[in] eid numeric identifier assigned to the Event Listener. The
+ * identifier is used as index for the event callback
+ * function.
+ * The value must range between zero and the size, in bit,
+ * of the @p eventid_t type minus one.
*/
#define chEvtRegister(esp, elp, eid) chEvtRegisterMask(esp, elp, EVENT_MASK(eid))
/**
- * Initializes an Event Source.
- * @param esp pointer to the @p EventSource structure
- * @note Can be called with interrupts disabled or enabled.
+ * @brief Initializes an Event Source.
+ * @note Can be used with interrupts disabled or enabled.
+ *
+ * @param[in] esp pointer to the @p EventSource structure
*/
#define chEvtInit(esp) \
((esp)->es_next = (EventListener *)(void *)(esp))
/**
- * Verifies if there is at least one @p EventListener registered on the
- * @p EventSource.
- * @param esp pointer to the @p EventSource structure
- * @note Can be called with interrupts disabled or enabled.
+ * @brief Verifies if there is at least one @p EventListener registered.
+ * @note Can be called with interrupts disabled or enabled.
+ *
+ * @param[in] esp pointer to the @p EventSource structure
*/
#define chEvtIsListening(esp) \
((void *)(esp) != (void *)(esp)->es_next)
-/** Event Handler callback function.*/
+/**
+ * @brief Event Handler callback function.
+ */
typedef void (*evhandler_t)(eventid_t);
#ifdef __cplusplus
|