Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Queue Management

Queue Management: provides services for creating and maintaining the queues.

Data Structures

struct  MiQueue
 Queue structure. More...
 
struct  miQueueBuffer
 
struct  search_tag
 Structure to search for a buffer to be removed from a queue. More...
 

Macros

#define BUFFER_POINTER(buf)   ((buf)->buffer)
 This macro provides the pointer to the corresponding body of the supplied buffer header. More...
 

Typedefs

typedef struct MiQueue MiQueue_t
 Queue structure. More...
 
typedef struct miQueueBuffer miQueueBuffer_t
 
typedef struct search_tag search_t
 Structure to search for a buffer to be removed from a queue. More...
 

Functions

void miQueueAppend (MiQueue_t *q, void *buf)
 Appends a buffer into the queue. More...
 
void miQueueFlush (MiQueue_t *q)
 Internal function for flushing a specific queue. More...
 
void miQueueInit (MiQueue_t *q)
 Initializes the queue. More...
 
miQueueBuffer_tmiQueueRead (MiQueue_t *q, search_t *search)
 Reads a buffer from queue. More...
 
miQueueBuffer_tmiQueueRemove (MiQueue_t *q, search_t *search)
 Removes a buffer from queue. More...
 

Variables

uint8_t * miQueueBuffer::buffer
 Handle to callback parameter. More...
 
uint8_t(* search_tag::criteria_func )(void *buf, void *handle)
 Pointer to search criteria function. More...
 
void * search_tag::handle
 Handle to callback parameter. More...
 
miQueueBuffer_tMiQueue::head
 Pointer to head of queue. More...
 
void * miQueueBuffer::nextItem
 Pointer to search criteria function. More...
 
uint8_t MiQueue::size
 Number of buffers present in the current queue. More...
 
miQueueBuffer_tMiQueue::tail
 Pointer to tail of queue. More...
 

#define BUFFER_POINTER (   buf)    ((buf)->buffer)

This macro provides the pointer to the corresponding body of the supplied buffer header.

typedef struct MiQueue MiQueue_t

Queue structure.

This structure defines the queue structure. The application should declare the queue of type queue_t and call miQueueinit before invoking any other functionality of qmm.

typedef struct search_tag search_t

Structure to search for a buffer to be removed from a queue.

void miQueueAppend ( MiQueue_t q,
void *  buf 
)

Appends a buffer into the queue.

This function appends a buffer into the queue.

Parameters
qQueue into which buffer should be appended
bufPointer to the buffer that should be appended into the queue.

References cpu_irq_disable(), cpu_irq_enable(), MiQueue::head, miQueueBuffer::nextItem, NULL, MiQueue::size, and MiQueue::tail.

Referenced by appAckWaitDataCallback(), dataTimerHandler(), frameParse(), frameTransmit(), MiApp_SendData(), otauDataInd(), PHY_DataReq(), and protocolTimerHandler().

void miQueueFlush ( MiQueue_t q)

Internal function for flushing a specific queue.

Parameters
qQueue to be flushed

References MiMem_Free(), miQueueRemove(), NULL, and MiQueue::size.

void miQueueInit ( MiQueue_t q)

Initializes the queue.

This function initializes the queue. Note that this function should be called before invoking any other functionality of QMM.

Parameters
qThe queue which should be initialized.

References MiQueue::head, NULL, MiQueue::size, and MiQueue::tail.

Referenced by MiApp_ProtocolInit(), and otauInit().

miQueueBuffer_t* miQueueRead ( MiQueue_t q,
search_t search 
)

Reads a buffer from queue.

This function reads either the first buffer if search is NULL or buffer matching the given criteria from queue.

Parameters
qThe queue from which buffer should be read.
searchIf this parameter is NULL first buffer in the queue will be read. Otherwise buffer matching the criteria will be read
Returns
Pointer to the buffer header which is to be read, NULL if the buffer is not available

References miQueueReadOrRemove(), and READ_MODE.

miQueueBuffer_t* miQueueRemove ( MiQueue_t q,
search_t search 
)

Removes a buffer from queue.

This function removes a buffer from queue

Parameters
qQueue from which buffer should be removed
searchSearch criteria. If this parameter is NULL, first buffer in the queue will be removed. Otherwise buffer matching the criteria will be removed.
Returns
Pointer to the buffer header, if the buffer is successfully removed, NULL otherwise.

References miQueueReadOrRemove(), and REMOVE_MODE.

Referenced by appAckWaitDataCallback(), dataTimerHandler(), frameParse(), macAckOnlyDataCallback(), miQueueFlush(), otauTask(), P2PTasks(), PHY_TxHandler(), and protocolTimerHandler().

uint8_t* miQueueBuffer::buffer

Handle to callback parameter.

Referenced by miQueueReadOrRemove().

uint8_t(* search_tag::criteria_func)(void *buf, void *handle)

Pointer to search criteria function.

Referenced by miQueueReadOrRemove(), and remove_frame_from_gts_q().

void* search_tag::handle

Handle to callback parameter.

Referenced by miQueueReadOrRemove(), and remove_frame_from_gts_q().

miQueueBuffer_t* MiQueue::head

Pointer to head of queue.

Referenced by miQueueAppend(), miQueueInit(), and miQueueReadOrRemove().

void* miQueueBuffer::nextItem

Pointer to search criteria function.

Referenced by miQueueAppend(), and miQueueReadOrRemove().

miQueueBuffer_t* MiQueue::tail

Pointer to tail of queue.

Referenced by miQueueAppend(), miQueueInit(), and miQueueReadOrRemove().