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=utf-8"> 5<META http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 7<title>KPADGetUnifiedWpadStatus</title> 8</head> 9 10<body> 11 12<h1>KPADGetUnifiedWpadStatus</h1> 13 14<h2>Syntax</h2> 15<dl><dd><pre class="construction"> 16#include <revolution/kpad.h> 17 18typedef struct KPADUnifiedWpadStatus { 19 union{ 20 WPADStatus core; 21 WPADFSStatus fs; 22 WPADCLStatus cl; 23 WPADTRStatus tr ; 24 WPADBLStatus bl; 25 WPADMPStatus mp; 26 } u; 27 u8 fmt; 28 u8 padding; 29} KPADUnifiedWpadStatus; 30 31void KPADGetUnifiedWpadStatus( s32 chan, KPADUnifiedWpadStatus *dst, u32 count ); 32</pre></dd></dl> 33 34<h2>Arguments</h2> 35<TABLE class="arguments" border="1" > 36 <TBODY> 37 <TR> 38<TH>chan</TH> 39<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 40 </TR> 41 <TR> 42<TH>dst</TH> 43<TD>Pointer to the buffer that stores the controller data.</TD> 44 </TR> 45 <TR> 46<TH>count</TH> 47<TD>Number of stored data. This value cannot exceed <CODE>KPAD_RING_BUFS</CODE>.</TD> 48 </TR> 49 </TBODY> 50</TABLE> 51 52<h2>Return Values</h2> 53<p> 54None. 55</p> 56 57<H2>Description</H2> 58<p> 59To the application-created buffer, copies the controller data stored in the internal buffer by the KPAD library. 60</p> 61 62<p> 63Regardless of the number of sampling-completed data in the KPAD library, the number of stored data will always be specified by <SPAN class="argument">count</SPAN>. The top most element will be the newest sampling data. 64</p> 65 66<p> 67<B>Note:</B>This function will not decrement the "number of sampling-completed data" counter in the KPAD library. <a href="./KPADRead.html"><CODE>KPADRead</CODE></a> function decrements the counter to prevent repeat use of data already processed. 68</p> 69 70<p> 71Using the <a href="./KPADRead.html"><CODE>KPADRead</CODE></a> function return value immediately preceding this will give a number close to the actual sampling-completed data count. However, a controller data sampling (interrupt) may occur after the <a href="./KPADRead.html"><CODE>KPADRead</CODE></a> function call. To use the exact same number of data or to obtain the same data processed by the immediately preceding <a href="./KPADRead.html"><CODE>KPADRead</CODE></a> function, <a href="./KPADRead.html"><CODE>KPADRead</CODE></a> and this function need to be called in interrupt-prohibited state. 72</p> 73 74<p> 75The application should reference the copied data through the following method. For error status and controller type definitions, see the description of the <a href="../wpad/WPADStatus.html"><CODE>WPADStatus</CODE></a> structure. 76</p> 77 78<ul> 79<li>First, check the error status (member <SPAN class="argument">u.core.err</SPAN>). The offset of this member is shared and can be checked, regardless of whether the external extension controller is connected. 80<li>If that value is <code>WPAD_ERR_NONE</code>, a sampling-completed data is stored in the <SPAN class="argument">u</SPAN> member. Even if the value is not <code>WPAD_ERR_NONE</code>, some of the data may be properly sampled. 81<li>Next, check the controller type (member <SPAN class="argument">u.core.dev</SPAN>). The offset of this member is also shared regardless of whether the external extension controller is connected. 82<li>Finally, if both the error status and the controller type have the expected values, check the data format (<SPAN class="argument">fmt</SPAN>) member. The <a href="../wpad/WPADGetDataFormat.html"><CODE>WPADGetDataFormat</CODE></a> function's return value at sampling is stored in a <code>u8</code> type. 83<li>Perform an appropriate processing based on the obtained error status, controller type, and data format. The error status, controller type, and data format may change for each element. 84</ul> 85 86<h2>See Also</h2> 87<p class="reference"> 88<a href="./KPADUnifiedWpadStatus.html"><CODE>KPADUnifiedWpadStatus</CODE></a><BR> <a href="./KPADRead.html"><CODE>KPADRead</CODE></a><BR> <a href="../wpad/WPADStatus.html"><CODE>WPADStatus</CODE></a> 89</p> 90 91<H2>Revision History</H2> 92<P> 932008/09/30 Updated the structure declarations.<br>2008/04/30 Updated the structure declarations.<br>2006/10/25 Initial version. <br> 94</P> 95 96<hr><p>CONFIDENTIAL</p></body> 97</html>