CAMERA_DmaPipeInfinity

Syntax

#include <twl/camera.h>

void CAMERA_DmaPipeInfinity(u32 dmaNo, void *dest, u32 unit, MINDmaCallback callback, void* arg);

Arguments

dmaNo New DMA channel to use (0–3)
dest The transfer destination address
unit One-time transfer size (width * line count)
callback Callback when the new DMA ends
arg Callback arguments when the new DMA ends

Return Values

None.

Description

Consecutively receives frame data asynchronously from the camera buffer. Once this function is called, data will continue to be received until the MI_StopNDma(dmaNo) function is called.

This function internally uses a new DMA to receive data. See the MI_NDmaCopy function for more detailed descriptions of a new DMA.

The width and line count used when finding the one-time transfer size will indicate the number of bytes transferred for a single line and the number of lines transferred at once, respectively.
One pixel takes up two bytes, so multiply the width by 2 to calculate the number of bytes to transfer. The width is the same as the one set by the CAMERA_SetTrimmingParams function if it is called, and the CAMERA_I2CSize* functions otherwise. (It will be the width of the default camera resolution value if none of these functions have been called. See the Overview for more information on default values.)Calculate the number of lines using the line count set with the CAMERA_SetTransferLines function. The default line count is 1 if it has not been set by the CAMERA_SetTransferLines function. In addition, adjust the one-time transfer size that is ultimately specified to be 2 KB (1024 pixels) or less.

Note: Unlike CAMERA_DMARecv and other functions, the transfer destination address dest is fixed for this function, and unit bytes of data (the one-time transfer size) will continue to be transferred to dest. In order to get the entire frame, therefore, the unit bytes of data transferred into dest must be copied into another frame buffer by the callback specified by this function.

Some example code is shown below.

Example:

#define WIDTH 256
#define HEIGHT 192

CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240);
CAMERA_SetTrimming(TRUE);
CAMERA_SetTransferLines(CAMERA_GET_MAX_LINES(WIDTH);    /* 256*4=1024 pixels */

.
.
.

CAMERA_DmaPipeInfinity(0, buffer, CAMERA_GetBytesAtOnce(WIDTH), NULL, NULL);

See Also

CAMERA_SetTransferLines, MI_StopNDma, CAMERA_SetTrimmingParams, CAMERA_SetTrimming, CAMERA_I2CSize*, CAMERA_GetBytesAtOnce, CAMERA_GET_MAX_LINES

Revision History

2008/09/11 Changed the sample code.
2007/11/14 Revised explanations for specifying the width and differences with the CAMERA_DmaRecv function.
2007/10/22 Added explanations.
2007/10/02 Initial version.


CONFIDENTIAL