pspctrl.h

Go to the documentation of this file.
00001 /*
00002  * PSP Software Development Kit - http://www.pspdev.org
00003  * -----------------------------------------------------------------------
00004  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
00005  *
00006  * pspctrl.h - Prototypes for the sceCtrl library.
00007  *
00008  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
00009  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
00010  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
00011  *
00012  * $Id: pspctrl.h 1964 2006-07-08 19:49:40Z tyranid $
00013  */
00014 
00015 /* Note: Some of the structures, types, and definitions in this file were
00016    extrapolated from symbolic debugging information found in the Japanese
00017    version of Puzzle Bobble. */
00018 
00019 #ifndef __CTRL_H__
00020 #define __CTRL_H__
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00028 
00034 enum PspCtrlButtons
00035 {
00037         PSP_CTRL_SELECT     = 0x000001,
00039         PSP_CTRL_START      = 0x000008,
00041         PSP_CTRL_UP         = 0x000010,
00043         PSP_CTRL_RIGHT      = 0x000020,
00045         PSP_CTRL_DOWN           = 0x000040,
00047         PSP_CTRL_LEFT           = 0x000080,
00049         PSP_CTRL_LTRIGGER   = 0x000100,
00051         PSP_CTRL_RTRIGGER   = 0x000200,
00053         PSP_CTRL_TRIANGLE   = 0x001000,
00055         PSP_CTRL_CIRCLE     = 0x002000,
00057         PSP_CTRL_CROSS      = 0x004000,
00059         PSP_CTRL_SQUARE     = 0x008000,
00061         PSP_CTRL_HOME       = 0x010000,
00063         PSP_CTRL_HOLD       = 0x020000,
00065         PSP_CTRL_NOTE       = 0x800000,
00067         PSP_CTRL_SCREEN     = 0x400000,
00069         PSP_CTRL_VOLUP      = 0x100000,
00071         PSP_CTRL_VOLDOWN    = 0x200000,
00073         PSP_CTRL_WLAN_UP    = 0x040000,
00075         PSP_CTRL_REMOTE     = 0x080000, 
00077         PSP_CTRL_DISC       = 0x1000000,
00079         PSP_CTRL_MS         = 0x2000000,
00080 };
00081 
00083 enum PspCtrlMode
00084 {
00085         /* Digitial. */
00086         PSP_CTRL_MODE_DIGITAL = 0,
00087         /* Analog. */
00088         PSP_CTRL_MODE_ANALOG
00089 };
00090 
00092 typedef struct SceCtrlData {
00094         unsigned int    TimeStamp;
00096         unsigned int    Buttons;
00098         unsigned char   Lx;
00100         unsigned char   Ly;
00102         unsigned char   Rsrv[6];
00103 } SceCtrlData;
00104 
00105 typedef struct SceCtrlLatch {
00106         unsigned int    uiMake;
00107         unsigned int    uiBreak;
00108         unsigned int    uiPress;
00109         unsigned int    uiRelease;
00110 } SceCtrlLatch;
00111 
00119 int sceCtrlSetSamplingCycle(int cycle);
00120 
00128 int sceCtrlGetSamplingCycle(int *pcycle);
00129 
00137 int sceCtrlSetSamplingMode(int mode);
00138 
00146 int sceCtrlGetSamplingMode(int *pmode);
00147 
00148 int sceCtrlPeekBufferPositive(SceCtrlData *pad_data, int count);
00149 
00150 int sceCtrlPeekBufferNegative(SceCtrlData *pad_data, int count);
00151 
00168 int sceCtrlReadBufferPositive(SceCtrlData *pad_data, int count);
00169 
00170 int sceCtrlReadBufferNegative(SceCtrlData *pad_data, int count);
00171 
00172 int sceCtrlPeekLatch(SceCtrlLatch *latch_data);
00173 
00174 int sceCtrlReadLatch(SceCtrlLatch *latch_data);
00175 
00178 #ifdef __cplusplus
00179 }
00180 #endif
00181 
00182 #endif

Generated on Tue Jul 24 15:21:22 2007 for PSPSDK-Rev2272 by  doxygen 1.5.2