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 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 } u; 26 u8 fmt; 27 u8 padding; 28} KPADUnifiedWpadStatus; 29 30void KPADGetUnifiedWpadStatus( s32 chan, KPADUnifiedWpadStatus *dst, u32 count ); 31</pre></dd></dl> 32 33<h2>Arguments</h2> 34<TABLE class="arguments" border="1" > 35 <TBODY> 36 <TR> 37<TH>chan</TH> 38<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 39 </TR> 40 <TR> 41<TH>dst</TH> 42<TD>Pointer to the buffer that stores the controller data.</TD> 43 </TR> 44 <TR> 45<TH>count</TH> 46<TD>Number of stored data. This value cannot exceed <CODE>KPAD_RING_BUFS</CODE>.</TD> 47 </TR> 48 </TBODY> 49</TABLE> 50 51<h2>Return Values</h2> 52<p> 53None. 54</p> 55 56<H2>Description</H2> 57<p> 58To the application-created buffer, copies the controller data stored in the internal buffer by the KPAD library. 59</p> 60 61<p> 62Regardless 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. 63</p> 64 65<p> 66<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. 67</p> 68 69<p> 70Using 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. 71</p> 72 73<p> 74The 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. 75</p> 76 77<ul> 78<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. 79<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. 80<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. 81<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. 82<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. 83</ul> 84 85<h2>See Also</h2> 86<p class="reference"> 87<a href="./KPADUnifiedWpadStatus.html">KPADUnifiedWpadStatus</a>, 88<a href="./KPADRead.html">KPADRead</a>, 89<a href="../wpad/WPADStatus.html">WPADStatus</a> 90</p> 91 92<H2>Revision History</H2> 93<P> 942008/04/30 Updated the structure declarations.<br>2006/10/25 Initial version. <br> 95</P> 96 97<hr><p>CONFIDENTIAL</p></body> 98</html>