#include <twl/mi.h> typedef struct _MINDmaConfig { u32 intervalTimer; u32 prescaler; u32 blockWord; u32 wordCount; } MINDmaConfig;
The members of the MINDmaConfig
structure are shown below.
Member Name | Description | Related Register | Default Values |
---|---|---|---|
intervalTimer |
Interval timer for block transfers. | d15-0 in DMAxBCNT | MI_NDMA_NO_INTERVAL |
prescaler |
Prescaler of interval timer for block transfers. | d17-16 in DMAxBCNT | MI_NDMA_INTERVAL_PS_1 |
blockWord |
Number of words in the block transfer. | d19-16 in DMAx_CNT | MI_NDMA_BWORD_1 |
wordCount |
Number of words in the transfer. | DMAxWCNT | MI_NDMA_AT_A_TIME |
MINDmaConfig
is a structure that specifies the DMA behavior used in new DMA operations.
There are many parameters that specify the behavior of the new DMA. Specifying all aspects of every behavior would cause the instruction length to be quite long, which in turn would be extremely troublesome. Consequently, the parts of these parameters that are unlikely to change during multiple DMA operations are gathered into the MINDmaConfig
structure. By having applications refer to this structure during DMA operations, the burden on applications can be reduced.
Each of the four new DMAs contains a MINDmaConfig
structure internally. During DMA operations, either of the following operations can be selected.
(1) Accessing theMINDmaConfig
structure maintained internally
(2) Accessing theMINDmaConfig
structure specified by the application
The functions that configure the internally maintained MINDmaConfig
structure are the following:
TheMI_InitNDmaConfig
function, used to initialize the four internal structures
TheMI_SetNDmaConfig
function, used to copy the specifiedMINDmaConfig
structure to an internal structure
TheMI_SetNDmaInterval
function, used to specify interval information for a particular internal structure
TheMI_SetNDmaBlockWord
function, used to specify BlockWord information for a particular internal structure
TheMI_SetNDmaWordCount
function, used to specifyWordCount
information for a particular internal structure
The functions that get the information in the internal MINDmaConfig
structure are the following:
TheMI_GetNDmaConfig
function, used to copy an internal structure to a specified region of memory
TheMI_GetNDmaIntervalTimer
function, used to get the interval timer information for a particular internal structure
TheMI_GetNDmaIntervalPrescaler
function, used to get the interval prescalar information for a particular internal structure
TheMI_GetNDmaBlockWord
function, used to get theBlockWord
information of a particular internal structure
TheMI_GetNDmaWordCount
function, used to get theWordCount
information of a particular internal structure
The "interval information" mentioned in the set functions refers to the Interval Timer and Interval Prescaler information; both can be set simultaneously. For the get functions, two separate functions have been created to get these values individually.
The internal structure will be initialized using the OS_Init
function, so the application doesn't have to handle the initialization at first. Call this function if it's necessary.
If you want to perform a new DMA operation using different parameters than the default settings, but you don't want to change the internal structure, perform the following procedure: (1) copy over the MINDmaConfig
structure, (2) overwrite the members of the MINDmaConfig
structure, (3) specify that structure and perform the new DMA operation.
If you want to change the actual value within the library's internal structure, either (1) copy MINDmaConfig
and overwrite the necessary portions, then set the library to the structure, or (2) overwrite the necessary parameters directly using functions such as MI_SetNDmaInterval()
.
(Example) Copy the new DMA1 settings, overwrite the interval information (that is, the Interval Timer and Interval Prescaler information), and set that as the config [structure] for the new DMA1 [channel].
MINDmaConfig config;
//---- get config
MI_GetNDmaConfig( 1, &config );
//---- change config values
config.intervalTimer = 0x100;
config.prescaler = MI_NDMA_INTERVAL_PS_16;
//---- set config
MI_SetNDmaConfig( 1, &config );
MI_InitNDmaConfig
MI_SetNDmaConfig
2008/01/22 Initial version.
CONFIDENTIAL