PDK API Guide for AM65xx
Queue

Introduction

Queue interface

Files

file  QueueP.h
 Queue Handling routines for RTOS.
 

Data Structures

struct  QueueP_Elem
 Opaque QueueP element. More...
 
struct  QueueP_Params
 Basic QueueP Parameters. More...
 
struct  Osal_Queue_Elem
 Queue element. More...
 

Functions

void QueueP_Params_init (QueueP_Params *params)
 Initialize params structure to default values. More...
 
QueueP_Handle QueueP_create (const QueueP_Params *params)
 Function to create a queue. More...
 
QueueP_Status QueueP_delete (QueueP_Handle handle)
 Function to delete a queue. More...
 
void * QueueP_get (QueueP_Handle handle)
 Function to Get the element at the front of the queue. This function removes an element from the front of a queue and returns it. More...
 
QueueP_Status QueueP_put (QueueP_Handle handle, void *elem)
 Function to Put an element at end of queue. More...
 
QueueP_State QueueP_isEmpty (QueueP_Handle handle)
 Function to perform queue empty check. More...
 
void * QueueP_getQPtr (QueueP_Handle handle)
 Function to get pointer to the queue. More...
 
void Osal_Queue_construct (void *structPtr, const void *queueParams)
 Function to construct the queue [NOTE: This will be obsolete in next release]. More...
 
Osal_Queue_Handle Osal_Queue_handle (void *structPtr)
 Function to return the queue handle from the structure [NOTE: This will be obsolete in next release]. More...
 
bool Osal_Queue_empty (Osal_Queue_Handle queueHandle)
 Function to perform queue empty check [NOTE: This will be obsolete in next release]. More...
 
void * Osal_Queue_get (Osal_Queue_Handle queueHandle)
 Function to return the element at the front of the queue [NOTE: This will be obsolete in next release]. More...
 
void Osal_Queue_put (Osal_Queue_Handle queueHandle, Osal_Queue_Elem *ptr)
 Function to put the element to the queue [NOTE: This will be obsolete in next release]. More...
 

Typedefs

typedef void * QueueP_Handle
 Opaque client reference to an instance of a QueueP. More...
 
typedef void * Osal_Queue_Handle
 

Enumerations

enum  QueueP_Status { QueueP_OK = 0, QueueP_FAILURE = (-(int32_t)1) }
 Status codes for QueueP APIs. More...
 
enum  QueueP_State { QueueP_NOTEMPTY = 0, QueueP_EMPTY = 1 }
 State codes for current queue state. More...
 

Typedef Documentation

◆ QueueP_Handle

typedef void* QueueP_Handle

Opaque client reference to an instance of a QueueP.

A QueueP_Handle returned from the QueueP_create represents that instance and is used in the other instance based functions

◆ Osal_Queue_Handle

typedef void* Osal_Queue_Handle

OSAL Queue handle Type [NOTE: This will be obsolete in next release]

Enumeration Type Documentation

◆ QueueP_Status

Status codes for QueueP APIs.

Enumerator
QueueP_OK 

API completed successfully

QueueP_FAILURE 

API failed

◆ QueueP_State

State codes for current queue state.

Enumerator
QueueP_NOTEMPTY 

Elements are present in the the queue

QueueP_EMPTY 

Queue is empty. No elements are present.

Function Documentation

◆ QueueP_Params_init()

void QueueP_Params_init ( QueueP_Params params)

Initialize params structure to default values.

Parameters
params[out] Pointer to the instance configuration parameters.

◆ QueueP_create()

QueueP_Handle QueueP_create ( const QueueP_Params params)

Function to create a queue.

Parameters
params[in] Pointer to the instance configuration parameters.
Returns
A QueueP_Handle on success or a NULL on an error

◆ QueueP_delete()

QueueP_Status QueueP_delete ( QueueP_Handle  handle)

Function to delete a queue.

Parameters
handle[in] A QueueP_Handle returned from QueueP_create
Returns
Status of the functions
  • QueueP_OK: Deleted the queue instance
  • QueueP_FAILURE: Failed to delete the queue instance

◆ QueueP_get()

void* QueueP_get ( QueueP_Handle  handle)

Function to Get the element at the front of the queue. This function removes an element from the front of a queue and returns it.

Parameters
handle[in] A QueueP_Handle returned from QueueP_create
Returns
pointer to the element or pointer to queue itself incase of empty queue

◆ QueueP_put()

QueueP_Status QueueP_put ( QueueP_Handle  handle,
void *  elem 
)

Function to Put an element at end of queue.

Parameters
handle[in] A QueueP_Handle returned from QueueP_create
elem[in] Pointer to new queue element
Returns
Status of the functions
  • QueueP_OK: Put the element at end of queue
  • QueueP_FAILURE: Failed to Put the element at end of queue

◆ QueueP_isEmpty()

QueueP_State QueueP_isEmpty ( QueueP_Handle  handle)

Function to perform queue empty check.

Parameters
handle[in] A QueueP_Handle returned from QueueP_create
Returns
Current state of the Queue
  • QueueP_NOTEMPTY: queue is not empty
  • QueueP_EMPTY: queue is empty

◆ QueueP_getQPtr()

void* QueueP_getQPtr ( QueueP_Handle  handle)

Function to get pointer to the queue.

Parameters
handle[in] A QueueP_Handle returned from QueueP_create
Returns
pointer to the queue

◆ Osal_Queue_construct()

void Osal_Queue_construct ( void *  structPtr,
const void *  queueParams 
)

Function to construct the queue [NOTE: This will be obsolete in next release].

Parameters
structPtrPointer to the structure containing the queue element
queueParamsqueue parameters

◆ Osal_Queue_handle()

Osal_Queue_Handle Osal_Queue_handle ( void *  structPtr)

Function to return the queue handle from the structure [NOTE: This will be obsolete in next release].

Parameters
structPtrPointer to the structure containing the queue element

◆ Osal_Queue_empty()

bool Osal_Queue_empty ( Osal_Queue_Handle  queueHandle)

Function to perform queue empty check [NOTE: This will be obsolete in next release].

Parameters
queueHandleThe queue handle

◆ Osal_Queue_get()

void* Osal_Queue_get ( Osal_Queue_Handle  queueHandle)

Function to return the element at the front of the queue [NOTE: This will be obsolete in next release].

Parameters
queueHandleThe queue handle

◆ Osal_Queue_put()

void Osal_Queue_put ( Osal_Queue_Handle  queueHandle,
Osal_Queue_Elem ptr 
)

Function to put the element to the queue [NOTE: This will be obsolete in next release].

Parameters
queueHandleThe queue handle
ptrPointer to the queue element