UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
406 of 1269
NXP Semiconductors
UM10503
Chapter 19: LPC43xx General Purpose DMA (GPDMA) controller
19.8.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
19.8.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 ENBLDCHNS controller register and find out which channels are inactive.
2. Choose an inactive channel that has the required priority.
3. Program the DMA controller
19.8.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.
19.8.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 IntTCClear
and INTERRCLEAR register. The previous channel operation might have left interrupt
active.
3. Write the source address into the CSRCADDR register.
4. Write the destination address into the CDESTADDR register.
5. Write the address of the next LLI into the CLLI 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 CCONTROL register.
7. Write the channel configuration information into the CCONFIG register. If the enable
bit is set then the DMA channel is automatically enabled.