VSF Documented
vsf_eda_slist_queue.h File Reference

Go to the source code of this file.

Data Structures

class  vsf_eda_slist_queue_t
 An vsf_eda_queue_t backend based on a singly-linked list. More...
 

Macros

#define vsf_msg_queue_t   vsf_eda_slist_queue_t
 Alias of vsf_eda_slist_queue_t for message queue usage.
 
#define vsf_eda_msg_queue_init(__queue, __max)
 Initialize an EDA singly-linked list message queue.
 
#define vsf_eda_msg_queue_send(__queue, __node, __timeout)
 Send a node to the message queue, pending while the queue is full.
 
#define vsf_eda_msg_queue_send_get_reason(__queue, __evt, __node)
 Retrieve the result of a message queue send from the wakeup event.
 
#define vsf_eda_msg_queue_recv(__queue, __node, __timeout)
 Receive a node from the message queue, pending while the queue is empty.
 
#define vsf_eda_msg_queue_recv_get_reason(__queue, __evt, __node)
 Retrieve the result of a message queue receive from the wakeup event.
 

Functions

vsf_err_t vsf_eda_slist_queue_init (vsf_eda_slist_queue_t *this_ptr, uint_fast16_t max)
 Initialize an EDA singly-linked list queue.
 

Macro Definition Documentation

◆ vsf_msg_queue_t

#define vsf_msg_queue_t   vsf_eda_slist_queue_t

Alias of vsf_eda_slist_queue_t for message queue usage.

◆ vsf_eda_msg_queue_init

#define vsf_eda_msg_queue_init ( __queue,
__max )
Value:
vsf_eda_slist_queue_init((__queue), (__max))
vsf_err_t vsf_eda_slist_queue_init(vsf_eda_slist_queue_t *this_ptr, uint_fast16_t max)
Initialize an EDA singly-linked list queue.
Definition vsf_eda_slist_queue.c:67

Initialize an EDA singly-linked list message queue.

Parameters
[in]queuea pointer to the message queue instance vsf_msg_queue_t
[in]maxmaximum number of nodes the queue can hold
Returns
vsf_err_t: always VSF_ERR_NONE (invalid parameters trigger an assertion)
Note
Must be called in task (or initialization) context, NOT in interrupt context.

◆ vsf_eda_msg_queue_send

#define vsf_eda_msg_queue_send ( __queue,
__node,
__timeout )
Value:
vsf_eda_queue_send((vsf_eda_queue_t *)(__queue), (__node), (__timeout))
OS-aware queue; send pends while full, recv pends while empty; backend ops are supplied by the user (...
Definition vsf_eda.h:2193
vsf_err_t vsf_eda_queue_send(vsf_eda_queue_t *pthis, void *node, vsf_timeout_tick_t timeout)
Send a node to a queue, pending while the queue is full.

Send a node to the message queue, pending while the queue is full.

Parameters
[in]queuea pointer to the message queue instance vsf_msg_queue_t
[in]nodethe node to send
[in]timeouttimeout in ticks; negative waits forever, 0 is a non-blocking try, a positive value waits up to the given ticks (requires timer support)
Returns
vsf_err_t: VSF_ERR_NONE if the node is enqueued immediately; VSF_ERR_NOT_READY if the queue is full and the caller pends or the try failed
Note
If VSF_ERR_NOT_READY is returned with a non-zero timeout, the caller is woken later with VSF_EVT_SYNC, VSF_EVT_TIMER (timeout) or VSF_EVT_SYNC_CANCEL; call vsf_eda_msg_queue_send_get_reason() to retrieve the result.
Must be called in an eda task context (i.e. inside an event handler); must NOT be called in interrupt context.

◆ vsf_eda_msg_queue_send_get_reason

#define vsf_eda_msg_queue_send_get_reason ( __queue,
__evt,
__node )
Value:
vsf_eda_queue_send_get_reason((vsf_eda_queue_t *)(__queue), (__evt), (__node))
vsf_sync_reason_t vsf_eda_queue_send_get_reason(vsf_eda_queue_t *pthis, vsf_evt_t evt, void *node)
Retrieve the result of a queue send from the wakeup event, retrying the enqueue if the resource is ob...

