Setting Up The Dma Transfer; Finding The Dma Descriptor; Transferring The Data; Ending The Packet Transfer - Philips LPC214 Series User Manual

Table of Contents

Advertisement

Philips Semiconductors
Volume 1
In cases, where the intended buffer lengths are already transferred and the last buffer
length has completed on the USB packet boundary, it is responsibility of Device software
to program the next DD with "DMA_buffer_length" field 0, after which an empty packet is
sent on USB by the hardware to mark the End Of Transfer for the Host.

14.13.1 Setting up the DMA transfer

There is an additional field in the descriptor called 'message_length_position' which has
to be set for the OUT endpoints.This indicates the start location of the message length in
the incoming data packet. Also the software will set the 'dma_buffer_length' field to '0' for
OUT endpoints as this field has to be updated by hardware.
For IN endpoints, descriptors are to be set in the same way as the normal mode operation.
Since a single packet can have two transfers which has to be transferred or collected from
different DMA buffers, the software should keep two buffers ready always, except for the
last delta transfer which ends with a short packet.

14.13.2 Finding the DMA Descriptor

DMA descriptors are found in the same way as the normal mode operation.

14.13.3 Transferring the Data

For OUT end points if the 'LS_byte_extracted' or 'MS_byte_extracted' bit in the status field
is not set, the hardware will extract the transfer length from the data stream.
'dma_buffer_length' field is derived from this information which is 2 bytes long. Once the
extraction is complete both the 'LS_byte_extracted' and 'MS_byte_extracted' bits will be
set.
For IN endpoints transfer proceeds like the normal mode and continues till the number of
bytes transferred equals the 'dma_buffer_length'.

14.13.4 Ending the packet transfer

DMA engine proceeds with the transfer till the number of bytes specified in the field
'dma_buffer_length' gets transferred to or from the USB RAM. END_OF_TRANSFER
interrupt will be generated. If this happens in the middle of the packet, the linked DD will
get loaded and the remaining part of the packet gets transferred to or from the address
pointed by the new DD.
For an OUT endpoint if the linked DD is not valid and the packet is partially transferred to
memory, the DD ends with data_over_run status set and DMA will be disabled for this
endpoint. Otherwise DD_status will be updated with 'normal completion'.
For an IN endpoint if the linked DD is not valid and the packet is partially transferred to
USB, DD ends with 'normal completion' and the packet will be sent as a short packet
(since this situation is the end of transfer). Also, when the linked DD is valid and buffer
length is 0, a short packet will be sent.
9397 750 XXXXX
User manual
Rev. 01 — 15 August 2005
UM10139
Chapter 14: USB Device Controller
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
239

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2148Lpc2141Lpc2142Lpc2144Lpc2146

Table of Contents