wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions

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

Collaboration diagram for WPAD:

Data Structures

struct  WPADVec2D
 2D vector. More...
 
struct  WPADVec3D
 3D vector. More...
 
struct  WPADIRDot
 A single IR dot tracked by the camera. More...
 
struct  WPADIRDotEx
 A single IR dot tracked by the camera, extra info. More...
 
struct  WPADStatus
 Core Wii Remote status. More...
 
struct  WPADStatusEx
 Extended core Wii Remote status, with more IR details. More...
 
struct  WPADStatusNunchuk
 Wii Remote + Nunchuk status. More...
 
struct  WPADStatusClassic
 Classic Controller and Classic Controller Pro status. More...
 
struct  WPADStatusProController
 Pro Controller status. More...
 
struct  WPADStatusMotionPlus
 MotionPlus status. More...
 
struct  WPADStatusBalanceBoard
 Balance Board status. More...
 
struct  WPADStatusTrain
 Bullet Train controller status. More...
 
struct  WPADInfo
 Controller status info. More...
 
struct  WPADiQueueElement
 
struct  WPADiQueue
 
struct  WPADAddress
 Bluetooth device address. More...
 
struct  WENCParams
 Continuation parameters for WENCGetEncodeData. More...
 
struct  WPADStatusNunchuk.stick
 
union  WPADStatusMotionPlus.__unnamed56__
 
struct  WPADStatusMotionPlus.__unnamed56__.nunchuk
 
struct  WPADStatusMotionPlus.__unnamed56__.nunchuk.stick
 
struct  WPADStatusMotionPlus.__unnamed56__.classic
 

Macros

#define WPAD_MAX_IR_DOTS   4
 
#define WPAD_MAX_PRESSURE_SENSORS   4
 

Typedefs

typedef struct WPADStatusProController WPADStatusProController
 
typedef struct WPADVec2D WPADVec2D
 
typedef struct WPADVec3D WPADVec3D
 
typedef struct WPADInfo WPADInfo
 
typedef struct WPADAddress WPADAddress
 
typedef struct WPADiQueueElement WPADiQueueElement
 
typedef struct WPADiQueue WPADiQueue
 
typedef struct WPADIRDot WPADIRDot
 
typedef struct WPADIRDotEx WPADIRDotEx
 
typedef struct WPADStatus WPADStatus
 
typedef struct WPADStatusEx WPADStatusEx
 
typedef struct WPADStatusNunchuk WPADStatusNunchuk
 
typedef struct WPADStatusClassic WPADStatusClassic
 
typedef struct WPADStatusMotionPlus WPADStatusMotionPlus
 
typedef struct WPADStatusBalanceBoard WPADStatusBalanceBoard
 
typedef struct WPADStatusTrain WPADStatusTrain
 
typedef WPADStatusProController WPADStatusPro
 
typedef struct WENCParams WENCParams
 
typedef enum WPADError WPADError
 
typedef enum WPADChan WPADChan
 Wii Remote channel.
 
typedef enum WPADDataFormat WPADDataFormat
 Data format.
 
typedef enum WPADExtensionType WPADExtensionType
 Extension type.
 
typedef enum WPADButton WPADButton
 Wii Remote buttons.
 
typedef enum WPADNunchukButton WPADNunchukButton
 Nunchuk buttons.
 
typedef enum WPADClassicButton WPADClassicButton
 Classic Controller buttons.
 
typedef enum WPADProButton WPADProButton
 Pro Controller buttons.
 
typedef enum WPADLed WPADLed
 WPAD Led flags.
 
typedef enum WPADDpdFormat WPADDpdFormat
 WPAD Infrared Format. For more information see IR Data Formats
 
typedef enum WPADSpeakerCmd WPADSpeakerCmd
 WPAD Speaker Command.
 
typedef enum WPADMplsMode WPADMplsMode
 MotionPlus Mode.
 
typedef enum WPADMplsStatus WPADMplsStatus
 MotionPlus status flags.
 
typedef enum WPADPeripheralSpace WPADPeripheralSpace
 WPAD Peripheral Memory Space Prefixes.
 
typedef enum WPADBalanceBoardCmd WPADBalanceBoardCmd
 Balance Board commands.
 
typedef void(* WPADCallback) (WPADChan channel, WPADError status)
 
typedef WPADCallback WPADControlLedCallback
 
typedef WPADCallback WPADControlDpdCallback
 
typedef WPADCallback WPADControlSpeakerCallback
 
typedef WPADCallback WPADIsMplsAttachedCallback
 
typedef WPADCallback WPADGetInfoCallback
 
typedef WPADCallback WPADReadMemoryCallback
 
typedef WPADCallback WPADWriteMemoryCallback
 
typedef WPADCallback WPADConnectCallback
 
typedef WPADCallback WPADiSendCallback
 
typedef WPADCallback WPADiWriteGameDataCallback
 
typedef void(* WPADSamplingCallback) (WPADChan channel)
 
typedef void(* WPADExtensionCallback) (WPADChan channel, WPADExtensionType ext)
 Callback called when the active extension changes.
 

Enumerations

enum  WPADError {
  WPAD_ERROR_NONE = 0 ,
  WPAD_ERROR_NO_CONTROLLER = -1 ,
  WPAD_ERROR_NOT_READY = -2 ,
  WPAD_ERROR_TRANSFER = -3 ,
  WPAD_ERROR_INVALID = -4 ,
  WPAD_ERROR_PERMISSION = -5 ,
  WPAD_ERROR_BROKEN = -6 ,
  WPAD_ERROR_QUEUE_EMPTY = -7 ,
  WPAD_ERROR_BAD_VALUE = -8 ,
  WPAD_ERROR_BAD_CONF = -9
}
 
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_CORE = 0x00 ,
  WPAD_FMT_CORE_ACC = 0x01 ,
  WPAD_FMT_CORE_ACC_DPD = 0x02 ,
  WPAD_FMT_NUNCHUK = 0x03 ,
  WPAD_FMT_NUNCHUK_ACC = 0x04 ,
  WPAD_FMT_NUNCHUK_ACC_DPD = 0x05 ,
  WPAD_FMT_CLASSIC = 0x06 ,
  WPAD_FMT_CLASSIC_ACC = 0x07 ,
  WPAD_FMT_CLASSIC_ACC_DPD = 0x08 ,
  WPAD_FMT_CORE_ACC_DPD_FULL = 0x09 ,
  WPAD_FMT_TRAIN = 0x0A ,
  WPAD_FMT_GUITAR = 0x0B ,
  WPAD_FMT_BALANCE_BOARD = 0x0C ,
  WPAD_FMT_DRUM = 0x0F ,
  WPAD_FMT_MPLUS = 0x10 ,
  WPAD_FMT_TAIKO = 0x11 ,
  WPAD_FMT_PRO_CONTROLLER = 0x16
}
 Data format. More...
 
