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_DmaRecv</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">CAMERA_DmaRecv <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_DmaRecv(u32 dmaNo, void *dest, u32 unit, u32 length);</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 width="13%"><EM><STRONG>length</STRONG></EM></TD>
36      <TD width="87%">Total size to transfer (frame size)</TD>
37    </TR>
38  </TBODY>
39</TABLE>
40
41<H2>Return Values</H2>
42<P>None.</P>
43
44<H2>Description</H2>
45<P>
46Receives frame data from the camera buffer.<BR><BR>
47This 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>
48The 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>
49One 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>Some example code is shown below.
50<BLOCKQUOTE><B>Example:</B><BR>
51<BR>
52<PRE>#define WIDTH 256<BR>
53#define HEIGHT 192
54
55CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240);
56CAMERA_SetTrimming(TRUE);
57CAMERA_SetTransferLines(CAMERA_GET_MAX_LINES(WIDTH));    /* 256*4=1024 pixels */
58
59.
60.
61.
62
63CAMERA_DmaRecv(0, buffer, CAMERA_GetBytesAtOnce(WIDTH), CAMERA_GET_FRAME_BYTES(WIDTH, HEIGHT));</PRE></BLOCKQUOTE>
64</P>
65
66<H2>See Also</H2>
67<P><CODE><A href="CAMERA_DmaRecvAsync.html">CAMERA_DmaRecvAsync</A>, <A href="CAMERA_SetTransferLines.html">CAMERA_SetTransferLines</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_FRAME_BYTES.html">CAMERA_GET_FRAME_BYTES</A>, <A href="CAMERA_GET_MAX_LINES.html">CAMERA_GET_MAX_LINES</A></CODE></P>
68<H2>Revision History</H2>
69<P>
702008/09/11 Changed the sample code. <br>2007/11/14 Revised explanations for specifying the width. <BR>2007/10/22 Added explanations. <BR>2007/10/02 Initial version.</P>
71<hr><p>CONFIDENTIAL</p></body>
72</HTML>
73