RetroArch
Classes | Macros | Typedefs | Enumerations | Functions
wpad.h File Reference
#include <gctypes.h>
#include <wiiuse/wiiuse.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.

Classes

struct  _wpad_data
 
struct  _wpad_encstatus
 

Macros

#define WPAD_MAX_IR_DOTS   4
 
#define WPAD_BUTTON_2   0x0001
 
#define WPAD_BUTTON_1   0x0002
 
#define WPAD_BUTTON_B   0x0004
 
#define WPAD_BUTTON_A   0x0008
 
#define WPAD_BUTTON_MINUS   0x0010
 
#define WPAD_BUTTON_HOME   0x0080
 
#define WPAD_BUTTON_LEFT   0x0100
 
#define WPAD_BUTTON_RIGHT   0x0200
 
#define WPAD_BUTTON_DOWN   0x0400
 
#define WPAD_BUTTON_UP   0x0800
 
#define WPAD_BUTTON_PLUS   0x1000
 
#define WPAD_NUNCHUK_BUTTON_Z   (0x0001<<16)
 
#define WPAD_NUNCHUK_BUTTON_C   (0x0002<<16)
 
#define WPAD_CLASSIC_BUTTON_UP   (0x0001<<16)
 
#define WPAD_CLASSIC_BUTTON_LEFT   (0x0002<<16)
 
#define WPAD_CLASSIC_BUTTON_ZR   (0x0004<<16)
 
#define WPAD_CLASSIC_BUTTON_X   (0x0008<<16)
 
#define WPAD_CLASSIC_BUTTON_A   (0x0010<<16)
 
#define WPAD_CLASSIC_BUTTON_Y   (0x0020<<16)
 
#define WPAD_CLASSIC_BUTTON_B   (0x0040<<16)
 
#define WPAD_CLASSIC_BUTTON_ZL   (0x0080<<16)
 
#define WPAD_CLASSIC_BUTTON_FULL_R   (0x0200<<16)
 
#define WPAD_CLASSIC_BUTTON_PLUS   (0x0400<<16)
 
#define WPAD_CLASSIC_BUTTON_HOME   (0x0800<<16)
 
#define WPAD_CLASSIC_BUTTON_MINUS   (0x1000<<16)
 
#define WPAD_CLASSIC_BUTTON_FULL_L   (0x2000<<16)
 
#define WPAD_CLASSIC_BUTTON_DOWN   (0x4000<<16)
 
#define WPAD_CLASSIC_BUTTON_RIGHT   (0x8000<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_STRUM_UP   (0x0001<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_YELLOW   (0x0008<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_GREEN   (0x0010<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_BLUE   (0x0020<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_RED   (0x0040<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_ORANGE   (0x0080<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_PLUS   (0x0400<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_MINUS   (0x1000<<16)
 
#define WPAD_GUITAR_HERO_3_BUTTON_STRUM_DOWN   (0x4000<<16)
 
#define WPAD_ERR_NONE   0
 
#define WPAD_ERR_NO_CONTROLLER   -1
 
#define WPAD_ERR_NOT_READY   -2
 
#define WPAD_ERR_TRANSFER   -3
 
#define WPAD_ERR_NONEREGISTERED   -4
 
#define WPAD_ERR_UNKNOWN   -5
 
#define WPAD_ERR_BAD_CHANNEL   -6
 
#define WPAD_ERR_QUEUE_EMPTY   -7
 
#define WPAD_ERR_BADVALUE   -8
 
#define WPAD_ERR_BADCONF   -9
 
#define WPAD_DATA_BUTTONS   0x01
 
#define WPAD_DATA_ACCEL   0x02
 
#define WPAD_DATA_EXPANSION   0x04
 
#define WPAD_DATA_IR   0x08
 
#define WPAD_ENC_FIRST   0x00
 
#define WPAD_ENC_CONT   0x01
 
#define WPAD_THRESH_IGNORE   -1
 
#define WPAD_THRESH_ANY   0
 
#define WPAD_THRESH_DEFAULT_BUTTONS   0
 
#define WPAD_THRESH_DEFAULT_IR   WPAD_THRESH_IGNORE
 
#define WPAD_THRESH_DEFAULT_ACCEL   20
 
