wut  v1.7.0
Wii U Toolchain
Data Structures | Typedefs | Enumerations | Functions
wpad.h File Reference
#include <wut.h>
#include <coreinit/time.h>
Include dependency graph for wpad.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  WPADVec2D
 2D vector. More...
 
struct  WPADStatusProController
 
struct  WPADInfo
 Controller status info. More...
 
struct  WPADiQueueElement
 
struct  WPADiQueue
 
struct  WPADAddress
 Bluetooth device address. More...
 

Typedefs

typedef struct WPADStatusProController WPADStatusProController
 
typedef struct WPADVec2D WPADVec2D
 
typedef struct WPADInfo WPADInfo
 
typedef struct WPADAddress WPADAddress
 
typedef struct WPADiQueueElement WPADiQueueElement
 
typedef struct WPADiQueue WPADiQueue
 
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 enum WPADLed WPADLed
 WPAD Led flags. More...
 
typedef enum WPADDpdFormat WPADDpdFormat
 WPAD Infrared Format. For more information see IR Data Formats More...
 
typedef enum WPADSpeakerCmd WPADSpeakerCmd
 WPAD Speaker Command. More...
 
typedef enum WPADMplsMode WPADMplsMode
 MotionPlus Mode. More...
 
typedef enum WPADPeripheralSpace WPADPeripheralSpace
 WPAD Peripheral Memory Space Prefixes. More...
 
typedef void(* WPADIsMplsAttachedCallback) (WPADChan chan, int32_t status)
 
typedef void(* WPADControlLedCallback) (WPADChan chan, int32_t status)
 
typedef void(* WPADControlDpdCallback) (WPADChan chan, int32_t status)
 
typedef void(* WPADControlSpeakerCallback) (WPADChan chan, int32_t status)
 
typedef void(* WPADGetInfoCallback) (WPADChan chan, int32_t status)
 
typedef void(* WPADReadMemoryCallback) (WPADChan chan, int32_t status)
 Callback called when data is attempted to be read from controller memory. More...
 
typedef void(* WPADWriteMemoryCallback) (WPADChan chan, int32_t status)
 Callback called when data is attempted to be written to controller memory. More...
 
typedef void(* WPADSamplingCallback) (WPADChan chan)
 
typedef void(* WPADExtensionCallback) (WPADChan chan, WPADExtensionType ext)
 Callback called when the active extension changes. More...
 
typedef void(* WPADConnectCallback) (WPADChan chan, int32_t status)
 Callback called when a controller connects or disconnects. More...
 
typedef void(* WPADiSendCallback) (WPADChan chan, int32_t status)
 
typedef void(* WPADiWriteGameDataCallback) (WPADChan chan, int32_t status)
 Callback called when WPADiWriteGameData completes,. More...
 

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_CORE = 0 ,
  WPAD_FMT_CORE_ACC = 1 ,
  WPAD_FMT_CORE_ACC_DPD = 2 ,
  WPAD_FMT_NUNCHUK = 3 ,
  WPAD_FMT_NUNCHUK_ACC = 4 ,
  WPAD_FMT_NUNCHUK_ACC_DPD = 5 ,
  WPAD_FMT_CLASSIC = 6 ,
  WPAD_FMT_CLASSIC_ACC = 7 ,
  WPAD_FMT_CLASSIC_ACC_DPD = 8 ,
  WPAD_FMT_CORE_ACC_DPD_FULL = 9 ,
  WPAD_FMT_TRAIN = 10 ,
  WPAD_FMT_GUITAR = 11 ,
  WPAD_FMT_BALANCE_BOARD = 12 ,
  WPAD_FMT_DRUM = 15 ,
  WPAD_FMT_MPLUS = 16 ,
  WPAD_FMT_TAIKO = 17 ,
  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 ,
  WPAD_EXT_DEV_NOT_FOUND = 253 ,
  WPAD_EXT_UNKNOWN = 255
}
 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...
 
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  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...
 

Functions

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