Retrieve the result of a message queue send from the wakeup event.

Parameters
[in]queuea pointer to the message queue instance vsf_msg_queue_t
[in]evtthe wakeup event (VSF_EVT_SYNC, VSF_EVT_TIMER or VSF_EVT_SYNC_CANCEL)
[in]nodethe node that was being sent
Returns
vsf_sync_reason_t: VSF_SYNC_GET if the node is enqueued, VSF_SYNC_TIMEOUT on timeout, VSF_SYNC_CANCEL if cancelled, VSF_SYNC_PENDING if the wait should continue
Note
Must be called in an eda task context (i.e. inside an event handler); must NOT be called in interrupt context.

◆ vsf_eda_msg_queue_recv

#define vsf_eda_msg_queue_recv ( __queue,
__node,
__timeout )
Value:
vsf_eda_queue_recv((vsf_eda_queue_t *)(__queue), (void **)(__node), (__timeout))
vsf_err_t vsf_eda_queue_recv(vsf_eda_queue_t *pthis, void **node, vsf_timeout_tick_t timeout)
Receive a node from a queue, pending while the queue is empty.

Receive a node from the message queue, pending while the queue is empty.

Parameters
[in]queuea pointer to the message queue instance vsf_msg_queue_t
[out]nodea pointer to store the received node
[in]timeouttimeout in ticks; negative waits forever, 0 is a non-blocking try, a positive value waits up to the given ticks (requires timer support)
Returns
vsf_err_t: VSF_ERR_NONE if a node is dequeued immediately; VSF_ERR_NOT_READY if the queue is empty and the caller pends or the try failed
Note
If VSF_ERR_NOT_READY is returned with a non-zero timeout, the caller is woken later with VSF_EVT_SYNC, VSF_EVT_TIMER (timeout) or VSF_EVT_SYNC_CANCEL; call vsf_eda_msg_queue_recv_get_reason() to retrieve the result.
Must be called in an eda task context (i.e. inside an event handler); must NOT be called in interrupt context.

◆ vsf_eda_msg_queue_recv_get_reason

#define vsf_eda_msg_queue_recv_get_reason ( __queue,
__evt,
__node )
Value:
vsf_eda_queue_recv_get_reason((vsf_eda_queue_t *)(__queue), (__evt), (void **)(__node))
vsf_sync_reason_t vsf_eda_queue_recv_get_reason(vsf_eda_queue_t *pthis, vsf_evt_t evt, void **node)
Retrieve the result of a queue receive from the wakeup event, retrying the dequeue if the resource is...

Retrieve the result of a message queue receive from the wakeup event.

Parameters
[in]queuea pointer to the message queue instance vsf_msg_queue_t
[in]evtthe wakeup event (VSF_EVT_SYNC, VSF_EVT_TIMER or VSF_EVT_SYNC_CANCEL)
[out]nodea pointer to store the received node
Returns
vsf_sync_reason_t: VSF_SYNC_GET if a node is dequeued, VSF_SYNC_TIMEOUT on timeout, VSF_SYNC_CANCEL if cancelled, VSF_SYNC_PENDING if the wait should continue
Note
Must be called in an eda task context (i.e. inside an event handler); must NOT be called in interrupt context.

Function Documentation

◆ vsf_eda_slist_queue_init()

vsf_err_t vsf_eda_slist_queue_init ( vsf_eda_slist_queue_t * this_ptr,
uint_fast16_t max )
extern

Initialize an EDA singly-linked list queue.

Parameters
[in]this_ptra pointer to structure vsf_eda_slist_queue_t
[in]maxmaximum number of nodes the queue can hold
Returns
vsf_err_t: always VSF_ERR_NONE (invalid parameters trigger an assertion)
Note
Must be called in task (or initialization) context, NOT in interrupt context.
Generated from commit: vsfteam/vsf@a5104db