DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
531 of 571
NXP Semiconductors
UM10316
Chapter 30: LPC29xx General Purpose DMA (GPDMA) controller
6.1.4 Disabling a DMA channel
A DMA channel can be disabled in three ways:
•
By writing directly to the channel enable bit. Any outstanding data in the FIFO’s is lost
if this method is used.
•
By using the active and halt bits in conjunction with the channel enable bit.
•
By waiting until the transfer completes. This automatically clears the channel.
Disabling a DMA channel and losing data in the FIFO
Clear the relevant channel enable bit in the relevant channel configuration register. The
current AHB transfer (if one is in progress) completes and the channel is disabled. Any
data in the FIFO is lost.
Disabling the DMA channel without losing data in the FIFO
•
Set the halt bit in the relevant channel configuration register. This causes any future
DMA request to be ignored.
•
Poll the active bit in the relevant channel configuration register until it reaches 0. This
bit indicates whether there is any data in the channel that has to be transferred.
•
Clear the channel enable bit in the relevant channel configuration register
6.1.5 Setting up a new DMA transfer
To set up a new DMA transfer:
If the channel is not set aside for the DMA transaction:
1. Read the DMACEnbldChns controller register and find out which channels are
inactive.
2. Choose an inactive channel that has the required priority.
3. Program the DMA controller
6.1.6 Halting a DMA channel
Set the halt bit in the relevant DMA channel configuration register. The current source
request is serviced. Any further source DMA request is ignored until the halt bit is cleared.
6.1.7 Programming a DMA channel
1. Choose a free DMA channel with the priority needed. DMA channel 0 has the highest
priority and DMA channel 7 the lowest priority.
2. Clear any pending interrupts on the channel to be used by writing to the
DMACIntTCClear and DMACIntErrClear register. The previous channel operation
might have left interrupt active.
3. Write the source address into the DMACCxSrcAddr register.
4. Write the destination address into the DMACCxDestAddr register.
5. Write the address of the next LLI into the DMACCxLLI register. If the transfer
comprises of a single packet of data then 0 must be written into this register.
6. Write the control information into the DMACCxControl register.