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>TPRecvCallback</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">TPRecvCallback <img src="../../image/NTR.gif"><img src="../../image/TWL.gif"></h1> 15<h2>Definition</h2> 16 17<dl> 18 <dd> 19<CODE>#include <nitro/spi.h></CODE><BR> 20 <PRE><CODE>typedef void (*TPRecvCallback)( 21 TPRequestCommand command, 22 TPRequestResult result, 23 u16 index ); 24</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">command</font></strong></em></TD> 31 <TD width="700">Type of request command</TD> 32 </TR> 33 <TR> 34 <TD><em><strong><font face="Courier New">result</font></strong></em></TD> 35 <TD>Processing results</TD> 36 </TR> 37 <TR> 38 <TD><em><strong><font face="Courier New">index</font></strong></em></TD> 39 <TD>Index value of autosampling callback</TD> 40 </TR> 41 </TBODY> 42</TABLE> 43<h2>Return Values</h2> 44<p>None.</p> 45<H2>Description</H2> 46<P>This is the format of the the user callback that is called each time a request to the ARM7 is processed, and each time that a touch panel value is periodically received as the result of autosampling. The <strong><em><code>command</code></em></strong> value identifies for which request the results are acquired. The <strong><em><code>result</code></em></strong> value acquires whether or not it was processed properly. The <strong><em><code>index</code></em></strong> value acquires the index of the most recent data when autosampling is in use. <BR> 47</P> 48<TABLE border="1"> 49 <TBODY> 50 <TR> 51 <TD width="30%"><CODE>TP_REQUEST_COMMAND_SAMPLING</CODE></TD> 52 <TD width="70%">Requests one round of sampling. Sent with a <CODE><A href="TP_RequestSamplingAsync.html">TP_RequestSampling*</A></CODE> function.</TD> 53 </TR> 54 <TR> 55 <TD width="30%"><CODE>TP_REQUEST_COMMAND_AUTO_ON</CODE></TD> 56 <TD width="70%">Requests to start autosampling. Sent with the <CODE><A href="TP_RequestAutoSamplingStart.html">TP_RequestAutoSamplingStart</A></CODE> function.</TD> 57 </TR> 58 <TR> 59 <TD width="30%"><CODE>TP_REQUEST_COMMAND_AUTO_OFF</CODE></TD> 60 <TD width="70%">Requests to stop autosampling. Sent with the <CODE><A href="TP_RequestAutoSamplingStart.html">TP_RequestAutoSamplingStop</A></CODE> function.</TD> 61 </TR> 62 <TR> 63 <TD width="30%"><CODE>TP_REQUEST_COMMAND_SET_STABILITY</CODE></TD> 64 <TD width="70%">Requests to set the chattering parameter. Sent with the <CODE><A href="TP_RequestSetStability.html">TP_RequestSetStability</A></CODE> function.</TD> 65 </TR> 66 <TR> 67 <TD><CODE>TP_REQUEST_COMMAND_AUTO_SAMPLING</CODE></TD> 68 <TD>This callback is called each time data is set by autosampling.</TD> 69 </TR> 70 </TBODY> 71</TABLE> 72<P></P> 73<TABLE border="1"> 74 <TBODY> 75 <TR> 76 <TD width="30%"><CODE>TP_RESULT_SUCCESS</CODE></TD> 77 <TD width="70%">Successful end</TD> 78 </TR> 79 <TR> 80 <TD><CODE>TP_RESULT_INVALID_PARAMETER</CODE></TD> 81 <TD>Parameters in the request that was sent are incorrect.</TD> 82 </TR> 83 <TR> 84 <TD><CODE>TP_RESULT_INVALID_STATUS</CODE></TD> 85 <TD>Cannot process this instruction in current status.</TD> 86 </TR> 87 <TR> 88 <TD><CODE>TP_RESULT_INVALID_EXCLUSIVE</CODE></TD> 89 <TD>ARM7 processor's peripheral device interface is in busy status.</TD> 90 </TR> 91 <TR> 92 <TD><CODE>TP_RESULT_PXI_BUSY</CODE></TD> 93 <TD>Request failed because communication between CPUs is busy</TD> 94 </TR> 95 </TBODY> 96</TABLE> 97<P>The following describes the enumerated type definitions of the arguments.</P> 98<PRE><CODE>// Type of instruction issued to the touch panel 99typedef enum { 100 TP_REQUEST_COMMAND_SAMPLING = 0x0, // Sample one time 101 TP_REQUEST_COMMAND_AUTO_ON = 0x1, // Start autosampling 102 TP_REQUEST_COMMAND_AUTO_OFF = 0x2, // Stop autosampling 103 TP_REQUEST_COMMAND_SETUP_STABILITY = 0x3, // Set chattering provision value 104 TP_REQUEST_COMMAND_AUTO_SAMPLING = 0x10 // Receive autosampling results 105} TPRequestCommand; 106 107// Type of results from the touch panel 108typedef enum { 109 TP_RESULT_SUCCESS = 0 , // Success 110 TP_RESULT_INVALID_PARAMETER , // Invalid parameter 111 TP_RESULT_ILLEGAL_STATUS , // In current status cannot receive instructions 112 TP_RESULT_EXCLUSIVE , // SPI device is busy 113 TP_RESULT_PXI_BUSY // The PXI communication with ARM7 is busy 114} TPRequestResult; 115</CODE></PRE> 116<h2>See Also</h2> 117<P><CODE><A href="TP_SetCallback.html">TP_SetCallback</A>, <A href="TP_RequestSamplingAsync.html">TP_RequestSampling</A>,<A href="TP_RequestAutoSamplingStart.html">TP_RequestAutoSamplingStart</A>, <A href="TP_RequestAutoSamplingStop.html">TP_RequestAutoSamplingStop</A>,<A href="TP_RequestSetStability.html">TP_RequestSetStability</A></CODE></P> 118<H2>Revision History</H2> 119<P>2004/04/16 Initial version.</P> 120<hr><p>CONFIDENTIAL</p></body> 121</html> 122