wut  v1.5.0
Wii U Toolchain
Data Structures | Typedefs | Enumerations | Functions

WPAD is a low-level library under KPAD. More...

Collaboration diagram for WPAD:

Data Structures

struct  WPADVec2D
 2D vector. More...
 
struct  WPADStatusProController
 

Typedefs

typedef struct WPADStatusProController WPADStatusProController
 
typedef struct WPADVec2D WPADVec2D
 
typedef enum WPADChan WPADChan
 Wii Remote channel. More...
 
typedef enum WPADDataFormat WPADDataFormat
 Data format. More...
 
typedef enum WPADExtensionType WPADExtensionType
 Extension type. More...
 
typedef enum WPADButton WPADButton
 Wii Remote buttons. More...
 
typedef enum WPADNunchukButton WPADNunchukButton
 Nunchuk buttons. More...
 
typedef enum WPADClassicButton WPADClassicButton
 Classic Controller buttons. More...
 
typedef enum WPADProButton WPADProButton
 Pro Controller buttons. More...
 
typedef void(* WPADSamplingCallback) (WPADChan chan)
 
typedef void(* WPADExtensionCallback) (WPADChan chan, int32_t status)
 
typedef void(* WPADConnectCallback) (WPADChan chan, int32_t status)
 

Enumerations

enum  WPADChan {
  WPAD_CHAN_0 = 0 ,
  WPAD_CHAN_1 = 1 ,
  WPAD_CHAN_2 = 2 ,
  WPAD_CHAN_3 = 3 ,
  WPAD_CHAN_4 = 4 ,
  WPAD_CHAN_5 = 5 ,
  WPAD_CHAN_6 = 6
}
 Wii Remote channel. More...
 
enum  WPADDataFormat { WPAD_FMT_PRO_CONTROLLER = 22 }
 Data format. More...
 
enum  WPADExtensionType {
  WPAD_EXT_CORE = 0 ,
  WPAD_EXT_NUNCHUK = 1 ,
  WPAD_EXT_CLASSIC = 2 ,
  WPAD_EXT_MPLUS = 5 ,
  WPAD_EXT_MPLUS_NUNCHUK = 6 ,
  WPAD_EXT_MPLUS_CLASSIC = 7 ,
  WPAD_EXT_PRO_CONTROLLER = 31
}
 Extension type. More...
 
enum  WPADButton {
  WPAD_BUTTON_LEFT = 0x0001 ,
  WPAD_BUTTON_RIGHT = 0x0002 ,
  WPAD_BUTTON_DOWN = 0x0004 ,
  WPAD_BUTTON_UP = 0x0008 ,
  WPAD_BUTTON_PLUS = 0x0010 ,
  WPAD_BUTTON_2 = 0x0100 ,
  WPAD_BUTTON_1 = 0x0200 ,
  WPAD_BUTTON_B = 0x0400 ,
  WPAD_BUTTON_A = 0x0800 ,
  WPAD_BUTTON_MINUS = 0x1000 ,
  WPAD_BUTTON_Z = 0x2000 ,
  WPAD_BUTTON_C = 0x4000 ,
  WPAD_BUTTON_HOME = 0x8000
}
 Wii Remote buttons. More...
 
enum  WPADNunchukButton {
  WPAD_NUNCHUK_STICK_EMULATION_LEFT = 0x0001 ,
  WPAD_NUNCHUK_STICK_EMULATION_RIGHT = 0x0002 ,
  WPAD_NUNCHUK_STICK_EMULATION_DOWN = 0x0004 ,
  WPAD_NUNCHUK_STICK_EMULATION_UP = 0x0008 ,
  WPAD_NUNCHUK_BUTTON_Z = 0x2000 ,
  WPAD_NUNCHUK_BUTTON_C = 0x4000
}
 Nunchuk buttons. More...
 
