Changeset 19a1800 in mainline for uspace/lib/usb/include/usb/classes/hidparser.h
- Timestamp:
- 2011-03-01T22:20:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e24e7b1
- Parents:
- 976f546 (diff), ac8285d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hidparser.h
r976f546 r19a1800 37 37 38 38 #include <stdint.h> 39 #include <adt/list.h>40 41 #include <hid_report_items.h>42 39 43 40 /** 44 * Item sprefix41 * Item prefix 45 42 */ 46 43 #define USB_HID_ITEM_SIZE(data) ((uint8_t)(data & 0x3)) … … 62 59 #define USB_HID_ITEM_FLAG_VOLATILE(flags) (flags & 0x80) 63 60 #define USB_HID_ITEM_FLAG_BUFFERED(flags) (flags & 0x100) 64 65 66 /**67 * Collection Item Types68 */69 #define USB_HID_COLLECTION_TYPE_PHYSICAL 0x0070 #define USB_HID_COLLECTION_TYPE_APPLICATION 0x0171 #define USB_HID_COLLECTION_TYPE_LOGICAL 0x0272 #define USB_HID_COLLECTION_TYPE_REPORT 0x0373 #define USB_HID_COLLECTION_TYPE_NAMED_ARRAY 0x0474 #define USB_HID_COLLECTION_TYPE_USAGE_SWITCH 0x0575 76 /*77 * modifiers definitions78 */79 #define USB_HID_BOOT_KEYBOARD_NUM_LOCK 0x0180 #define USB_HID_BOOT_KEYBOARD_CAPS_LOCK 0x0281 #define USB_HID_BOOT_KEYBOARD_SCROLL_LOCK 0x0482 #define USB_HID_BOOT_KEYBOARD_COMPOSE 0x0883 #define USB_HID_BOOT_KEYBOARD_KANA 0x1084 61 85 62 … … 128 105 129 106 107 130 108 /** HID parser callbacks for IN items. */ 131 109 typedef struct { … … 139 117 } usb_hid_report_in_callbacks_t; 140 118 119 120 typedef enum { 121 USB_HID_MOD_LCTRL = 0x01, 122 USB_HID_MOD_LSHIFT = 0x02, 123 USB_HID_MOD_LALT = 0x04, 124 USB_HID_MOD_LGUI = 0x08, 125 USB_HID_MOD_RCTRL = 0x10, 126 USB_HID_MOD_RSHIFT = 0x20, 127 USB_HID_MOD_RALT = 0x40, 128 USB_HID_MOD_RGUI = 0x80, 129 USB_HID_MOD_COUNT = 8 130 } usb_hid_modifiers_t; 131 132 typedef enum { 133 USB_HID_LED_NUM_LOCK = 0x1, 134 USB_HID_LED_CAPS_LOCK = 0x2, 135 USB_HID_LED_SCROLL_LOCK = 0x4, 136 USB_HID_LED_COMPOSE = 0x8, 137 USB_HID_LED_KANA = 0x10, 138 USB_HID_LED_COUNT = 5 139 } usb_hid_led_t; 140 141 static const usb_hid_modifiers_t 142 usb_hid_modifiers_consts[USB_HID_MOD_COUNT] = { 143 USB_HID_MOD_LCTRL, 144 USB_HID_MOD_LSHIFT, 145 USB_HID_MOD_LALT, 146 USB_HID_MOD_LGUI, 147 USB_HID_MOD_RCTRL, 148 USB_HID_MOD_RSHIFT, 149 USB_HID_MOD_RALT, 150 USB_HID_MOD_RGUI 151 }; 152 153 //static const usb_hid_led_t usb_hid_led_consts[USB_HID_LED_COUNT] = { 154 // USB_HID_LED_NUM_LOCK, 155 // USB_HID_LED_CAPS_LOCK, 156 // USB_HID_LED_SCROLL_LOCK, 157 // USB_HID_LED_COMPOSE, 158 // USB_HID_LED_KANA 159 //}; 160 161 //#define USB_HID_BOOT_KEYBOARD_NUM_LOCK 0x01 162 //#define USB_HID_BOOT_KEYBOARD_CAPS_LOCK 0x02 163 //#define USB_HID_BOOT_KEYBOARD_SCROLL_LOCK 0x04 164 //#define USB_HID_BOOT_KEYBOARD_COMPOSE 0x08 165 //#define USB_HID_BOOT_KEYBOARD_KANA 0x10 166 167 /* 168 * modifiers definitions 169 */ 170 141 171 int usb_hid_boot_keyboard_input_report(const uint8_t *data, size_t size, 142 172 const usb_hid_report_in_callbacks_t *callbacks, void *arg); 143 173 144 174 int usb_hid_boot_keyboard_output_report(uint8_t leds, uint8_t *data, size_t size); 145 146 175 147 176 int usb_hid_parser_init(usb_hid_report_parser_t *parser); … … 157 186 158 187 void usb_hid_descriptor_print(usb_hid_report_parser_t *parser); 188 159 189 #endif 160 190 /**
Note:
See TracChangeset
for help on using the changeset viewer.