wut  1.0.0-beta9
Wii U Toolchain
Data Structures | Typedefs | Enumerations | Functions
VPAD Input

Data Structures

struct  VPADVec2D
 
struct  VPADVec3D
 
struct  VPADDirection
 
struct  VPADTouchData
 
struct  VPADAccStatus
 
struct  VPADStatus
 

Typedefs

typedef struct VPADAccStatus VPADAccStatus
 
typedef struct VPADDirection VPADDirection
 
typedef struct VPADGyroStatus VPADGyroStatus
 
typedef struct VPADStatus VPADStatus
 
typedef struct VPADTouchData VPADTouchData
 
typedef struct VPADVec2D VPADVec2D
 
typedef struct VPADVec3D VPADVec3D
 
typedef enum VPADButtons VPADButtons
 
typedef enum VPADChan VPADChan
 
typedef enum VPADTouchPadValidity VPADTouchPadValidity
 
typedef enum VPADReadError VPADReadError
 
typedef enum VPADLcdMode VPADLcdMode
 

Enumerations

enum  VPADButtons {
  VPAD_BUTTON_A = 0x8000,
  VPAD_BUTTON_B = 0x4000,
  VPAD_BUTTON_X = 0x2000,
  VPAD_BUTTON_Y = 0x1000,
  VPAD_BUTTON_LEFT = 0x0800,
  VPAD_BUTTON_RIGHT = 0x0400,
  VPAD_BUTTON_UP = 0x0200,
  VPAD_BUTTON_DOWN = 0x0100,
  VPAD_BUTTON_ZL = 0x0080,
  VPAD_BUTTON_ZR = 0x0040,
  VPAD_BUTTON_L = 0x0020,
  VPAD_BUTTON_R = 0x0010,
  VPAD_BUTTON_PLUS = 0x0008,
  VPAD_BUTTON_MINUS = 0x0004,
  VPAD_BUTTON_HOME = 0x0002,
  VPAD_BUTTON_SYNC = 0x0001,
  VPAD_BUTTON_STICK_R = 0x00020000,
  VPAD_BUTTON_STICK_L = 0x00040000,
  VPAD_BUTTON_TV = 0x00010000,
  VPAD_STICK_R_EMULATION_LEFT = 0x04000000,
  VPAD_STICK_R_EMULATION_RIGHT = 0x02000000,
  VPAD_STICK_R_EMULATION_UP = 0x01000000,
  VPAD_STICK_R_EMULATION_DOWN = 0x00800000,
  VPAD_STICK_L_EMULATION_LEFT = 0x40000000,
  VPAD_STICK_L_EMULATION_RIGHT = 0x20000000,
  VPAD_STICK_L_EMULATION_UP = 0x10000000,
  VPAD_STICK_L_EMULATION_DOWN = 0x08000000
}
 
enum  VPADChan { VPAD_CHAN_0 = 0 }
 
enum  VPADTouchPadValidity {
  VPAD_VALID = 0x0,
  VPAD_INVALID_X = 0x1,
  VPAD_INVALID_Y = 0x2
}
 
enum  VPADReadError {
  VPAD_READ_SUCCESS = 0,
  VPAD_READ_NO_SAMPLES = -1,
  VPAD_READ_INVALID_CONTROLLER = -2
}
 
enum  VPADLcdMode {
  VPAD_LCD_STANDBY = 0,
  VPAD_LCD_OFF = 1,
  VPAD_LCD_ON = 0xFF
}
 

Functions

void VPADInit ()
 Initialises the VPAD library for use. More...
 
void VPADShutdown ()
 Cleans up and frees the VPAD library. More...
 
int32_t VPADRead (VPADChan chan, VPADStatus *buffers, uint32_t count, VPADReadError *outError)
 Read controller data from the desired Gamepad. More...
 
void VPADGetTPCalibratedPoint (VPADChan chan, VPADTouchData *calibratedData, VPADTouchData *uncalibratedData)
 Transform touch data according to the current calibration data. More...
 
