pspsdk-1.0+beta2
pspctrl.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspctrl.h - Prototypes for the sceCtrl library.
7  *
8  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11  *
12  * $Id: pspctrl.h 2433 2008-10-15 10:00:27Z iwn $
13  */
14 
15 /* Note: Some of the structures, types, and definitions in this file were
16  extrapolated from symbolic debugging information found in the Japanese
17  version of Puzzle Bobble. */
18 
19 #ifndef __CTRL_H__
20 #define __CTRL_H__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
28 
35 {
37  PSP_CTRL_SELECT = 0x000001,
39  PSP_CTRL_START = 0x000008,
41  PSP_CTRL_UP = 0x000010,
43  PSP_CTRL_RIGHT = 0x000020,
45  PSP_CTRL_DOWN = 0x000040,
47  PSP_CTRL_LEFT = 0x000080,
49  PSP_CTRL_LTRIGGER = 0x000100,
51  PSP_CTRL_RTRIGGER = 0x000200,
53  PSP_CTRL_TRIANGLE = 0x001000,
55  PSP_CTRL_CIRCLE = 0x002000,
57  PSP_CTRL_CROSS = 0x004000,
59  PSP_CTRL_SQUARE = 0x008000,
61  PSP_CTRL_HOME = 0x010000,
63  PSP_CTRL_HOLD = 0x020000,
65  PSP_CTRL_NOTE = 0x800000,
67  PSP_CTRL_SCREEN = 0x400000,
69  PSP_CTRL_VOLUP = 0x100000,
71  PSP_CTRL_VOLDOWN = 0x200000,
73  PSP_CTRL_WLAN_UP = 0x040000,
75  PSP_CTRL_REMOTE = 0x080000,
77  PSP_CTRL_DISC = 0x1000000,
79  PSP_CTRL_MS = 0x2000000,
80 };
81 
84 {
85  /* Digitial. */
87  /* Analog. */
89 };
90 
92 typedef struct SceCtrlData {
94  unsigned int TimeStamp;
96  unsigned int Buttons;
98  unsigned char Lx;
100  unsigned char Ly;
102  unsigned char Rsrv[6];
103 } SceCtrlData;
104 
105 typedef struct SceCtrlLatch {
106  unsigned int uiMake;
107  unsigned int uiBreak;
108  unsigned int uiPress;
109  unsigned int uiRelease;
110 } SceCtrlLatch;
111 
119 int sceCtrlSetSamplingCycle(int cycle);
120 
128 int sceCtrlGetSamplingCycle(int *pcycle);
129 
137 int sceCtrlSetSamplingMode(int mode);
138 
146 int sceCtrlGetSamplingMode(int *pmode);
147 
148 int sceCtrlPeekBufferPositive(SceCtrlData *pad_data, int count);
149 
150 int sceCtrlPeekBufferNegative(SceCtrlData *pad_data, int count);
151 
168 int sceCtrlReadBufferPositive(SceCtrlData *pad_data, int count);
169 
170 int sceCtrlReadBufferNegative(SceCtrlData *pad_data, int count);
171 
172 int sceCtrlPeekLatch(SceCtrlLatch *latch_data);
173 
174 int sceCtrlReadLatch(SceCtrlLatch *latch_data);
175 
188 int sceCtrlSetIdleCancelThreshold(int idlereset, int idleback);
189 
198 int sceCtrlGetIdleCancelThreshold(int *idlerest, int *idleback);
199 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif