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>TPData</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">TPData <img src="../../image/NTR.gif"><img src="../../image/TWL.gif"></h1>
15<h2>Definition</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;nitro/spi.h&gt;</CODE><BR>
20  <PRE><CODE>typedef struct {
21        u16         x;
22        u16         y;
23        u16         touch;
24        u16         validity;
25} TPData;</CODE></PRE>
26  </dd>
27</dl>
28<h2>Elements</h2>
29<TABLE border="1" width="100%">
30  <TBODY>
31    <TR>
32      <TD width="300"><em><strong><font face="Courier New">x</font></strong></em></TD>
33      <TD width="700">x-coordinate</TD>
34    </TR>
35    <TR>
36      <TD><em><strong><font face="Courier New">y</font></strong></em></TD>
37      <TD>y-coordinate</TD>
38    </TR>
39    <TR>
40      <TD><em><strong><font face="Courier New">touch</font></strong></em></TD>
41      <TD>Touch determination flag </TD>
42    </TR>
43    <TR>
44      <TD><em><strong><font face="Courier New">validity</font></strong></em></TD>
45      <TD>Coordinate value validity flag<br />Even when INVALID, touch value is valid</TD>
46    </TR>
47  </TBODY>
48</TABLE>
49<H2>Description</H2>
50<P>This structure expresses touch panel coordinates. You can use this structure for raw touch panel values as well as for screen coordinate values.</P>
51<P><code><em><strong>touch</strong></em></code> acquires the following values, and shows whether the touch panel is currently being touched.</P>
52<PRE><I>TP_TOUCH_OFF      0      //  Touch panel is not being touched
53TP_TOUCH_ON       1      //  Touch panel is being touched</I></PRE>
54<P><code><em><strong>validity</strong></em></code> acquires the following values and shows the validity of the results that were obtained from the chattering measure process. Even when this flag is INVALID, touch value is valid. Therefore, you should still perform ON/OFF assessment.</P>
55<PRE><I>TP_VALIDITY_VALID         0        // Valid data
56TP_VALIDITY_INVALID_X     1        // X coordinate data is invalid
57TP_VALIDITY_INVALID_Y     2        // Y coordinate data is invalid
58TP_VALIDITY_INVALID_XY   (TP_VALIDITY_INVALID_X | TP_VALIDITY_INVALID_Y)   // X, Y coordinate data are both invalid</I></PRE>
59<P>When creating an application, the case where the <code>INVALID</code> value is stored should be taken into consideration. To avoid abnormal operation even when an <code>INVALID</code> value was obtained, it is recommended that you take precautions against such a situation by using the coordinate data obtained last as <code>VALID</code> value.</P>
60<P><IMG src="touch_panel.gif" width="561" height="343" border="0"></P>
61<h2>See Also</h2>
62<H2>Revision History</H2>
63<P>2004/04/16 Initial version.</P>
64<hr><p>CONFIDENTIAL</p></body>
65</html>
66