#include <twl/mi.h>
void MI_NDmaPipe( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size );
void MI_NDmaPipe_SetUp( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size );
void MI_NDmaPipeAsync( u32 dmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg );
void MI_NDmaPipeAsync_SetUp( u32 dmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg );
void MI_NDmaPipeEx( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaConfig *config );
void MI_NDmaPipeEx_SetUp( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaConfig *config );
void MI_NDmaPipeExAsync( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg ,
MINDmaConfig *config
);
void MI_NDmaPipeExAsync_SetUp( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaConfig *config
);
void MI_NDmaPipe_Dev( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaDevice dev );
void MI_NDmaPipe_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaDevice dev );
void MI_NDmaPipeAsync_Dev( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaDevice dev );
void MI_NDmaPipeAsync_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaDevice dev );
void MI_NDmaPipeEx_Dev( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaConfig *config,
MINDmaDevice dev );
void MI_NDmaPipeEx_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaConfig *config,
MINDmaDevice dev );
void MI_NDmaPipeExAsync_Dev( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaConfig *config,
MINDmaDevice dev );
void MI_NDmaPipeExAsync_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
volatile void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaConfig *config,
MINDmaDevice dev );
ndmaNo | DMA channel to use (0-3 within the new DMA) |
src | Transfer source address |
dest | Transfer destination address |
size | Transfer size |
callback | Callback when DMA ends |
arg | Callback argument when DMA ends |
config | DMA configuration |
dev | Device (if starting a device) |
None.
Uses the new DMA to continually send data from the same transfer source address to the same transfer destination address.
(The *_SetUp
functions configure the DMA settings but do not transfer data.)
MI_NDmaPipe*
uses the TWL's new DMA to repeatedly send data in word (4-byte) units. Both the transfer source address (src) and the transfer destination address (dest) must be 4-byte aligned. The transfer size (size) needs to be a multiple of 4.
Specify the new DMA to use as a number between 0 and 3, in ndmaNo.
The MI_NDmaPipe*
functions includes functions for the separate operations given below.
-Whether to wait for DMA shutdown inside the function
-Whether to use defaults for advanced DMA settings or user specifications
-Whether to start DMA immediately, or start it based on an interrupt from a peripheral device
Note that the *_SetUp
functions configure the DMA settings but do not transfer data. To start DMA, call the MI_NDmaRestart
function.
Functions | Wait for DMA Completion in the Function | Detailed DMA Settings | Start DMA |
---|---|---|---|
MI_NDmaPipe |
Yes | Default | Immediately |
MI_NDmaPipeAsync |
No (Async) | Default | Immediately |
MI_NDmaPipeEx |
Yes | User-defined | Immediately |
MI_NDmaPipeExAsync |
No (Async) | User-defined | Immediately |
MI_NDmaPipe_Dev |
Yes | Default | Interrupt from peripheral device |
MI_NDmaPipeAsync_Dev |
No (Async) | Default | Interrupt from peripheral device |
MI_NDmaPipeEx_Dev |
Yes | User-defined | Interrupt from peripheral device |
MI_NDmaPipeExAsync_Dev |
No (Async) | User-defined | Interrupt from peripheral device |
The Async-type functions
calls the callback specified in callback upon DMA completion. The callback is of type MINDmaCallback
(a void
-type function that takes one of the void*
arguments). The callback argument is called from the system DMA interrupt handler and therefore is called even if interrupts are prohibited.
To achieve maximum functionality, it is necessary to understand how to use Async-type functions.
For more information, see the MI_DmaCopy
function.
The config argument is a pointer to the structure that determines the details of the DMA behavior.
The dev argument indicates the device when performing DMA upon startup of a peripheral device. For the values that can be set, see "DMA Start Timing" in New DMA: Overview
Uses the new I/O DMA registers.
MI_CpuPipe*
MI_DmaPipe*
MI_NDmaClear*
MI_NDmaFill*
MI_NDmaRecv
MI_NDmaRestart
MI_NDmaSend*
New DMA: Overview
2008/11/19 Added the link for MINDmaDevice
.
2007/10/31 Added _SetUp
.
2007/10/24 Initial version.
CONFIDENTIAL