KPADEXStatus

Syntax

#include <cafe/pads/kpad/kpad.h>

typedef union KPADEXStatus{
    struct {
        Vec2    stick ;

        Vec     acc ;
        f32     acc_value ;
        f32     acc_speed ;
    } fs ;

    struct {
        u32     hold ;
        u32     trig ;
        u32     release ;

        Vec2    lstick ;
        Vec2    rstick ;

        f32     ltrigger ;
        f32     rtrigger ;
    } cl ;

    struct {
        u32     hold ;
        u32     trig ;
        u32     release ;

        Vec2    lstick ;
        Vec2    rstick ;

        BOOL    charge ;
        BOOL    cable ;
    } uc ;

    struct {
        double  tgc_weight ;
        double  weight[ WPAD_PRESS_UNITS ] ;
        double  weight_ave[ WPAD_PRESS_UNITS ] ;
        s32     weight_err ;
        s32     tgc_weight_err ;
    } bl ;
} KPADEXStatus ;

Elements

fs.stick Control stick data for the Nunchuk. A circular or a cross clamp of maximum 1.0f is applied.
fs.acc Accelerometer data. Note the coordinate system. Unlike the WPAD library, when the Nunchuk is pointed toward the TV screen, forward is Z+, upward is Y+, and rightward is X+.
fs.acc_value Acceleration magnitude (length along the x-, y-, and z-axes).
fs.acc_speed Change in acceleration (difference in length along the x-, y-, and z-axes relative to the previous values).
cl.hold The flag is enabled while a Classic Controller button is pressed.
cl.trig The flag is enabled only for the instant a Classic Controller button is pressed.
cl.release The flag is enabled only for the instant a Classic Controller button is let go.
cl.lstick Information related to the Classic Controller's L Stick. A circular or cross clamp of maximum 1.0f is applied.
cl.rstick Information related to the Classic Controller's R Stick. A circular or cross clamp of maximum 1.0f is applied.
cl.ltrigger Information related to the L of the Classic Controller (where 0.0f ≦ ltrigger ≦ 1.0f).
cl.rtrigger Information related to the R of the Classic Controller (where 0.0f ≦ rtrigger ≦ 1.0f).
bl.tgc_weight The most recent average weight applied to the entire Wii Balance Board over approximately 2 seconds, with temperature and gravity corrections calculated. This is the true load applied to the Wii Balance Board.
bl.weight Sensor values for each of the four corners of the Wii Balance Board, converted into weights.
bl.weight_ave Average value calculated continuously over approximately 2 seconds' worth of samples of the body weight values calculated at each of the four corners of the Wii Balance Board.
bl.weight_err Error code related to bl.weight, the sensor value obtained from the Wii Balance Board.
bl.tgc_weight_err Error code related to bl.tgc_weight. The value is the most recent average weight applied to the entire Wii Balance Board over approximately 2 seconds, with temperature and gravity corrections calculated.
uc.hold The flag is enabled while a URCC button is pressed.
uc.trig The flag is enabled only for the instant a URCC button is pressed.
uc.release The flag is enabled only for the instant a URCC button is let go.
uc.lstick Information related to the URCC's L Stick. A circular or cross clamp of maximum 1.0f is applied.
uc.rstick Information related to the URCC's R Stick. A circular or cross clamp of maximum 1.0f is applied.
cl.charge This flag is enabled when the URCC's battery is recharging.
cl.cable This flag is enabled when the USB cable is plugged to URCC.

Return Values

Nunchuk Controller Button Input

Input from the Nunchuk Controller buttons is defined using the following macro constants:

KPAD_FS_BUTTON_STICK_EMULATION_LEFT Left on the emulated +Control Pad, using the analog stick input.
KPAD_FS_BUTTON_STICK_EMULATION_RIGHT Right on the emulated +Control Pad, using the analog stick input.
KPAD_FS_BUTTON_STICK_EMULATION_DOWN Down on the emulated +Control Pad, using the analog stick input.
KPAD_FS_BUTTON_STICK_EMULATION_UP Up on the emulated +Control Pad, using the analog stick input.

Classic Controller Button Input

Input from the Classic Controller buttons is defined using the following macro constants:

