PS2SDK
PS2 Homebrew Libraries
|
#include "types.h"
#include "iomanX.h"
#include "loadcore.h"
#include "stdio.h"
#include "sifcmd.h"
#include "sifrpc.h"
#include "sysclib.h"
#include "sysmem.h"
#include "usbd.h"
#include "usbd_macro.h"
#include "thbase.h"
#include "thevent.h"
#include "thsemap.h"
#include "ps2mouse.h"
Go to the source code of this file.
Data Structures | |
struct | _mouse_data_recv |
struct | _mouse_dev |
struct | _string_descriptor |
Macros | |
#define | MODNAME "PS2 USB mouse driver" |
#define | PS2MOUSE_VERSION 0x100 |
#define | USB_SUBCLASS_BOOT 1 |
#define | USB_HIDPROTO_MOUSE 2 |
#define | PS2MOUSE_MAXDEV 2 |
#define | PS2MOUSE_MAXBUTTONS 3 |
#define | PS2MOUSE_DEFDBLCLICK 500 |
#define | PS2MOUSE_DEFACCEL (1 << 16) |
#define | PS2MOUSE_DEFTHRES 65536; |
#define | ABS(x) (x < 0 ? -x : x) |
Typedefs | |
typedef struct _mouse_data_recv | mouse_data_recv |
typedef struct _mouse_dev | mouse_dev |
typedef struct _string_descriptor | string_descriptor |
Functions | |
IRX_ID (MODNAME, 1, 1) | |
static SifRpcDataQueue_t ps2mouse_queue | __attribute__ ((aligned(16))) |
static int _rpc_buffer[512] | __attribute__ ((__aligned__(4))) |
void | rpcMainThread (void *param) |
void * | rpcCommandHandler (u32 command, void *buffer, int size) |
int | ps2mouse_init () |
void | ps2mouse_config_set (int resultCode, int bytes, void *arg) |
void | ps2mouse_data_recv (int resultCode, int bytes, void *arg) |
int | ps2mouse_probe (int devId) |
int | ps2mouse_connect (int devId) |
int | ps2mouse_disconnect (int devId) |
void | usb_getstring (int endp, int index, char *desc) |
int | _start (int argc, char *argv[]) |
void | ps2mouse_getstring_set (int resultCode, int bytes, void *arg) |
void | do_ps2mouse_read (u8 *data, int size) |
void | do_ps2mouse_setreadmode (const u32 *data, int size) |
void | do_ps2mouse_getreadmode (u32 *data, int size) |
void | do_ps2mouse_setthres (const u32 *data, int size) |
void | do_ps2mouse_getthres (u32 *data, int size) |
void | do_ps2mouse_setaccel (const u32 *data, int size) |
void | do_ps2mouse_getaccel (u32 *data, int size) |
void | do_ps2mouse_setboundary (const s32 *data, int size) |
void | do_ps2mouse_getboundary (s32 *data, int size) |
void | do_ps2mouse_setposition (const s32 *data, int size) |
void | do_ps2mouse_reset () |
void | do_ps2mouse_enum (u32 *data, int size) |
void | do_ps2mouse_setdblclicktime (const u32 *data, int size) |
void | do_ps2mouse_getdblclicktime (u32 *data, int size) |
void | do_ps2mouse_getversion (u32 *data, int size) |
Variables | |
int | mouse_readmode |
int | mousex_min |
int | mousex_max |
int | mousey_min |
int | mousey_max |
int | mouse_thres |
int | mouse_accel |
int | mouse_dblclicktime |
int | mouse_sema |
mouse_data | mouse |
mouse_dev * | devices [PS2MOUSE_MAXDEV] |
int | dev_count |
sceUsbdLddOps | mouse_driver = { NULL, NULL, "PS2Mouse", ps2mouse_probe, ps2mouse_connect, ps2mouse_disconnect, 0, 0, 0, 0, 0, NULL } |
USB Mouse Driver for PS2
Definition in file ps2mouse.c.
struct _mouse_data_recv |
Definition at line 66 of file ps2mouse.c.
Data Fields | ||
---|---|---|
unsigned char | buttons | |
char | x | |
char | y | |
char | wheel |
struct _mouse_dev |
Definition at line 73 of file ps2mouse.c.
Data Fields | ||
---|---|---|
int | configEndp | |
int | dataEndp | |
int | packetSize | |
int | devId | |
mouse_data_recv | data |
Holds the data for the transfers |
u32 | timer[PS2MOUSE_MAXBUTTONS] |
Array to hold timers for double click |
struct _string_descriptor |
#define MODNAME "PS2 USB mouse driver" |
Definition at line 32 of file ps2mouse.c.
#define PS2MOUSE_VERSION 0x100 |
Definition at line 36 of file ps2mouse.c.
#define USB_SUBCLASS_BOOT 1 |
Definition at line 38 of file ps2mouse.c.
#define USB_HIDPROTO_MOUSE 2 |
Definition at line 39 of file ps2mouse.c.
#define PS2MOUSE_MAXDEV 2 |
Definition at line 41 of file ps2mouse.c.
#define PS2MOUSE_MAXBUTTONS 3 |
Definition at line 42 of file ps2mouse.c.
#define PS2MOUSE_DEFDBLCLICK 500 |
Definition at line 44 of file ps2mouse.c.
#define PS2MOUSE_DEFACCEL (1 << 16) |
Definition at line 46 of file ps2mouse.c.
#define PS2MOUSE_DEFTHRES 65536; |
Definition at line 47 of file ps2mouse.c.
#define ABS | ( | x | ) | (x < 0 ? -x : x) |
Definition at line 53 of file ps2mouse.c.
void rpcMainThread | ( | void * | param | ) |
Definition at line 128 of file ps2mouse.c.
void * rpcCommandHandler | ( | u32 | command, |
void * | buffer, | ||
int | size | ||
) |
Definition at line 757 of file ps2mouse.c.
int ps2mouse_init | ( | ) |
Definition at line 502 of file ps2mouse.c.
void ps2mouse_config_set | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
Definition at line 385 of file ps2mouse.c.
void ps2mouse_data_recv | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
Definition at line 407 of file ps2mouse.c.
int ps2mouse_probe | ( | int | devId | ) |
Definition at line 145 of file ps2mouse.c.
int ps2mouse_connect | ( | int | devId | ) |
Definition at line 220 of file ps2mouse.c.
int ps2mouse_disconnect | ( | int | devId | ) |
Definition at line 306 of file ps2mouse.c.
void usb_getstring | ( | int | endp, |
int | index, | ||
char * | desc | ||
) |
Definition at line 361 of file ps2mouse.c.
int _start | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 104 of file ps2mouse.c.
void ps2mouse_getstring_set | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
Definition at line 335 of file ps2mouse.c.
void do_ps2mouse_read | ( | u8 * | data, |
int | size | ||
) |
Definition at line 541 of file ps2mouse.c.
void do_ps2mouse_setreadmode | ( | const u32 * | data, |
int | size | ||
) |
Definition at line 564 of file ps2mouse.c.
void do_ps2mouse_getreadmode | ( | u32 * | data, |
int | size | ||
) |
Definition at line 590 of file ps2mouse.c.
void do_ps2mouse_setthres | ( | const u32 * | data, |
int | size | ||
) |
Definition at line 599 of file ps2mouse.c.
void do_ps2mouse_getthres | ( | u32 * | data, |
int | size | ||
) |
Definition at line 608 of file ps2mouse.c.
void do_ps2mouse_setaccel | ( | const u32 * | data, |
int | size | ||
) |
Definition at line 617 of file ps2mouse.c.
void do_ps2mouse_getaccel | ( | u32 * | data, |
int | size | ||
) |
Definition at line 626 of file ps2mouse.c.
void do_ps2mouse_setboundary | ( | const s32 * | data, |
int | size | ||
) |
Definition at line 635 of file ps2mouse.c.
void do_ps2mouse_getboundary | ( | s32 * | data, |
int | size | ||
) |
Definition at line 660 of file ps2mouse.c.
void do_ps2mouse_setposition | ( | const s32 * | data, |
int | size | ||
) |
Definition at line 672 of file ps2mouse.c.
void do_ps2mouse_reset | ( | ) |
Definition at line 709 of file ps2mouse.c.
void do_ps2mouse_enum | ( | u32 * | data, |
int | size | ||
) |
Definition at line 721 of file ps2mouse.c.
void do_ps2mouse_setdblclicktime | ( | const u32 * | data, |
int | size | ||
) |
Definition at line 730 of file ps2mouse.c.
void do_ps2mouse_getdblclicktime | ( | u32 * | data, |
int | size | ||
) |
Definition at line 739 of file ps2mouse.c.
void do_ps2mouse_getversion | ( | u32 * | data, |
int | size | ||
) |
Definition at line 748 of file ps2mouse.c.
int mouse_readmode |
Definition at line 88 of file ps2mouse.c.
int mousex_min |
Definition at line 89 of file ps2mouse.c.
int mousex_max |
Definition at line 90 of file ps2mouse.c.
int mousey_min |
Definition at line 91 of file ps2mouse.c.
int mousey_max |
Definition at line 92 of file ps2mouse.c.
int mouse_thres |
Definition at line 93 of file ps2mouse.c.
int mouse_accel |
Definition at line 94 of file ps2mouse.c.
int mouse_dblclicktime |
Definition at line 95 of file ps2mouse.c.
int mouse_sema |
Definition at line 96 of file ps2mouse.c.
mouse_data mouse |
Holds the current mouse information
Definition at line 98 of file ps2mouse.c.
mouse_dev* devices[PS2MOUSE_MAXDEV] |
Holds a list of current devices
Definition at line 100 of file ps2mouse.c.
int dev_count |
Definition at line 101 of file ps2mouse.c.
sceUsbdLddOps mouse_driver = { NULL, NULL, "PS2Mouse", ps2mouse_probe, ps2mouse_connect, ps2mouse_disconnect, 0, 0, 0, 0, 0, NULL } |
Definition at line 102 of file ps2mouse.c.