1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>CAMERA_DmaPipeInfinity</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">CAMERA_DmaPipeInfinity <IMG src="../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <CODE>#include &lt;twl/camera.h&gt;</CODE><BR>
16  <BR>
17  <CODE>void CAMERA_DmaPipeInfinity(u32 dmaNo, void *dest, u32 unit, MINDmaCallback callback, void* arg);</CODE>
18</DL>
19<H2>Arguments</H2>
20<TABLE border="1" width="100%">
21  <TBODY>
22    <TR>
23      <TD width="13%"><EM><STRONG>dmaNo</STRONG></EM></TD>
24      <TD width="87%">New DMA channel to use (0&ndash;3)</TD>
25    </TR>
26    <TR>
27      <TD width="13%"><EM><STRONG>dest</STRONG></EM></TD>
28      <TD width="87%">The transfer destination address</TD>
29    </TR>
30    <TR>
31      <TD width="13%"><EM><STRONG>unit</STRONG></EM></TD>
32      <TD width="87%">One-time transfer size (width * line count)</TD>
33    </TR>
34    <TR>
35      <TD><EM><STRONG>callback</STRONG></EM></TD>
36      <TD>Callback when the new DMA ends</TD>
37    </TR>
38    <TR>
39      <TD><EM><STRONG>arg</STRONG></EM></TD>
40      <TD>Callback arguments when the new DMA ends</TD>
41    </TR>
42  </TBODY>
43</TABLE>
44
45<H2>Return Values</H2>
46<P>None.</P>
47
48<H2>Description</H2>
49<P>
50Consecutively receives frame data asynchronously from the camera buffer. Once this function is called, data will continue to be received until the <code><A href="../mi/ndma/MI_StopNDma.html">MI_StopNDma(dmaNo)</A></code> function is called.<BR><BR>
51This function internally uses a new DMA to receive data. See the <code><A href="../mi/ndma/MI_NDmaCopy.html">MI_NDmaCopy</A></code> function for more detailed descriptions of a new DMA.<BR><BR>
52The 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.<BR>
53One 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 <code><A href="CAMERA_SetTrimmingParams.html">CAMERA_SetTrimmingParams</A></code> function if it is called, and the <code><A href="CAMERA_I2CSize.html">CAMERA_I2CSize*</A></code> functions otherwise. (It will be the width of the default camera resolution value if none of these functions have been called. See the <A href="about_camera.html"><B>Overview</B></A> for more information on default values.)Calculate the number of lines using the line count set with the <code><A href="CAMERA_SetTransferLines.html">CAMERA_SetTransferLines</A></code> function. The default line count is 1 if it has not been set by the <code><A href="CAMERA_SetTransferLines.html">CAMERA_SetTransferLines</A></code> function. In addition, adjust the one-time transfer size that is ultimately specified to be 2 KB (1024 pixels) or less. <BR><BR><B>Note:</B> Unlike <code><A href="CAMERA_DmaRecv.html">CAMERA_DMARecv</A></code> and other functions, the transfer destination address <span class="argument">dest</span> is fixed for this function, and <SPAN class="argument">unit</SPAN> bytes of data (the one-time transfer size) will continue to be transferred to <SPAN class="argument">dest</SPAN>. In order to get the entire frame, therefore, the <SPAN class="argument">unit</SPAN> bytes of data transferred into <SPAN class="argument">dest</SPAN> must be copied into another frame buffer by the callback specified by this function. <BR><BR>Some example code is shown below.
54<BLOCKQUOTE><B>Example:</B><BR>
55<BR>
56<PRE>#define WIDTH 256
57#define HEIGHT 192
58
59CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240);
60CAMERA_SetTrimming(TRUE);
61CAMERA_SetTransferLines(CAMERA_GET_MAX_LINES(WIDTH));    /* 256*4=1024 pixels */
62
63.
64.
65.
66
67CAMERA_DmaPipeInfinity(0, buffer, CAMERA_GetBytesAtOnce(WIDTH), NULL, NULL);</PRE></BLOCKQUOTE>
68
69</P>
70
71<H2>See Also</H2>
72<P><CODE><A href="CAMERA_SetTransferLines.html">CAMERA_SetTransferLines</A>, <A href="../mi/ndma/MI_StopNDma.html">MI_StopNDma</A>, <A href="CAMERA_SetTrimmingParams.html">CAMERA_SetTrimmingParams</A>?<A href="CAMERA_SetTrimming.html">CAMERA_SetTrimming</A>, <A href="CAMERA_I2CSize.html">CAMERA_I2CSize*</A>, <A href="CAMERA_GetBytesAtOnce.html">CAMERA_GetBytesAtOnce</A>, <A href="CAMERA_GET_MAX_LINES.html">CAMERA_GET_MAX_LINES</A></CODE></P>
73<H2>Revision History</H2>
74<P>
752008/09/11 Changed the sample code. <br>2007/11/14 Revised explanations for specifying the width and differences with the <code>CAMERA_DmaRecv</code> function. <BR>2007/10/22 Added explanations. <BR>2007/10/02 Initial version.</P>
76<hr><p>CONFIDENTIAL</p></body>
77</HTML>
78