# KE_EVT
[KERNEL]

Event scheduling module. More...

Collaboration diagram for KE_EVT:

## Data Structures
struct | ke_evt_tag
| Structure defining an event callback. More...
## Typedefs
typedef void(* | evt_ptr_t )(int)
| Format of an event handler function.
## Functions
void | ke_evt_set (evt_field_t const event)
| Set events.
void | ke_evt_clear (evt_field_t const event)
| Clear events.
void | ke_evt_schedule (void)
| Event scheduler entry point.
void | ke_init (void)
| This function performs all the initializations of the kernel.
void | ke_flush (void)
| This function flushes all messages, timers and events currently pending in the kernel.
__INLINE evt_field_t | ke_evt_get (void)
| Retrieves the pending events bit field.
## Variables
static struct ke_evt_tag | ke_evt_hdlr [32]
| Table of event handlers.
## Event definitions
enum | { KE_EVT_RESET = 0, KE_EVT_GP_DMA_UL, KE_EVT_MM_TIMER, KE_EVT_KE_TIMER, KE_EVT_MACIF_MSG, KE_EVT_KE_MESSAGE, KE_EVT_HW_IDLE, KE_EVT_PRIMARY_TBTT, KE_EVT_SECONDARY_TBTT, KE_EVT_RXUPLOADED, KE_EVT_RXUREADY, KE_EVT_RXREADY, KE_EVT_TXFRAME_CFM, KE_EVT_TXCFM_BCN, KE_EVT_TXCFM_AC3, KE_EVT_TXCFM_AC2, KE_EVT_TXCFM_AC1, KE_EVT_TXCFM_AC0, KE_EVT_MACIF_TXDESC_BCN, KE_EVT_MACIF_TXDESC_AC3, KE_EVT_MACIF_TXDESC_AC2, KE_EVT_MACIF_TXDESC_AC1, KE_EVT_MACIF_TXDESC_AC0, KE_EVT_GP_DMA_DL, KE_EVT_MAX }
| Offset of the different events in the event bit field. More...
#define | KE_EVT_RESET_BIT CO_BIT(31 - KE_EVT_RESET)
| Reset event.
#define | KE_EVT_MM_TIMER_BIT CO_BIT(31 - KE_EVT_MM_TIMER)
| MM timer event.
#define | KE_EVT_KE_TIMER_BIT CO_BIT(31 - KE_EVT_KE_TIMER)
| Kernel timer event.
#define | KE_EVT_KE_MESSAGE_BIT CO_BIT(31 - KE_EVT_KE_MESSAGE)
| Kernel message event.
#define | KE_EVT_HW_IDLE_BIT CO_BIT(31 - KE_EVT_HW_IDLE)
| IDLE state event.
#define | KE_EVT_PRIMARY_TBTT_BIT CO_BIT(31 - KE_EVT_PRIMARY_TBTT)
| Primary TBTT event.
#define | KE_EVT_SECONDARY_TBTT_BIT CO_BIT(31 - KE_EVT_SECONDARY_TBTT)
| Secondary TBTT event.
#define | KE_EVT_RXUREADY_BIT CO_BIT(31 - KE_EVT_RXUREADY)
| RXU ready event.
#define | KE_EVT_RXREADY_BIT CO_BIT(31 - KE_EVT_RXREADY)
| RX ready event.
#define | KE_EVT_RXUPLOADED_BIT CO_BIT(31 - KE_EVT_RXUPLOADED)
| RX DMA event.
#define | KE_EVT_TXFRAME_CFM_BIT CO_BIT(31 - KE_EVT_TXFRAME_CFM)
| Internal frame confirmation event.
#define | KE_EVT_MACIF_TXDESC_BCN_BIT CO_BIT(31 - KE_EVT_MACIF_TXDESC_BCN)
| IPC tx data event.
#define | KE_EVT_MACIF_TXDESC_AC3_BIT CO_BIT(31 - KE_EVT_MACIF_TXDESC_AC3)
| IPC tx data event.
#define | KE_EVT_MACIF_TXDESC_AC2_BIT CO_BIT(31 - KE_EVT_MACIF_TXDESC_AC2)
| IPC tx data event.
#define | KE_EVT_MACIF_TXDESC_AC1_BIT CO_BIT(31 - KE_EVT_MACIF_TXDESC_AC1)
| IPC tx data event.
#define | KE_EVT_MACIF_TXDESC_AC0_BIT CO_BIT(31 - KE_EVT_MACIF_TXDESC_AC0)
| IPC tx data event.
#define | KE_EVT_MACIF_MSG_BIT CO_BIT(31 - KE_EVT_MACIF_MSG)
| Application message event.
#define | KE_EVT_TXCFM_BCN_BIT CO_BIT(31 - KE_EVT_TXCFM_BCN)
| Tx confirmation event.
#define | KE_EVT_TXCFM_AC0_BIT CO_BIT(31 - KE_EVT_TXCFM_AC0)
| Tx confirmation event.
#define | KE_EVT_TXCFM_AC1_BIT CO_BIT(31 - KE_EVT_TXCFM_AC1)
| Tx confirmation event.
#define | KE_EVT_TXCFM_AC2_BIT CO_BIT(31 - KE_EVT_TXCFM_AC2)
| Tx confirmation event.
#define | KE_EVT_TXCFM_AC3_BIT CO_BIT(31 - KE_EVT_TXCFM_AC3)
| Tx confirmation event.
#define | KE_EVT_GP_DMA_DL_BIT CO_BIT(31 - KE_EVT_GP_DMA_DL)
| General purpose DMA DL event.
#define | KE_EVT_GP_DMA_UL_BIT CO_BIT(31 - KE_EVT_GP_DMA_UL)
| General purpose DMA UL event.
#define | KE_EVT_TXCFM_MASK
| Mask of the TX confirmation events.

