WPADSetDataFormat

Syntax

#include <revolution/wpad.h>
#include <revolution/wpadBalance.h>
#include <revolution/wpadGuitar.h>
#include <revolution/wpadTrain.h>

#define WPAD_CHAN0                     0
#define WPAD_CHAN1                     1
#define WPAD_CHAN2                     2
#define WPAD_CHAN3                     3

#define WPAD_FMT_CORE                  0
#define WPAD_FMT_CORE_ACC              1
#define WPAD_FMT_CORE_ACC_DPD          2
#define WPAD_FMT_FREESTYLE             3
#define WPAD_FMT_FREESTYLE_ACC         4
#define WPAD_FMT_FREESTYLE_ACC_DPD     5
#define WPAD_FMT_CLASSIC               6
#define WPAD_FMT_CLASSIC_ACC           7
#define WPAD_FMT_CLASSIC_ACC_DPD       8
#define WPAD_FMT_CORE_ACC_DPD_FULL     9
#define WPAD_FMT_TRAIN                10
#define WPAD_FMT_GUITAR               11
#define WPAD_FMT_BALANCE_CHECKER      12

s32 WPADSetDataFormat( s32 chan, u32 fmt );

Arguments

chan One of the WPAD_CHANn values.
fmt One of the WPAD_FMT_*.

Return Values

Returns one of the following codes:

WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY

Description

Changes 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 WPADRead function or autosampling is stored in the structure type corresponding to the specified format. By default, the Wii Remote data format (WPAD_FMT_CORE) is used for the Wii Remote, and the Wii Balance Board data format (WPAD_FMT_BALANCE_CHECKER) is used for the Wii Balance Board.

Do 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.

Data formats for received data are defined with the macro constants shown below.
WPAD_FMT_CORE Wii Remote data format (WPADStatus structure). Only button information is valid.
Note: This is the default type.
WPAD_FMT_CORE_ACC Wii Remote data format (WPADStatus structure). The button and motion sensor information is valid.
WPAD_FMT_CORE_ACC_DPD Wii Remote data format (WPADStatus structure). The button, motion sensor, and pointer information is valid. The pointer has valid size and coordinate data.
WPAD_FMT_FREESTYLE Nunchuk Style data format (WPADFSStatus structure). Only the button information is valid for the Wii Remote.
WPAD_FMT_FREESTYLE_ACC Nunchuk Style data format (WPADFSStatus structure). The button and Motion Sensor information is valid for the Wii Remote.
WPAD_FMT_FREESTYLE_ACC_DPD Nunchuk Style data format (WPADFSStatus structure). The Wii Remote button, Motion Sensor, and Pointer information is valid. However, only the coordinate data is valid for the Pointer.
WPAD_FMT_CLASSIC Classic Style data format (WPADCLStatus structure). Only the button information is valid for the Wii Remote.
WPAD_FMT_CLASSIC_ACC Classic Style data format (WPADCLStatus structure). The button and Motion Sensor information is valid for the Wii Remote.
WPAD_FMT_CLASSIC_ACC_DPD Classic Style data format (WPADCLStatus structure). The Wii Remote button, Motion Sensor, and Pointer information is valid. However, only the coordinate data is valid for the Pointer.
WPAD_FMT_CORE_ACC_DPD_FULL Wii Remote extended data format (WPADStatusEx 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).
WPAD_FMT_TRAIN Wii Remote + Master controller data format (WPADTRStatus structure). Only Wii Remote buttons are enabled.
WPAD_FMT_GUITAR Wii Remote + Guitar controller data format (WPADCLStatus structure). For the Wii Remote, the button, Motion Sensor, and Pointer information is valid. However, only the coordinate data is valid for the pointer.
WPAD_FMT_BALANCE_CHECKER Wii Balance Board data format (WPADBLStatus structure). Note: Wii Balance Board default
The return values are defined as follows.
WPAD_ERR_NONE The WPAD library received a command.
WPAD_ERR_BUSY The WPAD library was unable to receive a command.
WPAD_ERR_NO_CONTROLLER The connection was broken.

See Also

WPADGetDataFormat, WPADStatus

Revision History

2008/04/16 Added to the description of the master controller, guitar controller, and Wii Balance Board. Deleted the WPADFSStatus, WPADCLStatus, and WPADStatusEx structures from See Also.
2006/08/15 Added the extended data format.
2006/06/19 Renamed the external extension controller and added a data format.
2005/10/20 Initial version.


CONFIDENTIAL