![]() |
![]() |
Configures and controls MSP432's DMA controller which is built around ARM's uDMA controller. More...
Data Structures | |
struct | _DMA_ControlTable |
Macros | |
#define | DMA_TaskStructEntry(transferCount,itemSize,srcIncrement,srcAddr,dstIncrement,dstAddr,arbSize,mode) |
Typedefs | |
typedef struct _DMA_ControlTable | DMA_ControlTable |
Configures and controls MSP432's DMA controller which is built around ARM's uDMA controller.
The DMA controller has the following features:
The uDMA controller supports several different transfer modes, allowing for complex transfer schemes. The following transfer modes are provided:
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.
Below is a very brief example of how to configure the DMA controller to transfer from a data array (data_array) to the EUSCI I2C module to be sent over the I2C line. This is useful in the sense that the EUSCI module does not constantly have to wake up the CPU in order to load the next byte into the buffer.
#define DMA_TaskStructEntry | ( | transferCount, | |
itemSize, | |||
srcIncrement, | |||
srcAddr, | |||
dstIncrement, | |||
dstAddr, | |||
arbSize, | |||
mode | |||
) |
A helper macro for building scatter-gather task table entries.
This macro is intended to be used to help populate a table of DMA tasks for a scatter-gather transfer. This macro will calculate the values for the fields of a task structure entry based on the input parameters.
There are specific requirements for the values of each parameter. No checking is done so it is up to the caller to ensure that correct values are used for the parameters.
The transferCount parameter is the number of items that will be transferred by this task. It must be in the range 1-1024.
The itemSize parameter is the bit size of the transfer data. It must be one of UDMA_SIZE_8, UDMA_SIZE_16, or UDMA_SIZE_32.
The srcIncrement parameter is the increment size for the source data. It must be one of UDMA_SRC_INC_8, UDMA_SRC_INC_16, UDMA_SRC_INC_32, or UDMA_SRC_INC_NONE.
The srcAddr parameter is a void pointer to the beginning of the source data.
The dstIncrement parameter is the increment size for the destination data. It must be one of UDMA_DST_INC_8, UDMA_DST_INC_16, UDMA_DST_INC_32, or UDMA_DST_INC_NONE.
The dstAddr parameter is a void pointer to the beginning of the location where the data will be transferred.
The arbSize parameter is the arbitration size for the transfer, and must be one of UDMA_ARB_1, UDMA_ARB_2, UDMA_ARB_4, and so on up to UDMA_ARB_1024. This is used to select the arbitration size in powers of 2, from 1 to 1024.
The mode parameter is the mode to use for this transfer task. It must be one of UDMA_MODE_BASIC, UDMA_MODE_AUTO, UDMA_MODE_MEM_SCATTER_GATHER, or UDMA_MODE_PER_SCATTER_GATHER. Note that normally all tasks will be one of the scatter-gather modes while the last task is a task list will be AUTO or BASIC.
This macro is intended to be used to initialize individual entries of a structure of DMA_ControlTable type, like this:
transferCount | is the count of items to transfer for this task. |
itemSize | is the bit size of the items to transfer for this task. |
srcIncrement | is the bit size increment for source data. |
srcAddr | is the starting address of the data to transfer. |
dstIncrement | is the bit size increment for destination data. |
dstAddr | is the starting address of the destination data. |
arbSize | is the arbitration size to use for the transfer task. |
mode | is the transfer mode for this task. |
typedef struct _DMA_ControlTable DMA_ControlTable |