enum  WPADExtensionType {
  WPAD_EXT_CORE = 0x00 ,
  WPAD_EXT_NUNCHUK = 0x01 ,
  WPAD_EXT_CLASSIC = 0x02 ,
  WPAD_EXT_BALANCE_BOARD = 0x03 ,
  WPAD_EXT_MPLUS = 0x05 ,
  WPAD_EXT_MPLUS_NUNCHUK = 0x06 ,
  WPAD_EXT_MPLUS_CLASSIC = 0x07 ,
  WPAD_EXT_TRAIN = 0x10 ,
  WPAD_EXT_GUITAR = 0x11 ,
  WPAD_EXT_DRUM = 0x12 ,
  WPAD_EXT_TAIKO = 0x13 ,
  WPAD_EXT_PRO_CONTROLLER = 0x1f ,
  WPAD_EXT_DEV_NOT_FOUND = 0xfd ,
  WPAD_EXT_UNKNOWN = 0xff
}
 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_BUTTON_ZR = 0x00000004 ,
  WPAD_PRO_TRIGGER_ZR = WPAD_PRO_BUTTON_ZR ,
  WPAD_PRO_BUTTON_X = 0x00000008 ,
  WPAD_PRO_BUTTON_A = 0x00000010 ,
  WPAD_PRO_BUTTON_Y = 0x00000020 ,
  WPAD_PRO_BUTTON_B = 0x00000040 ,
  WPAD_PRO_BUTTON_ZL = 0x00000080 ,
  WPAD_PRO_TRIGGER_ZL = WPAD_PRO_BUTTON_ZL ,
  WPAD_PRO_RESERVED = 0x00000100 ,
  WPAD_PRO_BUTTON_R = 0x00000200 ,
  WPAD_PRO_TRIGGER_R = WPAD_PRO_BUTTON_R ,
  WPAD_PRO_BUTTON_PLUS = 0x00000400 ,
  WPAD_PRO_BUTTON_HOME = 0x00000800 ,
  WPAD_PRO_BUTTON_MINUS = 0x00001000 ,
  WPAD_PRO_BUTTON_L = 0x00002000 ,
  WPAD_PRO_TRIGGER_L = WPAD_PRO_BUTTON_L ,
  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...
 
enum  WPADLed {
  WPAD_LED_ONE = 0x01 ,
  WPAD_LED_TWO = 0x02 ,
  WPAD_LED_THREE = 0x04 ,
  WPAD_LED_FOUR = 0x08
}
 WPAD Led flags. More...
 
enum  WPADDpdFormat {
  WPAD_DPD_FMT_NONE = 0 ,
  WPAD_DPD_FMT_BASIC = 1 ,
  WPAD_DPD_FMT_EXTENDED = 3 ,
  WPAD_DPD_FMT_FULL = 5
}
 WPAD Infrared Format. For more information see IR Data Formats More...
 
enum  WPADSpeakerCmd {
  WPAD_SPEAKER_CMD_OFF = 0 ,
  WPAD_SPEAKER_CMD_ON = 1 ,
  WPAD_SPEAKER_CMD_MUTE = 2 ,
  WPAD_SPEAKER_CMD_UNMUTE = 3 ,
  WPAD_SPEAKER_CMD_PLAY = 4 ,
  WPAD_SPEAKER_CMD_ON_ALT = 5
}
 WPAD Speaker Command. More...
 
enum  WPADMplsMode {
  WPAD_MPLS_MODE_DISABLE = 0 ,
  WPAD_MPLS_MODE_MPLS_ONLY = 4 ,
  WPAD_MPLS_MODE_MPLS_NUNCHUK = 5 ,
  WPAD_MPLS_MODE_MPLS_CLASSIC = 7
}
 MotionPlus Mode. More...
 
enum  WPADMplsStatus {
  WPAD_MPLS_STATUS_ATTACHED = 0x01 ,
  WPAD_MPLS_STATUS_ROLL_CONV = 0x02 ,
  WPAD_MPLS_STATUS_PITCH_CONV = 0x04 ,
  WPAD_MPLS_STATUS_YAW_CONV = 0x08 ,
  WPAD_MPLS_STATUS_EXT_VALID = 0x40 ,
  WPAD_MPLS_STATUS_VALID = 0x80
}
 MotionPlus status flags. More...
 
enum  WPADPeripheralSpace {
  WPAD_PERIPHERAL_SPACE_SPEAKER = 0xA2 ,
  WPAD_PERIPHERAL_SPACE_EXTENSION = 0xA4 ,
  WPAD_PERIPHERAL_SPACE_MOTIONPLUS = 0xA6 ,
  WPAD_PERIPHERAL_SPACE_DPD = 0xB0
}
 WPAD Peripheral Memory Space Prefixes. More...
 
enum  WPADBalanceBoardCmd {
  WPAD_BALANCE_BOARD_CMD_UPDATE_TEMP = 0x00 ,
  WPAD_BALANCE_BOARD_CMD_OFF = 0x55 ,
  WPAD_BALANCE_BOARD_CMD_ON = 0xAA
}
 Balance Board commands. More...
 

Functions

 WUT_ENUM_BITMASK_TYPE (WPADLed)
 
void WPADInit (void)
 Initialises the WPAD library for use.
 
void WPADShutdown (void)
 Cleans up and frees the WPAD library.
 
BOOL WPADGetStatus (void)
 Get the status of the WPAD library.
 
void WPADDisconnect (WPADChan channel)
 Immediately disconnects the associated controller.
 
WPADError WPADProbe (WPADChan channel, WPADExtensionType *outExtensionType)
 Identifies the extension connected to the associated controller.
 
WPADError WPADSetDataFormat (WPADChan channel, WPADDataFormat format)
 Sets the data format of the controller, can be used to reduce or increase the amount of data received.
 
WPADDataFormat WPADGetDataFormat (WPADChan channel)
 Gets the data format in use by the controller.
 
void WPADRead (WPADChan channel, WPADStatus *status)
 Reads data for a given Wii Remote.
 
WPADError WPADControlLed (WPADChan channel, WPADLed led, WPADCallback callback)
 Controls the associated Wii Remote's LEDs.
 
WPADError WPADControlDpd (WPADChan channel, WPADDpdFormat mode, WPADCallback callback)
 Controls the Wii Remote's IR sensor.
 
WPADDpdFormat WPADGetDpdFormat (WPADChan channel)
 Returns the associated Wii Remote's IR mode.
 
void WPADControlMotor (WPADChan channel, BOOL motorEnabled)
 Controls the associated WPADChan's rumble motor.
 
int32_t WPADControlSpeaker (WPADChan channel, WPADSpeakerCmd mode, WPADCallback callback)
 Sets the Wii Remote speaker mode.
 
BOOL WPADIsSpeakerEnabled (WPADChan channel)
 Returns whether the Wii Remote's speaker is enabled.
 
BOOL WPADCanSendStreamData (WPADChan channel)
 Returns whether it is possible to send data to the Wii Remote's speaker at this moment May return false if device type is unknown, or the device is too busy.
 
WPADError WPADSendStreamData (WPADChan channel, const void *data, uint32_t size)
 Sends data to be played by Wii Remote speaker make sure the data is in the format the speaker was initialized for, (4-bit Yamaha ADPCM by default)
 
uint32_t WENCGetEncodeData (WENCParams *params, BOOL continuing, const int16_t *samples, uint32_t sampleCount, uint8_t *outEncodedData)
 Encode 16-bit LPCM as 4-bit Yamaha ADPCM.
 
uint8_t WPADGetSpeakerVolume (void)
 Returns the global Wii Remote speaker volume.
 
void WPADSetSpeakerVolume (uint8_t volume)
 Sets the global Wii Remote speaker volume.
 
int32_t WPADIsMplsAttached (WPADChan channel, BOOL *outEnabled, WPADCallback callback)
 Gets whether MotionPlus is enabled for the WPAD.
 
int32_t WPADIsMplsIntegrated (WPADChan channel)
 Returns whether the WPADChan has MotionPlus integrated.
 
WPADError WPADGetInfo (WPADChan channel, WPADInfo *outInfo)
 Retrieves status info from the controller.
 
WPADError WPADGetInfoAsync (WPADChan channel, WPADInfo *outInfo, WPADCallback callback)
 Retrieves status info from the controller asynchronously.
 
WPADError WPADReadMemoryAsync (WPADChan channel, void *destination, uint16_t size, uint32_t address, WPADCallback callback)
 Reads from the device's memory.
 
WPADError WPADWriteMemoryAsync (WPADChan channel, void *source, uint32_t size, uint32_t address, WPADCallback callback)
 Writes to the device's memory.
 
