event.h File Reference

Event API. More...

Detailed Description

#include <stdint.h>
#include "irq.h"
#include "thread_flags.h"
#include "clist.h"
+ Include dependency graph for event.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  event
 event structure More...
 
struct  event_queue_t
 event queue structure More...
 

Macros

#define THREAD_FLAG_EVENT   (0x1)
 Thread flag use to notify available events in an event queue.
 
#define EVENT_QUEUE_INIT   { .waiter = (thread_t *)sched_active_thread }
 event_queue_t static initializer
 
#define EVENT_QUEUE_INIT_DETACHED   { 0 }
 static initializer for detached event queues
 

Typedefs

typedef struct event event_t
 event structure forward declaration
 
typedef void(* event_handler_t) (event_t *)
 event handler type definition
 

Functions

void event_queue_init (event_queue_t *queue)
 Initialize an event queue. More...
 
void event_queue_init_detached (event_queue_t *queue)
 Initialize an event queue not binding it to a thread. More...
 
void event_queue_claim (event_queue_t *queue)
 Bind an event queue to the calling thread. More...
 
void event_post (event_queue_t *queue, event_t *event)
 Queue an event. More...
 
void event_cancel (event_queue_t *queue, event_t *event)
 Cancel a queued event. More...
 
event_tevent_get (event_queue_t *queue)
 Get next event from event queue, non-blocking. More...
 
event_tevent_wait (event_queue_t *queue)
 Get next event from event queue, blocking. More...
 
event_tevent_wait_timeout (event_queue_t *queue, uint32_t timeout)
 Get next event from event queue, blocking until timeout expires. More...
 
void event_loop (event_queue_t *queue)
 Simple event loop. More...