Ignore:
Timestamp:
2011-01-14T14:31:58Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
192466bc, b65ca41d
Parents:
2f60e57d (diff), 0a9ea4a (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:

Merged lelian/hidd into development

File:
1 edited

Legend:

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

    r2f60e57d r1d7a74e  
    3939#include <driver.h>
    4040#include <usb/classes/hidparser.h>
     41#include <usb/descriptor.h>
    4142
    4243/** USB/HID device requests. */
     
    6364 */
    6465typedef struct {
    65         /** Type of class descriptor (Report or Physical). */
    66         uint8_t class_descriptor_type;
    67         /** Length of class descriptor. */
    68         uint16_t class_descriptor_length;
    69 } __attribute__ ((packed)) usb_standard_hid_descriptor_class_item_t;
     66        /** Type of class-specific descriptor (Report or Physical). */
     67        uint8_t type;
     68        /** Length of class-specific descriptor in bytes. */
     69        uint16_t length;
     70} __attribute__ ((packed)) usb_standard_hid_class_descriptor_info_t;
    7071
    7172/** Standard USB HID descriptor.
     
    7374 * (See HID Specification, p.22)
    7475 *
    75  * It is actually only the "header" of the descriptor, as it may have arbitrary
    76  * length if more than one class descritor is provided.
     76 * It is actually only the "header" of the descriptor, it does not contain
     77 * the last two mandatory fields (type and length of the first class-specific
     78 * descriptor).
    7779 */
    7880typedef struct {
    79         /** Size of this descriptor in bytes. */
     81        /** Total size of this descriptor in bytes.
     82         *
     83         * This includes all class-specific descriptor info - type + length
     84         * for each descriptor.
     85         */
    8086        uint8_t length;
    8187        /** Descriptor type (USB_DESCTYPE_HID). */
     
    8591        /** Country code of localized hardware. */
    8692        uint8_t country_code;
    87         /** Total number of class (i.e. Report and Physical) descriptors. */
    88         uint8_t class_count;
    89         /** First mandatory class descriptor info. */
    90         usb_standard_hid_descriptor_class_item_t class_descriptor;
     93        /** Total number of class-specific (i.e. Report and Physical)
     94         * descriptors.
     95         *
     96         * @note There is always only one Report descriptor.
     97         */
     98        uint8_t class_desc_count;
     99        /** First mandatory class descriptor (Report) info. */
     100        usb_standard_hid_class_descriptor_info_t report_desc_info;
    91101} __attribute__ ((packed)) usb_standard_hid_descriptor_t;
    92102
     103/**
     104 *
     105 */
     106typedef struct {
     107        usb_standard_interface_descriptor_t iface_desc;
     108        usb_standard_endpoint_descriptor_t *endpoints;
     109        usb_standard_hid_descriptor_t hid_desc;
     110        uint8_t *report_desc;
     111        //usb_standard_hid_class_descriptor_info_t *class_desc_info;
     112        //uint8_t **class_descs;
     113} usb_hid_iface_t;
     114
     115/**
     116 *
     117 */
     118typedef struct {
     119        usb_standard_configuration_descriptor_t config_descriptor;
     120        usb_hid_iface_t *interfaces;
     121} usb_hid_configuration_t;
    93122
    94123/**
     
    99128typedef struct {
    100129        device_t *device;
     130        usb_hid_configuration_t *conf;
    101131        usb_address_t address;
    102132        usb_endpoint_t poll_endpoint;
     
    104134} usb_hid_dev_kbd_t;
    105135
     136// TODO: more configurations!
     137
    106138#endif
    107139/**
Note: See TracChangeset for help on using the changeset viewer.