R_RTOS  0.1
DistributedRealTimeOperatingSystemfortheARMCortexMArchitecture

Event services for sending/receiving events in tasks. More...

Data Structures

struct  evtQueue
 A simple singly linked list serving as one event queue. More...
 
struct  evtStruc
 Struct for Event maintenance. More...
 

Macros

#define CREATE_EVT_MSK(evtNr)    (EVTQSlots)((EVTQSlots)0x1u << evtNr)
 Makro that can be used to create an event mask for a group of event flags. More...
 
#define AMOUNT_OF_EVTS   ((uint8_t)0x4u)
 Defines the maximum amount of different events in the system. More...
 
#define EVT_QUEUE_SIZE   ((uint8_t)0x4u)
 Defines the maximum size of the event queues. More...
 
#define MEM_OBJECTS_EVT   ((uint8_t)0x4u)
 Number of SyncEle that will be allocated by the Event mechanism in its memory pool. More...
 

Typedefs

typedef struct evtQueue EVTQueue
 evtQueue
 
typedef uint8_t EvtNr
 Number of an event.
 
typedef uint32_t EvtMsk
 Used for event masks.
 
typedef uint32_t EVTQSlots
 Used as a bitarry for slots of an event queue.
 
typedef struct evtStruc Evt
 Struct for Event maintenance. More...
 

Functions

void evt_INIT (void)
 Initialize the event service. More...
 
RetCode evt_WaitForEvts (PTskTCB const tsk, EVTQSlots evtMask, const SysTicks maxWaitTime)
 Sets the task up to wait for the events specified by evtMask. More...
 
RetCode evt_SendEvt (const EvtNr evtNr)
 Sends the event specified by evtNr to all entities in the corresponding event queue. More...
 
RetCode evt_GiveUpOnEvts (PTskTCB const tsk)
 Removes the specified task from all event queues it was queued into. More...
 

Detailed Description

Event services for sending/receiving events in tasks.

Macro Definition Documentation

#define AMOUNT_OF_EVTS   ((uint8_t)0x4u)

Defines the maximum amount of different events in the system.

Note
User Defined
#define CREATE_EVT_MSK (   evtNr)    (EVTQSlots)((EVTQSlots)0x1u << evtNr)

Makro that can be used to create an event mask for a group of event flags.

Multiple events can be set using an ORed combination of this makro.

#define EVT_QUEUE_SIZE   ((uint8_t)0x4u)

Defines the maximum size of the event queues.

Note
Multiples of four are recommended.
User Defined
#define MEM_OBJECTS_EVT   ((uint8_t)0x4u)

Number of SyncEle that will be allocated by the Event mechanism in its memory pool.

Note
User Defined

Typedef Documentation

typedef struct evtStruc Evt

Struct for Event maintenance.

Contains information about the event.

Note
The design limits the number of entities, which can be notified by the event, to 32.

Function Documentation

RetCode evt_GiveUpOnEvts ( PTskTCB const  tsk)

Removes the specified task from all event queues it was queued into.

Parameters
[in]tskPointer to the TskTCB of the task giving up on all events.
Returns
RetCode Return the success of the operation

Calling this function removes the specified task from all event queues and updates the rest of the queues accordingly.

Note
Is called automatically if a task is destroyed, but has not yet received events it was waiting on.
void evt_INIT ( void  )

Initialize the event service.

Initialized the event queues.

Warning
Before using the event service it has to be initialized!
RetCode evt_SendEvt ( const EvtNr  evtNr)

Sends the event specified by evtNr to all entities in the corresponding event queue.

Parameters
[in]evtNrNumber of the event to be sent.
Returns
RetCode Return the success of the operation

The event queue related to the evt is evaluated and all entities are updated.

RetCode evt_WaitForEvts ( PTskTCB const  tsk,
EVTQSlots  evtMask,
const SysTicks  maxWaitTime 
)

Sets the task up to wait for the events specified by evtMask.

Parameters
[in]tskTask, which will then be waiting on the events specified by evtMask
[in]evtMaskEvent mask specifying all events to wait on
[in]maxWaitTimeMaximum time to block a task in SysTicks
Returns
Return the success of the operation

The task will be put into a waiting state until all of the specified events occured.