WPADError WPADReadExtReg (WPADChan channel, void *destination, uint16_t size, WPADPeripheralSpace peripheral, uint32_t address, WPADCallback callback)
 Reads from the registers of the Wii Remote's peripherals.
 
WPADError WPADWriteExtReg (WPADChan channel, const void *source, uint32_t size, WPADPeripheralSpace peripheral, uint32_t address, WPADCallback callback)
 Writes to the registers of the Wii Remote's peripherals.
 
WPADError WPADGetBLCalibration (WPADChan channel, void *destination, uint32_t address, uint32_t size, WPADCallback callback)
 Read Balance Board calibration.
 
void WPADSetPowerSaveMode (WPADChan channel, BOOL powerSave)
 Sets power save mode, this makes the controller only report input data when it changes.
 
BOOL WPADGetPowerSaveMode (WPADChan channel)
 
void WPADGetAddress (WPADChan channel, WPADAddress *outAddress)
 Retrieves the bluetooth address of the controller.
 
void WPADEnableMotor (BOOL enable)
 Enables/disables motors globally.
 
BOOL WPADIsMotorEnabled (void)
 Returns whether motors are disabled globally.
 
void WPADEnableURCC (BOOL enable)
 Enables/disables Wii U Pro Controller support.
 
BOOL WPADIsEnabledURC (void)
 Returns whether Wii U Pro Controllers are supported.
 
void WPADEnableWBC (void)
 Enables/disables Wii Balance Board support.
 
BOOL WPADIsEnableWBC (void)
 Returns whether Wii Balance Boards are supported.
 
void WPADEnableWiiRemote (BOOL enable)
 Enables/disables Wii Remote support.
 
void WPADSetAutoSleepTime (uint8_t time)
 
BOOL WPADStartSyncDevice (void)
 Starts searching for a WPAD controller in pairing mode and syncs with it.
 
BOOL WPADStartSyncDeviceEx (WPADAddress *deviceAddress, const char *deviceName)
 Starts attempts to sync with a WPAD with the specified properties.
 
WPADConnectCallback WPADSetConnectCallback (WPADChan channel, WPADCallback callback)
 Sets function to be run upon controller connect/disconnect.
 
WPADExtensionCallback WPADSetExtensionCallback (WPADChan channel, WPADExtensionCallback callback)
 Sets the function to be run upon extension connect and motion plus activation.
 
void WPADSetAutoSamplingBuf (WPADChan channel, void *buf, uint32_t count)
 Sets a custom status ring buffer for a Wii Remote.
 
uint32_t WPADGetLatestIndexInBuf (WPADChan channel)
 Returns the index of the most recent status sample for a Wii Remote.
 
WPADSamplingCallback WPADSetSamplingCallback (WPADChan channel, WPADSamplingCallback callback)
 Registers a callback to be invoked whenever new WPADStatus* data is stored in the ring buffer.
 
void WPADiShutdown (void)
 
void WPADiClearQueue (WPADiQueue *queue)
 Clears all elements from queue.
 
bool WPADiIsAvailableCmdQueue (WPADiQueue *queue, uint32_t count)
 Checks if there is enough space in the queue.
 
int32_t WPADiHIDParser (WPADChan channel, const uint8_t *hidData)
 Parses incoming HID report data for a controller.
 
BOOL WPADiSendSetVibrator (WPADiQueue *cmdQueue)
 Queues HID Report for Rumble Update.
 
BOOL WPADiSendSetPort (WPADiQueue *cmdQueue, WPADLed led, WPADCallback callback)
 Queues HID Report for setting LEDs used internally by WPADControlLed.
 
BOOL WPADiSendSetReportType (WPADiQueue *cmdQueue, WPADDataFormat dataFormat, BOOL powerSave, WPADCallback callback)
 Queues HID Report for setting data reporting mode used internally by WPADSetPowerSaveMode.
 
BOOL WPADiSendGetContStat (WPADiQueue *cmdQueue, WPADInfo *outInfo, WPADCallback callback)
 Queues HID report for a controller status request used internally by WPADGetInfoAsync and several other functions.
 
BOOL WPADiSendEnableDPD (WPADiQueue *cmdQueue, BOOL enable, WPADCallback callback)
 Queues HID Report for enabling the IR Camera clock used internally by WPADControlDpd.
 
BOOL WPADiSendEnableDPDCSB (WPADiQueue *cmdQueue, BOOL enable, WPADCallback callback)
 Queues HID Report for enabling IR Camera used internally by WPADControlDpd.
 
BOOL WPADiSendEnableSpeaker (WPADiQueue *cmdQueue, BOOL enable, WPADCallback callback)
 Queues HID Report for enabling speakers.
 
BOOL WPADiSendMuteSpeaker (WPADiQueue *cmdQueue, BOOL mute, WPADCallback callback)
 Queues HID Report for muting speakers used internally by .
 
BOOL WPADiSendStreamData (WPADiQueue *cmdQueue, void *source, uint32_t size)
 Queues HID Report for sending speaker stream data used internally by WPADSendStreamData.
 
BOOL WPADiSendWriteDataCmd (WPADiQueue *cmdQueue, uint8_t byte, uint32_t address, WPADCallback callback)
 Queues HID Report for a single-byte memory write.
 
BOOL WPADiSendWriteData (WPADiQueue *cmdQueue, void *source, uint32_t size, uint32_t address, WPADCallback callback)
 Queues HID Report for a multi-byte memory write used internally by WPADWriteMemoryAsync.
 
BOOL WPADiSendReadData (WPADiQueue *cmdQueue, void *destination, uint16_t size, uint32_t address, WPADCallback callback)
 Queues HID Report for a memory read used internally by WPADReadMemoryAsync.
 
uint32_t * WPADiGetGameCode (void)
 Game code (identifier), which may be saved to the EEPROM of connected controllers.
 
uint8_t WPADiGetGameType (void)
 Game type, which may be saved to the EEPROM of connected controllers.
 
void WPADSetGameTitleUtf16 (const uint16_t *title)
 Sets game title for all connected controllers.
 
WPADError WPADGetGameTitleUtf16 (WPADChan channel, uint16_t **outTitle)
 Gets game title stored on specified controller.
 
WPADError WPADGetGameDataTimestamp (WPADChan channel, OSTime *outTimestamp)
 Get the time that game data was written.
 
WPADError WPADiWriteGameData (WPADChan channel, const void *source, uint16_t size, uint32_t offset, WPADCallback callback)
 Write custom game data to the controller's EEPROM.
 
WPADError WPADiReadGameData (WPADChan channel, void *destination, uint16_t size, uint32_t offset, WPADCallback callback)
 Read custom game data from the controller's EEPROM.
 
WPADMplsMode WPADiGetMplsStatus (void)
 Get MotionPlus mode.
 
uint8_t WPADGetBatteryLevel (WPADChan channel)
 Returns the battery level.
 
WPADError WPADControlBLC (WPADChan channel, WPADBalanceBoardCmd command, WPADCallback callback)
 Sends a command to the balance board.
 

Detailed Description

WPAD is a low-level library under KPAD.


Data Structure Documentation

◆ WPADVec2D

struct WPADVec2D

2D vector.

Definition at line 398 of file wpad.h.

Data Fields
int16_t x x.
int16_t y y.

◆ WPADVec3D

struct WPADVec3D

3D vector.

Definition at line 410 of file wpad.h.

Data Fields
int16_t x x.
int16_t y y.
int16_t z z.

◆ WPADIRDot

struct WPADIRDot

A single IR dot tracked by the camera.

Definition at line 425 of file wpad.h.

Data Fields
WPADVec2D pos Position (in a 1024x768 grid).
uint16_t pixels Pixel area (in a 128x96 grid).
uint8_t id Identifier.

◆ WPADIRDotEx

struct WPADIRDotEx

