RetroArch
pad.h
Go to the documentation of this file.
1 #ifndef __PAD_H__
2 #define __PAD_H__
3 
4 #include <gctypes.h>
5 
6 #define PAD_CHAN0 0
7 #define PAD_CHAN1 1
8 #define PAD_CHAN2 2
9 #define PAD_CHAN3 3
10 #define PAD_CHANMAX 4
11 
12 #define PAD_MOTOR_STOP 0
13 #define PAD_MOTOR_RUMBLE 1
14 #define PAD_MOTOR_STOP_HARD 2
15 
16 #define PAD_ERR_NONE 0
17 #define PAD_ERR_NO_CONTROLLER -1
18 #define PAD_ERR_NOT_READY -2
19 #define PAD_ERR_TRANSFER -3
20 
21 #define PAD_BUTTON_LEFT 0x0001
22 #define PAD_BUTTON_RIGHT 0x0002
23 #define PAD_BUTTON_DOWN 0x0004
24 #define PAD_BUTTON_UP 0x0008
25 #define PAD_TRIGGER_Z 0x0010
26 #define PAD_TRIGGER_R 0x0020
27 #define PAD_TRIGGER_L 0x0040
28 #define PAD_BUTTON_A 0x0100
29 #define PAD_BUTTON_B 0x0200
30 #define PAD_BUTTON_X 0x0400
31 #define PAD_BUTTON_Y 0x0800
32 #define PAD_BUTTON_MENU 0x1000
33 #define PAD_BUTTON_START 0x1000
34 
35 #define PAD_CHAN0_BIT 0x80000000
36 #define PAD_CHAN1_BIT 0x40000000
37 #define PAD_CHAN2_BIT 0x20000000
38 #define PAD_CHAN3_BIT 0x10000000
39 /*+----------------------------------------------------------------------------------------------+*/
40 /*+----------------------------------------------------------------------------------------------+*/
41 /*+----------------------------------------------------------------------------------------------+*/
42 #ifdef __cplusplus
43  extern "C" {
44 #endif /* __cplusplus */
45 /*+----------------------------------------------------------------------------------------------+*/
46 typedef struct _padstatus {
57 } PADStatus;
58 
60 /*+----------------------------------------------------------------------------------------------+*/
61 /*+----------------------------------------------------------------------------------------------+*/
62 /*+----------------------------------------------------------------------------------------------+*/
63 
64 u32 PAD_Init();
65 u32 PAD_Sync();
66 u32 PAD_Read(PADStatus *status);
69 void PAD_Clamp(PADStatus *status);
70 void PAD_ControlMotor(s32 chan,u32 cmd);
71 void PAD_SetSpec(u32 spec);
72 
74 
75 u16 PAD_ButtonsUp(int pad);
76 u16 PAD_ButtonsDown(int pad);
77 u16 PAD_ButtonsHeld(int pad);
78 
79 s8 PAD_SubStickX(int pad);
80 s8 PAD_SubStickY(int pad);
81 
82 s8 PAD_StickX(int pad);
83 s8 PAD_StickY(int pad);
84 
85 u8 PAD_TriggerL(int pad);
86 u8 PAD_TriggerR(int pad);
87 
88 
90 
91 /*+----------------------------------------------------------------------------------------------+*/
92 
93 #ifdef __cplusplus
94  }
95 #endif /* __cplusplus */
96 
97 #endif
u32 PAD_Sync()
Definition: pad.c:581
void PAD_SetSpec(u32 spec)
Definition: pad.c:591
int32_t s32
32bit signed integer
Definition: gctypes.h:24
s8 PAD_StickY(int pad)
Definition: pad.c:740
u16 PAD_ButtonsDown(int pad)
Definition: pad.c:710
Data type definitions.
int8_t s8
8bit signed integer
Definition: gctypes.h:22
void PAD_Clamp(PADStatus *status)
Definition: pad.c:639
u16 PAD_ButtonsHeld(int pad)
Definition: pad.c:716
u8 analogB
Definition: pad.h:55
s8 PAD_StickX(int pad)
Definition: pad.c:734
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
Definition: pad.h:46
u8 triggerR
Definition: pad.h:53
struct _padstatus PADStatus
u32 PAD_ScanPads()
Definition: pad.c:653
ubyte cmd
Definition: wiiuse_internal.h:319
uint16_t u16
16bit unsigned integer
Definition: gctypes.h:18
u32 PAD_Recalibrate(u32 mask)
Definition: pad.c:571
u16 PAD_ButtonsUp(int pad)
Definition: pad.c:704
u32 PAD_Reset(u32 mask)
Definition: pad.c:547
s8 stickX
Definition: pad.h:48
s8 PAD_SubStickX(int pad)
Definition: pad.c:722
GLenum GLint GLuint mask
Definition: glext.h:6668
u8 PAD_TriggerR(int pad)
Definition: pad.c:752
u32 PAD_Init()
Definition: pad.c:452
u8 analogA
Definition: pad.h:54
u16 button
Definition: pad.h:47
u8 triggerL
Definition: pad.h:52
void(* sampling_callback)(void)
Definition: pad.h:59
u8 PAD_TriggerL(int pad)
Definition: pad.c:746
s8 substickY
Definition: pad.h:51
sampling_callback PAD_SetSamplingCallback(sampling_callback cb)
Definition: pad.c:624
void PAD_ControlMotor(s32 chan, u32 cmd)
Definition: pad.c:603
u32 PAD_Read(PADStatus *status)
Definition: pad.c:478
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
s8 stickY
Definition: pad.h:49
s8 err
Definition: pad.h:56
s8 PAD_SubStickY(int pad)
Definition: pad.c:728
s8 substickX
Definition: pad.h:50