## Detailed Description

Event scheduling module.

The KE_EVT module implements event scheduling functions. It can be used to implement deferred actions:

## Define Documentation

#define KE_EVT_TXCFM_MASK

Value:

    ( KE_EVT_TXCFM_AC0_BIT  \
                                | KE_EVT_TXCFM_AC1_BIT  \
                                | KE_EVT_TXCFM_AC2_BIT  \
                                | KE_EVT_TXCFM_AC3_BIT  \
                                | KE_EVT_TXCFM_BCN_BIT)

Mask of the TX confirmation events.

Definition at line 155 of file ke_event.h.

## Enumeration Type Documentation

anonymous enum

Offset of the different events in the event bit field.

0 is the highest priority and 31 is the lowest. THESE ENUMS MUST NOT BE USED WITH ke_evt_xxx()! USE xxx_BIT BLOW.

Definition at line 63 of file ke_event.h.

## Function Documentation

void ke_evt_clear | ( | evt_field_t const | event | ) |

Clear events.

This primitive clears one or more events in the event field variable.

Parameters:

  `[in]` | event | Events that have to be cleared (bit field).

Referenced by txl_cfm_evt(), and txl_frame_evt().

void ke_evt_schedule | ( | void |  | ) |

Event scheduler entry point.

This primitive has to be called in the background loop in order to execute the event handlers for the event that are set.

void ke_evt_set | ( | evt_field_t const | event | ) |

Set events.

This primitive sets one or more events in the event field variable. It will trigger the call to the corresponding event handlers in the next scheduling call.

Parameters:

  `[in]` | event | Events that have to be set (bit field).

Referenced by hal_machw_abs_timer_handler(), hal_machw_idle_irq_handler(), ipc_emb_enable_users(), ke_task_saved_update(), rxl_mpdu_isr(), txl_cfm_push(), txl_frame_cfm(), and txl_frame_exchange_done().

void ke_init | ( | void |  | ) |

This function performs all the initializations of the kernel.

It initializes first the heap, then the message queues and the events. Then if required it initializes the trace.