A single IR dot tracked by the camera, extra info.

Definition at line 441 of file wpad.h.

Data Fields
WPADVec2D topRight Top-right coordinate (in a 1024x768 grid).
WPADVec2D bottomLeft Bottom-left coordinate (in a 1024x768 grid).
uint16_t pixels Pixel area (in a 128x96 grid).
uint8_t size Calculated size (from 0 to 15).

◆ WPADStatus

struct WPADStatus

Core Wii Remote status.

Valid buffer for formats:

  • WPAD_FMT_CORE
  • WPAD_FMT_CORE_ACC
  • WPAD_FMT_CORE_ACC_DPD

Definition at line 467 of file wpad.h.

Data Fields
uint16_t buttons Bitset from WPADButton.
WPADVec3D acc Accelerometer data.
WPADIRDot ir[WPAD_MAX_IR_DOTS] IR dots tracked.
uint8_t extensionType One of WPADExtensionType.
int8_t error Error of the last WPADRead().

◆ WPADStatusEx

struct WPADStatusEx

Extended core Wii Remote status, with more IR details.

Valid buffer for formats:

  • WPAD_FMT_CORE_ACC_DPD_FULL

Definition at line 493 of file wpad.h.

Data Fields
WPADStatus core
WPADIRDotEx irEx[WPAD_MAX_IR_DOTS]

◆ WPADStatusNunchuk

struct WPADStatusNunchuk

Wii Remote + Nunchuk status.

Note that nunchuk buttons (Z and C) are reported in core.buttons.

Valid buffer for formats:

  • WPAD_FMT_NUNCHUK
  • WPAD_FMT_NUNCHUK_ACC
  • WPAD_FMT_NUNCHUK_ACC_DPD

Definition at line 512 of file wpad.h.

Data Fields
WPADStatus core Wii Remote core state + nunchuk buttons.
WPADVec3D acc Accelerometer data.
struct WPADStatusNunchuk.stick stick

◆ WPADStatusClassic

struct WPADStatusClassic

Classic Controller and Classic Controller Pro status.

Valid buffer for formats:

  • WPAD_FMT_CLASSIC
  • WPAD_FMT_CLASSIC_ACC
  • WPAD_FMT_CLASSIC_ACC_DPD
  • WPAD_FMT_GUITAR
  • WPAD_FMT_DRUM
  • WPAD_FMT_TAIKO

Definition at line 543 of file wpad.h.

Data Fields
WPADStatus core
uint16_t buttons Bitset from WPADClassicButton.
WPADVec2D leftStick Left stick: [-512, 511] x [-512, 511].
WPADVec2D rightStick Right stick: [-512, 511] x [-512, 511].
uint8_t leftTrigger
uint8_t rightTrigger

◆ WPADStatusProController

struct WPADStatusProController

Pro Controller status.

Valid buffer for formats:

  • WPAD_FMT_PRO_CONTROLLER

Definition at line 569 of file wpad.h.

Data Fields
WPADStatus core
uint32_t buttons Bitset from WPADProButton.
WPADVec2D leftStick Left stick: [-2048, 2047] x [-2048 x 2047].
WPADVec2D rightStick Right stick: [-2048, 2047] x [-2048 x 2047].
BOOL charging
BOOL wired

◆ WPADStatusMotionPlus

struct WPADStatusMotionPlus

MotionPlus status.

Use core.extensionType to determine if nunchuk or classic are valid.

Valid for formats:

  • WPAD_FMT_MPLUS

Note that the extension fields line up with WPADStatusNunchuk and WPADStatusClassic.

Definition at line 600 of file wpad.h.

Data Fields
WPADStatus core
union WPADStatusMotionPlus.__unnamed56__ __unnamed__
uint8_t status Bitset from WPADMplsStatus.
WPADVec3D angle

◆ WPADStatusBalanceBoard

struct WPADStatusBalanceBoard

Balance Board status.

Valid for formats:

  • WPAD_FMT_BALANCE_BOARD

Definition at line 652 of file wpad.h.

Data Fields
WPADStatus core
uint16_t pressure[WPAD_MAX_PRESSURE_SENSORS] Raw pressure data.
See also
WBCRead().
int8_t temperature Raw temperature data.
See also
WBCSetupCalibration().
uint8_t battery Raw battery charge.
See also
WBCGetBatteryLevel().

◆ WPADStatusTrain

struct WPADStatusTrain

Bullet Train controller status.

Valid for formats:

  • WPAD_FMT_TRAIN

Definition at line 674 of file wpad.h.

Data Fields
WPADStatus core
uint16_t buttons Bitset from WPADClassicButton.
uint8_t brake Brake (left) lever.
uint8_t throttle Throttle (right) lever.

◆ WPADInfo

struct WPADInfo

Controller status info.

Definition at line 691 of file wpad.h.

Data Fields
BOOL irEnabled
BOOL speakerEnabled
BOOL extensionAttached
BOOL batteryLow
BOOL speakerBufNearEmpty
uint8_t batteryLevel
uint8_t led
uint8_t protocol
uint8_t firmware

◆ WPADiQueueElement

struct WPADiQueueElement

Definition at line 715 of file wpad.h.

Data Fields
uint8_t data[0x30]

◆ WPADiQueue

struct WPADiQueue

Definition at line 722 of file wpad.h.

Data Fields
uint8_t frontIndex
uint8_t backIndex
WPADiQueueElement * elements
uint32_t capacity

◆ WPADAddress

struct WPADAddress

Bluetooth device address.

Definition at line 737 of file wpad.h.

Data Fields
uint8_t btDeviceAddress[6]

◆ WENCParams

struct WENCParams

Continuation parameters for WENCGetEncodeData.

Definition at line 745 of file wpad.h.

◆ WPADStatusNunchuk.stick

struct WPADStatusNunchuk.stick

Definition at line 518 of file wpad.h.

Data Fields
int8_t x x, in the range [-128, 127].
int8_t y y, in the range [-128, 127].

◆ WPADStatusMotionPlus.__unnamed56__

union WPADStatusMotionPlus.__unnamed56__

Definition at line 603 of file wpad.h.

Data Fields
struct WPADStatusMotionPlus.__unnamed56__.nunchuk nunchuk
struct WPADStatusMotionPlus.__unnamed56__.classic classic

◆ WPADStatusMotionPlus.__unnamed56__.nunchuk

struct WPADStatusMotionPlus.__unnamed56__.nunchuk

Definition at line 605 of file wpad.h.

Data Fields
WPADVec3D acc Accelerometer data.
struct WPADStatusMotionPlus.__unnamed56__.nunchuk.stick stick

◆ WPADStatusMotionPlus.__unnamed56__.nunchuk.stick

struct WPADStatusMotionPlus.__unnamed56__.nunchuk.stick

Definition at line 609 of file wpad.h.

Data Fields
int8_t x x: [-128, 127]
int8_t y y: [-128, 127]

◆ WPADStatusMotionPlus.__unnamed56__.classic

struct WPADStatusMotionPlus.__unnamed56__.classic

Definition at line 617 of file wpad.h.

Data Fields
uint16_t buttons Bitset from WPADClassicButton.
WPADVec2D leftStick Left stick: [-512, 511] x [-512, 511].
WPADVec2D rightStick Right stick: [-512, 511] x [-512, 511].
uint8_t leftTrigger
uint8_t rightTrigger

Macro Definition Documentation

◆ WPAD_MAX_IR_DOTS

#define WPAD_MAX_IR_DOTS   4

Definition at line 17 of file wpad.h.

◆ WPAD_MAX_PRESSURE_SENSORS

#define WPAD_MAX_PRESSURE_SENSORS   4

Definition at line 18 of file wpad.h.

Typedef Documentation

◆ WPADStatusProController

Definition at line 20 of file wpad.h.