enum  WPADClassicButton {
  WPAD_CLASSIC_BUTTON_UP = 0x00000001 ,
  WPAD_CLASSIC_BUTTON_LEFT = 0x00000002 ,
  WPAD_CLASSIC_BUTTON_ZR = 0x00000004 ,
  WPAD_CLASSIC_BUTTON_X = 0x00000008 ,
  WPAD_CLASSIC_BUTTON_A = 0x00000010 ,
  WPAD_CLASSIC_BUTTON_Y = 0x00000020 ,
  WPAD_CLASSIC_BUTTON_B = 0x00000040 ,
  WPAD_CLASSIC_BUTTON_ZL = 0x00000080 ,
  WPAD_CLASSIC_BUTTON_R = 0x00000200 ,
  WPAD_CLASSIC_BUTTON_PLUS = 0x00000400 ,
  WPAD_CLASSIC_BUTTON_HOME = 0x00000800 ,
  WPAD_CLASSIC_BUTTON_MINUS = 0x00001000 ,
  WPAD_CLASSIC_BUTTON_L = 0x00002000 ,
  WPAD_CLASSIC_BUTTON_DOWN = 0x00004000 ,
  WPAD_CLASSIC_BUTTON_RIGHT = 0x00008000 ,
  WPAD_CLASSIC_STICK_L_EMULATION_LEFT = 0x00010000 ,
  WPAD_CLASSIC_STICK_L_EMULATION_RIGHT = 0x00020000 ,
  WPAD_CLASSIC_STICK_L_EMULATION_DOWN = 0x00040000 ,
  WPAD_CLASSIC_STICK_L_EMULATION_UP = 0x00080000 ,
  WPAD_CLASSIC_STICK_R_EMULATION_LEFT = 0x00100000 ,
  WPAD_CLASSIC_STICK_R_EMULATION_RIGHT = 0x00200000 ,
  WPAD_CLASSIC_STICK_R_EMULATION_DOWN = 0x00400000 ,
  WPAD_CLASSIC_STICK_R_EMULATION_UP = 0x00800000
}
 Classic Controller buttons. More...
 
enum  WPADProButton {
  WPAD_PRO_BUTTON_UP = 0x00000001 ,
  WPAD_PRO_BUTTON_LEFT = 0x00000002 ,
  WPAD_PRO_TRIGGER_ZR = 0x00000004 ,
  WPAD_PRO_BUTTON_X = 0x00000008 ,
  WPAD_PRO_BUTTON_A = 0x00000010 ,
  WPAD_PRO_BUTTON_Y = 0x00000020 ,
  WPAD_PRO_BUTTON_B = 0x00000040 ,
  WPAD_PRO_TRIGGER_ZL = 0x00000080 ,
  WPAD_PRO_RESERVED = 0x00000100 ,
  WPAD_PRO_TRIGGER_R = 0x00000200 ,
  WPAD_PRO_BUTTON_PLUS = 0x00000400 ,
  WPAD_PRO_BUTTON_HOME = 0x00000800 ,
  WPAD_PRO_BUTTON_MINUS = 0x00001000 ,
  WPAD_PRO_TRIGGER_L = 0x00002000 ,
  WPAD_PRO_BUTTON_DOWN = 0x00004000 ,
  WPAD_PRO_BUTTON_RIGHT = 0x00008000 ,
  WPAD_PRO_BUTTON_STICK_R = 0x00010000 ,
  WPAD_PRO_BUTTON_STICK_L = 0x00020000 ,
  WPAD_PRO_STICK_L_EMULATION_UP = 0x00200000 ,
  WPAD_PRO_STICK_L_EMULATION_DOWN = 0x00100000 ,
  WPAD_PRO_STICK_L_EMULATION_LEFT = 0x00040000 ,
  WPAD_PRO_STICK_L_EMULATION_RIGHT = 0x00080000 ,
  WPAD_PRO_STICK_R_EMULATION_UP = 0x02000000 ,
  WPAD_PRO_STICK_R_EMULATION_DOWN = 0x01000000 ,
  WPAD_PRO_STICK_R_EMULATION_LEFT = 0x00400000 ,
  WPAD_PRO_STICK_R_EMULATION_RIGHT = 0x00800000
}
 Pro Controller buttons. More...
 