int32_t VPADBASEGetMotorOnRemainingCount (VPADChan chan)
 Return a count representing the amount of time left for the given Gamepad's rumble pattern. More...
 
int32_t VPADBASESetMotorOnRemainingCount (VPADChan chan, int32_t counter)
 Set a count representing the amount of time left for the given Gamepad's rumble pattern. More...
 
void VPADSetAccParam (VPADChan chan, float playRadius, float sensitivity)
 
void VPADGetAccParam (VPADChan chan, float *outPlayRadius, float *outSensitivity)
 
void VPADSetBtnRepeat (VPADChan chan, float delaySec, float pulseSec)
 Set a repeat for held buttons - instead of appearing to be continually held, repeated presses and releases will be simulated at the given frequency. More...
 
void VPADEnableStickCrossClamp (VPADChan chan)
 
void VPADDisableStickCrossClamp (VPADChan chan)
 
void VPADSetLStickClampThreshold (VPADChan chan, int32_t max, int32_t min)
 
void VPADSetRStickClampThreshold (VPADChan chan, int32_t max, int32_t min)
 
void VPADGetLStickClampThreshold (VPADChan chan, int32_t *max, int32_t *min)
 
void VPADGetRStickClampThreshold (VPADChan chan, int32_t *max, int32_t *min)
 
void VPADSetStickOrigin (VPADChan chan)
 
void VPADDisableLStickZeroClamp (VPADChan chan)
 
void VPADDisableRStickZeroClamp (VPADChan chan)
 
void VPADEnableLStickZeroClamp (VPADChan chan)
 
void VPADEnableRStickZeroClamp (VPADChan chan)
 
void VPADSetCrossStickEmulationParamsL (VPADChan chan, float rotationDegree, float range, float radius)
 
void VPADSetCrossStickEmulationParamsR (VPADChan chan, float rotationDegree, float range, float radius)
 
void VPADGetCrossStickEmulationParamsL (VPADChan chan, float *outRotationDegree, float *outRange, float *outRadius)
 
void VPADGetCrossStickEmulationParamsR (VPADChan chan, float *outRotationDegree, float *outRange, float *outRadius)
 
void VPADSetGyroAngle (VPADChan chan, float ax, float ay, float az)
 
void VPADSetGyroDirection (VPADChan chan, VPADDirection *dir)
 
void VPADSetGyroDirectionMag (VPADChan chan, float mag)
 
void VPADSetGyroMagnification (VPADChan chan, float pitch, float yaw, float roll)
 
void VPADEnableGyroZeroPlay (VPADChan chan)
 
void VPADEnableGyroDirRevise (VPADChan chan)
 
void VPADEnableGyroAccRevise (VPADChan chan)
 
void VPADDisableGyroZeroPlay (VPADChan chan)
 
void VPADDisableGyroDirRevise (VPADChan chan)
 
void VPADDisableGyroAccRevise (VPADChan chan)
 
float VPADIsEnableGyroZeroPlay (VPADChan chan)
 
float VPADIsEnableGyroZeroDrift (VPADChan chan)
 
float VPADIsEnableGyroDirRevise (VPADChan chan)
 
float VPADIsEnableGyroAccRevise (VPADChan chan)
 
void VPADSetGyroZeroPlayParam (VPADChan chan, float radius)
 
void VPADInitGyroZeroPlayParam (VPADChan chan)
 
void VPADInitGyroDirReviseParam (VPADChan chan)
 
void VPADInitGyroAccReviseParam (VPADChan chan)
 
void VPADInitGyroZeroDriftMode (VPADChan chan)
 
int32_t VPADControlMotor (VPADChan chan, uint8_t *pattern, uint8_t length)
 Turns on the rumble motor on the desired Gamepad. More...
 
void VPADStopMotor (VPADChan chan)
 Stops the desired Gamepad's rumble motor and cancels any ongoing rumble pattern. More...
 
int32_t VPADSetLcdMode (VPADChan chan, VPADLcdMode lcdMode)
 Sets the current mode of the display on the given Gamepad. More...
 
