#include <revolution/wpadBalance.h>
#define WPAD_CHAN0 0
#define WPAD_CHAN1 1
#define WPAD_CHAN2 2
#define WPAD_CHAN3 3
#define WPAD_BLCLB_BLK1_ADDR 0x0024
#define WPAD_BLCLB_BLK1_LEN 16
#define WPAD_BLCLB_BLK2_ADDR 0x0034
#define WPAD_BLCLB_BLK2_LEN 8
#define WPAD_BLCLB_BLK3_ADDR 0x003c
#define WPAD_BLCLB_BLK3_LEN 4
#define WPAD_BLCLB_BLK4_ADDR 0x0050
#define WPAD_BLCLB_BLK4_LEN 16
#define WPAD_BLCLB_BLK5_ADDR 0x0060
#define WPAD_BLCLB_BLK5_LEN 16
typedef void (*WPADCallback) ( s32 chan, s32 result );
s32 WPADGetBLCalibration( s32 chan, u8 *data, u16 addr, u16 len, WPADCallback callback );
chan |
Specify WPAD_CHAN3 because Wii Balance Board accessorys connect to WPAD_CHAN3. |
data |
Buffer where the calibration values are copied. |
addr |
Address where the obtained calibration values are stored. |
len |
Size of the obtained calibration values. |
callback |
Callback function to notify about the result. Notification processing is omitted if NULL is specified. |
Returns one of the following codes:
WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
Gets 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 WPAD_BLCLB_BLK*_ADDR and WPAD_BLCLB_BLK*_LEN, 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.
The return values have the following meanings:
WPAD_ERR_NONE |
The WPAD library received the command. |
WPAD_ERR_BUSY |
The WPAD library was unable to receive the command. Wait a short time and call the function again. |
WPAD_ERR_NO_CONTROLLER |
The connection was broken. |
In 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:
WPAD_ERR_NONE |
The command was processed normally. |
WPAD_ERR_BUSY |
The WPAD library was unable to receive the command. Wait a short time and call the function again. |
WPAD_ERR_TRANSFER |
A communication error prevented normal processing of the command. |
WPAD_ERR_NO_CONTROLLER |
The connection was broken. |
2007/11/15 Changed the device name to Wii Balance Board accessory.
2007/09/11 Corrected errors in notation.
2007/05/31 Initial version.
CONFIDENTIAL