LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Variables
usbhid.c File Reference
#include "cfe.h"
#include "usbchap9.h"
#include "usbd.h"
Include dependency graph for usbhid.c:

Go to the source code of this file.

Data Structures

struct  usbhid_softc_s
 
struct  keycode_s
 

Macros

#define CACHE_ALIGN   32 /* XXX place holder, big enough to now. */
 
#define BUFF_ALIGN   16
 
#define ALIGN(n, align)   (((n)+((align)-1)) & ~((align)-1))
 
#define usb_dma_alloc(n)   (KMALLOC(ALIGN((n),CACHE_ALIGN),BUFF_ALIGN))
 
#define usb_dma_free(p)   (KFREE(p))
 
#define HID_BOOT_PROTOCOL   0
 
#define HID_REPORT_PROTOCOL   1
 
#define HID_DEVTYPE_UNKNOWN   0
 
#define HID_DEVTYPE_KBD   1
 
#define HID_DEVTYPE_MOUSE   2
 
#define HID_DEVTYPE_MAX   2
 
#define UBR_KBD_MODS   0
 
#define UBR_KBD_RSVD   1
 
#define UBR_KBD_KEYS   2
 
#define UBR_KBD_NUMKEYS   6
 
#define UBR_KBD_MAX   8
 
#define KBD_MOD_LCTRL   0x01
 
#define KBD_MOD_LSHIFT   0x02
 
#define KBD_MOD_LALT   0x04
 
#define KBD_MOD_LWIN   0x08
 
#define KBD_MOD_RCTRL   0x10
 
#define KBD_MOD_RSHIFT   0x20
 
#define KBD_MOD_RALT   0x40
 
#define KBD_MOD_RWIN   0x80
 
#define usbhid_set_protocol(dev, protocol, ifc)    usb_simple_request(dev,0x21,0x0B,0,ifc)
 
#define FLG_NUM   0x0001 /* Toggles: same as bits for LEDs */
 
#define FLG_CAPS   0x0002
 
#define FLG_SCROLL   0x0004
 
#define FLG_SHIFT   0x0008 /* Shifts */
 
#define FLG_CTRL   0x0100
 
#define FLG_ALT   0x0200
 
#define FLG_FKEY   0x0400 /* function keys */
 
#define FLG_NKPD   0x0800 /* numeric keypad */
 
#define FLG_ASCII   0x1000 /* regular ASCII character */
 
#define FLG_NONE   0x2000
 
#define KC_RESPLEN   4
 
#define usbhid_scantablesize   (sizeof(usbhid_scantable)/sizeof(keycode_t))
 

Typedefs

typedef struct usbhid_softc_s usbhid_softc_t
 
typedef struct keycode_s keycode_t
 

Variables

usb_driver_t usbhid_driver
 

Macro Definition Documentation

◆ ALIGN

#define ALIGN (   n,
  align 
)    (((n)+((align)-1)) & ~((align)-1))

Definition at line 60 of file usbhid.c.

◆ BUFF_ALIGN

#define BUFF_ALIGN   16

Definition at line 59 of file usbhid.c.

◆ CACHE_ALIGN

#define CACHE_ALIGN   32 /* XXX place holder, big enough to now. */

Definition at line 58 of file usbhid.c.

◆ FLG_ALT

#define FLG_ALT   0x0200

Definition at line 146 of file usbhid.c.

◆ FLG_ASCII

#define FLG_ASCII   0x1000 /* regular ASCII character */

Definition at line 149 of file usbhid.c.

◆ FLG_CAPS

#define FLG_CAPS   0x0002

Definition at line 142 of file usbhid.c.

◆ FLG_CTRL

#define FLG_CTRL   0x0100

Definition at line 145 of file usbhid.c.

◆ FLG_FKEY

#define FLG_FKEY   0x0400 /* function keys */

Definition at line 147 of file usbhid.c.

◆ FLG_NKPD

#define FLG_NKPD   0x0800 /* numeric keypad */

Definition at line 148 of file usbhid.c.

◆ FLG_NONE

#define FLG_NONE   0x2000

Definition at line 150 of file usbhid.c.

◆ FLG_NUM

