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=utf-8"> 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 <revolution/wpad.h> 18#include <revolution/wpadBalance.h> 19#include <revolution/wpadGuitar.h> 20#include <revolution/wpadDrum.h> 21#include <revolution/wpadTaiko.h> 22#include <revolution/wpadTrain.h> 23 24#define WPAD_CHAN0 0 25#define WPAD_CHAN1 1 26#define WPAD_CHAN2 2 27#define WPAD_CHAN3 3 28 29#define WPAD_FMT_CORE 0 30#define WPAD_FMT_CORE_ACC 1 31#define WPAD_FMT_CORE_ACC_DPD 2 32#define WPAD_FMT_FREESTYLE 3 33#define WPAD_FMT_FREESTYLE_ACC 4 34#define WPAD_FMT_FREESTYLE_ACC_DPD 5 35#define WPAD_FMT_CLASSIC 6 36#define WPAD_FMT_CLASSIC_ACC 7 37#define WPAD_FMT_CLASSIC_ACC_DPD 8 38#define WPAD_FMT_CORE_ACC_DPD_FULL 9 39#define WPAD_FMT_TRAIN 10 40#define WPAD_FMT_GUITAR 11 41#define WPAD_FMT_BALANCE_CHECKER 12 42#define WPAD_FMT_DRUM 15 43#define WPAD_FMT_MPLS 16 44#define WPAD_FMT_TAIKO 17 45 46s32 WPADSetDataFormat( s32 chan, u32 fmt ); 47</pre></dd></dl> 48 49<h2>Arguments</h2> 50<TABLE class="arguments" border="1" > 51 <TBODY> 52 <TR> 53<TH>chan</TH> 54<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 55 </TR> 56 <TR> 57<TH>fmt</TH> 58<TD>One of the <code>WPAD_FMT_*</code>.</TD> 59 </TR> 60 </TBODY> 61</TABLE> 62 63<h2>Return Values</h2> 64<p> 65Returns one of the following codes: 66</p> 67<p> 68<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br> 69</p> 70 71<H2>Description</H2> 72<p> 73Changes 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. 74</p> 75<p> 76Do 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. 77</p> 78<blockquote> 79Data formats for received data are defined with the macro constants shown below. 80<TABLE class="arguments" border="1" > 81 <TR> 82<TH>WPAD_FMT_CORE </TH> 83<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> 84 </TR> 85 <TR> 86<TH>WPAD_FMT_CORE_ACC </TH> 87<TD>Wii Remote data format (<a href="./WPADStatus.html"><code>WPADStatus</code></a> structure). The button and motion sensor information is valid.</TD> 88 </TR> 89 <TR> 90<TH>WPAD_FMT_CORE_ACC_DPD </TH> 91<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> 92 </TR> 93 <TR> 94<TH>WPAD_FMT_FREESTYLE</TH> 95<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> 96 </TR> 97 <TR> 98<TH>WPAD_FMT_FREESTYLE_ACC</TH> 99<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> 100 </TR> 101 <TR> 102<TH>WPAD_FMT_FREESTYLE_ACC_DPD</TH> 103<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> 104 </TR> 105 <TR> 106<TH>WPAD_FMT_CLASSIC</TH> 107<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> 108 </TR> 109 <TR> 110<TH>WPAD_FMT_CLASSIC_ACC</TH> 111<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> 112 </TR> 113 <TR> 114<TH>WPAD_FMT_CLASSIC_ACC_DPD</TH> 115<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> 116 </TR> 117 <TR> 118<TH>WPAD_FMT_CORE_ACC_DPD_FULL</TH> 119<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> 120 </TR> 121 <TR> 122<TH>WPAD_FMT_TRAIN</TH> 123<TD>Wii Remote + Master Controller data format (<code>WPADTRStatus</code> structure). Only Wii Remote buttons are enabled.</TD> 124 </TR> 125 <TR> 126<TH>WPAD_FMT_GUITAR</TH> 127<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> 128 </TR> 129 <TR> 130<TH>WPAD_FMT_DRUM</TH> 131<TD>Wii Remote + Drum Controller data format (<a href="./WPADStatus.html"><code>WPADCLStatus</code></a> structure). The Wii Remote button, Motion Sensor, and Pointer information is valid. However, the coordinate data is only valid for the Pointer.</TD> 132 </TR> 133 <TR> 134<TH>WPAD_FMT_TAIKO</TH> 135<TD>Wii Remote + Taiko Drum Controller data format (<a href="./WPADStatus.html"><code>WPADCLStatus</code></a> structure). The Wii Remote button, Motion Sensor, and Pointer information is valid. However, the coordinate data is only valid for the Pointer.</TD> 136 </TR> 137 <TR> 138<TH>WPAD_FMT_BALANCE_CHECKER</TH> 139<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> 140 </TR> 141 <TR> 142<TH>WPAD_FMT_MPLS</TH> 143<TD>Wii MotionPlus data format (<a href="./WPADStatus.html"><code>WPADMPStatus</code></a> structure). The Wii Remote button, Motion Sensor, and Pointer information is valid. However, the coordinate data is only valid for the Pointer. Use this format when the format is either the MotionPlus Style or the Nunchuk/MotionPlus Style. When the format is the Nunchuk/MotionPlus Style, the sampling rates for the Wii MotionPlus and the Nunchuk are half the normal rates.</font></TD> 144 </TR> 145</table> 146</blockquote> 147 148<blockquote> 149The return values are defined as follows. 150<TABLE class="arguments" border="1" > 151 <TR> 152<TH>WPAD_ERR_NONE</TH> 153<TD>The WPAD library received a command.</TD> 154 </TR> 155 <TR> 156<TH>WPAD_ERR_BUSY</TH> 157<TD>The WPAD library was unable to receive a command.</TD> 158 </TR> 159 <TR> 160<TH>WPAD_ERR_NO_CONTROLLER</TH> 161<TD>The connection was broken.</TD> 162 </TR> 163</table> 164</blockquote> 165 166<h2>See Also</h2> 167<p class="reference"> 168<!--<A href="./toc.html" target="contents"><CODE>WPAD関数</CODE></A>, --> <A href="./WPADGetDataFormat.html"><CODE>WPADGetDataFormat</CODE></A><br><A href="./WPADStatus.html"><CODE>WPADStatus</CODE></A> 169</p> 170 171<H2>Revision History</H2> 172<p> 1732008/12/26 Added <code>WPAD_FMT_TAIKO</code>.<br>2008/12/19 Added <code>WPAD_FMT_DRUM</code>.<br> 2008/09/30 Explained the Wii MotionPlus.<br>2008/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> 174</p> 175 176<hr><p>CONFIDENTIAL</p></body> 177</html>