int32_t VPADGetLcdMode (VPADChan chan, VPADLcdMode *outLcdMode)
 Get the current status of the given Gamepad's display. More...
 
void VPADBASESetSensorBarSetting (VPADChan chan, int8_t setting)
 
void VPADBASEGetSensorBarSetting (VPADChan chan, int8_t *outSetting)
 
int32_t VPADSetSensorBar (VPADChan chan, BOOL on)
 Turn the given Gamepad's sensor bar on or off. More...
 

Detailed Description


Data Structure Documentation

◆ VPADVec2D

struct VPADVec2D

Definition at line 90 of file input.h.

Data Fields
float x
float y

◆ VPADVec3D

struct VPADVec3D

Definition at line 99 of file input.h.

Data Fields
float x
float y
float z

◆ VPADDirection

struct VPADDirection

Definition at line 110 of file input.h.

Data Fields
VPADVec3D x
VPADVec3D y
VPADVec3D z

◆ VPADTouchData

struct VPADTouchData

Definition at line 121 of file input.h.

Data Fields
uint16_t x The x-coordinate of a touched point.
uint16_t y The y-coordinate of a touched point.
uint16_t touched 0 if screen is not currently being touched
uint16_t validity Bitfield of VPADTouchPadValidity to indicate how touch sample accuracy.

◆ VPADAccStatus

struct VPADAccStatus

Definition at line 140 of file input.h.

Data Fields
VPADVec3D acc
float magnitude
float variation
VPADVec2D vertical

◆ VPADStatus

struct VPADStatus

Definition at line 153 of file input.h.

Data Fields
uint32_t hold Indicates what VPADButtons are held down.
uint32_t trigger Indicates what VPADButtons have been pressed since last sample.
uint32_t release Indicates what VPADButtons have been released since last sample.
VPADVec2D leftStick Position of left analog stick.
VPADVec2D rightStick Position of right analog stick.
VPADAccStatus accelorometer Status of DRC accelorometer.
VPADVec3D gyro Status of DRC gyro.
VPADVec3D angle Status of DRC angle.
uint8_t error
VPADTouchData tpNormal Current touch position on DRC.
VPADTouchData tpFiltered1 Filtered touch position, first level of smoothing.
VPADTouchData tpFiltered2 Filtered touch position, second level of smoothing.
VPADDirection direction
BOOL usingHeadphones Set to 1 if headphones are plugged in, 0 otherwise.
VPADVec3D mag Status of DRC magnetometer.
uint8_t slideVolume Current volume set by the slide control.
uint8_t battery Battery level of controller.
uint8_t micStatus Status of DRC microphone.
uint8_t slideVolumeEx Unknown volume related value.

Typedef Documentation

◆ VPADAccStatus

typedef struct VPADAccStatus VPADAccStatus

Definition at line 14 of file input.h.

◆ VPADDirection

typedef struct VPADDirection VPADDirection

Definition at line 15 of file input.h.

◆ VPADGyroStatus

Definition at line 16 of file input.h.

◆ VPADStatus

typedef struct VPADStatus VPADStatus

Definition at line 17 of file input.h.

◆ VPADTouchData

typedef struct VPADTouchData VPADTouchData

Definition at line 18 of file input.h.

◆ VPADVec2D

typedef struct VPADVec2D VPADVec2D

Definition at line 19 of file input.h.

◆ VPADVec3D

typedef struct VPADVec3D VPADVec3D

Definition at line 20 of file input.h.

◆ VPADButtons

typedef enum VPADButtons VPADButtons

◆ VPADChan

typedef enum VPADChan VPADChan

◆ VPADTouchPadValidity

◆ VPADReadError

◆ VPADLcdMode

typedef enum VPADLcdMode VPADLcdMode

Enumeration Type Documentation

◆ VPADButtons

