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 name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>WPADGetBLCalibration</title>
10</head>
11
12<body>
13
14<h1>WPADGetBLCalibration</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20  <dd><pre><code>#include &lt;revolution/wpadBalance.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_BLCLB_BLK1_ADDR     0x0024
28#define WPAD_BLCLB_BLK1_LEN      16
29#define WPAD_BLCLB_BLK2_ADDR     0x0034
30#define WPAD_BLCLB_BLK2_LEN      8
31#define WPAD_BLCLB_BLK3_ADDR     0x003c
32#define WPAD_BLCLB_BLK3_LEN      4
33#define WPAD_BLCLB_BLK4_ADDR     0x0050
34#define WPAD_BLCLB_BLK4_LEN      16
35#define WPAD_BLCLB_BLK5_ADDR     0x0060
36#define WPAD_BLCLB_BLK5_LEN      16
37
38typedef void (*WPADCallback) ( s32 chan, s32 result );
39
40s32 WPADGetBLCalibration( s32 chan, u8 *data, u16 addr, u16 len, WPADCallback callback );</code></pre>
41  </dd>
42</dl>
43
44<h2>Arguments</h2>
45<TABLE border="1">
46  <TBODY>
47    <TR>
48<TD><code><b><i>chan</i></b></code></TD>
49<TD>Specify <code>WPAD_CHAN3</code> because Wii Balance Board accessorys connect to <code>WPAD_CHAN3</code>.</TD>
50    </TR>
51    <TR>
52<TD><CODE><b><i>data</i></b></CODE></TD>
53<TD>Buffer where the calibration values are copied.</TD>
54    </TR>
55    <TR>
56<TD><CODE><b><i>addr</i></b></CODE></TD>
57<TD>Address where the obtained calibration values are stored.</TD>
58    </TR>
59    <TR>
60<TD><CODE><b><i>len</i></b></CODE></TD>
61<TD>Size of the obtained calibration values.</TD>
62    </TR>
63    <TR>
64<TD><CODE><b><i>callback</i></b></CODE></TD>
65<TD>Callback function to notify about the result. Notification processing is omitted if NULL is specified.</TD>
66    </TR>
67  </TBODY>
68</TABLE>
69<h2>Return Values</h2>
70<p>
71Returns one of the following codes:
72</p>
73<p>
74<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br>
75</P>
76<H2>Description</H2>
77<p>
78Gets the calibration values for the Wii Balance Board accessory. The Wii Balance Board accessory calibration values are divided into five blocks, and the address and size associated with each block of values are defined by <code>WPAD_BLCLB_BLK*_ADDR</code> and <code>WPAD_BLCLB_BLK*_LEN</code>, respectively. When obtaining values, use the defined address and size to obtain each block individually. Due to the Wii Balance Board accessory specification, when blocks of values are obtained in succession it is possible for the obtained values to be incorrect, even if no error code indicates a problem. For this reason, pause a short time between successive calls.
79</p>
80<li>Error Codes</li>
81</ul>
82<p>
83The return values have the following meanings:
84</p>
85<table border="1">
86<tr>
87<td><code>WPAD_ERR_NONE</code></td>
88<td>The WPAD library received the command.</td>
89</tr>
90<tr>
91<td><code>WPAD_ERR_BUSY</code></td>
92<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td>
93</tr>
94<tr>
95<td><code>WPAD_ERR_NO_CONTROLLER</code></td>
96<td>The connection was broken.</td>
97</tr>
98</table>
99
100<ul>
101<li>Callbacks</li>
102</ul>
103<p>
104In addition, if a callback function is set, the callback function returns the following error codes when its processing is complete. Their meanings are as follows:
105</p>
106<table border="1">
107<tr>
108<td><code>WPAD_ERR_NONE</code></td>
109<td>The command was processed normally.</td>
110</tr>
111<tr>
112<td><code>WPAD_ERR_BUSY</code></td>
113<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td>
114</tr>
115<tr>
116<td><code>WPAD_ERR_TRANSFER</code></td>
117<td>A communication error prevented normal processing of the command.</td>
118</tr>
119<tr>
120<td><code>WPAD_ERR_NO_CONTROLLER</code></td>
121<td>The connection was broken.</td>
122</tr>
123</table>
124
125<h2>See Also</h2>
126<p>
127</p>
128
129<H2>Revision History</H2>
130<P>
1312007/11/15 Changed the device name to Wii Balance Board accessory. <br>2007/09/11 Corrected errors in notation. <br>2007/05/31 Initial version. <br>
132</P>
133
134<hr><p>CONFIDENTIAL</p></body>
135</html>