12 #define PAD_MOTOR_STOP 0
13 #define PAD_MOTOR_RUMBLE 1
14 #define PAD_MOTOR_STOP_HARD 2
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
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
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 /*+----------------------------------------------------------------------------------------------+*/
44 #endif /* __cplusplus */
45 /*+----------------------------------------------------------------------------------------------+*/
46 typedef struct _padstatus
{
59 typedef void (*sampling_callback
)(void);
60 /*+----------------------------------------------------------------------------------------------+*/
61 /*+----------------------------------------------------------------------------------------------+*/
62 /*+----------------------------------------------------------------------------------------------+*/
66 u32
PAD_Read(PADStatus
*status
);
67 u32
PAD_Reset(u32 mask
);
68 u32
PAD_Recalibrate(u32 mask
);
69 void PAD_Clamp(PADStatus
*status
);
70 void PAD_ControlMotor(s32 chan
,u32 cmd
);
71 void PAD_SetSpec(u32 spec
);
75 u16
PAD_ButtonsUp(int pad
);
76 u16
PAD_ButtonsDown(int pad
);
77 u16
PAD_ButtonsHeld(int pad
);
79 s8
PAD_SubStickX(int pad
);
80 s8
PAD_SubStickY(int pad
);
82 s8
PAD_StickX(int pad
);
83 s8
PAD_StickY(int pad
);
85 u8
PAD_TriggerL(int pad
);
86 u8
PAD_TriggerR(int pad
);
89 sampling_callback
PAD_SetSamplingCallback(sampling_callback cb
);
91 /*+----------------------------------------------------------------------------------------------+*/
95 #endif /* __cplusplus */