KPAD_CL_BUTTON_UP +Control Pad UP is being pressed.
KPAD_CL_BUTTON_DOWN +Control Pad DOWN is being pressed.
KPAD_CL_BUTTON_LEFT +Control Pad LEFT is being pressed.
KPAD_CL_BUTTON_RIGHT+Control Pad RIGHT is being pressed.
KPAD_CL_BUTTON_A A Button is being pressed.
KPAD_CL_BUTTON_B B Button is being pressed.
KPAD_CL_BUTTON_X X Button is being pressed.
KPAD_CL_BUTTON_Y Y Button is being pressed.
KPAD_CL_BUTTON_PLUS +/START Button is being pressed.
KPAD_CL_BUTTON_HOME HOME Button is being pressed.
KPAD_CL_BUTTON_MINUS-/SELECT Button is being pressed.
KPAD_CL_BUTTON_L L Button is being pressed.
KPAD_CL_BUTTON_R R Button is being pressed.
KPAD_CL_BUTTON_ZL ZL Button is being pressed.
KPAD_CL_BUTTON_ZR ZR Button is being pressed.
KPAD_CL_BUTTON_STICK_L_EMULATION_LEFT Left on the emulated +Control Pad, using the analog stick(L) input.
KPAD_CL_BUTTON_STICK_L_EMULATION_RIGHT Right on the emulated +Control Pad, using the analog stick(L) input.
KPAD_CL_BUTTON_STICK_L_EMULATION_DOWN Down on the emulated +Control Pad, using the analog stick(L) input.
KPAD_CL_BUTTON_STICK_L_EMULATION_UP Up on the emulated +Control Pad, using the analog stick(L) input.
KPAD_CL_BUTTON_STICK_R_EMULATION_LEFT Left on the emulated +Control Pad, using the analog stick(R) input.
KPAD_CL_BUTTON_STICK_R_EMULATION_RIGHT Right on the emulated +Control Pad, using the analog stick(R) input.
KPAD_CL_BUTTON_STICK_R_EMULATION_DOWN Down on the emulated +Control Pad, using the analog stick(R) input.
KPAD_CL_BUTTON_STICK_R_EMULATION_UP Up on the emulated +Control Pad, using the analog stick(R) input.

Wii Balance Board Error Codes

The error codes related to Wii Balance Board sensor values are defined by the following macro definitions.

KPAD_WBC_ERR_EXISTA load of 7 kg or more has been placed on the Wii Balance Board.
KPAD_WBC_ERR_NONEA load of 7 kg or more has not been placed on the Wii Balance Board.
KPAD_WBC_ERR_NO_BATTERYThe Wii Balance Board has no remaining battery life and the sensors are not operational.
KPAD_WBC_ERR_SETUPThe calibration of the Wii Balance Board is not completed.
KPAD_WBC_ERR_WRONG_TEMPThis error code is not set any more.
KPAD_WBC_ERR_WRONG_ZEROA load was placed on the Wii Balance Board while the zero point was being set, so the zero-point setting has failed. Call the KPADResetWbcZeroPoint function and reset the zero point for the Wii Balance Board.
KPAD_WBC_ERR_WEIGHT_OVERA load of more than 150 kg has been placed on the Wii Balance Board.
KPAD_WBC_ERR_CALIBRATIONWii Balance Board calibration has failed three times.
KPAD_WBC_ERR_NO_ZEROPOINTThe Wii Balance Board zero point is not set. Call the KPADResetWbcZeroPoint function and set the zero point for the Wii Balance Board.
KPAD_WBC_ERR_ZEROPOINTThe Wii Balance Board zero point is in the process of being set.

The following macro constants define the error codes related to the most recent average weight applied to the entire Wii Balance Board over approximately 2 seconds, with temperature and gravity corrections calculated.

KPAD_WBC_ERR_TGC_READYReady to accurately measure the correct load.
KPAD_WBC_ERR_TGC_NONEMeasurement of the load is complete. The accurate value for the correct load is stored in bl.tgc_weight.
KPAD_WBC_ERR_TGC_UNSTABLEAn object is on the Wii Balance Board and it is ready to make an accurate measurement, but more than 10 seconds passed and the board failed to make an accurate weight measurement. The value of bl.tgc_weight is undefined.
KPAD_WBC_ERR_TGC_UNKNOWNThe state before accurately measuring the correct load. The value of bl.tgc_weight is undefined.
KPAD_WBC_ERR_TGC_TIMEOUTThe Wii Balance Board is ready to make an accurate measurement, but more than 10 seconds have passed and still no load has been placed on the device. The value of bl.tgc_weight is undefined.
KPAD_WBC_ERR_TGC_BUSYThe load is being measured. The value of bl.tgc_weight is undefined.