Enumerator
VPAD_BUTTON_A 
VPAD_BUTTON_B 
VPAD_BUTTON_X 
VPAD_BUTTON_Y 
VPAD_BUTTON_LEFT 
VPAD_BUTTON_RIGHT 
VPAD_BUTTON_UP 
VPAD_BUTTON_DOWN 
VPAD_BUTTON_ZL 
VPAD_BUTTON_ZR 
VPAD_BUTTON_L 
VPAD_BUTTON_R 
VPAD_BUTTON_PLUS 
VPAD_BUTTON_MINUS 
VPAD_BUTTON_HOME 
VPAD_BUTTON_SYNC 
VPAD_BUTTON_STICK_R 
VPAD_BUTTON_STICK_L 
VPAD_BUTTON_TV 
VPAD_STICK_R_EMULATION_LEFT 
VPAD_STICK_R_EMULATION_RIGHT 
VPAD_STICK_R_EMULATION_UP 
VPAD_STICK_R_EMULATION_DOWN 
VPAD_STICK_L_EMULATION_LEFT 
VPAD_STICK_L_EMULATION_RIGHT 
VPAD_STICK_L_EMULATION_UP 
VPAD_STICK_L_EMULATION_DOWN 

Definition at line 22 of file input.h.

◆ VPADChan

enum VPADChan
Enumerator
VPAD_CHAN_0 

Definition at line 53 of file input.h.

◆ VPADTouchPadValidity

Enumerator
VPAD_VALID 

Both X and Y touchpad positions are accurate.

VPAD_INVALID_X 

X position is inaccurate.

VPAD_INVALID_Y 

Y position is inaccurate.

Definition at line 58 of file input.h.

◆ VPADReadError

Enumerator
VPAD_READ_SUCCESS 

No error occured, and data was written to the buffers.

VPAD_READ_NO_SAMPLES 

There was no sample new data available to write.

VPAD_READ_INVALID_CONTROLLER 

The requested controller or channel was invalid.

Definition at line 70 of file input.h.

◆ VPADLcdMode

Enumerator
VPAD_LCD_STANDBY 

Display is in standby and will turn back on if any buttons are pressed.

VPAD_LCD_OFF 

Display is completely off and will remain so until explicitly changed.

VPAD_LCD_ON 

Display is on as normal.

Definition at line 80 of file input.h.

Function Documentation

◆ VPADInit()

void VPADInit ( )

Initialises the VPAD library for use.

Deprecated:
As of Cafe OS 5.5.x (OSv10 v15702) this function simply logs a deprecation message and returns. However, this may not be the case on older versions.
See also

◆ VPADShutdown()

void VPADShutdown ( )

Cleans up and frees the VPAD library.

Deprecated:
As of Cafe OS 5.5.x (OSv10 v15702) this function simply logs a deprecation message and returns. However, this may not be the case on older versions.
See also

◆ VPADRead()

int32_t VPADRead ( VPADChan  chan,
VPADStatus buffers,
uint32_t  count,
VPADReadError outError 
)

Read controller data from the desired Gamepad.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanThe channel to read from.
buffersPointer to an array of VPADStatus buffers to fill.
countNumber of buffers to fill.
outErrorPointer to write read error to (if any). See VPADReadError for meanings.
Warning
You must check outError - the VPADStatus buffers may be filled with random or invalid data on error, not neccesarily zeroes.
Returns
0 on success or 1 on failure. Check outError for reason.
See also

◆ VPADGetTPCalibratedPoint()

void VPADGetTPCalibratedPoint ( VPADChan  chan,
VPADTouchData calibratedData,
VPADTouchData uncalibratedData 
)

Transform touch data according to the current calibration data.

The calibration used may either be the system default or set by the application via VPADSetTPCalibrationParam().

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanDenotes which channel to get the calibration data from.
calibratedDataPointer to write calibrated touch data to.
uncalibratedDataPointer to the source data to apply the calibration to.
See also

◆ VPADBASEGetMotorOnRemainingCount()

int32_t VPADBASEGetMotorOnRemainingCount ( VPADChan  chan)

Return a count representing the amount of time left for the given Gamepad's rumble pattern.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanDenotes which channel to get the rumble time from.

◆ VPADBASESetMotorOnRemainingCount()

int32_t VPADBASESetMotorOnRemainingCount ( VPADChan  chan,
int32_t  counter 
)