◆ WPADVec2D

typedef struct WPADVec2D WPADVec2D

Definition at line 21 of file wpad.h.

◆ WPADVec3D

typedef struct WPADVec3D WPADVec3D

Definition at line 22 of file wpad.h.

◆ WPADInfo

typedef struct WPADInfo WPADInfo

Definition at line 23 of file wpad.h.

◆ WPADAddress

typedef struct WPADAddress WPADAddress

Definition at line 24 of file wpad.h.

◆ WPADiQueueElement

Definition at line 25 of file wpad.h.

◆ WPADiQueue

typedef struct WPADiQueue WPADiQueue

Definition at line 26 of file wpad.h.

◆ WPADIRDot

typedef struct WPADIRDot WPADIRDot

Definition at line 27 of file wpad.h.

◆ WPADIRDotEx

typedef struct WPADIRDotEx WPADIRDotEx

Definition at line 28 of file wpad.h.

◆ WPADStatus

typedef struct WPADStatus WPADStatus

Definition at line 29 of file wpad.h.

◆ WPADStatusEx

typedef struct WPADStatusEx WPADStatusEx

Definition at line 30 of file wpad.h.

◆ WPADStatusNunchuk

Definition at line 31 of file wpad.h.

◆ WPADStatusClassic

Definition at line 32 of file wpad.h.

◆ WPADStatusMotionPlus

Definition at line 33 of file wpad.h.

◆ WPADStatusBalanceBoard

Definition at line 34 of file wpad.h.

◆ WPADStatusTrain

Definition at line 35 of file wpad.h.

◆ WPADStatusPro

Definition at line 36 of file wpad.h.

◆ WENCParams

typedef struct WENCParams WENCParams

Definition at line 37 of file wpad.h.

◆ WPADError

typedef enum WPADError WPADError

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

◆ WPADLed

typedef enum WPADLed WPADLed

WPAD Led flags.

◆ WPADDpdFormat

WPAD Infrared Format. For more information see IR Data Formats

◆ WPADSpeakerCmd

WPAD Speaker Command.

◆ WPADMplsMode

typedef enum WPADMplsMode WPADMplsMode

MotionPlus Mode.

◆ WPADMplsStatus

MotionPlus status flags.

◆ WPADPeripheralSpace

WPAD Peripheral Memory Space Prefixes.

◆ WPADBalanceBoardCmd

Balance Board commands.

◆ WPADCallback

typedef void(* WPADCallback) (WPADChan channel, WPADError status)

Definition at line 751 of file wpad.h.

◆ WPADControlLedCallback

Definition at line 752 of file wpad.h.

◆ WPADControlDpdCallback

Definition at line 753 of file wpad.h.

◆ WPADControlSpeakerCallback

Definition at line 754 of file wpad.h.

◆ WPADIsMplsAttachedCallback

Definition at line 755 of file wpad.h.

◆ WPADGetInfoCallback

Definition at line 756 of file wpad.h.

◆ WPADReadMemoryCallback

Definition at line 757 of file wpad.h.

◆ WPADWriteMemoryCallback

Definition at line 758 of file wpad.h.

◆ WPADConnectCallback

Definition at line 759 of file wpad.h.

◆ WPADiSendCallback

Definition at line 760 of file wpad.h.

◆ WPADiWriteGameDataCallback

Definition at line 761 of file wpad.h.

◆ WPADSamplingCallback

typedef void(* WPADSamplingCallback) (WPADChan channel)

Definition at line 763 of file wpad.h.

◆ WPADExtensionCallback

typedef void(* WPADExtensionCallback) (WPADChan channel, WPADExtensionType ext)

Callback called when the active extension changes.

Definition at line 768 of file wpad.h.

Enumeration Type Documentation

◆ WPADError

enum WPADError
Enumerator
WPAD_ERROR_NONE 
WPAD_ERROR_NO_CONTROLLER 
WPAD_ERROR_NOT_READY 
WPAD_ERROR_TRANSFER 
WPAD_ERROR_INVALID 
WPAD_ERROR_PERMISSION 
WPAD_ERROR_BROKEN 
WPAD_ERROR_QUEUE_EMPTY 
WPAD_ERROR_BAD_VALUE 
WPAD_ERROR_BAD_CONF 

Definition at line 39 of file wpad.h.

◆ 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 55 of file wpad.h.

◆ WPADDataFormat

Data format.

Enumerator
WPAD_FMT_CORE 

Wii Remote buttons.

WPAD_FMT_CORE_ACC 

Wii Remote buttons and accelerometer.

WPAD_FMT_CORE_ACC_DPD 

Wii Remote buttons, accelerometer and IR pos.

WPAD_FMT_NUNCHUK 

Wii Remote buttons, Nunchuk.

WPAD_FMT_NUNCHUK_ACC 

Wii Remote buttons, accelerometer, Nunchuk.

WPAD_FMT_NUNCHUK_ACC_DPD 

Wii Remote buttons, accelerometer, IR pos, Nunchuk.

WPAD_FMT_CLASSIC 

Wii Remote buttons, Classic Controller.

WPAD_FMT_CLASSIC_ACC 

Wii Remote buttons, accelerometer, Classic Controller.

WPAD_FMT_CLASSIC_ACC_DPD 

Wii Remote buttons, accelerometer, IR pos, Classic Controller.

WPAD_FMT_CORE_ACC_DPD_FULL 

Wii Remote buttons, accelerometer and IR pos with bounds.

WPAD_FMT_TRAIN 

Wii Remote, Densha De GO! Shinkansen Controller.

WPAD_FMT_GUITAR 

Guitar Hero Guitar.

WPAD_FMT_BALANCE_BOARD 

Wii Balance Board.

WPAD_FMT_DRUM 

Guitar Hero World Tour Drums.

WPAD_FMT_MPLUS 

Wii Remote buttons, accelerometer, IR pos, Motion Plus gyroscope.

WPAD_FMT_TAIKO 

Wii Remote, Taiko no Tatsujin TaTaCon.

WPAD_FMT_PRO_CONTROLLER 

Wii U Pro Controller.

Definition at line 74 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_BALANCE_BOARD 

Balance Board.

WPAD_EXT_MPLUS 

Motion Plus.

WPAD_EXT_MPLUS_NUNCHUK 

Motion Plus with Nunchuk.

WPAD_EXT_MPLUS_CLASSIC 

Motion Plus with Classic Controller.

WPAD_EXT_TRAIN 

Train controller.

WPAD_EXT_GUITAR 

Guitar controller.

WPAD_EXT_DRUM 

Drum controller.

WPAD_EXT_TAIKO 

Taiko no Tatsujin controller.

WPAD_EXT_PRO_CONTROLLER 

Pro Controller.

WPAD_EXT_DEV_NOT_FOUND 

No controller found.

WPAD_EXT_UNKNOWN 

Extension unknown.

Definition at line 113 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 146 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 177 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 194 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_BUTTON_ZR 

The ZR button.

WPAD_PRO_TRIGGER_ZR 

Another name for 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_BUTTON_ZL 

The ZL button.

WPAD_PRO_TRIGGER_ZL 

Another name for the ZL button.

WPAD_PRO_RESERVED 

Reserved.

WPAD_PRO_BUTTON_R 

The R button.

WPAD_PRO_TRIGGER_R 

Another name for the R button.

WPAD_PRO_BUTTON_PLUS 

The + button.

WPAD_PRO_BUTTON_HOME 

The HOME button.

WPAD_PRO_BUTTON_MINUS 

The - button.

WPAD_PRO_BUTTON_L 

The L button.

WPAD_PRO_TRIGGER_L 

Another name for the L 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 245 of file wpad.h.

◆ WPADLed

enum WPADLed

WPAD Led flags.

