Download Stellaris Peripheral Driver Library User's Guide

Transcript
www.ti.com
API Functions
The ulMode 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 ulTransferSize 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 uDMAChannelEnable() after calling this function. 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 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 will be unpredictable, including the possibility of undesired data transfers to or from
memory or peripherals. For BASIC and AUTO modes, it is safe to make changes when the
channel is disabled, or the uDMAChannelModeGet() returns UDMA_MODE_STOP. For PINGPONG 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 uDMAChannelModeGet() function will
return UDMA_MODE_STOP when a channel control structure is inactive and safe to modify.
Returns:
None.
23.2.2.14 uDMAControlBaseGet
Gets the base address for the channel control table.
Prototype:
void *
uDMAControlBaseGet(void)
Description:
This function gets the base address of the channel control table. This table resides in system
memory and holds control information for each uDMA channel.
SW-DRL-UG-5450 - December 02, 2009
uDMA Controller
331