WPADSetDataFormat

C Specification

#include <revolution/wpad.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

s32 WPADSetDataFormat( s32 chan, u32 fmt );
      

Arguments

chan One of the WPAD_CHANn values.
fmt One of 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 WPADRead or autosampling is stored in the structure type corresponding to the specified format. The default setting is the data format for the Wii Remote (WPAD_FMT_CORE).

In addition, do not call this function unless necessary. 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 type (WPADFSStatus structure). For the Wii Remote, only the button information is valid.
WPAD_FMT_FREESTYLE_ACC Nunchuk Style data format type (WPADFSStatus structure). For the Wii Remote, the button and motion sensor information is valid.
WPAD_FMT_FREESTYLE_ACC_DPD Nunchuk Style data format type (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 type (WPADCLStatus structure). For the Wii Remote, only the button information is valid.
WPAD_FMT_CLASSIC_ACC Classic Style data format type (WPADCLStatus structure). For the Wii Remote, the button and motion sensor information is valid.
WPAD_FMT_CLASSIC_ACC_DPD Classic Style data format type (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).
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

WPAD Functions
WPADGetDataFormat, WPADStatus, WPADFSStatus, WPADCLStatus, WPADStatusEx

Revision History

2006/08/15 Added the extended data format
2006/06/19 Changed the name of the external extended controller; added data format
2005/10/20 Initial version.


CONFIDENTIAL