Enumerator
WPAD_LED_ONE 
WPAD_LED_TWO 
WPAD_LED_THREE 
WPAD_LED_FOUR 

Definition at line 310 of file wpad.h.

◆ WPADDpdFormat

WPAD Infrared Format. For more information see IR Data Formats

Enumerator
WPAD_DPD_FMT_NONE 

Disable IR.

WPAD_DPD_FMT_BASIC 
WPAD_DPD_FMT_EXTENDED 
WPAD_DPD_FMT_FULL 

Definition at line 320 of file wpad.h.

◆ WPADSpeakerCmd

WPAD Speaker Command.

Enumerator
WPAD_SPEAKER_CMD_OFF 

Deinitializes and turns off speaker.

WPAD_SPEAKER_CMD_ON 

Turns on and initializes speaker to use 4-bit Yamaha ADPCM data format at 3000 Hz.

WPAD_SPEAKER_CMD_MUTE 

Mutes speaker.

WPAD_SPEAKER_CMD_UNMUTE 

Unmutes speaker.

WPAD_SPEAKER_CMD_PLAY 

Allows sound to play.

WPAD_SPEAKER_CMD_ON_ALT 

Does the same as WPAD_SPEAKER_CMD_ON.

Definition at line 330 of file wpad.h.

◆ WPADMplsMode

MotionPlus Mode.

Enumerator
WPAD_MPLS_MODE_DISABLE 
WPAD_MPLS_MODE_MPLS_ONLY 

MotionPlus exclusive mode.

WPAD_MPLS_MODE_MPLS_NUNCHUK 

Nunchuk passthrough mode.

WPAD_MPLS_MODE_MPLS_CLASSIC 

Classic passthrough mode.

Definition at line 347 of file wpad.h.

◆ WPADMplsStatus

MotionPlus status flags.

Enumerator
WPAD_MPLS_STATUS_ATTACHED 

When something is attached to the MotionPlus.

WPAD_MPLS_STATUS_ROLL_CONV 

When the roll is in low-velocity mode.

WPAD_MPLS_STATUS_PITCH_CONV 

When the pitch is in low-velocity mode.

WPAD_MPLS_STATUS_YAW_CONV 

When the yaw is in low-velocity mode.

WPAD_MPLS_STATUS_EXT_VALID 

When extension data is valid.

WPAD_MPLS_STATUS_VALID 

When MotionPlus data is valid.

Definition at line 359 of file wpad.h.

◆ WPADPeripheralSpace

WPAD Peripheral Memory Space Prefixes.

Enumerator
WPAD_PERIPHERAL_SPACE_SPEAKER 
WPAD_PERIPHERAL_SPACE_EXTENSION 

Any extension other than Motion Plus.

WPAD_PERIPHERAL_SPACE_MOTIONPLUS 
WPAD_PERIPHERAL_SPACE_DPD 

Infrared.

Definition at line 376 of file wpad.h.

◆ WPADBalanceBoardCmd

Balance Board commands.

Enumerator
WPAD_BALANCE_BOARD_CMD_UPDATE_TEMP 

Update temperature data.

WPAD_BALANCE_BOARD_CMD_OFF 

Turn Balance Board off.

WPAD_BALANCE_BOARD_CMD_ON 

Turn Balance Board on.

Definition at line 387 of file wpad.h.

Function Documentation

◆ WUT_ENUM_BITMASK_TYPE()

WUT_ENUM_BITMASK_TYPE ( WPADLed  )

◆ WPADInit()

void WPADInit ( void  )

Initialises the WPAD library for use.

◆ WPADShutdown()

void WPADShutdown ( void  )

Cleans up and frees the WPAD library.

◆ WPADGetStatus()

BOOL WPADGetStatus ( void  )

Get the status of the WPAD library.

Returns
TRUE if the library is initialized.

◆ WPADDisconnect()

void WPADDisconnect ( WPADChan  channel)

Immediately disconnects the associated controller.

◆ WPADProbe()

WPADError WPADProbe ( WPADChan  channel,
WPADExtensionType outExtensionType 
)

Identifies the extension connected to the associated controller.

Returns
WPAD_ERROR_NO_CONTROLLER if controller is not connected,
WPAD_ERROR_NOT_READY if busy

◆ WPADSetDataFormat()

WPADError WPADSetDataFormat ( WPADChan  channel,
WPADDataFormat  format 
)

Sets the data format of the controller, can be used to reduce or increase the amount of data received.

Parameters
channel
formatdata format
Returns
WPAD_ERROR_NONE on success
WPAD_ERROR_NOT_READY if busy or data
WPAD_ERROR_INVALID if format is for a disabled device type

◆ WPADGetDataFormat()

WPADDataFormat WPADGetDataFormat ( WPADChan  channel)

Gets the data format in use by the controller.

Returns
the current data format

◆ WPADRead()

void WPADRead ( WPADChan  channel,
WPADStatus status 
)

Reads data for a given Wii Remote.

Parameters
channel
statusWhere to store the data; must have be the correct type for the data format.
See also

◆ WPADControlLed()

WPADError WPADControlLed ( WPADChan  channel,
WPADLed  led,
WPADCallback  callback 
)

Controls the associated Wii Remote's LEDs.

◆ WPADControlDpd()

WPADError WPADControlDpd ( WPADChan  channel,
WPADDpdFormat  mode,
WPADCallback  callback 
)

Controls the Wii Remote's IR sensor.

◆ WPADGetDpdFormat()

WPADDpdFormat WPADGetDpdFormat ( WPADChan  channel)

Returns the associated Wii Remote's IR mode.

◆ WPADControlMotor()

void WPADControlMotor ( WPADChan  channel,
BOOL  motorEnabled 
)

Controls the associated WPADChan's rumble motor.

◆ WPADControlSpeaker()

int32_t WPADControlSpeaker ( WPADChan  channel,
WPADSpeakerCmd  mode,
WPADCallback  callback 
)

Sets the Wii Remote speaker mode.

◆ WPADIsSpeakerEnabled()

BOOL WPADIsSpeakerEnabled ( WPADChan  channel)

Returns whether the Wii Remote's speaker is enabled.

◆ WPADCanSendStreamData()

BOOL WPADCanSendStreamData ( WPADChan  channel)

Returns whether it is possible to send data to the Wii Remote's speaker at this moment May return false if device type is unknown, or the device is too busy.

◆ WPADSendStreamData()

WPADError WPADSendStreamData ( WPADChan  channel,
const void *  data,
uint32_t  size 
)

Sends data to be played by Wii Remote speaker make sure the data is in the format the speaker was initialized for, (4-bit Yamaha ADPCM by default)

Parameters
dataaudio encoded in initialized format
sizenumber of bytes to send, up to 20 bytes may be sent per call
Returns
WPAD_ERROR_NOT_READY, if not possible to send data at this moment
WPAD_ERROR_NO_CONTROLLER, if channel is invalid, data is NULL or size is more than 20
See also
WPADControlSpeaker
WPADCanSendStreamData
WENCGetEncodeData

◆ WENCGetEncodeData()

uint32_t WENCGetEncodeData ( WENCParams params,
BOOL  continuing,
const int16_t *  samples,
uint32_t  sampleCount,
uint8_t *  outEncodedData 
)

Encode 16-bit LPCM as 4-bit Yamaha ADPCM.

Parameters
paramsencoding continuation params, written on first call, and read and updated on each subsequent call
continuingshould be TRUE if continuing encoding stream with the params produced via a prior call
samples16-bit LPCM sample buffer
sampleCountnumber of 16-bit LPCM samples
outEncodedDatabuffer for the returned adpcm samples, buffer size should be equal to {(sampleCount + 1) / 2}
Returns
Number of LPCM-16 samples
See also
WPADSendStreamData

◆ WPADGetSpeakerVolume()

