PS2SDK
PS2 Homebrew Libraries
|
#include "types.h"
#include "ioman.h"
#include "loadcore.h"
#include "stdio.h"
#include "sifcmd.h"
#include "sifrpc.h"
#include "sysclib.h"
#include <errno.h>
#include "sysmem.h"
#include "usbd.h"
#include "usbd_macro.h"
#include "thbase.h"
#include "thevent.h"
#include "thsemap.h"
#include "ps2kbd.h"
#include "us_keymap.h"
Go to the source code of this file.
Data Structures | |
struct | _kbd_data_recv |
struct | _keyb_dev |
struct | _string_descriptor |
Macros | |
#define | MODNAME "PS2 USB keyboard driver" |
#define | PS2KBD_VERSION 0x100 |
#define | USB_SUBCLASS_BOOT 1 |
#define | USB_HIDPROTO_KEYBOARD 1 |
#define | PS2KBD_MAXDEV 2 |
#define | PS2KBD_MAXKEYS 6 |
#define | PS2KBD_DEFLINELEN 4096 |
#define | PS2KBD_DEFREPEATRATE 100 |
#define | PS2KBD_REPEATWAIT 1000 |
#define | USB_KEYB_NUMLOCK 0x53 |
#define | USB_KEYB_CAPSLOCK 0x39 |
#define | USB_KEYB_SCRLOCK 0x47 |
#define | USB_KEYB_NUMPAD_START 0x54 |
#define | USB_KEYB_NUMPAD_END 0x63 |
#define | SEMA_ZERO -419 |
#define | SEMA_DELETED -425 |
Typedefs | |
typedef struct _kbd_data_recv | kbd_data_recv |
typedef struct _keyb_dev | kbd_dev |
typedef struct _string_descriptor | string_descriptor |
Functions | |
IRX_ID (MODNAME, 1, 1) | |
int | ps2kbd_init () |
void | ps2kbd_config_set (int resultCode, int bytes, void *arg) |
void | ps2kbd_idlemode_set (int resultCode, int bytes, void *arg) |
void | ps2kbd_data_recv (int resultCode, int bytes, void *arg) |
int | ps2kbd_probe (int devId) |
int | ps2kbd_connect (int devId) |
int | ps2kbd_disconnect (int devId) |
void | usb_getstring (int endp, int index, char *desc) |
int | _start (int argc, char *argv[]) |
void | ps2kbd_getstring_set (int resultCode, int bytes, void *arg) |
void | ps2kbd_led_set (int resultCode, int bytes, void *arg) |
void | ps2kbd_build_uniquekeys (u8 *res, const u8 *new, const u8 *old) |
u32 | ps2kbd_repeathandler (void *arg) |
void | ps2kbd_getkeys (u8 keyMods, u8 ledStatus, const u8 *keys, kbd_dev *dev) |
void | ps2kbd_getkeys_raw (u8 newKeyMods, u8 oldKeyMods, const u8 *new, const u8 *old) |
void | flushbuffer () |
void | ps2kbd_ioctl_setreadmode (u32 readmode) |
void | ps2kbd_ioctl_setkeymap (kbd_keymap *keymaps) |
void | ps2kbd_ioctl_setctrlmap (u8 *ctrlmap) |
void | ps2kbd_ioctl_setaltmap (u8 *altmap) |
void | ps2kbd_ioctl_setspecialmap (u8 *special) |
void | ps2kbd_ioctl_resetkeymap () |
void | ps2kbd_ioctl_flushbuffer () |
void | ps2kbd_ioctl_setleds (u8 ledStatus) |
void | ps2kbd_ioctl_setblockmode (u32 blockmode) |
void | ps2kbd_ioctl_setrepeatrate (u32 rate) |
int | fio_dummy () |
int | fio_init (iop_device_t *driver) |
int | fio_format (iop_file_t *f) |
int | fio_open (iop_file_t *f, const char *name, int mode) |
int | fio_read (iop_file_t *f, void *buf, int size) |
int | fio_ioctl (iop_file_t *f, int cmd, void *param) |
int | fio_close (iop_file_t *f) |
int | init_fio () |
void | repeat_thread (void *arg) |
int | init_repeatthread () |
Variables | |
int | kbd_readmode |
int | kbd_blocking |
u32 | kbd_repeatrate |
kbd_dev * | devices [PS2KBD_MAXDEV] |
int | dev_count |
sceUsbdLddOps | kbd_driver = { NULL, NULL, "PS2Kbd", ps2kbd_probe, ps2kbd_connect, ps2kbd_disconnect, 0, 0, 0, 0, 0, NULL } |
u8 * | lineBuffer |
u32 | lineStartP |
u32 | lineEndP |
int | lineSema |
int | bufferSema |
u32 | lineSize |
u8 | keymap [PS2KBD_KEYMAP_SIZE] |
u8 | shiftkeymap [PS2KBD_KEYMAP_SIZE] |
u8 | keycap [PS2KBD_KEYMAP_SIZE] |
u8 | special_keys [PS2KBD_KEYMAP_SIZE] |
u8 | control_map [PS2KBD_KEYMAP_SIZE] |
u8 | alt_map [PS2KBD_KEYMAP_SIZE] |
u8 | keyModValue [8] = { 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7 } |
int | repeat_tid |
int | eventid |
static iop_device_ops_t | fio_ops |
static iop_device_t | kbd_filedrv |
USB Keyboard Driver for PS2
Definition in file ps2kbd.c.
struct _kbd_data_recv |
struct _keyb_dev |
Data Fields | ||
---|---|---|
int | configEndp | |
int | dataEndp | |
int | packetSize | |
int | devId | |
int | interfaceNo |
Holds the interface number selected on this device |
char | repeatkeys[2] | |
u32 | eventmask | |
u8 | ledStatus |
Maintains state on the led status |
kbd_data_recv | oldData | |
kbd_data_recv | data |
Holds the data for the transfers |
struct _string_descriptor |
#define PS2KBD_REPEATWAIT 1000 |
#define USB_KEYB_NUMLOCK 0x53 |
void ps2kbd_config_set | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
void ps2kbd_idlemode_set | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
void ps2kbd_data_recv | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
void ps2kbd_getstring_set | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
void ps2kbd_led_set | ( | int | resultCode, |
int | bytes, | ||
void * | arg | ||
) |
void ps2kbd_build_uniquekeys | ( | u8 * | res, |
const u8 * | new, | ||
const u8 * | old | ||
) |
void ps2kbd_getkeys | ( | u8 | keyMods, |
u8 | ledStatus, | ||
const u8 * | keys, | ||
kbd_dev * | dev | ||
) |
void ps2kbd_getkeys_raw | ( | u8 | newKeyMods, |
u8 | oldKeyMods, | ||
const u8 * | new, | ||
const u8 * | old | ||
) |
void ps2kbd_ioctl_setkeymap | ( | kbd_keymap * | keymaps | ) |
int fio_init | ( | iop_device_t * | driver | ) |
int fio_format | ( | iop_file_t * | f | ) |
int fio_open | ( | iop_file_t * | f, |
const char * | name, | ||
int | mode | ||
) |
int fio_read | ( | iop_file_t * | f, |
void * | buf, | ||
int | size | ||
) |
int fio_ioctl | ( | iop_file_t * | f, |
int | cmd, | ||
void * | param | ||
) |
int fio_close | ( | iop_file_t * | f | ) |
kbd_dev* devices[PS2KBD_MAXDEV] |
sceUsbdLddOps kbd_driver = { NULL, NULL, "PS2Kbd", ps2kbd_probe, ps2kbd_connect, ps2kbd_disconnect, 0, 0, 0, 0, 0, NULL } |
u8 keycap[PS2KBD_KEYMAP_SIZE] |
u8 keyModValue[8] = { 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7 } |
|
static |
|
static |