Functions

void WPADInit ()
 Initialises the WPAD library for use. More...
 
void WPADShutdown ()
 Cleans up and frees the WPAD library. More...
 
int32_t WPADProbe (WPADChan chan, WPADExtensionType *outExtensionType)
 
int32_t WPADSetDataFormat (WPADChan chan, WPADDataFormat format)
 
void WPADEnableURCC (int32_t enable)
 
void WPADEnableWiiRemote (int32_t enable)
 
void WPADRead (WPADChan chan, void *data)
 
void WPADControlMotor (WPADChan chan, BOOL motorEnabled)
 Controls the associated WPADChan's rumble motor. More...
 
void WPADSetAutoSleepTime (uint8_t time)
 
void WPADDisconnect (WPADChan chan)
 
WPADConnectCallback WPADSetConnectCallback (WPADChan chan, WPADConnectCallback callback)
 
WPADExtensionCallback WPADSetExtensionCallback (WPADChan chan, WPADExtensionCallback callback)
 
WPADSamplingCallback WPADSetSamplingCallback (WPADChan chan, WPADSamplingCallback callback)
 

Detailed Description

WPAD is a low-level library under KPAD.


Data Structure Documentation

◆ WPADVec2D

struct WPADVec2D

2D vector.

Definition at line 220 of file wpad.h.

Data Fields
int16_t x x.
int16_t y y.

◆ WPADStatusProController

struct WPADStatusProController

Definition at line 231 of file wpad.h.

Data Fields
uint8_t extensionType A value from WPADExtensionType.
uint8_t err
uint32_t buttons
WPADVec2D leftStick
WPADVec2D rightStick
WPADDataFormat dataFormat

Typedef Documentation

◆ WPADStatusProController

Definition at line 1 of file wpad.h.

◆ WPADVec2D

typedef struct WPADVec2D WPADVec2D

Definition at line 1 of file wpad.h.

◆ WPADChan

typedef enum WPADChan WPADChan

Wii Remote channel.

◆ WPADDataFormat

Data format.

◆ WPADExtensionType

Extension type.

◆ WPADButton

typedef enum WPADButton WPADButton

Wii Remote buttons.

◆ WPADNunchukButton

Nunchuk buttons.

◆ WPADClassicButton

Classic Controller buttons.

◆ WPADProButton

Pro Controller buttons.

◆ WPADSamplingCallback

typedef void(* WPADSamplingCallback) (WPADChan chan)

Definition at line 254 of file wpad.h.

◆ WPADExtensionCallback

typedef void(* WPADExtensionCallback) (WPADChan chan, int32_t status)

Definition at line 255 of file wpad.h.

◆ WPADConnectCallback

typedef void(* WPADConnectCallback) (WPADChan chan, int32_t status)

Definition at line 256 of file wpad.h.

Enumeration Type Documentation

◆ WPADChan

enum WPADChan

Wii Remote channel.

Enumerator
WPAD_CHAN_0 

Channel 0.

WPAD_CHAN_1 

Channel 1.

WPAD_CHAN_2 

Channel 2.

WPAD_CHAN_3 

Channel 3.

WPAD_CHAN_4 

Channel 4.

WPAD_CHAN_5 

Channel 5.

WPAD_CHAN_6 

Channel 6.

Definition at line 20 of file wpad.h.

◆ WPADDataFormat

Data format.

Enumerator
WPAD_FMT_PRO_CONTROLLER 

Definition at line 39 of file wpad.h.

◆ WPADExtensionType

Extension type.

Enumerator
WPAD_EXT_CORE 

Wii Remote with no extension.

WPAD_EXT_NUNCHUK 

Nunchuk.

WPAD_EXT_CLASSIC 

Classic Controller.

WPAD_EXT_MPLUS 

Motion Plus.

WPAD_EXT_MPLUS_NUNCHUK 