uint8_t WPADGetSpeakerVolume ( void  )

Returns the global Wii Remote speaker volume.

◆ WPADSetSpeakerVolume()

void WPADSetSpeakerVolume ( uint8_t  volume)

Sets the global Wii Remote speaker volume.

Only applies to Wii Remotes whose speakers are initialized after this call.

◆ WPADIsMplsAttached()

int32_t WPADIsMplsAttached ( WPADChan  channel,
BOOL outEnabled,
WPADCallback  callback 
)

Gets whether MotionPlus is enabled for the WPAD.

Parameters
outEnabledis set to true if MotionPlus is enabled

◆ WPADIsMplsIntegrated()

int32_t WPADIsMplsIntegrated ( WPADChan  channel)

Returns whether the WPADChan has MotionPlus integrated.

Returns
-1 if controller is not connected, 1 if MotionPlus integrated, 0 if not

◆ WPADGetInfo()

WPADError WPADGetInfo ( WPADChan  channel,
WPADInfo outInfo 
)

Retrieves status info from the controller.

Returns
WPAD_ERROR_NO_CONTROLLER if info request fails
WPAD_ERROR_NOT_READY if controller is not connected

◆ WPADGetInfoAsync()

WPADError WPADGetInfoAsync ( WPADChan  channel,
WPADInfo outInfo,
WPADCallback  callback 
)

Retrieves status info from the controller asynchronously.

Parameters
callbackpointer to function called when info is obtained
Returns
WPAD_ERROR_NO_CONTROLLER if info request fails
WPAD_ERROR_NOT_READY if controller is not connected

◆ WPADReadMemoryAsync()

WPADError WPADReadMemoryAsync ( WPADChan  channel,
void *  destination,
uint16_t  size,
uint32_t  address,
WPADCallback  callback 
)

Reads from the device's memory.

Parameters
destinationwhere the received data will be stored
sizenumber of bytes to read
addressdevice memory address, see EEPROM Memory and Control Registers
callbackfunction to be called upon completion
See also

◆ WPADWriteMemoryAsync()

WPADError WPADWriteMemoryAsync ( WPADChan  channel,
void *  source,
uint32_t  size,
uint32_t  address,
WPADCallback  callback 
)

Writes to the device's memory.

Parameters
sourcedata to be written to the controller
sizenumber of bytes to write
addressdevice memory address, see EEPROM Memory and Control Registers
callbackfunction to be called upon completion
See also

◆ WPADReadExtReg()

WPADError WPADReadExtReg ( WPADChan  channel,
void *  destination,
uint16_t  size,
WPADPeripheralSpace  peripheral,
uint32_t  address,
WPADCallback  callback 
)

Reads from the registers of the Wii Remote's peripherals.

Parameters
addressaddress within the peripheral's memory space
See also

◆ WPADWriteExtReg()

WPADError WPADWriteExtReg ( WPADChan  channel,
const void *  source,
uint32_t  size,
WPADPeripheralSpace  peripheral,
uint32_t  address,
WPADCallback  callback 
)

Writes to the registers of the Wii Remote's peripherals.

Parameters
addressaddress within the peripheral's memory space
peripheraltarget peripheral memory area
See also

Usage:

// Setting speaker volume on specific controller
uint8_t volume = 0x40;
WPADError WPADWriteExtReg(WPADChan channel, const void *source, uint32_t size, WPADPeripheralSpace peripheral, uint32_t address, WPADCallback callback)
Writes to the registers of the Wii Remote's peripherals.
@ WPAD_CHAN_0
Channel 0.
Definition wpad.h:58
@ WPAD_PERIPHERAL_SPACE_SPEAKER
Definition wpad.h:378

◆ WPADGetBLCalibration()

WPADError WPADGetBLCalibration ( WPADChan  channel,
void *  destination,
uint32_t  address,
uint32_t  size,
WPADCallback  callback 
)

Read Balance Board calibration.

Parameters
addressmay only be in the ranges [0x24,0x40) and [0x50, 0x70)
See also

◆ WPADSetPowerSaveMode()

void WPADSetPowerSaveMode ( WPADChan  channel,
BOOL  powerSave 
)

Sets power save mode, this makes the controller only report input data when it changes.

◆ WPADGetPowerSaveMode()

BOOL WPADGetPowerSaveMode ( WPADChan  channel)
Returns
FALSE, if power save mode is off.

◆ WPADGetAddress()

void WPADGetAddress ( WPADChan  channel,
WPADAddress outAddress 
)

Retrieves the bluetooth address of the controller.

◆ WPADEnableMotor()

void WPADEnableMotor ( BOOL  enable)

Enables/disables motors globally.

◆ WPADIsMotorEnabled()

BOOL WPADIsMotorEnabled ( void  )

Returns whether motors are disabled globally.

◆ WPADEnableURCC()

void WPADEnableURCC ( BOOL  enable)

Enables/disables Wii U Pro Controller support.

◆ WPADIsEnabledURC()

BOOL WPADIsEnabledURC ( void  )

Returns whether Wii U Pro Controllers are supported.

◆ WPADEnableWBC()

void WPADEnableWBC ( void  )

Enables/disables Wii Balance Board support.

◆ WPADIsEnableWBC()

BOOL WPADIsEnableWBC ( void  )

Returns whether Wii Balance Boards are supported.

◆ WPADEnableWiiRemote()

void WPADEnableWiiRemote ( BOOL  enable)

Enables/disables Wii Remote support.

◆ WPADSetAutoSleepTime()

void WPADSetAutoSleepTime ( uint8_t  time)

◆ WPADStartSyncDevice()

BOOL WPADStartSyncDevice ( void  )

Starts searching for a WPAD controller in pairing mode and syncs with it.

Returns
TRUE if sync started

◆ WPADStartSyncDeviceEx()

BOOL WPADStartSyncDeviceEx ( WPADAddress deviceAddress,
const char *  deviceName 
)

Starts attempts to sync with a WPAD with the specified properties.

If unable to find a device, does the same as WPADStartSyncDevice

Parameters
deviceAddressBluetooth address of the device to connect to.
deviceNameBluetooth name of the device to connect to (up to 24 characters)
Returns
TRUE if sync started

Usage:

memset(&addr, 0x10, 6);
// Initially searches for device with address 10:10:10:10:10:10 and name "Nintendo RVL-CNT-01" (Wii Remote)
WPADStartSyncDeviceEx(&addr, "Nintendo RVL-CNT-01");
BOOL WPADStartSyncDeviceEx(WPADAddress *deviceAddress, const char *deviceName)
Starts attempts to sync with a WPAD with the specified properties.
Bluetooth device address.
Definition wpad.h:738

◆ WPADSetConnectCallback()

WPADConnectCallback WPADSetConnectCallback ( WPADChan  channel,
WPADCallback  callback 
)

Sets function to be run upon controller connect/disconnect.

Parameters
callbackCallback to be invoked; status will be:
  • WPAD_ERROR_NONE when controller connects.
  • WPAD_ERROR_NO_CONTROLLER when controller disconnects.
Returns
the previously used callback
Warning
May overwrite callbacks used internally by KPAD. If using KPAD, KPADSetConnectCallback is preferable.

◆ WPADSetExtensionCallback()

WPADExtensionCallback WPADSetExtensionCallback ( WPADChan  channel,
WPADExtensionCallback  callback 
)

Sets the function to be run upon extension connect and motion plus activation.

Returns
the previously used callback

◆ WPADSetAutoSamplingBuf()

void WPADSetAutoSamplingBuf ( WPADChan  channel,
void *  buf,
uint32_t  count 
)

Sets a custom status ring buffer for a Wii Remote.

Parameters
bufpoints to an array of elements that match the data format.
counthow many elements are in the buf array.
See also

◆ WPADGetLatestIndexInBuf()

uint32_t WPADGetLatestIndexInBuf ( WPADChan  channel)

Returns the index of the most recent status sample for a Wii Remote.

See also

◆ WPADSetSamplingCallback()

WPADSamplingCallback WPADSetSamplingCallback ( WPADChan  channel,
WPADSamplingCallback  callback 
)

Registers a callback to be invoked whenever new WPADStatus* data is stored in the ring buffer.

Warning
May overwrite callbacks used internally by KPAD. If using KPAD, KPADSetSamplingCallback is preferable.
See also

◆ WPADiShutdown()

void WPADiShutdown ( void  )

◆ WPADiClearQueue()

void WPADiClearQueue ( WPADiQueue queue)

Clears all elements from queue.

◆ WPADiIsAvailableCmdQueue()

bool WPADiIsAvailableCmdQueue ( WPADiQueue queue,
uint32_t  count 
)

Checks if there is enough space in the queue.

◆ WPADiHIDParser()

int32_t WPADiHIDParser ( WPADChan  channel,
const uint8_t *  hidData 
)

Parses incoming HID report data for a controller.

Returns
-1 if first byte is outside the valid input report range (0x20 to 0x3f)

◆ WPADiSendSetVibrator()

BOOL WPADiSendSetVibrator ( WPADiQueue cmdQueue)

Queues HID Report for Rumble Update.

Rumble must be set before this

Returns
TRUE if successfully added to queue

◆ WPADiSendSetPort()

BOOL WPADiSendSetPort ( WPADiQueue cmdQueue,
WPADLed  led,
WPADCallback  callback 
)

Queues HID Report for setting LEDs used internally by WPADControlLed.

Returns
TRUE if successfully added to queue

◆ WPADiSendSetReportType()

BOOL WPADiSendSetReportType ( WPADiQueue cmdQueue,
WPADDataFormat  dataFormat,
BOOL  powerSave,
WPADCallback  callback 
)

Queues HID Report for setting data reporting mode used internally by WPADSetPowerSaveMode.

Returns
TRUE if successfully added to queue

◆ WPADiSendGetContStat()

BOOL WPADiSendGetContStat ( WPADiQueue cmdQueue,
WPADInfo outInfo,
WPADCallback  callback 
)

Queues HID report for a controller status request used internally by WPADGetInfoAsync and several other functions.

Returns
TRUE if successfully added to queue

◆ WPADiSendEnableDPD()

BOOL WPADiSendEnableDPD ( WPADiQueue cmdQueue,
BOOL  enable,
WPADCallback  callback 
)

Queues HID Report for enabling the IR Camera clock used internally by WPADControlDpd.

Returns
TRUE if successfully added to queue

◆ WPADiSendEnableDPDCSB()

BOOL WPADiSendEnableDPDCSB ( WPADiQueue cmdQueue,
BOOL  enable,
WPADCallback  callback 
)

Queues HID Report for enabling IR Camera used internally by WPADControlDpd.

Returns
TRUE if successfully added to queue

◆ WPADiSendEnableSpeaker()

BOOL WPADiSendEnableSpeaker ( WPADiQueue cmdQueue,
BOOL  enable,
WPADCallback  callback 
)

Queues HID Report for enabling speakers.

Used internally by TRUE if successfully added to queue

◆ WPADiSendMuteSpeaker()

BOOL WPADiSendMuteSpeaker ( WPADiQueue cmdQueue,
BOOL  mute,
WPADCallback  callback 
)

Queues HID Report for muting speakers used internally by .

Returns
TRUE if successfully added to queue

◆ WPADiSendStreamData()

BOOL WPADiSendStreamData ( WPADiQueue cmdQueue,
void *  source,
uint32_t  size 
)

Queues HID Report for sending speaker stream data used internally by WPADSendStreamData.

Returns
TRUE if successfully added to queue

◆ WPADiSendWriteDataCmd()

BOOL WPADiSendWriteDataCmd ( WPADiQueue cmdQueue,
uint8_t  byte,
uint32_t  address,
WPADCallback  callback 
)

Queues HID Report for a single-byte memory write.

Returns
TRUE if successfully added to queue

◆ WPADiSendWriteData()

BOOL WPADiSendWriteData ( WPADiQueue cmdQueue,
void *  source,
uint32_t  size,
uint32_t  address,
WPADCallback  callback 
)

Queues HID Report for a multi-byte memory write used internally by WPADWriteMemoryAsync.

Returns
TRUE if successfully added to queue

◆ WPADiSendReadData()

BOOL WPADiSendReadData ( WPADiQueue cmdQueue,
void *  destination,
uint16_t  size,
uint32_t  address,
WPADCallback  callback 
)

Queues HID Report for a memory read used internally by WPADReadMemoryAsync.

Returns
TRUE if successfully added to queue

◆ WPADiGetGameCode()

uint32_t * WPADiGetGameCode ( void  )

Game code (identifier), which may be saved to the EEPROM of connected controllers.

Returns
pointer to the game code

◆ WPADiGetGameType()

uint8_t WPADiGetGameType ( void  )

Game type, which may be saved to the EEPROM of connected controllers.

Returns
0x80

◆ WPADSetGameTitleUtf16()

void WPADSetGameTitleUtf16 ( const uint16_t *  title)

Sets game title for all connected controllers.

Parameters
titleup to 17 UTF-16 characters including null terminator title will be copied onto the controller EEPROM
See also

◆ WPADGetGameTitleUtf16()

WPADError WPADGetGameTitleUtf16 ( WPADChan  channel,
uint16_t **  outTitle 
)

Gets game title stored on specified controller.

Parameters
outTitlepointer to where the title will be output
Returns
WPAD_ERROR_INVALID, if game data previously failed to write
See also

◆ WPADGetGameDataTimestamp()

WPADError WPADGetGameDataTimestamp ( WPADChan  channel,
OSTime outTimestamp 
)

Get the time that game data was written.

Returns
WPAD_ERROR_INVALID, if game data previously failed to write

◆ WPADiWriteGameData()

WPADError WPADiWriteGameData ( WPADChan  channel,
const void *  source,
uint16_t  size,
uint32_t  offset,
WPADCallback  callback 
)

Write custom game data to the controller's EEPROM.

Parameters
offsetstart address within custom data region
callbackInvoked when write completes; status will be:
  • WPAD_ERROR_NONE on success.
  • WPAD_ERROR_TRANSFER on failure.

also stores the current game type and game code and commits the game title set by WPADSetGameTitleUtf16

Returns
WPAD_ERROR_NONE, if the write request was sent
WPAD_ERROR_NOT_READY, if the controller is busy, or game data is in the process of being read or written
See also

◆ WPADiReadGameData()

WPADError WPADiReadGameData ( WPADChan  channel,
void *  destination,
uint16_t  size,
uint32_t  offset,
WPADCallback  callback 
)

Read custom game data from the controller's EEPROM.

Parameters
offsetstart address within custom data region
Returns
WPAD_ERROR_NONE, if the read request was sent
WPAD_ERROR_NOT_READY, if the controller's game data is in the process of being read or written
WPAD_ERROR_PERMISSION, if the WPAD's GameCode does not match the global Game Code
WPAD_ERROR_BROKEN, if game data previously failed to write
See also

◆ WPADiGetMplsStatus()

WPADMplsMode WPADiGetMplsStatus ( void  )

Get MotionPlus mode.

identical to KPADGetMplsStatus

◆ WPADGetBatteryLevel()

uint8_t WPADGetBatteryLevel ( WPADChan  channel)

Returns the battery level.

Returns
A charge level, from 0 to 4.

◆ WPADControlBLC()

WPADError WPADControlBLC ( WPADChan  channel,
WPADBalanceBoardCmd  command,
WPADCallback  callback 
)

Sends a command to the balance board.