uDMA Controller
Peripheral scatter/gather mode is similar to memory scatter/gather mode except that it is
controlled by a peripheral request.
Detailed explanation of the various transfer modes is beyond the scope of this document. Please
refer to the device data sheet for more information on the operation of the uDMA controller.
The naming convention for the microDMA controller is to use the Greek letter “mu” to represent
“micro”. For the purposes of this document, and in the software library function names, a lower
case “u” will be used in place of “mu” when the controller is referred to as “uDMA”.
The general order of function calls to set up and perform a uDMA transfer is the following:
ROM_uDMAEnable() is called once to enable the controller.
ROM_uDMAControlBaseSet() is called once to set the channel control table.
ROM_uDMAChannelAttributeEnable() is called once or infrequently to configure the behavior
of the channel.
ROM_uDMAChannelControlSet() is used to set up characteristics of the data transfer. It only
needs to be called once if the nature of the data transfer does not change.
ROM_uDMAChannelTransferSet() is used to set the buffer pointers and size for a transfer. It
is called before each new transfer.
ROM_uDMAChannelEnable() enables a channel to perform data transfers.
ROM_uDMAChannelRequest() is used to initiate a software based transfer. This is normally
not used for peripheral based transfers.
In order to use the uDMA controller, you must first enable it by calling ROM_uDMAEnable(). You
can later disable it, if no longer needed, by calling ROM_uDMADisable().
Once the uDMA controller is enabled, you must tell it where to find the channel control structures
in system memory. This is done by using the function ROM_uDMAControlBaseSet() and passing a
pointer to the base of the channel control structure. The control structure must be allocated by the
application. One way to do this is to declare an array of data type int8_t or uint8_t. In order to
support all channels and transfer modes, the control table array should be 1024 bytes, but it can be
fewer depending on transfer modes used and number of channels actually used.
Note:
The control table must be aligned on a 1024 byte boundary.
The uDMA controller supports multiple channels. Each channel has a set of attribute flags to con-
trol certain uDMA features and channel behavior. The attribute flags are set with the function
ROM_uDMAChannelAttributeEnable() and cleared with ROM_uDMAChannelAttributeDisable().
The setting of the channel attribute flags can be queried by using the function
ROM_uDMAChannelAttributeGet().
Next, the control parameters of the DMA transfer must be set. These parameters con-
trol the size and address increment of the data items to be transferred. The function
ROM_uDMAChannelControlSet() is used to set up these control parameters.
All of the functions mentioned so far are used only once or infrequently to set up the uDMA chan-
nel and transfer. In order to set the transfer addresses, transfer size, and transfer mode, use
the function ROM_uDMAChannelTransferSet(). This function must be called for each new trans-
fer. Once everything is set up, then channel is enabled by calling ROM_uDMAChannelEnable(),
which must be done before each new transfer. The uDMA controller will automatically disable
the channel at the completion of a transfer. A channel can be manually disabled by using
ROM_uDMAChannelDisable().
272 April 8, 2013