#define WPAD_THRESH_DEFAULT_JOYSTICK   2
 
#define WPAD_THRESH_DEFAULT_BALANCEBOARD   60
 
#define WPAD_THRESH_DEFAULT_MOTION_PLUS   100
 

Typedefs

typedef struct _wpad_data WPADData
 
typedef struct _wpad_encstatus WPADEncStatus
 
typedef void(* WPADDataCallback) (s32 chan, const WPADData *data)
 
typedef void(* WPADShutdownCallback) (s32 chan)
 

Enumerations

enum  {
  WPAD_CHAN_ALL = -1, WPAD_CHAN_0, WPAD_CHAN_1, WPAD_CHAN_2,
  WPAD_CHAN_3, WPAD_BALANCE_BOARD, WPAD_MAX_WIIMOTES
}
 
enum  {
  WPAD_EXP_NONE = 0, WPAD_EXP_NUNCHUK, WPAD_EXP_CLASSIC, WPAD_EXP_GUITARHERO3,
  WPAD_EXP_WIIBOARD, WPAD_EXP_UNKNOWN = 255
}
 
enum  { WPAD_FMT_BTNS = 0, WPAD_FMT_BTNS_ACC, WPAD_FMT_BTNS_ACC_IR }
 
enum  { WPAD_STATE_DISABLED, WPAD_STATE_ENABLING, WPAD_STATE_ENABLED }
 

Functions

s32 WPAD_Init ()
 
s32 WPAD_ControlSpeaker (s32 chan, s32 enable)
 
s32 WPAD_ReadEvent (s32 chan, WPADData *data)
 
s32 WPAD_DroppedEvents (s32 chan)
 
s32 WPAD_Flush (s32 chan)
 
s32 WPAD_ReadPending (s32 chan, WPADDataCallback datacb)
 
s32 WPAD_SetDataFormat (s32 chan, s32 fmt)
 
s32 WPAD_SetMotionPlus (s32 chan, u8 enable)
 
s32 WPAD_SetVRes (s32 chan, u32 xres, u32 yres)
 
s32 WPAD_GetStatus ()
 
s32 WPAD_Probe (s32 chan, u32 *type)
 
s32 WPAD_SetEventBufs (s32 chan, WPADData *bufs, u32 cnt)
 
s32 WPAD_Disconnect (s32 chan)
 
s32 WPAD_IsSpeakerEnabled (s32 chan)
 
s32 WPAD_SendStreamData (s32 chan, void *buf, u32 len)
 
void WPAD_Shutdown ()
 
void WPAD_SetIdleTimeout (u32 seconds)
 
void WPAD_SetPowerButtonCallback (WPADShutdownCallback cb)
 
void WPAD_SetBatteryDeadCallback (WPADShutdownCallback cb)
 
s32 WPAD_ScanPads ()
 
s32 WPAD_Rumble (s32 chan, int status)
 
s32 WPAD_SetIdleThresholds (s32 chan, s32 btns, s32 ir, s32 accel, s32 js, s32 wb, s32 mp)
 
void WPAD_EncodeData (WPADEncStatus *info, u32 flag, const s16 *pcmSamples, s32 numSamples, u8 *encData)
 
WPADDataWPAD_Data (int chan)
 
u8 WPAD_BatteryLevel (int chan)
 
u32 WPAD_ButtonsUp (int chan)
 
u32 WPAD_ButtonsDown (int chan)
 
u32 WPAD_ButtonsHeld (int chan)
 
void WPAD_IR (int chan, struct ir_t *ir)
 
void WPAD_Orientation (int chan, struct orient_t *orient)
 
void WPAD_GForce (int chan, struct gforce_t *gforce)
 
void WPAD_Accel (int chan, struct vec3w_t *accel)
 
void WPAD_Expansion (int chan, struct expansion_t *exp)
 

Macro Definition Documentation

◆ WPAD_BUTTON_1

#define WPAD_BUTTON_1   0x0002

◆ WPAD_BUTTON_2

#define WPAD_BUTTON_2   0x0001

◆ WPAD_BUTTON_A

#define WPAD_BUTTON_A   0x0008

◆ WPAD_BUTTON_B

#define WPAD_BUTTON_B   0x0004

