GD32A50x User Manual
250
12.4.3.
DMAMUX request generator
The DMAMUX request generator produces DMA requests upon trigger input event. Its
component unit is the request generator channels. DMA request trigger inputs are connected
in parallel to all request generator channels. And there is a built-in DMAMUX request
generator counter for each request generator channel.
The active edge of trigger input events is selected through the RGTP[1:0] bits in
DMAMUX_RG_CHxCFG register. The DMA request trigger input for the DMAMUX request
generator channel x is selected through the TID[4:0] bits in DMAMUX_RG_CHxCFG register,
Table 12-4. Trigger input mapping
. DMAMUX request generator
channel x can be enabled by setting RGEN to 1 in DMAMUX_RG_CHxCFG register.
Request generator channel
Upon the trigger input event, the corresponding request generator channel starts generating
DMA requests on its output, and the output goes to the input of the DMAMUX request
multiplexer. Each time the DMAMUX generated request is served by the connected DMA
controller, the served request will be de-asserted, and the built-in DMAMUX request generator
counter of the request generator channel is decremented. At the request generator counter
underrun, the request generator channel stops generating DMA requests. The built-in
DMAMUX request generator counter will be automatically reloaded to its programmed value
upon the next trigger input event, the built-in counter is programmed by the NBRG[4:0] bits of
the DMAMUX_RG_CHxCFG register.
Note:
The number of generated DMA requests after the trigger input event is NBRG[4:0] + 1.
The NBRG[4:0] value shall only be written by software when the RGEN bit of the
corresponding generator channel x is disabled.
Trigger overrun
If a request generator channel x was enabled by RGEN bit, when a new DMA request trigger
event for the request generator channel x occurs before the DMAMUX request generator
counter underrun, then the request trigger overrun event flag bit TOIFx is set by hardware in
the DMAMUX_RG_INTF register.
Note:
The request generator channel x shall be disabled by resetting RGEN bit in
DMAMUX_RG_CHxCFG register at the completion of the usage of the related channel of the
DMA controller. Otherwise, when a new detected trigger event occurs, there will be a trigger
overrun due to the absence of an acknowledge (that is, no served request) received from the
DMA.
12.4.4.
Channel configurations
The following sequence should be followed to configure a DMAMUX channel y and the related
DMA channel x: