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 http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>WPADSetDataFormat</title>
9</head>
10
11<body>
12
13<h1>WPADSetDataFormat</h1>
14
15
16<h2>C Specification</h2>
17
18<dl>
19<dd><pre><code>#include &lt;revolution/wpad.h&gt;
20
21#define WPAD_CHAN0                     0
22#define WPAD_CHAN1                     1
23#define WPAD_CHAN2                     2
24#define WPAD_CHAN3                     3
25
26#define WPAD_FMT_CORE                  0
27#define WPAD_FMT_CORE_ACC              1
28#define WPAD_FMT_CORE_ACC_DPD          2
29#define WPAD_FMT_FREESTYLE             3
30#define WPAD_FMT_FREESTYLE_ACC         4
31#define WPAD_FMT_FREESTYLE_ACC_DPD     5
32#define WPAD_FMT_CLASSIC               6
33#define WPAD_FMT_CLASSIC_ACC           7
34#define WPAD_FMT_CLASSIC_ACC_DPD       8
35#define WPAD_FMT_CORE_ACC_DPD_FULL     9
36
37s32 WPADSetDataFormat( s32 chan, u32 fmt );
38      </code></pre>
39  </dd>
40</dl>
41
42<h2>Arguments</h2>
43<TABLE border="1">
44  <TBODY>
45    <TR>
46<TD width="120" bgcolor="#ffffe8"><code><b><i>chan</i></b></code></TD>
47<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
48    </TR>
49    <TR>
50<TD width="120" bgcolor="#ffffe8"><CODE><b><i>fmt</i></b></CODE></TD>
51<TD>One of <code>WPAD_FMT_*</code>.</TD>
52    </TR>
53  </TBODY>
54</TABLE>
55<h2>Return Values</h2>
56<p>
57Returns one of the following codes:
58</p>
59<p>
60<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br>
61</p>
62<H2>Description</H2>
63<p>
64Changes the data format received from the Wii Remote on the specified channel. This function registers the data format change command in the WPAD library. The WPAD library processes registered commands when other commands are not running. Valid data cannot be obtained while commands are being processed. After the change has been made, data obtained with <code><a href="./WPADRead.html">WPADRead</a></code> or autosampling is stored in the structure type corresponding to the specified format. The default setting is the data format for the Wii Remote (<code>WPAD_FMT_CORE</code>).
65</p>
66<p>
67In addition, do not call this function unless necessary. The counter for the screen burn-in protection feature, as counted internally by the system, is reset when the data format is changed by calling this function.
68</p>
69<blockquote>
70Data formats for received data are defined with the macro constants shown below.
71<table border="1">
72<TR>
73<TD width="150"><CODE>WPAD_FMT_CORE </CODE></TD>
74<TD>Wii Remote data format (<a href="./WPADStatus.html"><code>WPADStatus</code> structure</a>). Only button information is valid. <br><B>Note:</B> This is the default type.</TD>
75</TR>
76<TR>
77<TD width="150"><CODE>WPAD_FMT_CORE_ACC </CODE></TD>
78<TD>Wii Remote data format (<a href="./WPADStatus.html"><code>WPADStatus</code> structure</a>). The button and motion sensor information is valid.</TD>
79</TR>
80<TR>
81<TD width="150"><CODE>WPAD_FMT_CORE_ACC_DPD </CODE></TD>
82<TD>Wii Remote data format (<a href="./WPADStatus.html"><code>WPADStatus</code> structure</a>). The button, motion sensor, and pointer information is valid. The pointer has valid size and coordinate data.</TD>
83</TR>
84<TR>
85<TD width="150"><CODE>WPAD_FMT_FREESTYLE</CODE></TD>
86<TD>Nunchuk Style data format type (<a href="./WPADFSStatus.html"><code>WPADFSStatus</code> structure</a>). For the Wii Remote, only the button information is valid.</TD>
87</TR>
88<TR>
89<TD width="150"><CODE>WPAD_FMT_FREESTYLE_ACC</CODE></TD>
90<TD>Nunchuk Style data format type (<a href="./WPADFSStatus.html"><code>WPADFSStatus</code> structure</a>). For the Wii Remote, the button and motion sensor information is valid.</TD>
91</TR>
92<TR>
93<TD width="150"><CODE>WPAD_FMT_FREESTYLE_ACC_DPD</CODE></TD>
94<TD>Nunchuk Style data format type (<a href="./WPADFSStatus.html"><code>WPADFSStatus</code> structure</a>). The Wii Remote button, motion sensor, and pointer information is valid. However, only the coordinate data is valid for the pointer.</TD>
95</TR>
96<TR>
97<TD width="150"><CODE>WPAD_FMT_CLASSIC</CODE></TD>
98<TD>Classic Style data format type (<a href="./WPADCLStatus.html"><code>WPADCLStatus</code> structure</a>). For the Wii Remote, only the button information is valid.</TD>
99</TR>
100<TR>
101<TD width="150"><CODE>WPAD_FMT_CLASSIC_ACC</CODE></TD>
102<TD>Classic Style data format type (<a href="./WPADCLStatus.html"><code>WPADCLStatus</code> structure</a>). For the Wii Remote, the button and motion sensor information is valid.</TD>
103</TR>
104<TR>
105<TD width="150"><CODE>WPAD_FMT_CLASSIC_ACC_DPD</CODE></TD>
106<TD>Classic Style data format type (<a href="./WPADCLStatus.html"><code>WPADCLStatus</code> structure</a>). The Wii Remote button, motion sensor, and pointer information is valid. However, only the coordinate data is valid for the pointer.</TD>
107</TR>
108<TR>
109<TD width="150"><CODE>WPAD_FMT_CORE_ACC_DPD_FULL</CODE></TD>
110<TD>Wii Remote extended data format (<a href="./WPADStatus.html"><code>WPADStatusEx</code> structure</a>). The Wii Remote button, motion sensor, and pointer information is valid. For the pointer, the coordinate data, size, object radius, pixel value, and range are valid. However, the data rate is half that of normal (roughly 100 samples per second).</TD>
111</TR>
112</table>
113</blockquote>
114
115<blockquote>
116The return values are defined as follows.
117<table border="1">
118<TR>
119<TD width="150"><CODE>WPAD_ERR_NONE </CODE></TD>
120<TD>The WPAD library received a command.</TD>
121</TR>
122<TR>
123<TD width="150"><CODE>WPAD_ERR_BUSY </CODE></TD>
124<TD>The WPAD library was unable to receive a command.</TD>
125</TR>
126<TR>
127<TD width="150"><CODE>WPAD_ERR_NO_CONTROLLER </CODE></TD>
128<TD>The connection was broken.</TD>
129</TR>
130</table>
131</blockquote>
132
133<h2>See Also</h2>
134<p>
135<A href="./toc.html" target="contents">WPAD Functions</A><br> <A href="./WPADGetDataFormat.html"><CODE>WPADGetDataFormat</CODE></A>, <A href="./WPADStatus.html"><CODE>WPADStatus</CODE></A>, <A href="./WPADFSStatus.html"><CODE>WPADFSStatus</CODE></A>, <A href="./WPADCLStatus.html"><CODE>WPADCLStatus</CODE></A>, <A href="./WPADStatusEx.html"><CODE>WPADStatusEx</CODE></A><br>
136</p>
137
138<H2>Revision History</H2>
139<p>
1402006/08/15 Added the extended data format<br> 2006/06/19 Changed the name of the external extended controller; added data format<br> 2005/10/20 Initial version.<br>
141</p>
142<hr><p>CONFIDENTIAL</p></body>
143</html>