◆ WPAD_BUTTON_DOWN

#define WPAD_BUTTON_DOWN   0x0400

◆ WPAD_BUTTON_HOME

#define WPAD_BUTTON_HOME   0x0080

◆ WPAD_BUTTON_LEFT

#define WPAD_BUTTON_LEFT   0x0100

◆ WPAD_BUTTON_MINUS

#define WPAD_BUTTON_MINUS   0x0010

◆ WPAD_BUTTON_PLUS

#define WPAD_BUTTON_PLUS   0x1000

◆ WPAD_BUTTON_RIGHT

#define WPAD_BUTTON_RIGHT   0x0200

◆ WPAD_BUTTON_UP

#define WPAD_BUTTON_UP   0x0800

◆ WPAD_CLASSIC_BUTTON_A

#define WPAD_CLASSIC_BUTTON_A   (0x0010<<16)

◆ WPAD_CLASSIC_BUTTON_B

#define WPAD_CLASSIC_BUTTON_B   (0x0040<<16)

◆ WPAD_CLASSIC_BUTTON_DOWN

#define WPAD_CLASSIC_BUTTON_DOWN   (0x4000<<16)

◆ WPAD_CLASSIC_BUTTON_FULL_L

#define WPAD_CLASSIC_BUTTON_FULL_L   (0x2000<<16)

◆ WPAD_CLASSIC_BUTTON_FULL_R

#define WPAD_CLASSIC_BUTTON_FULL_R   (0x0200<<16)

◆ WPAD_CLASSIC_BUTTON_HOME

#define WPAD_CLASSIC_BUTTON_HOME   (0x0800<<16)

◆ WPAD_CLASSIC_BUTTON_LEFT

#define WPAD_CLASSIC_BUTTON_LEFT   (0x0002<<16)

◆ WPAD_CLASSIC_BUTTON_MINUS

#define WPAD_CLASSIC_BUTTON_MINUS   (0x1000<<16)

◆ WPAD_CLASSIC_BUTTON_PLUS

#define WPAD_CLASSIC_BUTTON_PLUS   (0x0400<<16)

◆ WPAD_CLASSIC_BUTTON_RIGHT

#define WPAD_CLASSIC_BUTTON_RIGHT   (0x8000<<16)

◆ WPAD_CLASSIC_BUTTON_UP

#define WPAD_CLASSIC_BUTTON_UP   (0x0001<<16)

◆ WPAD_CLASSIC_BUTTON_X

#define WPAD_CLASSIC_BUTTON_X   (0x0008<<16)

◆ WPAD_CLASSIC_BUTTON_Y

#define WPAD_CLASSIC_BUTTON_Y   (0x0020<<16)

◆ WPAD_CLASSIC_BUTTON_ZL

#define WPAD_CLASSIC_BUTTON_ZL   (0x0080<<16)

◆ WPAD_CLASSIC_BUTTON_ZR

#define WPAD_CLASSIC_BUTTON_ZR   (0x0004<<16)

◆ WPAD_DATA_ACCEL

#define WPAD_DATA_ACCEL   0x02

◆ WPAD_DATA_BUTTONS

#define WPAD_DATA_BUTTONS   0x01

◆ WPAD_DATA_EXPANSION

#define WPAD_DATA_EXPANSION   0x04

◆ WPAD_DATA_IR

#define WPAD_DATA_IR   0x08

◆ WPAD_ENC_CONT

#define WPAD_ENC_CONT   0x01

◆ WPAD_ENC_FIRST

#define WPAD_ENC_FIRST   0x00

◆ WPAD_ERR_BAD_CHANNEL

#define WPAD_ERR_BAD_CHANNEL   -6

◆ WPAD_ERR_BADCONF

#define WPAD_ERR_BADCONF   -9

◆ WPAD_ERR_BADVALUE

#define WPAD_ERR_BADVALUE   -8

◆ WPAD_ERR_NO_CONTROLLER

#define WPAD_ERR_NO_CONTROLLER   -1

◆ WPAD_ERR_NONE

#define WPAD_ERR_NONE   0

◆ WPAD_ERR_NONEREGISTERED

#define WPAD_ERR_NONEREGISTERED   -4

◆ WPAD_ERR_NOT_READY

#define WPAD_ERR_NOT_READY   -2

◆ WPAD_ERR_QUEUE_EMPTY

#define WPAD_ERR_QUEUE_EMPTY   -7

◆ WPAD_ERR_TRANSFER

#define WPAD_ERR_TRANSFER   -3

◆ WPAD_ERR_UNKNOWN

#define WPAD_ERR_UNKNOWN   -5

◆ WPAD_GUITAR_HERO_3_BUTTON_BLUE

#define WPAD_GUITAR_HERO_3_BUTTON_BLUE   (0x0020<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_GREEN

#define WPAD_GUITAR_HERO_3_BUTTON_GREEN   (0x0010<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_MINUS

#define WPAD_GUITAR_HERO_3_BUTTON_MINUS   (0x1000<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_ORANGE

#define WPAD_GUITAR_HERO_3_BUTTON_ORANGE   (0x0080<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_PLUS

#define WPAD_GUITAR_HERO_3_BUTTON_PLUS   (0x0400<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_RED

#define WPAD_GUITAR_HERO_3_BUTTON_RED   (0x0040<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_STRUM_DOWN

#define WPAD_GUITAR_HERO_3_BUTTON_STRUM_DOWN   (0x4000<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_STRUM_UP

#define WPAD_GUITAR_HERO_3_BUTTON_STRUM_UP   (0x0001<<16)

◆ WPAD_GUITAR_HERO_3_BUTTON_YELLOW

#define WPAD_GUITAR_HERO_3_BUTTON_YELLOW   (0x0008<<16)

◆ WPAD_MAX_IR_DOTS

#define WPAD_MAX_IR_DOTS   4

◆ WPAD_NUNCHUK_BUTTON_C

#define WPAD_NUNCHUK_BUTTON_C   (0x0002<<16)

◆ WPAD_NUNCHUK_BUTTON_Z

#define WPAD_NUNCHUK_BUTTON_Z   (0x0001<<16)

◆ WPAD_THRESH_ANY

#define WPAD_THRESH_ANY   0

◆ WPAD_THRESH_DEFAULT_ACCEL

#define WPAD_THRESH_DEFAULT_ACCEL   20

◆ WPAD_THRESH_DEFAULT_BALANCEBOARD

#define WPAD_THRESH_DEFAULT_BALANCEBOARD   60

◆ WPAD_THRESH_DEFAULT_BUTTONS

#define WPAD_THRESH_DEFAULT_BUTTONS   0

◆ WPAD_THRESH_DEFAULT_IR

#define WPAD_THRESH_DEFAULT_IR   WPAD_THRESH_IGNORE

◆ WPAD_THRESH_DEFAULT_JOYSTICK

#define WPAD_THRESH_DEFAULT_JOYSTICK   2

◆ WPAD_THRESH_DEFAULT_MOTION_PLUS

#define WPAD_THRESH_DEFAULT_MOTION_PLUS   100

◆ WPAD_THRESH_IGNORE

#define WPAD_THRESH_IGNORE   -1

Typedef Documentation

◆ WPADData

typedef struct _wpad_data WPADData

◆ WPADDataCallback

typedef void(* WPADDataCallback) (s32 chan, const WPADData *data)

◆ WPADEncStatus

◆ WPADShutdownCallback

typedef void(* WPADShutdownCallback) (s32 chan)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WPAD_CHAN_ALL 
WPAD_CHAN_0 
WPAD_CHAN_1 
WPAD_CHAN_2 
WPAD_CHAN_3 
WPAD_BALANCE_BOARD 
WPAD_MAX_WIIMOTES 

◆ anonymous enum

anonymous enum
Enumerator
WPAD_EXP_NONE 
WPAD_EXP_NUNCHUK 
WPAD_EXP_CLASSIC 
WPAD_EXP_GUITARHERO3 
WPAD_EXP_WIIBOARD 
WPAD_EXP_UNKNOWN 

◆ anonymous enum

anonymous enum
Enumerator
WPAD_FMT_BTNS 
WPAD_FMT_BTNS_ACC 
WPAD_FMT_BTNS_ACC_IR 

◆ anonymous enum