#define FLG_NUM   0x0001 /* Toggles: same as bits for LEDs */

Definition at line 141 of file usbhid.c.

◆ FLG_SCROLL

#define FLG_SCROLL   0x0004

Definition at line 143 of file usbhid.c.

◆ FLG_SHIFT

#define FLG_SHIFT   0x0008 /* Shifts */

Definition at line 144 of file usbhid.c.

◆ HID_BOOT_PROTOCOL

#define HID_BOOT_PROTOCOL   0

Definition at line 69 of file usbhid.c.

◆ HID_DEVTYPE_KBD

#define HID_DEVTYPE_KBD   1

Definition at line 73 of file usbhid.c.

◆ HID_DEVTYPE_MAX

#define HID_DEVTYPE_MAX   2

Definition at line 75 of file usbhid.c.

◆ HID_DEVTYPE_MOUSE

#define HID_DEVTYPE_MOUSE   2

Definition at line 74 of file usbhid.c.

◆ HID_DEVTYPE_UNKNOWN

#define HID_DEVTYPE_UNKNOWN   0

Definition at line 72 of file usbhid.c.

◆ HID_REPORT_PROTOCOL

#define HID_REPORT_PROTOCOL   1

Definition at line 70 of file usbhid.c.

◆ KBD_MOD_LALT

#define KBD_MOD_LALT   0x04

Definition at line 85 of file usbhid.c.

◆ KBD_MOD_LCTRL

#define KBD_MOD_LCTRL   0x01

Definition at line 83 of file usbhid.c.

◆ KBD_MOD_LSHIFT

#define KBD_MOD_LSHIFT   0x02

Definition at line 84 of file usbhid.c.

◆ KBD_MOD_LWIN

#define KBD_MOD_LWIN   0x08

Definition at line 86 of file usbhid.c.

◆ KBD_MOD_RALT

#define KBD_MOD_RALT   0x40

Definition at line 90 of file usbhid.c.

◆ KBD_MOD_RCTRL

#define KBD_MOD_RCTRL   0x10

Definition at line 88 of file usbhid.c.

◆ KBD_MOD_RSHIFT

#define KBD_MOD_RSHIFT   0x20

Definition at line 89 of file usbhid.c.

◆ KBD_MOD_RWIN

#define KBD_MOD_RWIN   0x80

Definition at line 91 of file usbhid.c.

◆ KC_RESPLEN

#define KC_RESPLEN   4

Definition at line 157 of file usbhid.c.

◆ UBR_KBD_KEYS

#define UBR_KBD_KEYS   2

Definition at line 79 of file usbhid.c.

◆ UBR_KBD_MAX

#define UBR_KBD_MAX   8

Definition at line 81 of file usbhid.c.

◆ UBR_KBD_MODS

#define UBR_KBD_MODS   0

Definition at line 77 of file usbhid.c.

◆ UBR_KBD_NUMKEYS

#define UBR_KBD_NUMKEYS   6

Definition at line 80 of file usbhid.c.

◆ UBR_KBD_RSVD

#define UBR_KBD_RSVD   1

Definition at line 78 of file usbhid.c.

◆ usb_dma_alloc

#define usb_dma_alloc (   n)    (KMALLOC(ALIGN((n),CACHE_ALIGN),BUFF_ALIGN))

Definition at line 62 of file usbhid.c.

◆ usb_dma_free

#define usb_dma_free (   p)    (KFREE(p))

Definition at line 63 of file usbhid.c.

◆ usbhid_scantablesize

#define usbhid_scantablesize   (sizeof(usbhid_scantable)/sizeof(keycode_t))

Definition at line 287 of file usbhid.c.

◆ usbhid_set_protocol

#define usbhid_set_protocol (   dev,
  protocol,
  ifc 
)     usb_simple_request(dev,0x21,0x0B,0,ifc)

Definition at line 97 of file usbhid.c.

Typedef Documentation

◆ keycode_t

typedef struct keycode_s keycode_t

◆ usbhid_softc_t

Variable Documentation

◆ usbhid_driver

usb_driver_t usbhid_driver
Initial value:
= {
"Human-Interface Device",
usbhid_attach,
usbhid_detach
}

Definition at line 121 of file usbhid.c.