VSF Documented
vsf_evtq.h File Reference
#include "kernel/vsf_kernel_cfg.h"
#include "./vsf_eda.h"

Go to the source code of this file.

Data Structures

struct  vsf_evtq_ctx_t
 
struct  vsf_evtq_t
 
struct  vsf_evt_node_t
 

Typedefs

typedef struct vsf_evtq_ctx_t vsf_evtq_ctx_t
 
typedef struct vsf_evt_node_t vsf_evt_node_t
 
typedef struct vsf_evtq_t vsf_evtq_t
 

Functions

vsf_err_t vsf_evtq_init (vsf_evtq_t *this_ptr)
 Initialize an event queue.
 
vsf_err_t vsf_evtq_post_evt_msg (vsf_eda_t *eda, vsf_evt_t evt, void *msg)
 Post an event with a message to the event queue of the target eda.
 
bool vsf_evtq_is_empty (vsf_evtq_t *this_ptr)
 Check whether an event queue is empty.
 
vsf_err_t vsf_evtq_poll (vsf_evtq_t *this_ptr)
 Poll an event queue and dispatch the pending events to their edas.
 
void vsf_evtq_clean_evt (vsf_evt_t evt)
 Clean the pending event(s) posted to the current eda.
 
void vsf_evtq_on_eda_init (vsf_eda_t *eda)
 Event queue hook called when an eda is initialized.
 
void vsf_evtq_on_eda_fini (vsf_eda_t *eda)
 Event queue hook called when an eda is finalized.
 
vsf_err_t vsf_evtq_post_evt_ex (vsf_eda_t *eda, vsf_evt_t evt, bool force)
 Post an event to the event queue of the target eda, with force control.
 
vsf_err_t vsf_evtq_post_evt (vsf_eda_t *eda, vsf_evt_t evt)
 Post an event to the event queue of the target eda.
 
vsf_err_t vsf_evtq_post_msg (vsf_eda_t *eda, void *msg)
 Post a message to the event queue of the target eda (event VSF_EVT_MESSAGE)
 

Typedef Documentation

◆ vsf_evtq_ctx_t

typedef struct vsf_evtq_ctx_t vsf_evtq_ctx_t

◆ vsf_evt_node_t

typedef struct vsf_evt_node_t vsf_evt_node_t

◆ vsf_evtq_t

typedef struct vsf_evtq_t vsf_evtq_t

Function Documentation

◆ vsf_evtq_init()

vsf_err_t vsf_evtq_init ( vsf_evtq_t * this_ptr)
extern

Initialize an event queue.

Parameters
[in]this_ptra pointer to structure vsf_evtq_t
Returns
vsf_err_t: always VSF_ERR_NONE
Note
Kernel-internal API, called during kernel startup; applications do not call it directly.

◆ vsf_evtq_post_evt_msg()

vsf_err_t vsf_evtq_post_evt_msg ( vsf_eda_t * eda,
vsf_evt_t evt,
void * msg )
extern

Post an event with a message to the event queue of the target eda.

Parameters
[in]edaa pointer to the target vsf_eda_t
[in]evtthe event to post
[in]msgthe message pointer carried with the event
Returns
vsf_err_t: VSF_ERR_NONE if posted successfully; VSF_ERR_FAIL if the eda is limited and already has a pending event; VSF_ERR_NOT_ENOUGH_RESOURCES if the event queue is full
Note
Can be called in task or interrupt context.

◆ vsf_evtq_is_empty()

bool vsf_evtq_is_empty ( vsf_evtq_t * this_ptr)
extern

Check whether an event queue is empty.

Parameters
[in]this_ptra pointer to structure vsf_evtq_t
Returns
bool: true if the event queue is empty, false otherwise
Note
Kernel-internal API used by the kernel event queues; applications normally use vsf_eda_post_evt()/vsf_eda_post_msg() instead.

◆ vsf_evtq_poll()

vsf_err_t vsf_evtq_poll ( vsf_evtq_t * this_ptr)
extern

Poll an event queue and dispatch the pending events to their edas.

Parameters
[in]this_ptra pointer to structure vsf_evtq_t
Returns
vsf_err_t: VSF_ERR_NONE
Note
Kernel-internal API used in event-queue (SWI) context; applications normally use vsf_eda_post_evt()/vsf_eda_post_msg() instead.

◆ vsf_evtq_clean_evt()

void vsf_evtq_clean_evt ( vsf_evt_t evt)
extern

Clean the pending event(s) posted to the current eda.

Parameters
[in]evtthe event to clean; VSF_EVT_NONE cleans all pending events of the current eda
Returns
none
Note
Kernel-internal API, called in the current eda task context; applications normally use vsf_eda_post_evt()/vsf_eda_post_msg() instead.

◆ vsf_evtq_on_eda_init()

void vsf_evtq_on_eda_init ( vsf_eda_t * eda)
extern

Event queue hook called when an eda is initialized.

Parameters
[in]edaa pointer to the vsf_eda_t being initialized
Returns
none
Note
Kernel-internal hook, invoked by the kernel in task context when an eda is initialized; applications do not call it directly.

◆ vsf_evtq_on_eda_fini()

void vsf_evtq_on_eda_fini ( vsf_eda_t * eda)
extern

Event queue hook called when an eda is finalized.

Parameters
[in]edaa pointer to the vsf_eda_t being finalized
Returns
none
Note
Kernel-internal hook, invoked by the kernel in task context when an eda is terminated; applications do not call it directly.

◆ vsf_evtq_post_evt_ex()

vsf_err_t vsf_evtq_post_evt_ex ( vsf_eda_t * eda,
vsf_evt_t evt,
bool force )
extern

Post an event to the event queue of the target eda, with force control.

Parameters
[in]edaa pointer to the target vsf_eda_t
[in]evtthe event to post
[in]forcetrue to post even if the eda is limited and already has a pending event
Returns
vsf_err_t: VSF_ERR_NONE if posted successfully; VSF_ERR_FAIL if the eda is limited and already has a pending event while force is false; VSF_ERR_NOT_ENOUGH_RESOURCES if the event queue is full
Note
Can be called in task or interrupt context.

◆ vsf_evtq_post_evt()

vsf_err_t vsf_evtq_post_evt ( vsf_eda_t * eda,
vsf_evt_t evt )
extern

Post an event to the event queue of the target eda.

Parameters
[in]edaa pointer to the target vsf_eda_t
[in]evtthe event to post
Returns
vsf_err_t: VSF_ERR_NONE if posted successfully; VSF_ERR_FAIL if the eda is limited and already has a pending event; VSF_ERR_NOT_ENOUGH_RESOURCES if the event queue is full
Note
Can be called in task or interrupt context.

◆ vsf_evtq_post_msg()

vsf_err_t vsf_evtq_post_msg ( vsf_eda_t * eda,
void * msg )
extern

Post a message to the event queue of the target eda (event VSF_EVT_MESSAGE)

Parameters
[in]edaa pointer to the target vsf_eda_t
[in]msgthe message pointer to post
Returns
vsf_err_t: VSF_ERR_NONE if posted successfully; VSF_ERR_FAIL if the eda is limited and already has a pending event; VSF_ERR_NOT_ENOUGH_RESOURCES if the event queue is full
Note
Can be called in task or interrupt context.
Generated from commit: vsfteam/vsf@a5104db