anonymous enum
Enumerator
WPAD_STATE_DISABLED 
WPAD_STATE_ENABLING 
WPAD_STATE_ENABLED 

Function Documentation

◆ WPAD_Accel()

void WPAD_Accel ( int  chan,
struct vec3w_t accel 
)

◆ WPAD_BatteryLevel()

u8 WPAD_BatteryLevel ( int  chan)

◆ WPAD_ButtonsDown()

u32 WPAD_ButtonsDown ( int  chan)

◆ WPAD_ButtonsHeld()

u32 WPAD_ButtonsHeld ( int  chan)

◆ WPAD_ButtonsUp()

u32 WPAD_ButtonsUp ( int  chan)

◆ WPAD_ControlSpeaker()

s32 WPAD_ControlSpeaker ( s32  chan,
s32  enable 
)

◆ WPAD_Data()

WPADData* WPAD_Data ( int  chan)
Here is the caller graph for this function:

◆ WPAD_Disconnect()

s32 WPAD_Disconnect ( s32  chan)
Here is the call graph for this function:

◆ WPAD_DroppedEvents()

s32 WPAD_DroppedEvents ( s32  chan)

◆ WPAD_EncodeData()

void WPAD_EncodeData ( WPADEncStatus info,
u32  flag,
const s16 pcmSamples,
s32  numSamples,
u8 encData 
)

◆ WPAD_Expansion()

void WPAD_Expansion ( int  chan,
struct expansion_t exp 
)

◆ WPAD_Flush()

s32 WPAD_Flush ( s32  chan)
Here is the caller graph for this function:

◆ WPAD_GetStatus()

s32 WPAD_GetStatus ( )

◆ WPAD_GForce()

void WPAD_GForce ( int  chan,
struct gforce_t gforce 
)

◆ WPAD_Init()

s32 WPAD_Init ( )
Here is the call graph for this function:

◆ WPAD_IR()

void WPAD_IR ( int  chan,
struct ir_t ir 
)

◆ WPAD_IsSpeakerEnabled()

s32 WPAD_IsSpeakerEnabled ( s32  chan)

◆ WPAD_Orientation()

void WPAD_Orientation ( int  chan,
struct orient_t orient 
)

◆ WPAD_Probe()

s32 WPAD_Probe ( s32  chan,
u32 type 
)

◆ WPAD_ReadEvent()

s32 WPAD_ReadEvent ( s32  chan,
WPADData data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WPAD_ReadPending()

s32 WPAD_ReadPending ( s32  chan,
WPADDataCallback  datacb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WPAD_Rumble()

s32 WPAD_Rumble ( s32  chan,
int  status 
)

◆ WPAD_ScanPads()

s32 WPAD_ScanPads ( )

◆ WPAD_SendStreamData()

s32 WPAD_SendStreamData ( s32  chan,
void buf,
u32  len 
)

◆ WPAD_SetBatteryDeadCallback()

void WPAD_SetBatteryDeadCallback ( WPADShutdownCallback  cb)

◆ WPAD_SetDataFormat()

s32 WPAD_SetDataFormat ( s32  chan,
s32  fmt 
)

◆ WPAD_SetEventBufs()

s32 WPAD_SetEventBufs ( s32  chan,
WPADData bufs,
u32  cnt 
)

◆ WPAD_SetIdleThresholds()

s32 WPAD_SetIdleThresholds ( s32  chan,
s32  btns,
s32  ir,
s32  accel,
s32  js,
s32  wb,
s32  mp 
)

◆ WPAD_SetIdleTimeout()

void WPAD_SetIdleTimeout ( u32  seconds)

◆ WPAD_SetMotionPlus()

s32 WPAD_SetMotionPlus ( s32  chan,
u8  enable 
)
Here is the call graph for this function:

◆ WPAD_SetPowerButtonCallback()

void WPAD_SetPowerButtonCallback ( WPADShutdownCallback  cb)
Here is the call graph for this function:

◆ WPAD_SetVRes()

s32 WPAD_SetVRes ( s32  chan,
u32  xres,
u32  yres 
)
Here is the call graph for this function:

◆ WPAD_Shutdown()

void WPAD_Shutdown ( )
Here is the call graph for this function:
Here is the caller graph for this function: