MI_NDmaRecv*

Syntax

#include <twl/mi.h>

void MI_NDmaRecv( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size );
void MI_NDmaRecv_SetUp( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size );
void MI_NDmaRecvAsync( u32 dmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg );
void MI_NDmaRecvAsync_SetUp( u32 dmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg );
void MI_NDmaRecvEx( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaConfig *config );
void MI_NDmaRecvEx_SetUp( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaConfig *config );
void MI_NDmaRecvExAsync( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg ,
MINDmaConfig *config );
void MI_NDmaRecvExAsync_SetUp( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaConfig *config );
void MI_NDmaRecv_Dev( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaDevice dev );
void MI_NDmaRecv_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaDevice dev );
void MI_NDmaRecvAsync_Dev( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaDevice dev );
void MI_NDmaRecvAsync_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaDevice dev );
void MI_NDmaRecvEx_Dev( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaConfig *config,
MINDmaDevice dev );
void MI_NDmaRecvEx_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaConfig *config,
MINDmaDevice dev );
void MI_NDmaRecvExAsync_Dev( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaConfig *config,
MINDmaDevice dev );
void MI_NDmaRecvExAsync_Dev_SetUp( u32 ndmaNo,
volatile const void* src,
void* dest,
u32 size,
MINDmaCallback callback,
void* arg,
MINDmaConfig *config,
MINDmaDevice dev );

Arguments

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)

Return Values

None.

Description

Uses the new DMA to receive data from the same source transfer address.
(The *_SetUp functions configure the DMA settings but do not transfer data.)

The MI_NDmaRecv* functions uses the TWL's new DMA to repeatedly receive 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_NDmaRecv* functions include 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

In addition, the *_SetUp functions only configure the given settings without starting DMA. To start DMA, call the MI_NDmaRestart function.

Functions Wait for DMA Completion in the Function Detailed DMA Settings Start DMA
MI_NDmaRecv Yes Default Immediately
MI_NDmaRecvAsync No (Async) Default Immediately
MI_NDmaRecvEx Yes User-defined Immediately
MI_NDmaRecvExAsync No (Async) User-defined Immediately
MI_NDmaRecv_Dev Yes Default Interrupt from peripheral device
MI_NDmaRecvAsync_Dev No (Async) Default Interrupt from peripheral device
MI_NDmaRecvEx_Dev Yes User-defined Interrupt from peripheral device
MI_NDmaRecvExAsync_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

Internal Operation

Uses the new I/O DMA registers.

See Also

MI_NDmaFill*
MI_NDmaClear*
MI_NDmaSend*
MI_DmaRecv*
MI_CpuRecv*
MI_NDmaRestart
New DMA: Overview

Revision History

2008/11/19 Added the link for MINDmaDevice.
2007/10/31 Added _SetUp.
2007/10/23 Initial version.


CONFIDENTIAL