Ignore:
Timestamp:
2011-03-01T22:20:56Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
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.
Message:

Merge with the current development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/classes/hidparser.h

    r976f546 r19a1800  
    3737
    3838#include <stdint.h>
    39 #include <adt/list.h>
    40 
    41 #include <hid_report_items.h>
    4239
    4340/**
    44  * Items prefix
     41 * Item prefix
    4542 */
    4643#define USB_HID_ITEM_SIZE(data)         ((uint8_t)(data & 0x3))
     
    6259#define USB_HID_ITEM_FLAG_VOLATILE(flags)       (flags & 0x80)
    6360#define USB_HID_ITEM_FLAG_BUFFERED(flags)       (flags & 0x100)
    64 
    65 
    66 /**
    67  * Collection Item Types
    68  */
    69 #define USB_HID_COLLECTION_TYPE_PHYSICAL                0x00
    70 #define USB_HID_COLLECTION_TYPE_APPLICATION             0x01
    71 #define USB_HID_COLLECTION_TYPE_LOGICAL                 0x02
    72 #define USB_HID_COLLECTION_TYPE_REPORT                  0x03
    73 #define USB_HID_COLLECTION_TYPE_NAMED_ARRAY             0x04
    74 #define USB_HID_COLLECTION_TYPE_USAGE_SWITCH    0x05
    75 
    76 /*
    77  * modifiers definitions
    78  */
    79 #define USB_HID_BOOT_KEYBOARD_NUM_LOCK          0x01
    80 #define USB_HID_BOOT_KEYBOARD_CAPS_LOCK         0x02
    81 #define USB_HID_BOOT_KEYBOARD_SCROLL_LOCK       0x04
    82 #define USB_HID_BOOT_KEYBOARD_COMPOSE           0x08
    83 #define USB_HID_BOOT_KEYBOARD_KANA                      0x10
    8461
    8562
     
    128105
    129106
     107
    130108/** HID parser callbacks for IN items. */
    131109typedef struct {
     
    139117} usb_hid_report_in_callbacks_t;
    140118
     119
     120typedef 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
     132typedef 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
     141static 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
    141171int usb_hid_boot_keyboard_input_report(const uint8_t *data, size_t size,
    142172        const usb_hid_report_in_callbacks_t *callbacks, void *arg);
    143173
    144174int usb_hid_boot_keyboard_output_report(uint8_t leds, uint8_t *data, size_t size);
    145 
    146175
    147176int usb_hid_parser_init(usb_hid_report_parser_t *parser);
     
    157186
    158187void usb_hid_descriptor_print(usb_hid_report_parser_t *parser);
     188
    159189#endif
    160190/**
Note: See TracChangeset for help on using the changeset viewer.