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>Syntax</h2> 18 19<dl> 20 <dd><pre><code>#include <revolution/wpadBalance.h> 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 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>data</TH> 53<TD><code>Buffer where the calibration values are copied.</code></TD> 54 </TR> 55 <TR> 56<TH>addr</TH> 57<TD><code>Address where the obtained calibration values are stored.</code></TD> 58 </TR> 59 <TR> 60<TH>len</TH> 61<TD><code>Size of the obtained calibration values.</code></TD> 62 </TR> 63 <TR> 64<TH>callback</TH> 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 specified Wii Balance Board. The Wii Balance Board 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 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<ul> 81<li>Error Codes</li> 82</ul> 83<p> 84The return values have the following meanings: 85</p> 86<TABLE class="arguments" border="1"> 87<tr> 88<TH>WPAD_ERR_NONE</TH> 89<td>The WPAD library received the command.</td> 90</tr> 91<tr> 92<TH>WPAD_ERR_BUSY</TH> 93<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td> 94</tr> 95<tr> 96<TH>WPAD_ERR_NO_CONTROLLER</TH> 97<td>The connection was broken.</td> 98</tr> 99</table> 100 101<ul> 102<li>Callbacks</li> 103</ul> 104<p> 105In 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: 106</p> 107<TABLE class="arguments" border="1"> 108<tr> 109<TH>WPAD_ERR_NONE</TH> 110<td>The command was processed normally.</td> 111</tr> 112<tr> 113<TH>WPAD_ERR_BUSY</TH> 114<td>The WPAD library was unable to receive the command. Wait a short time and call the function again.</td> 115</tr> 116<tr> 117<TH>WPAD_ERR_TRANSFER</TH> 118<td>A communication error prevented normal processing of the command.</td> 119</tr> 120<tr> 121<TH>WPAD_ERR_NO_CONTROLLER</TH> 122<td>The connection was broken.</td> 123</tr> 124</table> 125 126<h2>See Also</h2> 127<p> 128None. 129</p> 130 131<H2>Revision History</H2> 132<P> 1332007/09/11 Corrected errors in notation.<br> 2007/05/31 Initial version.<br> 134</P> 135 136<hr><p>CONFIDENTIAL</p></body> 137</html>