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 13 14<h1>KPADGetUnifiedWpadStatus</h1> 15 16 17<h2>C Specification</h2> 18<dl> 19 <dd><pre><code>#include <revolution/kpad.h></code></pre> 20 </dd> 21<code><pre> 22typedef struct KPADUnifiedWpadStatus { 23 union { 24 WPADStatus core; 25 WPADFSStatus fs; 26 WPADCLStatus cl; 27 } u; 28 u8 fmt; 29 u8 padding; 30} KPADUnifiedWpadStatus; 31 32void KPADGetUnifiedWpadStatus( s32 <i>chan</i>, 33 KPADUnifiedWpadStatus *<i>dst</i>, 34 u32 <i>count</i> ) ; 35</pre></code> 36</dl> 37 38<h2>Arguments</h2> 39<p> 40<TABLE border="1"> 41 <TBODY> 42 <TR> 43<TD><code><b><i>chan</i></b></code></TD> 44<TD>one of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 45 </TR> 46 <TR> 47<TD><code><b><i>dst</i></b></code></TD> 48 <TD>Pointer to the buffer that stores the controller data</TD> 49 </TR> 50 <TR> 51<TD><code><b><i>count</i></b></code></TD> 52 <TD>Number of stored data. This value cannot exceed KPAD_RING_BUFS.</TD> 53 </TR> 54 </TBODY> 55</TABLE> 56</p> 57 58<h2>Return Values</h2> 59<p> 60None. 61</p> 62 63<H2>Description</H2> 64<p> 65Copies the controller data stored in the internal buffer by the KPAD library to an application created buffer. 66</p> 67 68<p> 69Regardless of the number of data actually completed sampling in the KPAD library, the number of stored data will always be that specified by <b><i>count</i></b>. The top most element will be the newest sampling data. 70</p> 71 72<p> 73<B>Note:</B> This function will not decrement the "number of sampling completed data" counter in the KPAD library. The <a href="./KPADRead.html">KPADRead</a> function decrements the counter to prevent repeat use of data already processed. 74</p> 75 76<p> 77Using the <a href="./KPADRead.html">KPADRead</a> function return value immediately preceding this will give a number close to the actual sampling completed data count. However, there is a chance of a controller data sampling (interrupt) after a <a href="./KPADRead.html">KPADRead</a> function call. If you wish to use the exact same number of data or wish to obtain the same data processed by an immediately preceding <a href="./KPADRead.html">KPADRead</a> function, <a href="./KPADRead.html">KPADRead</a> and this function need to be called in interrupt prohibited state. 78</p> 79 80<p> 81The application should reference the copied data through the following method. For error status and controller type definitions, see the <a href="../wpad/WPADStatus.html">WPADStatus</a> structure description. 82</p> 83 84<ul> 85<li>First, check the error status (member <code>u.core.err</code>). The offset of this member is shared and can be checked, regardless of whether the external extension controller is connected. 86<li>If that value is <code>WPAD_ERR_NONE</code>, sampling completed data is stored in the member <code>u</code>. Even if the value is not <code>WPAD_ERR_NONE</code>, some of the data may be properly sampled. 87<li>Next, check the controller type (member <code>u.core.dev</code>). The offset of this member is also shared regardless of whether the external extension controller is connected. 88<li>If both the error status and the controller type have the expected values, finally check the data format (member <code>fmt</code>). The <a href="../wpad/WPADGetDataFormat.html">WPADGetDataFormat</a> function return value at sampling is stored in a <code>u8</code> type. 89<li>Perform 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. 90</ul> 91 92<h2>See Also</h2> 93<p> 94<a href="./KPADUnifiedWpadStatus.html">KPADUnifiedWpadStatus</a><br> <a href="./KPADRead.html">KPADRead</a><br> <a href="../wpad/WPADStatus.html">WPADStatus</a><br> <a href="../wpad/WPADFSStatus.html">WPADFSStatus</a><br> <a href="../wpad/WPADCLStatus.html">WPADCLStatus</a><br> 95</p> 96 97<H2>Revision History</H2> 98<P> 992006/10/25 Initial version. <br> 100</P> 101 102<hr> 103<P>CONFIDENTIAL</p> 104</BODY> 105</HTML>