|
QP/C
|
platform-independent event queue interface. More...
Go to the source code of this file.
Data Structures | |
| struct | QEQueue |
| Native QF Event Queue. More... | |
Defines | |
| #define | QF_EQUEUE_CTR_SIZE 1 |
| The size (in bytes) of the ring-buffer counters used in the native QF event queue implementation. Valid values: 1, 2, or 4; default 1. | |
| #define | QEQueue_getNFree(me_) ((me_)->nFree) |
| "raw" thread-safe QF event queue operation for obtaining the number of free entries still available in the queue. | |
Typedefs | |
| typedef uint8_t | QEQueueCtr |
| The data type to store the ring-buffer counters based on the macro QF_EQUEUE_CTR_SIZE. | |
Functions | |
| void | QEQueue_init (QEQueue *me, QEvent const *qSto[], QEQueueCtr qLen) |
| Initializes the native QF event queue. | |
| void | QEQueue_postFIFO (QEQueue *me, QEvent const *e) |
| "raw" thread-safe QF event queue implementation for the First-In-First-Out (FIFO) event posting. You can call this function from any task context or ISR context. Please note that this function uses internally a critical section. | |
| void | QEQueue_postLIFO (QEQueue *me, QEvent const *e) |
| "raw" thread-safe QF event queue implementation for the Last-In-First-Out (LIFO) event posting. | |
| QEvent const * | QEQueue_get (QEQueue *me) |
| "raw" thread-safe QF event queue implementation for the event get operation. | |
platform-independent event queue interface.
This header file must be included in all QF ports that use native QF event queue implementation. Also, this file is needed when the "raw" thread-safe queues are used for communication between active objects and non-framework entities, such as ISRs, device drivers, or legacy code.
Definition in file qequeue.h.
| #define QEQueue_getNFree | ( | me_ | ) | ((me_)->nFree) |
"raw" thread-safe QF event queue operation for obtaining the number of free entries still available in the queue.
| #define QF_EQUEUE_CTR_SIZE 1 |
The size (in bytes) of the ring-buffer counters used in the native QF event queue implementation. Valid values: 1, 2, or 4; default 1.
This macro can be defined in the QF port file (qf_port.h) to configure the QEQueueCtr type. Here the macro is not defined so the default of 1 byte is chosen.
| typedef uint8_t QEQueueCtr |
The data type to store the ring-buffer counters based on the macro QF_EQUEUE_CTR_SIZE.
The dynamic range of this data type determines the maximum length of the ring buffer managed by the native QF event queue.
| QEvent const* QEQueue_get | ( | QEQueue * | me | ) |
"raw" thread-safe QF event queue implementation for the event get operation.
If the queue has one or more events, the function returns the event at the front of the queue, otherwise it returns NULL. You can call this function from any task context or ISR context. Please note that this function uses internally a critical section.
Definition at line 41 of file qeq_get.c.
References QEQueue::end, QEQueue::frontEvt, QEQueue::nFree, QF_EVT_POOL_ID_, QF_EVT_REF_CTR_, QF_PTR_AT_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_EQC_, QS_eqObj_, QS_OBJ_, QS_QF_EQUEUE_GET, QS_QF_EQUEUE_GET_LAST, QS_TIME_, QS_U8_, QEQueue::ring, QEvent::sig, and QEQueue::tail.
Referenced by QActive_recall().
| void QEQueue_init | ( | QEQueue * | me, |
| QEvent const * | qSto[], | ||
| QEQueueCtr | qLen | ||
| ) |
Initializes the native QF event queue.
The parameters are as follows: me points to the QEvent struct to be initialized, qSto[] is the ring buffer storage, qLen is the length of the ring buffer in the units of event-pointers.
Definition at line 38 of file qeq_init.c.
References QEQueue::end, QEQueue::frontEvt, QEQueue::head, QEQueue::nFree, QEQueue::nMin, QS_BEGIN_, QS_CRIT_STAT_, QS_END_, QS_EQC_, QS_eqObj_, QS_OBJ_, QS_QF_EQUEUE_INIT, QEQueue::ring, and QEQueue::tail.
Referenced by QActive_start().
| void QEQueue_postFIFO | ( | QEQueue * | me, |
| QEvent const * | e | ||
| ) |
"raw" thread-safe QF event queue implementation for the First-In-First-Out (FIFO) event posting. You can call this function from any task context or ISR context. Please note that this function uses internally a critical section.
Definition at line 41 of file qeq_fifo.c.
References Q_ASSERT, QF_EVT_POOL_ID_, QF_EVT_REF_CTR_, QF_EVT_REF_CTR_INC_, QF_PTR_AT_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_EQC_, QS_eqObj_, QS_OBJ_, QS_QF_EQUEUE_POST_FIFO, QS_TIME_, and QS_U8_.
Referenced by QActive_defer().
| void QEQueue_postLIFO | ( | QEQueue * | me, |
| QEvent const * | e | ||
| ) |
"raw" thread-safe QF event queue implementation for the Last-In-First-Out (LIFO) event posting.
Definition at line 41 of file qeq_lifo.c.
References Q_ASSERT, QF_EVT_POOL_ID_, QF_EVT_REF_CTR_, QF_EVT_REF_CTR_INC_, QF_PTR_AT_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_EQC_, QS_eqObj_, QS_OBJ_, QS_QF_EQUEUE_POST_LIFO, QS_TIME_, and QS_U8_.
1.7.6.1