uDMA Controller
Description:
This function is used to set the parameters for a uDMA transfer. These are typically parameters
that are changed often. The function ROM_uDMAChannelControlSet() MUST be called at least
once for this channel prior to calling this function.
The ui32ChannelStructIndex parameter should be the logical OR of the channel number with
one of UDMA_PRI_SELECT or UDMA_ALT_SELECT to choose whether the primary or alter-
nate data structure is used.
The ui32Mode parameter should be one of the following values:
UDMA_MODE_STOP stops the uDMA transfer. The controller sets the mode to this value
at the end of a transfer.
UDMA_MODE_BASIC to perform a basic transfer based on request.
UDMA_MODE_AUTO to perform a transfer that will always complete once started even if
request is removed.
UDMA_MODE_PINGPONG to set up a transfer that switches between the primary and
alternate control structures for the channel. This allows use of ping-pong buffering for
uDMA transfers.
UDMA_MODE_MEM_SCATTER_GATHER to set up a memory scatter-gather transfer.
UDMA_MODE_PER_SCATTER_GATHER to set up a peripheral scatter-gather transfer.
The pvSrcAddr and pvDstAddr parameters are pointers to the first location of the data to be
transferred. These addresses should be aligned according to the item size. The compiler will
take care of this if the pointers are pointing to storage of the appropriate data type.
The ui32TransferSize parameter is the number of data items, not the number of bytes.
The two scatter/gather modes, memory and peripheral, are actually different depending on
whether the primary or alternate control structure is selected. This function will look for the
UDMA_PRI_SELECT and UDMA_ALT_SELECT flag along with the channel number and will
set the scatter/gather mode as appropriate for the primary or alternate control structure.
The channel must also be enabled using ROM_uDMAChannelEnable() after calling this func-
tion. The transfer will not begin until the channel has been set up and enabled. Note
that the channel is automatically disabled after the transfer is completed, meaning that
ROM_uDMAChannelEnable() must be called again after setting up the next transfer.
Note:
Great care must be taken to not modify a channel control structure that is in use or else the
results are unpredictable, including the possibility of undesired data transfers to or from mem-
ory or peripherals. For BASIC and AUTO modes, it is safe to make changes when the channel
is disabled, or the ROM_uDMAChannelModeGet() returns UDMA_MODE_STOP. For PING-
PONG or one of the SCATTER_GATHER modes, it is safe to modify the primary or alternate
control structure only when the other is being used. The ROM_uDMAChannelModeGet() func-
tion will return UDMA_MODE_STOP when a channel control structure is inactive and safe to
modify.
Returns:
None.
23.2.1.16 ROM_uDMAControlAlternateBaseGet
Gets the base address for the channel control table alternate structures.
April 8, 2013 291