1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>TP_RequestAutoSamplingStart</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">TP_RequestAutoSamplingStart <img src="../../image/NTR.gif"><img src="../../image/TWL.gif"></h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;nitro/spi.h&gt;</CODE><BR>
20  <PRE><CODE>u32 TP_RequestAutoSamplingStart(
21            u16 vcount,
22            u16 frequence,
23            <A href="TPData.html">TPData</A> samplingBufs[],
24            u16 bufSize );</CODE></PRE>
25  </dd>
26</dl><h2>Arguments</h2>
27<TABLE border="1" width="100%">
28  <TBODY>
29    <TR>
30      <TD width="300"><em><strong><font face="Courier New">vcount</font></strong></em></TD>
31      <TD width="700">Base V-count value for auto sampling.</TD>
32    </TR>
33    <TR>
34      <TD><em><strong><font face="Courier New">frequence</font></strong></em></TD>
35      <TD>The number of samples taken during one frame (MAX 4).</TD>
36    </TR>
37    <TR>
38      <TD><em><strong><font face="Courier New">samplingBufs</font></strong></em></TD>
39      <TD>The pointer that sets the buffer in which auto sampling values are stored.</TD>
40    </TR>
41    <TR>
42      <TD><em><strong><font face="Courier New">bufSize</font></strong></em></TD>
43      <TD>The element count of the buffer passed by <CODE>samplingBufs</CODE>.</TD>
44    </TR>
45  </TBODY>
46</TABLE>
47<h2>Return Values</h2>
48<p>Returns 0 if the request succeeds; returns non-zero value if it fails.</p>
49<H2>Description</H2>
50<P>This function issues a request to ARM7 to begin auto sampling touch panel values and waits for the request to complete internally. This is the synchronous version of the <CODE><A href="TP_RequestAutoSamplingStartAsync.html">TP_RequestAutoSamplingStartAsync</A></CODE> function. After this request is accepted, sampling is carried out periodically and values are stored in the array specified by <b><i><code>samplingBufs</code></i></b>. The autosampling interval is the interval at which VAlarm samples data uniformly, <code><STRONG><EM>frequence</EM></STRONG></code> times per frame, based on the value set in <code><STRONG><EM>vcount</EM></STRONG></code>.<BR>However, the span of time over which the V-Count values range from 200 to 214 is not used for sampling. This is because the V-Count values may be changed by the <CODE><A href="../../gx/gx/GX_SetVCount.html">GX_SetVCount</A></CODE> function. If the V-count value to be sampled is contained in this interval, sampling is delayed until line 215.<BR>If a user callback is set with the <CODE><A href="TP_SetCallback.html">TP_SetCallback</A></CODE> function, notification is given by a callback each time a value is saved. After this function clears <b><i><code>samplingBufs</code></i></b>, the buffer will be used as a loop buffer. The <CODE><A href="TP_GetLatestIndexInAuto.html">TP_GetLatestIndexInAuto</A></CODE> function can be used to get the index of the data that was last saved. When auto-sampling, it is possible that&nbsp; the sampling value for (newest index + 1) will be unexpectedly overwritten by an interrupt. If you are using the sampling values from one frame all together, you can avoid this by securing an area that is at least <b><i><code>frequence</code></i></b> + 1.<BR>
51</P>
52<H2>Note</H2>
53<P>This function uses an interrupt to wait for a completion response from ARM7. Notice that if it is called while FIFO receive interrupts from ARM7 are prohibited, it will not be possible to return from wait.</P>
54<h2>See Also</h2>
55<P><CODE><A href="TP_RequestAutoSamplingStop.html">TP_RequestAutoSamplingStop</A>, <A href="TP_GetLatestRawPointInAuto.html">TP_GetLatestRawPointInAuto</A>, <A href="TP_GetLatestCalibratedPointInAuto.html">TP_GetLatestCalibratedPointInAuto</A>, <A href="TP_GetLatestIndexInAuto.html">TP_GetLatestIndexInAuto</A>, <A href="TP_RequestAutoSamplingStartAsync.html">TP_RequestAutoSamplingStartAsync</A>, <A href="TPData.html">TPData</A></CODE></P>
56<H2>Revision History</H2>
57<P>
582007/10/29 Added a description.<br> 2007/10/16 Added an explanation of unused V-count values.<br>2006/09/01 Revised the description of <CODE>bufSize</CODE>.<br>2004/04/21 Made this a synchronous function and created an asynchronous version.<br>2004/04/16 Initial version.</P>
59<hr><p>CONFIDENTIAL</p></body>
60</html>
61