Set a count representing the amount of time left for the given Gamepad's rumble pattern.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanDenotes which channel to set the rumble count for.
counterThe value of the new rumble count.

◆ VPADSetAccParam()

void VPADSetAccParam ( VPADChan  chan,
float  playRadius,
float  sensitivity 
)

◆ VPADGetAccParam()

void VPADGetAccParam ( VPADChan  chan,
float *  outPlayRadius,
float *  outSensitivity 
)

◆ VPADSetBtnRepeat()

void VPADSetBtnRepeat ( VPADChan  chan,
float  delaySec,
float  pulseSec 
)

Set a repeat for held buttons - instead of appearing to be continually held, repeated presses and releases will be simulated at the given frequency.

This is similar to what happens with most computer keyboards when you hold a key.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanDenotes which channel to set up button repeat on.
delaySecThe amount of time, in seconds, to wait until a button should start repeating.
pulseSecThe amount of time to wait between simulated presses - effectively setting the period of the repetition.

◆ VPADEnableStickCrossClamp()

void VPADEnableStickCrossClamp ( VPADChan  chan)

◆ VPADDisableStickCrossClamp()

void VPADDisableStickCrossClamp ( VPADChan  chan)

◆ VPADSetLStickClampThreshold()

void VPADSetLStickClampThreshold ( VPADChan  chan,
int32_t  max,
int32_t  min 
)

◆ VPADSetRStickClampThreshold()

void VPADSetRStickClampThreshold ( VPADChan  chan,
int32_t  max,
int32_t  min 
)

◆ VPADGetLStickClampThreshold()

void VPADGetLStickClampThreshold ( VPADChan  chan,
int32_t *  max,
int32_t *  min 
)

◆ VPADGetRStickClampThreshold()

void VPADGetRStickClampThreshold ( VPADChan  chan,
int32_t *  max,
int32_t *  min 
)

◆ VPADSetStickOrigin()

void VPADSetStickOrigin ( VPADChan  chan)

◆ VPADDisableLStickZeroClamp()

void VPADDisableLStickZeroClamp ( VPADChan  chan)

◆ VPADDisableRStickZeroClamp()

void VPADDisableRStickZeroClamp ( VPADChan  chan)

◆ VPADEnableLStickZeroClamp()

void VPADEnableLStickZeroClamp ( VPADChan  chan)

◆ VPADEnableRStickZeroClamp()

void VPADEnableRStickZeroClamp ( VPADChan  chan)

◆ VPADSetCrossStickEmulationParamsL()

void VPADSetCrossStickEmulationParamsL ( VPADChan  chan,
float  rotationDegree,
float  range,
float  radius 
)

◆ VPADSetCrossStickEmulationParamsR()

void VPADSetCrossStickEmulationParamsR ( VPADChan  chan,
float  rotationDegree,
float  range,
float  radius 
)

◆ VPADGetCrossStickEmulationParamsL()

void VPADGetCrossStickEmulationParamsL ( VPADChan  chan,
float *  outRotationDegree,
float *  outRange,
float *  outRadius 
)

◆ VPADGetCrossStickEmulationParamsR()

void VPADGetCrossStickEmulationParamsR ( VPADChan  chan,
float *  outRotationDegree,
float *  outRange,
float *  outRadius 
)

◆ VPADSetGyroAngle()

void VPADSetGyroAngle ( VPADChan  chan,
float  ax,
float  ay,
float  az 
)

◆ VPADSetGyroDirection()

void VPADSetGyroDirection ( VPADChan  chan,
VPADDirection dir 
)

◆ VPADSetGyroDirectionMag()

void VPADSetGyroDirectionMag ( VPADChan  chan,
float  mag 
)

◆ VPADSetGyroMagnification()

void VPADSetGyroMagnification ( VPADChan  chan,
float  pitch,
float  yaw,
float  roll 
)

◆ VPADEnableGyroZeroPlay()

void VPADEnableGyroZeroPlay ( VPADChan  chan)

◆ VPADEnableGyroDirRevise()

void VPADEnableGyroDirRevise ( VPADChan  chan)

◆ VPADEnableGyroAccRevise()

void VPADEnableGyroAccRevise ( VPADChan  chan)

◆ VPADDisableGyroZeroPlay()

void VPADDisableGyroZeroPlay ( VPADChan  chan)

◆ VPADDisableGyroDirRevise()

void VPADDisableGyroDirRevise ( VPADChan  chan)

◆ VPADDisableGyroAccRevise()

void VPADDisableGyroAccRevise ( VPADChan  chan)

◆ VPADIsEnableGyroZeroPlay()

float VPADIsEnableGyroZeroPlay ( VPADChan  chan)

◆ VPADIsEnableGyroZeroDrift()

float VPADIsEnableGyroZeroDrift ( VPADChan  chan)

◆ VPADIsEnableGyroDirRevise()

float VPADIsEnableGyroDirRevise ( VPADChan  chan)

◆ VPADIsEnableGyroAccRevise()

float VPADIsEnableGyroAccRevise ( VPADChan  chan)

◆ VPADSetGyroZeroPlayParam()

void VPADSetGyroZeroPlayParam ( VPADChan  chan,
float  radius 
)

◆ VPADInitGyroZeroPlayParam()

void VPADInitGyroZeroPlayParam ( VPADChan  chan)

◆ VPADInitGyroDirReviseParam()

void VPADInitGyroDirReviseParam ( VPADChan  chan)

◆ VPADInitGyroAccReviseParam()

void VPADInitGyroAccReviseParam ( VPADChan  chan)

◆ VPADInitGyroZeroDriftMode()

void VPADInitGyroZeroDriftMode ( VPADChan  chan)

◆ VPADControlMotor()

int32_t VPADControlMotor ( VPADChan  chan,
uint8_t *  pattern,
uint8_t  length 
)

Turns on the rumble motor on the desired Gamepad.

A custom rumble pattern can be set by setting bytes in the input buffer.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanThe channel of the Gamepad to rumble.
patternPointer to an array of bytes, where each byte represents the status of the rumble at a given time. 0xFF denotes rumble while 0x00 denotes no rumble.
lengthThe size of the rumble pattern, in bytes.

◆ VPADStopMotor()

void VPADStopMotor ( VPADChan  chan)

Stops the desired Gamepad's rumble motor and cancels any ongoing rumble pattern.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanThe channel of the Gamepad to stop rumbling.

◆ VPADSetLcdMode()

int32_t VPADSetLcdMode ( VPADChan  chan,
VPADLcdMode  lcdMode 
)

Sets the current mode of the display on the given Gamepad.

This function can be used to turn the display on and off, or place it in standby.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanThe channel of the Gamepad to have its display mode changed.
lcdModeOne of VPADLcdMode representing the new status of the display.
Returns
0 on success, or a negative value on error.

◆ VPADGetLcdMode()

int32_t VPADGetLcdMode ( VPADChan  chan,
VPADLcdMode outLcdMode 
)

Get the current status of the given Gamepad's display.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanThe channel of the Gamepad to get the display mode from.
outLcdModePointer to write a value of VPADLcdMode into.
Returns
0 on success, or a negative value on error.

◆ VPADBASESetSensorBarSetting()

void VPADBASESetSensorBarSetting ( VPADChan  chan,
int8_t  setting 
)

◆ VPADBASEGetSensorBarSetting()

void VPADBASEGetSensorBarSetting ( VPADChan  chan,
int8_t *  outSetting 
)

◆ VPADSetSensorBar()

int32_t VPADSetSensorBar ( VPADChan  chan,
BOOL  on 
)

Turn the given Gamepad's sensor bar on or off.

Enabling the sensor bar allows any Wii Remote to position itself relative to the GamePad.

Note
Retail Wii U systems have a single Gamepad on VPAD_CHAN_0.
Parameters
chanThe channel of the Gamepad to control the sensor bar on.
ontrue to enable the sensor bar, false to disable it.
Returns
0 on success, or a negative value on error.