wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
wpad.h
Go to the documentation of this file.
1#pragma once
2#include <wut.h>
3#include <coreinit/time.h>
4
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#define WPAD_MAX_IR_DOTS 4
18#define WPAD_MAX_PRESSURE_SENSORS 4
19
21typedef struct WPADVec2D WPADVec2D;
22typedef struct WPADVec3D WPADVec3D;
23typedef struct WPADInfo WPADInfo;
24typedef struct WPADAddress WPADAddress;
26typedef struct WPADiQueue WPADiQueue;
27typedef struct WPADIRDot WPADIRDot;
28typedef struct WPADIRDotEx WPADIRDotEx;
29typedef struct WPADStatus WPADStatus;
37typedef struct WENCParams WENCParams;
38
52
53
72
111
144
175
192
243
308
318
328
345
357
374
385
396
399{
401 int16_t x;
403 int16_t y;
404};
405WUT_CHECK_OFFSET(WPADVec2D, 0x00, x);
406WUT_CHECK_OFFSET(WPADVec2D, 0x02, y);
407WUT_CHECK_SIZE(WPADVec2D, 0x04);
408
411{
413 int16_t x;
415 int16_t y;
417 int16_t z;
418};
419WUT_CHECK_OFFSET(WPADVec3D, 0x00, x);
420WUT_CHECK_OFFSET(WPADVec3D, 0x02, y);
421WUT_CHECK_OFFSET(WPADVec3D, 0x04, z);
422WUT_CHECK_SIZE(WPADVec3D, 0x06);
423
426{
430 uint16_t pixels;
432 uint8_t id;
433 WUT_PADDING_BYTES(1);
434};
435WUT_CHECK_OFFSET(WPADIRDot, 0x0, pos);
436WUT_CHECK_OFFSET(WPADIRDot, 0x4, pixels);
437WUT_CHECK_OFFSET(WPADIRDot, 0x6, id);
438WUT_CHECK_SIZE(WPADIRDot, 0x8);
439
442{
448 uint16_t pixels;
450 uint8_t size;
451 WUT_PADDING_BYTES(1);
452};
453WUT_CHECK_OFFSET(WPADIRDotEx, 0x00, topRight);
454WUT_CHECK_OFFSET(WPADIRDotEx, 0x04, bottomLeft);
455WUT_CHECK_OFFSET(WPADIRDotEx, 0x08, pixels);
456WUT_CHECK_OFFSET(WPADIRDotEx, 0x0A, size);
457WUT_CHECK_SIZE(WPADIRDotEx, 0x0C);
458
480WUT_CHECK_OFFSET(WPADStatus, 0x00, buttons);
481WUT_CHECK_OFFSET(WPADStatus, 0x02, acc);
482WUT_CHECK_OFFSET(WPADStatus, 0x08, ir);
483WUT_CHECK_OFFSET(WPADStatus, 0x28, extensionType);
484WUT_CHECK_OFFSET(WPADStatus, 0x29, error);
485WUT_CHECK_SIZE(WPADStatus, 0x2a);
486
498WUT_CHECK_OFFSET(WPADStatusEx, 0x00, core);
499WUT_CHECK_OFFSET(WPADStatusEx, 0x2A, irEx);
500WUT_CHECK_SIZE(WPADStatusEx, 0x5a);
501
513{
518 struct
519 {
521 int8_t x;
523 int8_t y;
525};
526WUT_CHECK_OFFSET(WPADStatusNunchuk, 0x00, core);
527WUT_CHECK_OFFSET(WPADStatusNunchuk, 0x2a, acc);
528WUT_CHECK_OFFSET(WPADStatusNunchuk, 0x30, stick.x);
529WUT_CHECK_OFFSET(WPADStatusNunchuk, 0x31, stick.y);
530WUT_CHECK_SIZE(WPADStatusNunchuk, 0x32);
531
555WUT_CHECK_OFFSET(WPADStatusClassic, 0x00, core);
556WUT_CHECK_OFFSET(WPADStatusClassic, 0x2a, buttons);
557WUT_CHECK_OFFSET(WPADStatusClassic, 0x2c, leftStick);
558WUT_CHECK_OFFSET(WPADStatusClassic, 0x30, rightStick);
559WUT_CHECK_OFFSET(WPADStatusClassic, 0x34, leftTrigger);
560WUT_CHECK_OFFSET(WPADStatusClassic, 0x35, rightTrigger);
561WUT_CHECK_SIZE(WPADStatusClassic, 0x36);
562
582WUT_CHECK_OFFSET(WPADStatusProController, 0x00, core);
583WUT_CHECK_OFFSET(WPADStatusProController, 0x2C, buttons);
584WUT_CHECK_OFFSET(WPADStatusProController, 0x30, leftStick);
585WUT_CHECK_OFFSET(WPADStatusProController, 0x34, rightStick);
586WUT_CHECK_OFFSET(WPADStatusProController, 0x38, charging);
587WUT_CHECK_OFFSET(WPADStatusProController, 0x3c, wired);
588WUT_CHECK_SIZE(WPADStatusProController, 0x40);
589
601{
603 union
604 {
605 struct
606 {
608 WPADVec3D acc;
609 struct
610 {
612 int8_t x;
614 int8_t y;
615 } stick;
616 } nunchuk;
617 struct
618 {
620 uint16_t buttons;
622 WPADVec2D leftStick;
624 WPADVec2D rightStick;
625 uint8_t leftTrigger;
626 uint8_t rightTrigger;
627 } classic;
628 };
630 uint8_t status;
631 WUT_PADDING_BYTES(1);
633};
634WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x00, core);
635WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x2a, nunchuk.acc);
636WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x30, nunchuk.stick);
637WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x2a, classic.buttons);
638WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x2c, classic.leftStick);
639WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x30, classic.rightStick);
640WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x34, classic.leftTrigger);
641WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x35, classic.rightTrigger);
642WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x36, status);
643WUT_CHECK_OFFSET(WPADStatusMotionPlus, 0x38, angle);
644WUT_CHECK_SIZE(WPADStatusMotionPlus, 0x3e);
645
662WUT_CHECK_OFFSET(WPADStatusBalanceBoard, 0x00, core);
663WUT_CHECK_OFFSET(WPADStatusBalanceBoard, 0x2a, pressure);
664WUT_CHECK_OFFSET(WPADStatusBalanceBoard, 0x32, temperature);
665WUT_CHECK_OFFSET(WPADStatusBalanceBoard, 0x33, battery);
666WUT_CHECK_SIZE(WPADStatusBalanceBoard, 0x34);
667
675{
678 uint16_t buttons;
680 uint8_t brake;
682 uint8_t throttle;
683};
684WUT_CHECK_OFFSET(WPADStatusTrain, 0x00, core);
685WUT_CHECK_OFFSET(WPADStatusTrain, 0x2a, buttons);
686WUT_CHECK_OFFSET(WPADStatusTrain, 0x2c, brake);
687WUT_CHECK_OFFSET(WPADStatusTrain, 0x2d, throttle);
688WUT_CHECK_SIZE(WPADStatusTrain, 0x2e);
689
703WUT_CHECK_OFFSET(WPADInfo, 0x00, irEnabled);
704WUT_CHECK_OFFSET(WPADInfo, 0x04, speakerEnabled);
705WUT_CHECK_OFFSET(WPADInfo, 0x08, extensionAttached);
706WUT_CHECK_OFFSET(WPADInfo, 0x0c, batteryLow);
707WUT_CHECK_OFFSET(WPADInfo, 0x10, speakerBufNearEmpty);
708WUT_CHECK_OFFSET(WPADInfo, 0x14, batteryLevel);
709WUT_CHECK_OFFSET(WPADInfo, 0x15, led);
710WUT_CHECK_OFFSET(WPADInfo, 0x16, protocol);
711WUT_CHECK_OFFSET(WPADInfo, 0x17, firmware);
712WUT_CHECK_SIZE(WPADInfo, 0x18);
713
714
716{
717 uint8_t data[0x30];
718};
719WUT_CHECK_OFFSET(WPADiQueueElement, 0x00, data);
720WUT_CHECK_SIZE(WPADiQueueElement, 0x30);
721
723{
724 uint8_t frontIndex;
725 uint8_t backIndex;
726 WUT_PADDING_BYTES(2);
728 uint32_t capacity;
729};
730WUT_CHECK_OFFSET(WPADiQueue, 0x00, frontIndex);
731WUT_CHECK_OFFSET(WPADiQueue, 0x01, backIndex);
732WUT_CHECK_OFFSET(WPADiQueue, 0x04, elements);
733WUT_CHECK_OFFSET(WPADiQueue, 0x08, capacity);
734WUT_CHECK_SIZE(WPADiQueue, 0xc);
735
738{
739 uint8_t btDeviceAddress[6];
740};
741WUT_CHECK_OFFSET(WPADAddress, 0x00, btDeviceAddress);
742WUT_CHECK_SIZE(WPADAddress, 0x6);
743
746{
747 WUT_UNKNOWN_BYTES(32);
748};
749WUT_CHECK_SIZE(WENCParams, 32);
750
751typedef void (*WPADCallback)(WPADChan channel, WPADError status);
762
763typedef void (*WPADSamplingCallback)(WPADChan channel);
764
769
770
774void
776
780void
782
788BOOL
790
794void
796
804 WPADExtensionType *outExtensionType);
805
817 WPADDataFormat format);
818
825
836void
838 WPADStatus *status);
839
845 WPADLed led,
846 WPADCallback callback);
847
853 WPADDpdFormat mode,
854 WPADCallback callback);
855
861
865void
867 BOOL motorEnabled);
868
872int32_t
874 WPADSpeakerCmd mode,
875 WPADCallback callback);
876
880BOOL
882
887BOOL
889
905 const void *data,
906 uint32_t size);
907
919uint32_t
921 BOOL continuing,
922 const int16_t *samples,
923 uint32_t sampleCount,
924 uint8_t *outEncodedData);
925
929uint8_t
931
936void
937WPADSetSpeakerVolume(uint8_t volume);
938
943int32_t
945 BOOL *outEnabled,
946 WPADCallback callback);
947
952int32_t
954
962 WPADInfo *outInfo);
963
972 WPADInfo *outInfo,
973 WPADCallback callback);
974
989 void *destination,
990 uint16_t size,
991 uint32_t address,
992 WPADCallback callback);
993
1008 void *source,
1009 uint32_t size,
1010 uint32_t address,
1011 WPADCallback callback);
1012
1022 void *destination,
1023 uint16_t size,
1024 WPADPeripheralSpace peripheral,
1025 uint32_t address,
1026 WPADCallback callback);
1027
1045 const void *source,
1046 uint32_t size,
1047 WPADPeripheralSpace peripheral,
1048 uint32_t address,
1049 WPADCallback callback);
1050
1059 void *destination,
1060 uint32_t address,
1061 uint32_t size,
1062 WPADCallback callback);
1063
1068void
1070 BOOL powerSave);
1071
1075BOOL
1077
1081void
1083 WPADAddress* outAddress);
1084
1088void
1090
1094BOOL
1096
1100void
1102
1106BOOL
1108
1112void
1114
1118BOOL
1120
1124void
1126
1127void
1129
1134BOOL
1136
1152BOOL
1154 const char* deviceName);
1155
1167 WPADCallback callback);
1174 WPADExtensionCallback callback);
1175
1186void
1188 void *buf,
1189 uint32_t count);
1190
1198uint32_t
1200
1213 WPADSamplingCallback callback);
1214
1215void
1217
1221void
1223
1227bool
1229 uint32_t count);
1230
1235int32_t
1237 const uint8_t *hidData);
1238
1239
1246BOOL
1248
1254BOOL
1256 WPADLed led,
1257 WPADCallback callback);
1258
1264BOOL
1266 WPADDataFormat dataFormat,
1267 BOOL powerSave,
1268 WPADCallback callback);
1269
1275BOOL
1277 WPADInfo *outInfo,
1278 WPADCallback callback);
1279
1285BOOL
1287 BOOL enable,
1288 WPADCallback callback);
1289
1295BOOL
1297 BOOL enable,
1298 WPADCallback callback);
1299
1305BOOL
1307 BOOL enable,
1308 WPADCallback callback);
1309
1315BOOL
1317 BOOL mute,
1318 WPADCallback callback);
1319
1325BOOL
1327 void *source,
1328 uint32_t size);
1329
1334BOOL
1336 uint8_t byte,
1337 uint32_t address,
1338 WPADCallback callback);
1339
1345BOOL
1347 void *source,
1348 uint32_t size,
1349 uint32_t address,
1350 WPADCallback callback);
1351
1357BOOL
1359 void *destination,
1360 uint16_t size,
1361 uint32_t address,
1362 WPADCallback callback);
1363
1368uint32_t*
1370
1375uint8_t
1377
1386void
1387WPADSetGameTitleUtf16(const uint16_t *title);
1388
1399 uint16_t **outTitle);
1400
1407 OSTime *outTimestamp);
1408
1428 const void *source,
1429 uint16_t size,
1430 uint32_t offset,
1431 WPADCallback callback);
1432
1446 void *destination,
1447 uint16_t size,
1448 uint32_t offset,
1449 WPADCallback callback);
1450
1458
1464uint8_t
1466
1472 WPADBalanceBoardCmd command,
1473 WPADCallback callback);
1474
1475#ifdef __cplusplus
1476}
1477#endif
1478
int64_t OSTime
Definition time.h:18
uint8_t extensionType
One of WPADExtensionType.
Definition wpad.h:476
WPADVec2D bottomLeft
Bottom-left coordinate (in a 1024x768 grid).
Definition wpad.h:446
WPADVec2D pos
Position (in a 1024x768 grid).
Definition wpad.h:428
uint8_t btDeviceAddress[6]
Definition wpad.h:739
BOOL extensionAttached
Definition wpad.h:695
uint8_t id
Identifier.
Definition wpad.h:432
WPADIRDot ir[WPAD_MAX_IR_DOTS]
IR dots tracked.
Definition wpad.h:474
WPADVec2D rightStick
Right stick: [-512, 511] x [-512, 511].
Definition wpad.h:551
BOOL batteryLow
Definition wpad.h:696
uint32_t capacity
Definition wpad.h:728
BOOL speakerEnabled
Definition wpad.h:694
uint8_t data[0x30]
Definition wpad.h:717
WPADVec2D topRight
Top-right coordinate (in a 1024x768 grid).
Definition wpad.h:444
uint16_t buttons
Bitset from WPADButton.
Definition wpad.h:470
BOOL speakerBufNearEmpty
Definition wpad.h:697
uint8_t backIndex
Definition wpad.h:725
uint16_t pressure[WPAD_MAX_PRESSURE_SENSORS]
Raw pressure data.
Definition wpad.h:656
uint32_t buttons
Bitset from WPADProButton.
Definition wpad.h:574
WPADVec3D acc
Accelerometer data.
Definition wpad.h:472
uint8_t throttle
Throttle (right) lever.
Definition wpad.h:682
int8_t temperature
Raw temperature data.
Definition wpad.h:658
uint8_t rightTrigger
Definition wpad.h:553
uint8_t battery
Raw battery charge.
Definition wpad.h:660
uint8_t frontIndex
Definition wpad.h:724
uint8_t firmware
Definition wpad.h:701
WPADVec3D angle
Definition wpad.h:632
uint8_t brake
Brake (left) lever.
Definition wpad.h:680
uint8_t batteryLevel
Definition wpad.h:698
uint16_t pixels
Pixel area (in a 128x96 grid).
Definition wpad.h:430
WPADStatus core
Definition wpad.h:495
WPADiQueueElement * elements
Definition wpad.h:727
struct WPADStatusNunchuk::@54 stick
int8_t error
Error of the last WPADRead().
Definition wpad.h:478
int16_t z
z.
Definition wpad.h:417
BOOL irEnabled
Definition wpad.h:693
uint8_t led
Definition wpad.h:699
WPADVec2D leftStick
Left stick: [-512, 511] x [-512, 511].
Definition wpad.h:549
uint8_t protocol
Definition wpad.h:700
uint8_t leftTrigger
Definition wpad.h:552
WPADIRDotEx irEx[WPAD_MAX_IR_DOTS]
Definition wpad.h:496
uint8_t status
Bitset from WPADMplsStatus.
Definition wpad.h:630
int16_t x
x.
Definition wpad.h:401
uint8_t size
Calculated size (from 0 to 15).
Definition wpad.h:450
int16_t y
y.
Definition wpad.h:403
WPADError
Definition wpad.h:40
BOOL WPADIsEnabledURC(void)
Returns whether Wii U Pro Controllers are supported.
WPADError WPADProbe(WPADChan channel, WPADExtensionType *outExtensionType)
Identifies the extension connected to the associated controller.
int32_t WPADIsMplsAttached(WPADChan channel, BOOL *outEnabled, WPADCallback callback)
Gets whether MotionPlus is enabled for the WPAD.
WPADCallback WPADConnectCallback
Definition wpad.h:759
void(* WPADExtensionCallback)(WPADChan channel, WPADExtensionType ext)
Callback called when the active extension changes.
Definition wpad.h:768
BOOL WPADIsMotorEnabled(void)
Returns whether motors are disabled globally.
WPADCallback WPADControlDpdCallback
Definition wpad.h:753
int32_t WPADControlSpeaker(WPADChan channel, WPADSpeakerCmd mode, WPADCallback callback)
Sets the Wii Remote speaker mode.
WPADError WPADGetGameTitleUtf16(WPADChan channel, uint16_t **outTitle)
Gets game title stored on specified controller.
WPADError WPADControlLed(WPADChan channel, WPADLed led, WPADCallback callback)
Controls the associated Wii Remote's LEDs.
WPADError WPADiReadGameData(WPADChan channel, void *destination, uint16_t size, uint32_t offset, WPADCallback callback)
Read custom game data from the controller's EEPROM.
BOOL WPADiSendEnableDPDCSB(WPADiQueue *cmdQueue, BOOL enable, WPADCallback callback)
Queues HID Report for enabling IR Camera used internally by WPADControlDpd.
WPADCallback WPADiSendCallback
Definition wpad.h:760
WPADCallback WPADControlSpeakerCallback
Definition wpad.h:754
WPADButton
Wii Remote buttons.
Definition wpad.h:147
WPADExtensionCallback WPADSetExtensionCallback(WPADChan channel, WPADExtensionCallback callback)
Sets the function to be run upon extension connect and motion plus activation.
WPADMplsMode WPADiGetMplsStatus(void)
Get MotionPlus mode.
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
Data format.
Definition wpad.h:75
WPADError WPADControlDpd(WPADChan channel, WPADDpdFormat mode, WPADCallback callback)
Controls the Wii Remote's IR sensor.
WPADCallback WPADiWriteGameDataCallback
Definition wpad.h:761
BOOL WPADiSendSetReportType(WPADiQueue *cmdQueue, WPADDataFormat dataFormat, BOOL powerSave, WPADCallback callback)
Queues HID Report for setting data reporting mode used internally by WPADSetPowerSaveMode.
uint8_t WPADGetSpeakerVolume(void)
Returns the global Wii Remote speaker volume.
BOOL WPADStartSyncDeviceEx(WPADAddress *deviceAddress, const char *deviceName)
Starts attempts to sync with a WPAD with the specified properties.
void WPADRead(WPADChan channel, WPADStatus *status)
Reads data for a given Wii Remote.
WPADMplsStatus
MotionPlus status flags.
Definition wpad.h:360
WPADChan
Wii Remote channel.
Definition wpad.h:56
WPADSamplingCallback WPADSetSamplingCallback(WPADChan channel, WPADSamplingCallback callback)
Registers a callback to be invoked whenever new WPADStatus* data is stored in the ring buffer.
WPADCallback WPADWriteMemoryCallback
Definition wpad.h:758
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 ini...
WPADCallback WPADGetInfoCallback
Definition wpad.h:756
WPADStatusProController WPADStatusPro
Definition wpad.h:36
WPADPeripheralSpace
WPAD Peripheral Memory Space Prefixes.
Definition wpad.h:377
BOOL WPADCanSendStreamData(WPADChan channel)
Returns whether it is possible to send data to the Wii Remote's speaker at this moment May return fal...
WPADError WPADControlBLC(WPADChan channel, WPADBalanceBoardCmd command, WPADCallback callback)
Sends a command to the balance board.
WPADError WPADGetGameDataTimestamp(WPADChan channel, OSTime *outTimestamp)
Get the time that game data was written.
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.
bool WPADiIsAvailableCmdQueue(WPADiQueue *queue, uint32_t count)
Checks if there is enough space in the queue.
void WPADSetPowerSaveMode(WPADChan channel, BOOL powerSave)
Sets power save mode, this makes the controller only report input data when it changes.
void WPADEnableWiiRemote(BOOL enable)
Enables/disables Wii Remote support.
int32_t WPADiHIDParser(WPADChan channel, const uint8_t *hidData)
Parses incoming HID report data for a controller.
WPADClassicButton
Classic Controller buttons.
Definition wpad.h:195
void WPADEnableWBC(void)
Enables/disables Wii Balance Board support.
WPADError WPADGetInfo(WPADChan channel, WPADInfo *outInfo)
Retrieves status info from the controller.
BOOL WPADGetPowerSaveMode(WPADChan channel)
void WPADEnableMotor(BOOL enable)
Enables/disables motors globally.
uint8_t WPADiGetGameType(void)
Game type, which may be saved to the EEPROM of connected controllers.
void WPADDisconnect(WPADChan channel)
Immediately disconnects the associated controller.
void WPADInit(void)
Initialises the WPAD library for use.
void WPADSetGameTitleUtf16(const uint16_t *title)
Sets game title for all connected controllers.
WPADError WPADReadMemoryAsync(WPADChan channel, void *destination, uint16_t size, uint32_t address, WPADCallback callback)
Reads from the device's memory.
BOOL WPADiSendSetPort(WPADiQueue *cmdQueue, WPADLed led, WPADCallback callback)
Queues HID Report for setting LEDs used internally by WPADControlLed.
void WPADiShutdown(void)
WPADCallback WPADIsMplsAttachedCallback
Definition wpad.h:755
BOOL WPADiSendGetContStat(WPADiQueue *cmdQueue, WPADInfo *outInfo, WPADCallback callback)
Queues HID report for a controller status request used internally by WPADGetInfoAsync and several oth...
#define WPAD_MAX_IR_DOTS
Definition wpad.h:17
void(* WPADSamplingCallback)(WPADChan channel)
Definition wpad.h:763
WPADError WPADGetInfoAsync(WPADChan channel, WPADInfo *outInfo, WPADCallback callback)
Retrieves status info from the controller asynchronously.
BOOL WPADIsSpeakerEnabled(WPADChan channel)
Returns whether the Wii Remote's speaker is enabled.
void WPADShutdown(void)
Cleans up and frees the WPAD library.
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.
int32_t WPADIsMplsIntegrated(WPADChan channel)
Returns whether the WPADChan has MotionPlus integrated.
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 WPADGetLatestIndexInBuf(WPADChan channel)
Returns the index of the most recent status sample for a Wii Remote.
BOOL WPADiSendMuteSpeaker(WPADiQueue *cmdQueue, BOOL mute, WPADCallback callback)
Queues HID Report for muting speakers used internally by .
void(* WPADCallback)(WPADChan channel, WPADError status)
Definition wpad.h:751
void WPADGetAddress(WPADChan channel, WPADAddress *outAddress)
Retrieves the bluetooth address of the controller.
BOOL WPADGetStatus(void)
Get the status of the WPAD library.
void WPADControlMotor(WPADChan channel, BOOL motorEnabled)
Controls the associated WPADChan's rumble motor.
void WPADSetAutoSamplingBuf(WPADChan channel, void *buf, uint32_t count)
Sets a custom status ring buffer for a Wii Remote.
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.
void WPADSetAutoSleepTime(uint8_t time)
WPADExtensionType
Extension type.
Definition wpad.h:114
uint8_t WPADGetBatteryLevel(WPADChan channel)
Returns the battery level.
WPADSpeakerCmd
WPAD Speaker Command.
Definition wpad.h:331
WPADDpdFormat WPADGetDpdFormat(WPADChan channel)
Returns the associated Wii Remote's IR mode.
WPADLed
WPAD Led flags.
Definition wpad.h:311
WPADMplsMode
MotionPlus Mode.
Definition wpad.h:348
BOOL WPADiSendWriteDataCmd(WPADiQueue *cmdQueue, uint8_t byte, uint32_t address, WPADCallback callback)
Queues HID Report for a single-byte memory write.
BOOL WPADiSendSetVibrator(WPADiQueue *cmdQueue)
Queues HID Report for Rumble Update.
WPADCallback WPADControlLedCallback
Definition wpad.h:752
BOOL WPADiSendStreamData(WPADiQueue *cmdQueue, void *source, uint32_t size)
Queues HID Report for sending speaker stream data used internally by WPADSendStreamData.
BOOL WPADStartSyncDevice(void)
Starts searching for a WPAD controller in pairing mode and syncs with it.
WPADError WPADWriteMemoryAsync(WPADChan channel, void *source, uint32_t size, uint32_t address, WPADCallback callback)
Writes to the device's memory.
WPADBalanceBoardCmd
Balance Board commands.
Definition wpad.h:388
WPADDataFormat WPADGetDataFormat(WPADChan channel)
Gets the data format in use by the controller.
BOOL WPADiSendEnableSpeaker(WPADiQueue *cmdQueue, BOOL enable, WPADCallback callback)
Queues HID Report for enabling speakers.
void WPADSetSpeakerVolume(uint8_t volume)
Sets the global Wii Remote speaker volume.
WPADConnectCallback WPADSetConnectCallback(WPADChan channel, WPADCallback callback)
Sets function to be run upon controller connect/disconnect.
#define WPAD_MAX_PRESSURE_SENSORS
Definition wpad.h:18
WPADError WPADGetBLCalibration(WPADChan channel, void *destination, uint32_t address, uint32_t size, WPADCallback callback)
Read Balance Board calibration.
WPADNunchukButton
Nunchuk buttons.
Definition wpad.h:178
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.
WPADDpdFormat
WPAD Infrared Format. For more information see IR Data Formats
Definition wpad.h:321
WPADError WPADiWriteGameData(WPADChan channel, const void *source, uint16_t size, uint32_t offset, WPADCallback callback)
Write custom game data to the controller's EEPROM.
BOOL WPADiSendEnableDPD(WPADiQueue *cmdQueue, BOOL enable, WPADCallback callback)
Queues HID Report for enabling the IR Camera clock used internally by WPADControlDpd.
void WPADiClearQueue(WPADiQueue *queue)
Clears all elements from queue.
void WPADEnableURCC(BOOL enable)
Enables/disables Wii U Pro Controller support.
WPADCallback WPADReadMemoryCallback
Definition wpad.h:757
uint32_t * WPADiGetGameCode(void)
Game code (identifier), which may be saved to the EEPROM of connected controllers.
WPADProButton
Pro Controller buttons.
Definition wpad.h:246
BOOL WPADIsEnableWBC(void)
Returns whether Wii Balance Boards are supported.
@ WPAD_ERROR_PERMISSION
Definition wpad.h:46
@ WPAD_ERROR_NOT_READY
Definition wpad.h:43
@ WPAD_ERROR_NO_CONTROLLER
Definition wpad.h:42
@ WPAD_ERROR_BROKEN
Definition wpad.h:47
@ WPAD_ERROR_BAD_VALUE
Definition wpad.h:49
@ WPAD_ERROR_NONE
Definition wpad.h:41
@ WPAD_ERROR_TRANSFER
Definition wpad.h:44
@ WPAD_ERROR_BAD_CONF
Definition wpad.h:50
@ WPAD_ERROR_QUEUE_EMPTY
Definition wpad.h:48
@ WPAD_ERROR_INVALID
Definition wpad.h:45
@ WPAD_BUTTON_DOWN
The down button of the D-pad.
Definition wpad.h:153
@ WPAD_BUTTON_A
The A button.
Definition wpad.h:165
@ WPAD_BUTTON_C
The C button on the Nunchuk extension.
Definition wpad.h:171
@ WPAD_BUTTON_LEFT
The left button of the D-pad.
Definition wpad.h:149
@ WPAD_BUTTON_2
The 2 button.
Definition wpad.h:159
@ WPAD_BUTTON_MINUS
The - button.
Definition wpad.h:167
@ WPAD_BUTTON_Z
The Z button on the Nunchuk extension.
Definition wpad.h:169
@ WPAD_BUTTON_UP
The up button of the D-pad.
Definition wpad.h:155
@ WPAD_BUTTON_PLUS
The + button.
Definition wpad.h:157
@ WPAD_BUTTON_1
The 1 button.
Definition wpad.h:161
@ WPAD_BUTTON_RIGHT
The right button of the D-pad.
Definition wpad.h:151
@ WPAD_BUTTON_HOME
The HOME button.
Definition wpad.h:173
@ WPAD_BUTTON_B
The B button.
Definition wpad.h:163
@ WPAD_FMT_DRUM
Guitar Hero World Tour Drums.
Definition wpad.h:103
@ WPAD_FMT_TAIKO
Wii Remote, Taiko no Tatsujin TaTaCon.
Definition wpad.h:107
@ WPAD_FMT_CLASSIC
Wii Remote buttons, Classic Controller.
Definition wpad.h:89
@ WPAD_FMT_CORE_ACC
Wii Remote buttons and accelerometer.
Definition wpad.h:79
@ WPAD_FMT_CORE
Wii Remote buttons.
Definition wpad.h:77
@ WPAD_FMT_NUNCHUK
Wii Remote buttons, Nunchuk.
Definition wpad.h:83
@ WPAD_FMT_CLASSIC_ACC
Wii Remote buttons, accelerometer, Classic Controller.
Definition wpad.h:91
@ WPAD_FMT_CORE_ACC_DPD_FULL
Wii Remote buttons, accelerometer and IR pos with bounds.
Definition wpad.h:95
@ WPAD_FMT_PRO_CONTROLLER
Wii U Pro Controller.
Definition wpad.h:109
@ WPAD_FMT_BALANCE_BOARD
Wii Balance Board.
Definition wpad.h:101
@ WPAD_FMT_NUNCHUK_ACC
Wii Remote buttons, accelerometer, Nunchuk.
Definition wpad.h:85
@ WPAD_FMT_CORE_ACC_DPD
Wii Remote buttons, accelerometer and IR pos.
Definition wpad.h:81
@ WPAD_FMT_MPLUS
Wii Remote buttons, accelerometer, IR pos, Motion Plus gyroscope.
Definition wpad.h:105
@ WPAD_FMT_GUITAR
Guitar Hero Guitar.
Definition wpad.h:99
@ WPAD_FMT_TRAIN
Wii Remote, Densha De GO! Shinkansen Controller.
Definition wpad.h:97
@ WPAD_FMT_CLASSIC_ACC_DPD
Wii Remote buttons, accelerometer, IR pos, Classic Controller.
Definition wpad.h:93
@ WPAD_FMT_NUNCHUK_ACC_DPD
Wii Remote buttons, accelerometer, IR pos, Nunchuk.
Definition wpad.h:87
@ WPAD_MPLS_STATUS_EXT_VALID
When extension data is valid.
Definition wpad.h:370
@ WPAD_MPLS_STATUS_VALID
When MotionPlus data is valid.
Definition wpad.h:372
@ WPAD_MPLS_STATUS_ROLL_CONV
When the roll is in low-velocity mode.
Definition wpad.h:364
@ WPAD_MPLS_STATUS_PITCH_CONV
When the pitch is in low-velocity mode.
Definition wpad.h:366
@ WPAD_MPLS_STATUS_YAW_CONV
When the yaw is in low-velocity mode.
Definition wpad.h:368
@ WPAD_MPLS_STATUS_ATTACHED
When something is attached to the MotionPlus.
Definition wpad.h:362
@ WPAD_CHAN_2
Channel 2.
Definition wpad.h:62
@ WPAD_CHAN_5
Channel 5.
Definition wpad.h:68
@ WPAD_CHAN_6
Channel 6.
Definition wpad.h:70
@ WPAD_CHAN_0
Channel 0.
Definition wpad.h:58
@ WPAD_CHAN_4
Channel 4.
Definition wpad.h:66
@ WPAD_CHAN_1
Channel 1.
Definition wpad.h:60
@ WPAD_CHAN_3
Channel 3.
Definition wpad.h:64
@ WPAD_PERIPHERAL_SPACE_EXTENSION
Any extension other than Motion Plus.
Definition wpad.h:380
@ WPAD_PERIPHERAL_SPACE_SPEAKER
Definition wpad.h:378
@ WPAD_PERIPHERAL_SPACE_DPD
Infrared.
Definition wpad.h:383
@ WPAD_PERIPHERAL_SPACE_MOTIONPLUS
Definition wpad.h:381
@ WPAD_CLASSIC_BUTTON_UP
The up button of the D-pad.
Definition wpad.h:197
@ WPAD_CLASSIC_BUTTON_R
The R button.
Definition wpad.h:213
@ WPAD_CLASSIC_BUTTON_ZL
The ZL button.
Definition wpad.h:211
@ WPAD_CLASSIC_STICK_R_EMULATION_DOWN
The emulated down button on the right stick.
Definition wpad.h:239
@ WPAD_CLASSIC_BUTTON_DOWN
The down button of the D-pad.
Definition wpad.h:223
@ WPAD_CLASSIC_BUTTON_A
The A button.
Definition wpad.h:205
@ WPAD_CLASSIC_BUTTON_ZR
The ZR button.
Definition wpad.h:201
@ WPAD_CLASSIC_STICK_R_EMULATION_UP
The emulated up button on the right stick.
Definition wpad.h:241
@ WPAD_CLASSIC_STICK_L_EMULATION_UP
The emulated up button on the left stick.
Definition wpad.h:233
@ WPAD_CLASSIC_BUTTON_B
The B button.
Definition wpad.h:209
@ WPAD_CLASSIC_BUTTON_Y
The Y button.
Definition wpad.h:207
@ WPAD_CLASSIC_STICK_L_EMULATION_LEFT
The emulated left button on the left stick.
Definition wpad.h:227
@ WPAD_CLASSIC_STICK_R_EMULATION_RIGHT
The emulated right button on the right stick.
Definition wpad.h:237
@ WPAD_CLASSIC_STICK_L_EMULATION_RIGHT
The emulated right button on the left stick.
Definition wpad.h:229
@ WPAD_CLASSIC_BUTTON_PLUS
The + button.
Definition wpad.h:215
@ WPAD_CLASSIC_BUTTON_RIGHT
The right button of the D-pad.
Definition wpad.h:225
@ WPAD_CLASSIC_STICK_R_EMULATION_LEFT
The emulated left button on the right stick.
Definition wpad.h:235
@ WPAD_CLASSIC_BUTTON_LEFT
The left button of the D-pad.
Definition wpad.h:199
@ WPAD_CLASSIC_BUTTON_L
The L button.
Definition wpad.h:221
@ WPAD_CLASSIC_BUTTON_MINUS
The - button.
Definition wpad.h:219
@ WPAD_CLASSIC_BUTTON_X
The X button.
Definition wpad.h:203
@ WPAD_CLASSIC_STICK_L_EMULATION_DOWN
The emulated down button on the left stick.
Definition wpad.h:231
@ WPAD_CLASSIC_BUTTON_HOME
The HOME button.
Definition wpad.h:217
@ WPAD_EXT_MPLUS_CLASSIC
Motion Plus with Classic Controller.
Definition wpad.h:128
@ WPAD_EXT_GUITAR
Guitar controller.
Definition wpad.h:132
@ WPAD_EXT_MPLUS_NUNCHUK
Motion Plus with Nunchuk.
Definition wpad.h:126
@ WPAD_EXT_DEV_NOT_FOUND
No controller found.
Definition wpad.h:140
@ WPAD_EXT_MPLUS
Motion Plus.
Definition wpad.h:124
@ WPAD_EXT_UNKNOWN
Extension unknown.
Definition wpad.h:142
@ WPAD_EXT_NUNCHUK
Nunchuk.
Definition wpad.h:118
@ WPAD_EXT_BALANCE_BOARD
Balance Board.
Definition wpad.h:122
@ WPAD_EXT_CLASSIC
Classic Controller.
Definition wpad.h:120
@ WPAD_EXT_PRO_CONTROLLER
Pro Controller.
Definition wpad.h:138
@ WPAD_EXT_TRAIN
Train controller.
Definition wpad.h:130
@ WPAD_EXT_TAIKO
Taiko no Tatsujin controller.
Definition wpad.h:136
@ WPAD_EXT_DRUM
Drum controller.
Definition wpad.h:134
@ WPAD_EXT_CORE
Wii Remote with no extension.
Definition wpad.h:116
@ WPAD_SPEAKER_CMD_MUTE
Mutes speaker.
Definition wpad.h:337
@ WPAD_SPEAKER_CMD_ON_ALT
Does the same as WPAD_SPEAKER_CMD_ON.
Definition wpad.h:343
@ WPAD_SPEAKER_CMD_UNMUTE
Unmutes speaker.
Definition wpad.h:339
@ WPAD_SPEAKER_CMD_OFF
Deinitializes and turns off speaker.
Definition wpad.h:333
@ WPAD_SPEAKER_CMD_PLAY
Allows sound to play.
Definition wpad.h:341
@ WPAD_SPEAKER_CMD_ON
Turns on and initializes speaker to use 4-bit Yamaha ADPCM data format at 3000 Hz.
Definition wpad.h:335
@ WPAD_LED_TWO
Definition wpad.h:313
@ WPAD_LED_FOUR
Definition wpad.h:315
@ WPAD_LED_THREE
Definition wpad.h:314
@ WPAD_LED_ONE
Definition wpad.h:312
@ WPAD_MPLS_MODE_MPLS_CLASSIC
Classic passthrough mode.
Definition wpad.h:355
@ WPAD_MPLS_MODE_MPLS_ONLY
MotionPlus exclusive mode.
Definition wpad.h:351
@ WPAD_MPLS_MODE_DISABLE
Definition wpad.h:349
@ WPAD_MPLS_MODE_MPLS_NUNCHUK
Nunchuk passthrough mode.
Definition wpad.h:353
@ WPAD_BALANCE_BOARD_CMD_OFF
Turn Balance Board off.
Definition wpad.h:392
@ WPAD_BALANCE_BOARD_CMD_ON
Turn Balance Board on.
Definition wpad.h:394
@ WPAD_BALANCE_BOARD_CMD_UPDATE_TEMP
Update temperature data.
Definition wpad.h:390
@ 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.
Definition wpad.h:180
@ 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.
Definition wpad.h:186
@ 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.
Definition wpad.h:182
@ WPAD_NUNCHUK_BUTTON_Z
The Z button.
Definition wpad.h:188
@ WPAD_NUNCHUK_BUTTON_C
The C button.
Definition wpad.h:190
@ 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.
Definition wpad.h:184
@ WPAD_DPD_FMT_EXTENDED
Definition wpad.h:325
@ WPAD_DPD_FMT_BASIC
Definition wpad.h:324
@ WPAD_DPD_FMT_FULL
Definition wpad.h:326
@ WPAD_DPD_FMT_NONE
Disable IR.
Definition wpad.h:323
@ WPAD_PRO_BUTTON_PLUS
The + button.
Definition wpad.h:274
@ WPAD_PRO_BUTTON_B
The B button.
Definition wpad.h:262
@ WPAD_PRO_BUTTON_ZL
The ZL button.
Definition wpad.h:264
@ WPAD_PRO_RESERVED
Reserved.
Definition wpad.h:268
@ WPAD_PRO_BUTTON_DOWN
The down button of the D-pad.
Definition wpad.h:284
@ WPAD_PRO_BUTTON_X
The X button.
Definition wpad.h:256
@ WPAD_PRO_BUTTON_HOME
The HOME button.
Definition wpad.h:276
@ WPAD_PRO_BUTTON_Y
The Y button.
Definition wpad.h:260
@ WPAD_PRO_STICK_R_EMULATION_UP
The emulated up button on the right stick.
Definition wpad.h:300
@ WPAD_PRO_STICK_L_EMULATION_UP
The emulated up button on the left stick.
Definition wpad.h:292
@ WPAD_PRO_BUTTON_LEFT
The left button of the D-pad.
Definition wpad.h:250
@ WPAD_PRO_BUTTON_R
The R button.
Definition wpad.h:270
@ WPAD_PRO_STICK_L_EMULATION_DOWN
The emulated down button on the left stick.
Definition wpad.h:294
@ WPAD_PRO_BUTTON_MINUS
The - button.
Definition wpad.h:278
@ WPAD_PRO_STICK_R_EMULATION_DOWN
The emulated down button on the right stick.
Definition wpad.h:302
@ WPAD_PRO_TRIGGER_R
Another name for the R button.
Definition wpad.h:272
@ WPAD_PRO_STICK_R_EMULATION_LEFT
The emulated left button on the right stick.
Definition wpad.h:304
@ WPAD_PRO_STICK_L_EMULATION_RIGHT
The emulated right button on the left stick.
Definition wpad.h:298
@ WPAD_PRO_BUTTON_L
The L button.
Definition wpad.h:280
@ WPAD_PRO_BUTTON_STICK_L
The left stick button.
Definition wpad.h:290
@ WPAD_PRO_STICK_L_EMULATION_LEFT
The emulated left button on the left stick.
Definition wpad.h:296
@ WPAD_PRO_TRIGGER_L
Another name for the L button.
Definition wpad.h:282
@ WPAD_PRO_BUTTON_STICK_R
The right stick button.
Definition wpad.h:288
@ WPAD_PRO_BUTTON_ZR
The ZR button.
Definition wpad.h:252
@ WPAD_PRO_TRIGGER_ZL
Another name for the ZL button.
Definition wpad.h:266
@ WPAD_PRO_TRIGGER_ZR
Another name for the ZR button.
Definition wpad.h:254
@ WPAD_PRO_BUTTON_UP
The up button of the D-pad.
Definition wpad.h:248
@ WPAD_PRO_STICK_R_EMULATION_RIGHT
The emulated right button on the right stick.
Definition wpad.h:306
@ WPAD_PRO_BUTTON_A
The A button.
Definition wpad.h:258
@ WPAD_PRO_BUTTON_RIGHT
The right button of the D-pad.
Definition wpad.h:286
Continuation parameters for WENCGetEncodeData.
Definition wpad.h:746
Bluetooth device address.
Definition wpad.h:738
A single IR dot tracked by the camera.
Definition wpad.h:426
A single IR dot tracked by the camera, extra info.
Definition wpad.h:442
Controller status info.
Definition wpad.h:692
Core Wii Remote status.
Definition wpad.h:468
Balance Board status.
Definition wpad.h:653
Classic Controller and Classic Controller Pro status.
Definition wpad.h:544
Extended core Wii Remote status, with more IR details.
Definition wpad.h:494
MotionPlus status.
Definition wpad.h:601
Wii Remote + Nunchuk status.
Definition wpad.h:513
Pro Controller status.
Definition wpad.h:570
Bullet Train controller status.
Definition wpad.h:675
2D vector.
Definition wpad.h:399
3D vector.
Definition wpad.h:411
int32_t BOOL
Definition wut_types.h:7
#define WUT_ENUM_BITMASK_TYPE(_type)
Definition wut_types.h:45