wut v1.8.0
Wii U Toolchain
|
WPAD is a low-level library under KPAD. More...
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 |
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. | |
WPAD is a low-level library under KPAD.
struct WPADVec2D |
struct WPADVec3D |
struct WPADIRDot |
struct WPADIRDotEx |
struct WPADStatus |
Core Wii Remote status.
Valid buffer for formats:
WPAD_FMT_CORE
WPAD_FMT_CORE_ACC
WPAD_FMT_CORE_ACC_DPD
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() . |
struct WPADStatusEx |
Extended core Wii Remote status, with more IR details.
Valid buffer for formats:
WPAD_FMT_CORE_ACC_DPD_FULL
Data Fields | ||
---|---|---|
WPADStatus | core | |
WPADIRDotEx | irEx[WPAD_MAX_IR_DOTS] |
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
Data Fields | ||
---|---|---|
WPADStatus | core | Wii Remote core state + nunchuk buttons. |
WPADVec3D | acc | Accelerometer data. |
struct WPADStatusNunchuk.stick | stick |
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
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 |
struct WPADStatusProController |
Pro Controller status.
Valid buffer for formats:
WPAD_FMT_PRO_CONTROLLER
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 |
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
.
Data Fields | ||
---|---|---|
WPADStatus | core | |
union WPADStatusMotionPlus.__unnamed56__ | __unnamed__ | |
uint8_t | status | Bitset from WPADMplsStatus. |
WPADVec3D | angle |
struct WPADStatusBalanceBoard |
Balance Board status.
Valid for formats:
WPAD_FMT_BALANCE_BOARD
Data Fields | ||
---|---|---|
WPADStatus | core | |
uint16_t | pressure[WPAD_MAX_PRESSURE_SENSORS] |
Raw pressure data.
|
int8_t | temperature |
Raw temperature data.
|
uint8_t | battery |
Raw battery charge.
|
struct WPADStatusTrain |
Bullet Train controller status.
Valid for formats:
WPAD_FMT_TRAIN
Data Fields | ||
---|---|---|
WPADStatus | core | |
uint16_t | buttons |
Bitset from WPADClassicButton . |
uint8_t | brake | Brake (left) lever. |
uint8_t | throttle | Throttle (right) lever. |
struct WPADInfo |
struct WPADiQueue |
Data Fields | ||
---|---|---|
uint8_t | frontIndex | |
uint8_t | backIndex | |
WPADiQueueElement * | elements | |
uint32_t | capacity |
struct WPADAddress |
struct WENCParams |
struct WPADStatusNunchuk.stick |
union WPADStatusMotionPlus.__unnamed56__ |
Data Fields | ||
---|---|---|
struct WPADStatusMotionPlus.__unnamed56__.nunchuk | nunchuk | |
struct WPADStatusMotionPlus.__unnamed56__.classic | classic |
struct WPADStatusMotionPlus.__unnamed56__.nunchuk |
Data Fields | ||
---|---|---|
WPADVec3D | acc | Accelerometer data. |
struct WPADStatusMotionPlus.__unnamed56__.nunchuk.stick | stick |
struct WPADStatusMotionPlus.__unnamed56__.nunchuk.stick |
struct WPADStatusMotionPlus.__unnamed56__.classic |
typedef struct WPADStatusProController WPADStatusProController |
typedef struct WPADAddress WPADAddress |
typedef struct WPADiQueueElement WPADiQueueElement |
typedef struct WPADiQueue WPADiQueue |
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 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 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 WPADCallback WPADControlLedCallback |
typedef WPADCallback WPADControlDpdCallback |
typedef WPADCallback WPADGetInfoCallback |
typedef WPADCallback WPADReadMemoryCallback |
typedef WPADCallback WPADWriteMemoryCallback |
typedef WPADCallback WPADConnectCallback |
typedef WPADCallback WPADiSendCallback |
typedef void(* WPADExtensionCallback) (WPADChan channel, WPADExtensionType ext) |
enum WPADError |
enum WPADChan |
enum WPADDataFormat |
Data format.
enum WPADExtensionType |
Extension type.
enum WPADButton |
Wii Remote buttons.
enum WPADNunchukButton |
Nunchuk buttons.
enum WPADClassicButton |
Classic Controller buttons.
enum WPADProButton |
Pro Controller buttons.
enum WPADLed |
enum 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 |
enum WPADSpeakerCmd |
WPAD Speaker Command.
enum WPADMplsMode |
enum WPADMplsStatus |
MotionPlus status flags.
enum WPADPeripheralSpace |
enum WPADBalanceBoardCmd |
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.
TRUE
if the library is initialized. void WPADDisconnect | ( | WPADChan | channel | ) |
Immediately disconnects the associated controller.
WPADError WPADProbe | ( | WPADChan | channel, |
WPADExtensionType * | outExtensionType | ||
) |
Identifies the extension connected to the associated controller.
WPAD_ERROR_NO_CONTROLLER
if controller is not connected, WPAD_ERROR_NOT_READY
if busy 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.
channel | |
format | data format |
WPAD_ERROR_NONE
on success WPAD_ERROR_NOT_READY
if busy or data WPAD_ERROR_INVALID
if format is for a disabled device type 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.
channel | |
status | Where to store the data; must have be the correct type for the data format. |
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.
Controls the associated WPADChan's rumble motor.
int32_t WPADControlSpeaker | ( | WPADChan | channel, |
WPADSpeakerCmd | mode, | ||
WPADCallback | callback | ||
) |
Sets the Wii Remote speaker mode.
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.
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)
data | audio encoded in initialized format |
size | number of bytes to send, up to 20 bytes may be sent per call |
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 20uint32_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.
params | encoding continuation params, written on first call, and read and updated on each subsequent call |
continuing | should be TRUE if continuing encoding stream with the params produced via a prior call |
samples | 16-bit LPCM sample buffer |
sampleCount | number of 16-bit LPCM samples |
outEncodedData | buffer for the returned adpcm samples, buffer size should be equal to {(sampleCount + 1) / 2} |
uint8_t WPADGetSpeakerVolume | ( | void | ) |
Returns the global Wii Remote speaker volume.
void WPADSetSpeakerVolume | ( | uint8_t | volume | ) |
Sets the global Wii Remote speaker volume.
Only applies to Wii Remotes whose speakers are initialized after this call.
int32_t WPADIsMplsAttached | ( | WPADChan | channel, |
BOOL * | outEnabled, | ||
WPADCallback | callback | ||
) |
Gets whether MotionPlus is enabled for the WPAD.
outEnabled | is set to true if MotionPlus is enabled |
int32_t WPADIsMplsIntegrated | ( | WPADChan | channel | ) |
Returns whether the WPADChan has MotionPlus integrated.
Retrieves status info from the controller.
WPADError WPADGetInfoAsync | ( | WPADChan | channel, |
WPADInfo * | outInfo, | ||
WPADCallback | callback | ||
) |
Retrieves status info from the controller asynchronously.
callback | pointer to function called when info is obtained |
WPADError WPADReadMemoryAsync | ( | WPADChan | channel, |
void * | destination, | ||
uint16_t | size, | ||
uint32_t | address, | ||
WPADCallback | callback | ||
) |
Reads from the device's memory.
destination | where the received data will be stored |
size | number of bytes to read |
address | device memory address, see EEPROM Memory and Control Registers |
callback | function to be called upon completion |
WPADError WPADWriteMemoryAsync | ( | WPADChan | channel, |
void * | source, | ||
uint32_t | size, | ||
uint32_t | address, | ||
WPADCallback | callback | ||
) |
Writes to the device's memory.
source | data to be written to the controller |
size | number of bytes to write |
address | device memory address, see EEPROM Memory and Control Registers |
callback | function to be called upon completion |
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.
address | address within the peripheral's memory space |
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.
address | address within the peripheral's memory space |
peripheral | target peripheral memory area |
Usage:
WPADError WPADGetBLCalibration | ( | WPADChan | channel, |
void * | destination, | ||
uint32_t | address, | ||
uint32_t | size, | ||
WPADCallback | callback | ||
) |
Read Balance Board calibration.
address | may only be in the ranges [0x24,0x40) and [0x50, 0x70) |
Sets power save mode, this makes the controller only report input data when it changes.
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.
If unable to find a device, does the same as WPADStartSyncDevice
deviceAddress | Bluetooth address of the device to connect to. |
deviceName | Bluetooth name of the device to connect to (up to 24 characters) |
Usage:
WPADConnectCallback WPADSetConnectCallback | ( | WPADChan | channel, |
WPADCallback | callback | ||
) |
Sets function to be run upon controller connect/disconnect.
callback | Callback to be invoked; status will be:
|
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.
buf | points to an array of elements that match the data format. |
count | how many elements are in the buf array. |
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.
Rumble must be set before this
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.
Used internally by TRUE if successfully added to queue
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.
title | up to 17 UTF-16 characters including null terminator title will be copied onto the controller EEPROM |
Gets game title stored on specified controller.
outTitle | pointer to where the title will be output |
WPAD_ERROR_INVALID
, if game data previously failed to write Get the time that game data was written.
WPAD_ERROR_INVALID
, if game data previously failed to write WPADError WPADiWriteGameData | ( | WPADChan | channel, |
const void * | source, | ||
uint16_t | size, | ||
uint32_t | offset, | ||
WPADCallback | callback | ||
) |
Write custom game data to the controller's EEPROM.
offset | start address within custom data region |
callback | Invoked when write completes; status will be:
|
also stores the current game type and game code and commits the game title set by WPADSetGameTitleUtf16
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 WPADError WPADiReadGameData | ( | WPADChan | channel, |
void * | destination, | ||
uint16_t | size, | ||
uint32_t | offset, | ||
WPADCallback | callback | ||
) |
Read custom game data from the controller's EEPROM.
offset | start address within custom data region |
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 WPADMplsMode WPADiGetMplsStatus | ( | void | ) |
Get MotionPlus mode.
identical to KPADGetMplsStatus
uint8_t WPADGetBatteryLevel | ( | WPADChan | channel | ) |
Returns the battery level.
WPADError WPADControlBLC | ( | WPADChan | channel, |
WPADBalanceBoardCmd | command, | ||
WPADCallback | callback | ||
) |
Sends a command to the balance board.