User manual

www.ti.com
Data Queue Usage
23.4.1.5 PROC_FINISH_RX: Commit Received Data to RX Data Entry
The procedure takes the following input parameters:
Pointer to queue, pQueue
Size of entry element that has been stored, size
The procedure returns the following:
Pointer to data entry where data is stored, pEntry
Pointer to a finished data entry, or NULL if not finished; pFinishedEntry
The procedure returns with error if the queue is empty or if there is not room for an entry element of the
specified size. Otherwise, the following is done:
If pQueue->pCurrEntry->type != 1 then
Set pTemp = pQueue->pCurrEntry
Set pQueue->pCurrEntry = pTemp->pNextEntry
Set pTemp->status = Finished
else
Increase pQueue->pCurrEntry->nextIndex by size
Increment pQueue->pCurrEntry->numElements by 1
If pQueue->pCurrEntry->nextIndex + 2 == pQueue->pCurrEntry->length then
Set pTemp = pQueue->pCurrEntry
Set pQueue->pCurrEntry = pTemp->pNextEntry
Set pTemp->status = Finished
Set pFinishedEntry == pTemp
else
Set pQueue->pCurrEntry->status = Active
Set pFinishedEntry == NULL
end if
end if
This operation is to be done after doing PROC_ALLOCATE_RX and writing to the correct locations in the
buffer; the size must be the same as with PROC_ALLOCATE_RX.
23.4.2 Radio CPU Usage Model
23.4.2.1 Receive Queues
When the radio CPU receives a packet, it prepares a buffer for reading by calling PROC_ALLOCATE_RX.
If this is successful, the allocated buffer is used for storing the incoming packet as defined for each
protocol. In case of a no space error, the received data cannot be stored, and the handling is defined for
each protocol.
After a packet has been received, it may be kept or discarded depending on rules defined for each
protocol. To keep the packet, the radio CPU calls PROC_FINISH_RX. This makes the received data
available for the system CPU. To discard the packet, the radio CPU calls PROC_FREE_DATA_ENTRY,
meaning that the next packet may overwrite the data received in the last packet.
23.4.2.2 Transmit Queues
When the radio CPU is about to transmit a packet from a TX queue, it calls PROC_ALLOCATE_TX to get
a pointer to the data to transmit. When the packet has been transmitted, the radio CPU calls
PROC_FINISH_DATA_ENTRY or PROC_FREE_DATA_ENTRY. If PROC_FINISH_DATA_ENTRY is
called, the system CPU gets informed that the entry is finished and may be reused. This must be used if
re-transmission of the packet is not an option. If PROC_FREE_DATA_ENTRY is called, the transmitted
entry remains first in the queue so that it may be transmitted, which is used when an acknowledgment is
expected.
If an acknowledgment is received on a packet that was transmitted, followed by the radio CPU calling
PROC_FREE_DATA_ENTRY, the radio CPU calls PROC_ALLOCATE_TX followed by
PROC_FINISH_DATA_ENTRY (this is equivalent to CMD_REMOVE_DATA_ENTRY, see Section 23.3.4,
Protocol Independent Direct and Immediate Commands). This causes the next entry in the queue to be
transmitted. If an acknowledgment is not received, the last transmitted packet is re-transmitted.
1493
SWCU117AFebruary 2015Revised March 2015 Radio
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated