GD32W51x User Manual
327
Figure 12-6
. Data packing/unpacking when PWIDTH = ‘10’
read 0xB3B2B1B0[31:0] @0x0
read 0xB7B6B5B4[31:0] @0x4
read 0xB11B10B9B8[31:0] @0x8
read 0xB15B14B13B12[31:0] @0xC
B15
B14
B13
B12
B11
B10
B9
B8
B7
B6
B5
B4
B3
B2
B1
B0
write 0xB0[7:0] @0x0 write 0xB8[7:0] @0x8
write 0xB1[7:0] @0x1 write 0xB9[7:0] @0x9
write 0xB2[7:0] @0x2 write 0xB10[7:0] @0xA
write 0xB3[7:0] @0x3 write 0xB11[7:0] @0xB
write 0xB4[7:0] @0x4 write 0xB12[7:0] @0xC
write 0xB5[7:0] @0x5 write 0xB13[7:0] @0xD
write 0xB6[7:0] @0x6 write 0xB14[7:0] @0xE
write 0xB7[7:0] @0x7 write 0xB15[7:0] @0xF
push data
pop data
read 0xB3B2B1B0[31:0] @0x0
read 0xB7B6B5B4[31:0] @0x4
read 0xB11B10B9B8[31:0] @0x8
read 0xB15B14B13B12[31:0] @0xC
write 0xB1B0[15:0] @0x0
write 0xB3B2[15:0] @0x2
write 0xB5B4[15:0] @0x4
write 0xB7B6[15:0] @0x6
write 0xB9B8[15:0] @0x8
write 0xB11B10[15:0] @0xA
write 0xB13B12[15:0] @0xC
write 0xB15B14[15:0] @0xE
push data
pop data
read 0xB3B2B1B0[31:0] @0x0
read 0xB7B6B5B4[31:0] @0x4
read 0xB11B10B9B8[31:0] @0x8
read 0xB15B14B13B12[31:0] @0xC
write 0xB3B2B1B0[31:0] @0x0
write 0xB7B6B5B4[31:0] @0x4
write 0xB11B10B9B8[31:0] @0x8
write 0xB15B14B13B12[31:0] @0xC
push data
pop data
word 4
word 3
word 2
word 1
B15
B14
B13
B12
B11
B10
B9
B8
B7
B6
B5
B4
B3
B2
B1
B0
word 4
word 3
word 2
word 1
PAIF = 1, MWIDTH = 8-bit
PAIF = 0, MWIDTH = 16-bit
PAIF = 0, MWIDTH = 32-bit
B15
B14
B13
B12
B11
B10
B9
B8
B7
B6
B5
B4
B3
B2
B1
B0
word 4
word 3
word 2
word 1
12.4.4.
Address generation
Two kinds of address generation algorithm are implemented independently for memory and
peripheral, including the fixed mode and the increased mode. The PNAGA and MNAGA bit in
the DMA_CHxCTL register are used to configure the next address generation algorit hm of
peripheral and memory.
In the fixed mode, the next address is always equal to the base address configured in the
base address registers (DMA_CHxPADDR, DMA_CHxM0ADDR, and DMA_CHxM1ADDR).
In the increasing mode, the next address is euqal to the current address plus 1 or 2 or 4,
depending on the transfer data width. In Multi-data mode with PBURST in the DMA_CHxCTL
register different from ‘00’, if PAIF in the DMA_CHxCTL register is enable, the next peripheral
address increment is fixed to 4, and has nothing to do with the peripheral transfer data width.
The PAIF has no meaning to the memory address generation.
Note
: If PAIF in the DMA_CHxCTL register is enable, the peripheral base address configured
in the DMA_CHxPADDR register must be 32-bit alignment.
12.4.5.
Circular mode
Circular mode is implemented to handle continue peripheral requests. The CMEN bit in the
DMA_CHxCTL register is used to enable/disable the circular mode. Circular mode is available
only when DMA controls the transfer flow. When the peripheral is selected as the transfer flow
controller by setting the TFCS, the circular mode is automatically disabled immediately after
the channel is enabled.
In circular mode, the CNT bits are automatically reloaded with the pre-programmed value and
the full transfer finish flag is asserted at the end of every DMA transfer. DMA can always
respond the peripheral request until a transfer error is detected or the CHEN bit in the