Motion Plus with Nunchuk.

WPAD_EXT_MPLUS_CLASSIC 

Motion Plus with Classic Controller.

WPAD_EXT_PRO_CONTROLLER 

Pro Controller.

Definition at line 45 of file wpad.h.

◆ WPADButton

enum WPADButton

Wii Remote buttons.

Enumerator
WPAD_BUTTON_LEFT 

The left button of the D-pad.

WPAD_BUTTON_RIGHT 

The right button of the D-pad.

WPAD_BUTTON_DOWN 

The down button of the D-pad.

WPAD_BUTTON_UP 

The up button of the D-pad.

WPAD_BUTTON_PLUS 

The + button.

WPAD_BUTTON_2 

The 2 button.

WPAD_BUTTON_1 

The 1 button.

WPAD_BUTTON_B 

The B button.

WPAD_BUTTON_A 

The A button.

WPAD_BUTTON_MINUS 

The - button.

WPAD_BUTTON_Z 

The Z button on the Nunchuk extension.

WPAD_BUTTON_C 

The C button on the Nunchuk extension.

WPAD_BUTTON_HOME 

The HOME button.

Definition at line 64 of file wpad.h.

◆ WPADNunchukButton

Nunchuk buttons.

Enumerator
WPAD_NUNCHUK_STICK_EMULATION_LEFT 

The emulated left button on the Nunchuk stick or the left button of the D-pad on the Wii Remote.

WPAD_NUNCHUK_STICK_EMULATION_RIGHT 

The emulated right button on the Nunchuk stick or the right button of the D-pad on the Wii Remote.

WPAD_NUNCHUK_STICK_EMULATION_DOWN 

The emulated down button on the Nunchuk stick or the down button of the D-pad on the Wii Remote.

WPAD_NUNCHUK_STICK_EMULATION_UP 

The emulated up button on the Nunchuk stick or the up button of the D-pad on the Wii Remote.

WPAD_NUNCHUK_BUTTON_Z 

The Z button.

WPAD_NUNCHUK_BUTTON_C 

The C button.

Definition at line 95 of file wpad.h.

◆ WPADClassicButton

Classic Controller buttons.

Enumerator
WPAD_CLASSIC_BUTTON_UP 

The up button of the D-pad.

WPAD_CLASSIC_BUTTON_LEFT 

The left button of the D-pad.

WPAD_CLASSIC_BUTTON_ZR 

The ZR button.

WPAD_CLASSIC_BUTTON_X 

The X button.

WPAD_CLASSIC_BUTTON_A 

The A button.

WPAD_CLASSIC_BUTTON_Y 

The Y button.

WPAD_CLASSIC_BUTTON_B 

The B button.

WPAD_CLASSIC_BUTTON_ZL 

The ZL button.

WPAD_CLASSIC_BUTTON_R 

The R button.

WPAD_CLASSIC_BUTTON_PLUS 

The + button.

WPAD_CLASSIC_BUTTON_HOME 

The HOME button.

WPAD_CLASSIC_BUTTON_MINUS 

The - button.

WPAD_CLASSIC_BUTTON_L 

The L button.

WPAD_CLASSIC_BUTTON_DOWN 

The down button of the D-pad.

WPAD_CLASSIC_BUTTON_RIGHT 

The right button of the D-pad.

WPAD_CLASSIC_STICK_L_EMULATION_LEFT 

The emulated left button on the left stick.

WPAD_CLASSIC_STICK_L_EMULATION_RIGHT 

The emulated right button on the left stick.

WPAD_CLASSIC_STICK_L_EMULATION_DOWN 

The emulated down button on the left stick.

WPAD_CLASSIC_STICK_L_EMULATION_UP 

The emulated up button on the left stick.

WPAD_CLASSIC_STICK_R_EMULATION_LEFT 

The emulated left button on the right stick.

WPAD_CLASSIC_STICK_R_EMULATION_RIGHT 

The emulated right button on the right stick.

WPAD_CLASSIC_STICK_R_EMULATION_DOWN 

