RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
RKH_QUEUE_T Struct Reference

Defines the data structure used to maintain information about the queue. More...

#include <rkhqueue.h>

Data Fields

RKH_QUENE_T nelems
 Number of elements.
 
RKH_QUENE_T qty
 Number of elements currently in the queue.
 
void ** pout
 Points to the free next place in the storage area.
 
void ** pin
 Points to the next place of queued item.
 
const void ** pstart
 Points to beginning of the queue storage area.
 
void ** pend
 Points to the end of the queue storage area.
 
const struct RKH_SMA_Tsma
 Points to the associated SMA (a.k.a Active Object) that receives the enqueued events. More...
 
RKH_QUENE_T nmin
 Minimum number of free elements ever in this queue. The nmin low-watermark provides valuable empirical data for proper sizing of the queue.
 
RKH_QUEI_T rqi
 Performance information. This member is optional, thus it could be eliminated in compile-time with RKH_CFG_QUE_GET_INFO_EN.
 

Detailed Description

Defines the data structure used to maintain information about the queue.

The queue is a buffer-like object through which state machine applications (SMA) and ISRs send and receive messages to communicate and synchornize with data. It temporarily holds pointer to messages from a sender until the intended receiver is ready to read them.

The number of messages a queue can hold depends on its message size (pointer size) and the size of the memory area supplied during creation. To calculate the total message capacity of the queue, divide the number of bytes in each message into the total number of bytes in the supplied

The memory area for buffering messages is specified during queue creation. It can be located anywhere in the target's address space. This is an important feature because it gives the application considerable flexibility.

Note
RKH prohibits an application from explicitly modifying the RKH_QUEUE_T structure. The RKH's queue structures can be located anywhere in memory, but it is most common to make it a global structure by defining it outside the scope of any function. An RKH queue is created when an queue (copy by reference) is declared with the RKH_QUEUE_T data type. The following listing declares "gsmque" timer:
RKH_QUEUE_T gsmque;

Definition at line 167 of file rkhqueue.h.

Field Documentation

const struct RKH_SMA_T* sma

Points to the associated SMA (a.k.a Active Object) that receives the enqueued events.

Note
If sma is set to NULL they never block.

Definition at line 213 of file rkhqueue.h.


The documentation for this struct was generated from the following file: