GD32W51x User Manual
329
the transfer flow.
DMA as transfer flow controller: The CNT bits in the DMA_CHxCNT register determine
the number of data items to be transferred. The CNT bits must be configured before the
channel is enabled.
Peripheral as transfer flow controller: The CNT bits configured in the DMA_CHxCNT
register before the channel is enabled have no meaning and these bits are force to
‘0xFFFF’ immediately after the channel is enabled. The peripheral determines when to
finish the DMA transfer by informing a last request signal to DMA.
Note:
When the transfer mode is memory-to-memory, the transfer flow controller is fixed to
be DMA whatever the TFCS bit is configured to.
12.4.8.
Transfer operation
Three transfer modes are supported to implement the data transfer, including peripheral-to-
memory, memory-to-peripheral and memory-to-memory. Memory and peripheral can be
configured as source and destination relatively.
Memory transfer
Peripheral-to-memory mode:
-
In single-data mode, when the FIFO is not empty, DMA initiates a single memory
transfer and writes data into the corresponding memory address.
-
In multi-data mode, when the FIFO counter reaches the critical value, DMA starts
single or burst memory transfers to entirely fetch the FIFO data and write to the
memory.
Memory-to-peripheral mode:
-
In single-data mode, when the channel is enabled, DMA starts a single memory
transfer and pushes the reading data into the FIFO immediately. During the
transmission, the memory transfer is initiated only when the FIFO is empty.
-
In multi-data mode, when the channel is enabled, DMA starts several single or burst
transfers to fill up the FIFO whether the peripheral request is asserted or not. During
the transmission, the memory transfer is initiated once when there is enough space
for it in the FIFO.
Memory-to-memory mode: Only the multi-data mode is supported. When the FIFO
counter reaches the critical value, DMA starts single or burst memory transfers to entirely
fetch the FIFO data and write to the memory.
Peripheral transfer
Peripheral-to-memory mode: When receiving a peripheral request and there is enough
space in the FIFO for a peripheral transfer, DMA starts a peripheral transfer and pushes
the reading data into the FIFO.
Memory-to-peripheral mode: When receiving a peripheral request and there is enough