The emulated down button on the right stick.

WPAD_CLASSIC_STICK_R_EMULATION_UP 

The emulated up button on the right stick.

Definition at line 112 of file wpad.h.

◆ WPADProButton

Pro Controller buttons.

Enumerator
WPAD_PRO_BUTTON_UP 

The up button of the D-pad.

WPAD_PRO_BUTTON_LEFT 

The left button of the D-pad.

WPAD_PRO_TRIGGER_ZR 

The ZR button.

WPAD_PRO_BUTTON_X 

The X button.

WPAD_PRO_BUTTON_A 

The A button.

WPAD_PRO_BUTTON_Y 

The Y button.

WPAD_PRO_BUTTON_B 

The B button.

WPAD_PRO_TRIGGER_ZL 

The ZL button.

WPAD_PRO_RESERVED 

Reserved.

WPAD_PRO_TRIGGER_R 

The right trigger button.

WPAD_PRO_BUTTON_PLUS 

The + button.

WPAD_PRO_BUTTON_HOME 

The HOME button.

WPAD_PRO_BUTTON_MINUS 

The - button.

WPAD_PRO_TRIGGER_L 

The left trigger button.

WPAD_PRO_BUTTON_DOWN 

The down button of the D-pad.

WPAD_PRO_BUTTON_RIGHT 

The right button of the D-pad.

WPAD_PRO_BUTTON_STICK_R 

The right stick button.

WPAD_PRO_BUTTON_STICK_L 

The left stick button.

WPAD_PRO_STICK_L_EMULATION_UP 

The emulated up button on the left stick.

WPAD_PRO_STICK_L_EMULATION_DOWN 

The emulated down button on the left stick.

WPAD_PRO_STICK_L_EMULATION_LEFT 

The emulated left button on the left stick.

WPAD_PRO_STICK_L_EMULATION_RIGHT 

The emulated right button on the left stick.

WPAD_PRO_STICK_R_EMULATION_UP 

The emulated up button on the right stick.

WPAD_PRO_STICK_R_EMULATION_DOWN 

The emulated down button on the right stick.

WPAD_PRO_STICK_R_EMULATION_LEFT 

The emulated left button on the right stick.

WPAD_PRO_STICK_R_EMULATION_RIGHT 

The emulated right button on the right stick.

Definition at line 163 of file wpad.h.

Function Documentation

◆ WPADInit()

void WPADInit ( )

Initialises the WPAD library for use.

◆ WPADShutdown()

void WPADShutdown ( )

Cleans up and frees the WPAD library.

◆ WPADProbe()

int32_t WPADProbe ( WPADChan  chan,
WPADExtensionType outExtensionType 
)

◆ WPADSetDataFormat()

int32_t WPADSetDataFormat ( WPADChan  chan,
WPADDataFormat  format 
)

◆ WPADEnableURCC()

void WPADEnableURCC ( int32_t  enable)

◆ WPADEnableWiiRemote()

void WPADEnableWiiRemote ( int32_t  enable)

◆ WPADRead()

void WPADRead ( WPADChan  chan,
void *  data 
)

◆ WPADControlMotor()

void WPADControlMotor ( WPADChan  chan,
BOOL  motorEnabled 
)

Controls the associated WPADChan's rumble motor.

◆ WPADSetAutoSleepTime()

void WPADSetAutoSleepTime ( uint8_t  time)

◆ WPADDisconnect()

void WPADDisconnect ( WPADChan  chan)

◆ WPADSetConnectCallback()

WPADConnectCallback WPADSetConnectCallback ( WPADChan  chan,
WPADConnectCallback  callback 
)

◆ WPADSetExtensionCallback()

WPADExtensionCallback WPADSetExtensionCallback ( WPADChan  chan,
WPADExtensionCallback  callback 
)

◆ WPADSetSamplingCallback()

WPADSamplingCallback WPADSetSamplingCallback ( WPADChan  chan,
WPADSamplingCallback  callback 
)