Ameba-D User Manual
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
192
Fig 9-60 DMA transfer flow for source address auto-reloaded and contiguous destination address
9.4.6
Disabling a Channel Prior to Transfer Completion
Under normal operation, software enables a channel by writing a 1 to the channel enable register, ChEnReg.CH_EN, and hardware disables a
channel on transfer completion by clearing the ChEnReg.CH_EN register bit.
The recommended way for software to disable a channel without losing data is to use the CH_SUSP bit in conjunction with the FIFO_EMPTY bit
in the Channel Configuration Register (CFGx).
(1)
If software wishes to disable a channel prior to the DMA transfer completion, then it can set the CFG
x
.CH_SUSP bit to tell the DMAC to
halt all transfers from the source peripheral. Therefore, the channel FIFO receives no new data.
(2)
Software can now poll the CFG
x
.FIFO_EMPTY bit until it indicates that the channel FIFO is empty.
(3)
The ChEnReg.CH_EN bit can then be cleared by software once the channel FIFO is empty.
When CTLx.SRC_TR_WIDTH < CTLx.DST_TR_WIDTH and the CFGx.CH_SUSP bit is high, the CFGx.FIFO_EMPTY is asserted once the contents of
the FIFO do not permit a single word of CTL
x
.DST_TR_WIDTH to be formed. However, there may still be data in the channel FIFO, but not
enough to form a single transfer of CTL
x
.DST_TR_WIDTH. In this scenario, once the channel is disabled, the remaining data in the channel FIFO
is not transferred to the destination peripheral.
It is permissible to remove the channel from the suspension state by writing a 0 to the CFGx.CH_SUSP register. The DMA transfer completes in
the normal manner.
Note
:
If a channel is disabled by software, an active single or burst transaction is not guaranteed to receive an acknowledgement.
If the DMAC is configured to use defined length bursts (DMAH_INCR_BURSTS = 0), disabling the channel via software prior to completing
a transfer is not supported.
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03