Go to the source code of this file.
|
| #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.
|
| |
◆ vsf_msg_queue_t
◆ vsf_eda_msg_queue_init
| #define vsf_eda_msg_queue_init |
( |
| __queue, |
|
|
| __max ) |
Value:
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] | queue | a pointer to the message queue instance vsf_msg_queue_t |
| [in] | max | maximum 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:
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] | queue | a pointer to the message queue instance vsf_msg_queue_t |
| [in] | node | the node to send |
| [in] | timeout | timeout 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_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] | queue | a pointer to the message queue instance vsf_msg_queue_t |
| [in] | evt | the wakeup event (VSF_EVT_SYNC, VSF_EVT_TIMER or VSF_EVT_SYNC_CANCEL) |
| [in] | node | the 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_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] | queue | a pointer to the message queue instance vsf_msg_queue_t |
| [out] | node | a pointer to store the received node |
| [in] | timeout | timeout 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_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] | queue | a pointer to the message queue instance vsf_msg_queue_t |
| [in] | evt | the wakeup event (VSF_EVT_SYNC, VSF_EVT_TIMER or VSF_EVT_SYNC_CANCEL) |
| [out] | node | a 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.
◆ vsf_eda_slist_queue_init()
Initialize an EDA singly-linked list queue.
- Parameters
-
| [in] | this_ptr | a pointer to structure vsf_eda_slist_queue_t |
| [in] | max | maximum 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.