URCC Button Input

Input from the URCC buttons is defined using the following macro constants:

KPAD_UC_BUTTON_UP +Control Pad UP is being pressed.
KPAD_UC_BUTTON_DOWN +Control Pad DOWN is being pressed.
KPAD_UC_BUTTON_LEFT +Control Pad LEFT is being pressed.
KPAD_UC_BUTTON_RIGHT+Control Pad RIGHT is being pressed.
KPAD_UC_BUTTON_A A Button is being pressed.
KPAD_UC_BUTTON_B B Button is being pressed.
KPAD_UC_BUTTON_X X Button is being pressed.
KPAD_UC_BUTTON_Y Y Button is being pressed.
KPAD_UC_BUTTON_PLUS +/START Button is being pressed.
KPAD_UC_BUTTON_HOME HOME Button is being pressed.
KPAD_UC_BUTTON_MINUS-/SELECT Button is being pressed.
KPAD_UC_BUTTON_L L Button is being pressed.
KPAD_UC_BUTTON_R R Button is being pressed.
KPAD_UC_BUTTON_ZL ZL Button is being pressed.
KPAD_UC_BUTTON_ZR ZR Button is being pressed.
KPAD_UC_BUTTON_STICK_LStick L Button is being pressed.
KPAD_UC_BUTTON_STICK_RStick R Button is being pressed.
KPAD_UC_BUTTON_STICK_L_EMULATION_LEFT Left on the emulated +Control Pad, using the analog stick(L) input.
KPAD_UC_BUTTON_STICK_L_EMULATION_RIGHT Right on the emulated +Control Pad, using the analog stick(L) input.
KPAD_UC_BUTTON_STICK_L_EMULATION_DOWN Down on the emulated +Control Pad, using the analog stick(L) input.
KPAD_UC_BUTTON_STICK_L_EMULATION_UP Up on the emulated +Control Pad, using the analog stick(L) input.
KPAD_UC_BUTTON_STICK_R_EMULATION_LEFT Left on the emulated +Control Pad, using the analog stick(R) input.
KPAD_UC_BUTTON_STICK_R_EMULATION_RIGHT Right on the emulated +Control Pad, using the analog stick(R) input.
KPAD_UC_BUTTON_STICK_R_EMULATION_DOWN Down on the emulated +Control Pad, using the analog stick(R) input.
KPAD_UC_BUTTON_STICK_R_EMULATION_UP Up on the emulated +Control Pad, using the analog stick(R) input.

Description

This union stores the information that is described in the tables above from the external extension controller (Nunchuk and Classic Controller) separate from the Wii remote. When the programmer accesses the ex_status member of the KPADStatus structure, that access must be performed according to the values of error status (wpad_err), controller type (dev_type), and data format (data_format).

See Also

KPADStatus

Revision History

2013/05/08 Automated cleanup pass.
2012/02/27 Add description for URCC.
2011/12/19 Replaced kpad definitions KPAD_CL_TRIGGER_L, KPAD_CL_TRIGGER_R, KPAD_CL_TRIGGER_ZL, KPAD_CL_TRIGGER_ZR with KPAD_CL_BUTTON_L, KPAD_CL_BUTTON_R, KPAD_CL_BUTTON_ZL, KPAD_CL_BUTTON_ZR
2010/04/29 Revised the description of the Wii Balance Board error codes.
2009/06/23 Revised the explanations for cl.ltrigger and cl.rtrigger.
2009/03/18 Revised the explanation for the Wii Balance Board structure members, bl.tgc_weight and bl.tgc_weight_err. Added the Wii Balance Board error codes.
2008/12/12 Changed a structure member for the Wii Balance Board. Revised Description regarding bl.weight_ave.
2008/04/30 Added descriptions related to the Wii Balance Board.
2006/10/25 Revised the description to match KPAD version 2.
2006/06/19 Changed the product name from tentative to official. Added information about unsupported member variables.
2006/03/01 Initial version.


CONFIDENTIAL