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<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/wpad.h&gt;
18#include &lt;revolution/wpadBalance.h&gt;
19#include &lt;revolution/wpadGuitar.h&gt;
20#include &lt;revolution/wpadTrain.h&gt;
21
22#define WPAD_CHAN0                     0
23#define WPAD_CHAN1                     1
24#define WPAD_CHAN2                     2
25#define WPAD_CHAN3                     3
26
27#define WPAD_FMT_CORE                  0
28#define WPAD_FMT_CORE_ACC              1
29#define WPAD_FMT_CORE_ACC_DPD          2
30#define WPAD_FMT_FREESTYLE             3
31#define WPAD_FMT_FREESTYLE_ACC         4
32#define WPAD_FMT_FREESTYLE_ACC_DPD     5
33#define WPAD_FMT_CLASSIC               6
34#define WPAD_FMT_CLASSIC_ACC           7
35#define WPAD_FMT_CLASSIC_ACC_DPD       8
36#define WPAD_FMT_CORE_ACC_DPD_FULL     9
37#define WPAD_FMT_TRAIN                10
38#define WPAD_FMT_GUITAR               11
39#define WPAD_FMT_BALANCE_CHECKER      12
40
41s32 WPADSetDataFormat( s32 chan, u32 fmt );
42</pre></dd></dl>
43
44<h2>Arguments</h2>
45<TABLE class="arguments" border="1" >
46  <TBODY>
47    <TR>
48<TH>chan</TH>
49<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD>
50    </TR>
51    <TR>
52<TH>fmt</TH>
53<TD>One of the <code>WPAD_FMT_*</code>.</TD>
54    </TR>
55  </TBODY>
56</TABLE>
57
58<h2>Return Values</h2>
59<p>
60Returns one of the following codes:
61</p>
62<p>
63<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br>
64</p>
65
66<H2>Description</H2>
67<p>
68Changes 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 the <a href="./WPADRead.html"><CODE>WPADRead</CODE></a> function or autosampling is stored in the structure type corresponding to the specified format. By default, the Wii Remote data format (<code>WPAD_FMT_CORE</code>) is used for the Wii Remote, and the Wii Balance Board data format (<code>WPAD_FMT_BALANCE_CHECKER</code>) is used for the Wii Balance Board.
69</p>
70<p>
71Do not call this function unless necessary because 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.
72</p>
73<blockquote>
74Data formats for received data are defined with the macro constants shown below.
75<TABLE class="arguments" border="1" >
76  <TR>
77<TH>WPAD_FMT_CORE </TH>
78<TD>Wii Remote data format (<a href="./WPADStatus.html"><code>WPADStatus</code></a> structure). Only button information is valid. <br><font color="ff0000"><B>Note:</B> This is the default type.</font></TD>
79  </TR>
80  <TR>
81<TH>WPAD_FMT_CORE_ACC </TH>
82<TD>Wii Remote data format (<a href="./WPADStatus.html"><code>WPADStatus</code></a> structure). The button and motion sensor information is valid.</TD>
83  </TR>
84  <TR>
85<TH>WPAD_FMT_CORE_ACC_DPD </TH>
86<TD>Wii Remote data format (<a href="./WPADStatus.html"><code>WPADStatus</code></a> structure). The button, motion sensor, and pointer information is valid. The pointer has valid size and coordinate data.</TD>
87  </TR>
88  <TR>
89<TH>WPAD_FMT_FREESTYLE</TH>
90<TD>Nunchuk Style data format (<a href="./WPADStatus.html"><code>WPADFSStatus</code></a> structure). Only the button information is valid for the Wii Remote.</TD>
91  </TR>
92  <TR>
93<TH>WPAD_FMT_FREESTYLE_ACC</TH>
94<TD>Nunchuk Style data format (<a href="./WPADStatus.html"><code>WPADFSStatus</code></a> structure). The button and Motion Sensor information is valid for the Wii Remote.</TD>
95  </TR>
96  <TR>
97<TH>WPAD_FMT_FREESTYLE_ACC_DPD</TH>
98<TD>Nunchuk Style data format (<a href="./WPADStatus.html"><code>WPADFSStatus</code></a> structure). The Wii Remote button, Motion Sensor, and Pointer information is valid. However, only the coordinate data is valid for the Pointer.</TD>
99  </TR>
100  <TR>
101<TH>WPAD_FMT_CLASSIC</TH>
102<TD>Classic Style data format (<a href="./WPADStatus.html"><code>WPADCLStatus</code></a> structure). Only the button information is valid for the Wii Remote.</TD>
103  </TR>
104  <TR>
105<TH>WPAD_FMT_CLASSIC_ACC</TH>
106<TD>Classic Style data format (<a href="./WPADStatus.html"><code>WPADCLStatus</code></a> structure). The button and Motion Sensor information is valid for the Wii Remote.</TD>
107  </TR>
108  <TR>
109<TH>WPAD_FMT_CLASSIC_ACC_DPD</TH>
110<TD>Classic Style data format (<a href="./WPADStatus.html"><code>WPADCLStatus</code></a> structure). The Wii Remote button, Motion Sensor, and Pointer information is valid. However, only the coordinate data is valid for the Pointer.</TD>
111  </TR>
112  <TR>
113<TH>WPAD_FMT_CORE_ACC_DPD_FULL</TH>
114<TD>Wii Remote extended data format (<a href="./WPADStatus.html"><code>WPADStatusEx</code></a> structure). 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>
115  </TR>
116  <TR>
117<TH>WPAD_FMT_TRAIN</TH>
118<TD>Wii Remote + Master controller data format (<a href="./WPADStatus.html"><code>WPADTRStatus</code></a> structure). Only Wii Remote buttons are enabled.</TD>
119  </TR>
120  <TR>
121<TH>WPAD_FMT_GUITAR</TH>
122<TD>Wii Remote + Guitar controller data format (<a href="./WPADStatus.html"><code>WPADCLStatus</code></a> structure). For the Wii Remote, the button, Motion Sensor, and Pointer information is valid. However, only the coordinate data is valid for the pointer.</TD>
123  </TR>
124  <TR>
125<TH>WPAD_FMT_BALANCE_CHECKER</TH>
126<TD>Wii Balance Board data format (<a href="./WPADStatus.html"><code>WPADBLStatus</code> structure</a>). <font color="#ff0000">Note: Wii Balance Board default</font></TD>
127  </TR>
128</table>
129</blockquote>
130
131<blockquote>
132The return values are defined as follows.
133<TABLE class="arguments" border="1" >
134  <TR>
135<TH>WPAD_ERR_NONE</TH>
136<TD>The WPAD library received a command.</TD>
137  </TR>
138  <TR>
139<TH>WPAD_ERR_BUSY</TH>
140<TD>The WPAD library was unable to receive a command.</TD>
141  </TR>
142  <TR>
143<TH>WPAD_ERR_NO_CONTROLLER</TH>
144<TD>The connection was broken.</TD>
145  </TR>
146</table>
147</blockquote>
148
149<h2>See Also</h2>
150<p class="reference">
151<A href="./WPADGetDataFormat.html">WPADGetDataFormat</A>,
152<A href="./WPADStatus.html">WPADStatus</A>
153</p>
154
155<H2>Revision History</H2>
156<p>
1572008/04/16 Added to the description of the master controller, guitar controller, and Wii Balance Board. Deleted the <CODE>WPADFSStatus</CODE>, <CODE>WPADCLStatus</CODE>, and <CODE>WPADStatusEx</CODE> structures from <B>See Also</B>.<br>2006/08/15 Added the extended data format.<br>2006/06/19 Renamed the external extension controller and added a data format.<br>2005/10/20 Initial version.<br>
158</p>
159
160<hr><p>CONFIDENTIAL</p></body>
161</html>