Index: uspace/lib/usbhid/include/usb/hid/hid_report_items.h
===================================================================
--- uspace/lib/usbhid/include/usb/hid/hid_report_items.h	(revision ef90ffb36a666fc9c6a9a42b1148e05fdc9c271e)
+++ uspace/lib/usbhid/include/usb/hid/hid_report_items.h	(revision 63d4d4fd3e88e94da562806fa61e80068520ae4c)
@@ -27,84 +27,326 @@
  */
 
-/** @addtogroup libusbhid
+/** @addtogroup libusb
  * @{
  */
 /** @file
- * @brief USB HID parser.
- */
-#ifndef LIBUSBHID_HID_REPORT_ITEMS_H_
-#define LIBUSBHID_HID_REPORT_ITEMS_H_
+ * @brief USB HID Report descriptor item tags.
+ */
+#ifndef LIBUSB_HID_REPORT_ITEMS_H_
+#define LIBUSB_HID_REPORT_ITEMS_H_
 
 #include <stdint.h>
 
-/**
+/*---------------------------------------------------------------------------*/
+/*
  * Item prefix
  */
+
+/** Returns size of item data in bytes */
 #define USB_HID_ITEM_SIZE(data) 	((uint8_t)(data & 0x3))
+
+/** Returns item tag */
 #define USB_HID_ITEM_TAG(data) 		((uint8_t)((data & 0xF0) >> 4))
+
+/** Returns class of item tag */
 #define USB_HID_ITEM_TAG_CLASS(data)	((uint8_t)((data & 0xC) >> 2))
+
+/** Returns if the item is the short item or long item. Long items are not
+ * supported. */
 #define USB_HID_ITEM_IS_LONG(data)	(data == 0xFE)
 
-
-/**
+/*---------------------------------------------------------------------------*/
+/*
  * Extended usage macros
  */
+
+/** Recognizes if the given usage is extended (contains also usage page).  */
 #define USB_HID_IS_EXTENDED_USAGE(usage)	((usage & 0xFFFF0000) != 0)
+
+/** Cuts usage page of the extended usage. */
 #define USB_HID_EXTENDED_USAGE_PAGE(usage)	((usage & 0xFFFF0000) >> 16)
+
+/** Cuts usage of the extended usage */
 #define USB_HID_EXTENDED_USAGE(usage)		(usage & 0xFFFF)
 
-/**
+/*---------------------------------------------------------------------------*/
+/*
  * Input/Output/Feature Item flags
  */
-/** Constant (1) / Variable (0) */
+/** 
+ * Indicates whether the item is data (0) or a constant (1) value. Data
+ * indicates the item is defining report fields that contain modifiable device
+ * data. Constant indicates the item is a static read-only field in a report
+ * and cannot be modified (written) by the host.
+ */
 #define USB_HID_ITEM_FLAG_CONSTANT(flags) 	((flags & 0x1) == 0x1)
-/** Variable (1) / Array (0) */
+
+/**
+ * Indicates whether the item creates variable (1) or array (0) data fields in
+ * reports. 
+ */
 #define USB_HID_ITEM_FLAG_VARIABLE(flags) 	((flags & 0x2) == 0x2)
-/** Absolute / Relative*/
+
+/**
+ * Indicates whether the data is absolute (0) (based on a fixed origin) or
+ * relative (1) (indicating the change in value from the last report). Mouse
+ * devices usually provide relative data, while tablets usually provide
+ * absolute data.
+ */
 #define USB_HID_ITEM_FLAG_RELATIVE(flags) 	((flags & 0x4) == 0x4)
-/** Wrap / No Wrap */
+
+/**
+ * Indicates whether the data “rolls over” when reaching either the extreme
+ * high or low value. For example, a dial that can spin freely 360 degrees
+ * might output values from 0 to 10. If Wrap is indicated, the next value
+ * reported after passing the 10 position in the increasing direction would be
+ * 0.
+ */
 #define USB_HID_ITEM_FLAG_WRAP(flags)		((flags & 0x8) == 0x8)
+
+/**
+ * Indicates whether the raw data from the device has been processed in some
+ * way, and no longer represents a linear relationship between what is
+ * measured and the data that is reported.
+ */
 #define USB_HID_ITEM_FLAG_LINEAR(flags)		((flags & 0x10) == 0x10)
+
+/**
+ * Indicates whether the control has a preferred state to which it will return
+ * when the user is not physically interacting with the control. Push buttons
+ * (as opposed to toggle buttons) and self- centering joysticks are examples.
+ */
 #define USB_HID_ITEM_FLAG_PREFERRED(flags)	((flags & 0x20) == 0x20)
+
+/**
+ * Indicates whether the control has a state in which it is not sending
+ * meaningful data. One possible use of the null state is for controls that
+ * require the user to physically interact with the control in order for it to
+ * report useful data.
+ */
 #define USB_HID_ITEM_FLAG_POSITION(flags)	((flags & 0x40) == 0x40)
+
+/**
+ * Indicates whether the Feature or Output control's value should be changed
+ * by the host or not.  Volatile output can change with or without host
+ * interaction. To avoid synchronization problems, volatile controls should be
+ * relative whenever possible.
+ */
 #define USB_HID_ITEM_FLAG_VOLATILE(flags)	((flags & 0x80) == 0x80)
+
+/**
+ * Indicates that the control emits a fixed-size stream of bytes. The contents
+ * of the data field are determined by the application. The contents of the
+ * buffer are not interpreted as a single numeric quantity. Report data
+ * defined by a Buffered Bytes item must be aligned on an 8-bit boundary.
+ */
 #define USB_HID_ITEM_FLAG_BUFFERED(flags)	((flags & 0x100) == 0x100)
 
+/*---------------------------------------------------------------------------*/
+
 /* MAIN ITEMS */
-#define USB_HID_TAG_CLASS_MAIN				0x0
-#define USB_HID_REPORT_TAG_INPUT			0x8
-#define USB_HID_REPORT_TAG_OUTPUT			0x9
-#define USB_HID_REPORT_TAG_FEATURE			0xB
+
+/**
+ * Main items are used to either define or group certain types of data fields
+ * within a Report descriptor.
+ */
+#define USB_HID_TAG_CLASS_MAIN			0x0
+
+/**
+ * An Input item describes information about the data provided by one or more
+ * physical controls. An application can use this information to interpret the
+ * data provided by the device. All data fields defined in a single item share
+ * an identical data format.
+ */
+#define USB_HID_REPORT_TAG_INPUT		0x8
+
+/**
+ * The Output item is used to define an output data field in a report. This
+ * item is similar to an Input item except it describes data sent to the
+ * device—for example, LED states.
+ */
+#define USB_HID_REPORT_TAG_OUTPUT		0x9
+
+/**
+ * Feature items describe device configuration information that can be sent to
+ * the device.
+ */
+#define USB_HID_REPORT_TAG_FEATURE		0xB
+
+/**
+ * A Collection item identifies a relationship between two or more data
+ * (Input, Output, or Feature.) 
+ */
 #define USB_HID_REPORT_TAG_COLLECTION		0xA
+
+/**
+ * While the Collection item opens a collection of data, the End Collection
+ * item closes a collection.
+ */
 #define USB_HID_REPORT_TAG_END_COLLECTION	0xC
 
+/*---------------------------------------------------------------------------*/
+
 /* GLOBAL ITEMS */
-#define USB_HID_TAG_CLASS_GLOBAL			0x1
+
+/**
+ * Global items describe rather than define data from a control.
+ */
+#define USB_HID_TAG_CLASS_GLOBAL		0x1
+
+/**
+ * Unsigned integer specifying the current Usage Page. Since a usage are 32
+ * bit values, Usage Page items can be used to conserve space in a report
+ * descriptor by setting the high order 16 bits of a subsequent usages. Any
+ * usage that follows which is defines 16 bits or less is interpreted as a
+ * Usage ID and concatenated with the Usage Page to form a 32 bit Usage.
+ */
 #define USB_HID_REPORT_TAG_USAGE_PAGE		0x0
+
+/** 
+ * Extent value in logical units. This is the minimum value that a variable
+ * or array item will report. For example, a mouse reporting x position values
+ * from 0 to 128 would have a Logical Minimum of 0 and a Logical Maximum of
+ * 128.
+ */
 #define USB_HID_REPORT_TAG_LOGICAL_MINIMUM	0x1
+
+/** 
+ * Extent value in logical units. This is the maximum value that a variable
+ * or array item will report.
+ */
 #define USB_HID_REPORT_TAG_LOGICAL_MAXIMUM	0x2
-#define USB_HID_REPORT_TAG_PHYSICAL_MINIMUM 0x3
-#define USB_HID_REPORT_TAG_PHYSICAL_MAXIMUM 0x4
+
+/** 
+ * Minimum value for the physical extent of a variable item. This represents
+ * the Logical Minimum with units applied to it.
+ */
+#define USB_HID_REPORT_TAG_PHYSICAL_MINIMUM 	0x3
+
+/** 
+ * Maximum value for the physical extent of a variable item.
+ */
+#define USB_HID_REPORT_TAG_PHYSICAL_MAXIMUM 	0x4
+
+/** 
+ * Value of the unit exponent in base 10. See the table later in this section
+ * for more information.
+ */
 #define USB_HID_REPORT_TAG_UNIT_EXPONENT	0x5
-#define USB_HID_REPORT_TAG_UNIT				0x6
+
+/** 
+ * Unit values.
+ */
+#define USB_HID_REPORT_TAG_UNIT			0x6
+
+/** 
+ * Unsigned integer specifying the size of the report fields in bits. This
+ * allows the parser to build an item map for the report handler to use.
+ */
 #define USB_HID_REPORT_TAG_REPORT_SIZE		0x7
+
+/** 
+ * Unsigned value that specifies the Report ID. If a Report ID tag is used
+ * anywhere in Report descriptor, all data reports for the device are preceded
+ * by a single byte ID field. All items succeeding the first Report ID tag but
+ * preceding a second Report ID tag are included in a report prefixed by a
+ * 1-byte ID. All items succeeding the second but preceding a third Report ID
+ * tag are included in a second report prefixed by a second ID, and so on.
+ */
 #define USB_HID_REPORT_TAG_REPORT_ID		0x8
+
+/** 
+ * Unsigned integer specifying the number of data fields for the item;
+ * determines how many fields are included in the report for this particular
+ * item (and consequently how many bits are added to the report).
+ */
 #define USB_HID_REPORT_TAG_REPORT_COUNT		0x9
-#define USB_HID_REPORT_TAG_PUSH				0xA
-#define USB_HID_REPORT_TAG_POP				0xB
-
+
+/** 
+ * Places a copy of the global item state table on the stack.
+ */
+#define USB_HID_REPORT_TAG_PUSH			0xA
+
+/** 
+ * Replaces the item state table with the top structure from the stack.
+ */
+#define USB_HID_REPORT_TAG_POP			0xB
+
+/*---------------------------------------------------------------------------*/
 
 /* LOCAL ITEMS */
-#define USB_HID_TAG_CLASS_LOCAL					0x2
-#define USB_HID_REPORT_TAG_USAGE				0x0
-#define USB_HID_REPORT_TAG_USAGE_MINIMUM		0x1
-#define USB_HID_REPORT_TAG_USAGE_MAXIMUM		0x2
-#define USB_HID_REPORT_TAG_DESIGNATOR_INDEX		0x3
+
+/**
+ * Local item tags define characteristics of controls. These items do not
+ * carry over to the next Main item. If a Main item defines more than one
+ * control, it may be preceded by several similar Local item tags. For
+ * example, an Input item may have several Usage tags associated with it, one
+ * for each control.
+ */
+#define USB_HID_TAG_CLASS_LOCAL			0x2
+
+/**
+ * Usage index for an item usage; represents a suggested usage for the item or
+ * collection. In the case where an item represents multiple controls, a Usage
+ * tag may suggest a usage for every variable or element in an array.
+ */
+#define USB_HID_REPORT_TAG_USAGE		0x0
+
+/**
+ * Defines the starting usage associated with an array or bitmap.
+ */
+#define USB_HID_REPORT_TAG_USAGE_MINIMUM	0x1
+
+/**
+ * Defines the ending usage associated with an array or bitmap.
+ */
+#define USB_HID_REPORT_TAG_USAGE_MAXIMUM	0x2
+
+/**
+ * Determines the body part used for a control. Index points to a designator
+ * in the Physical descriptor.
+ */
+#define USB_HID_REPORT_TAG_DESIGNATOR_INDEX	0x3
+
+/**
+ * Defines the index of the starting designator associated with an array or
+ * bitmap.
+ */
 #define USB_HID_REPORT_TAG_DESIGNATOR_MINIMUM	0x4
+
+/**
+ * Defines the index of the ending designator associated with an array or
+ * bitmap.
+ */
 #define USB_HID_REPORT_TAG_DESIGNATOR_MAXIMUM	0x5
-#define USB_HID_REPORT_TAG_STRING_INDEX			0x7
-#define USB_HID_REPORT_TAG_STRING_MINIMUM		0x8
-#define USB_HID_REPORT_TAG_STRING_MAXIMUM		0x9
-#define USB_HID_REPORT_TAG_DELIMITER			0xA
+
+/**
+ * String index for a String descriptor; allows a string to be associated with
+ * a particular item or control.
+ */
+#define USB_HID_REPORT_TAG_STRING_INDEX		0x7
+
+/**
+ * Specifies the first string index when assigning a group of sequential
+ * strings to controls in an array or bitmap.
+ */
+#define USB_HID_REPORT_TAG_STRING_MINIMUM	0x8
+
+/**
+ * Specifies the last string index when assigning a group of sequential
+ * strings to controls in an array or bitmap.
+ */
+#define USB_HID_REPORT_TAG_STRING_MAXIMUM	0x9
+
+/**
+ * Defines the beginning or end of a set of local items (1 = open set, 0 =
+ * close set).
+ *
+ * Usages other than the first (most preferred) usage defined are not
+ * accessible by system software.
+ */
+#define USB_HID_REPORT_TAG_DELIMITER		0xA
+
+/*---------------------------------------------------------------------------*/
 
 #endif
Index: uspace/lib/usbhid/include/usb/hid/hiddescriptor.h
===================================================================
--- uspace/lib/usbhid/include/usb/hid/hiddescriptor.h	(revision ef90ffb36a666fc9c6a9a42b1148e05fdc9c271e)
+++ uspace/lib/usbhid/include/usb/hid/hiddescriptor.h	(revision 63d4d4fd3e88e94da562806fa61e80068520ae4c)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusbhid
+/** @addtogroup libusb
  * @{
  */
@@ -33,6 +33,6 @@
  * USB HID report descriptor and report data parser
  */
-#ifndef LIBUSBHID_HIDDESCRIPTOR_H_
-#define LIBUSBHID_HIDDESCRIPTOR_H_
+#ifndef LIBUSB_HIDDESCRIPTOR_H_
+#define LIBUSB_HIDDESCRIPTOR_H_
 
 #include <stdint.h>
@@ -42,41 +42,43 @@
 #include <usb/hid/hidtypes.h>
 
-
-/*
- * Descriptor parser functions
- */
-
-/** */
 int usb_hid_parse_report_descriptor(usb_hid_report_t *report, 
                                     const uint8_t *data, size_t size);
 
-/** */
 void usb_hid_free_report(usb_hid_report_t *report);
 
-/** */
 void usb_hid_descriptor_print(usb_hid_report_t *report);
 
+int usb_hid_report_init(usb_hid_report_t *report);
 
-int usb_hid_report_init(usb_hid_report_t *report);
 int usb_hid_report_append_fields(usb_hid_report_t *report, 
                                  usb_hid_report_item_t *report_item);
 
 usb_hid_report_description_t * usb_hid_report_find_description(const usb_hid_report_t *report, uint8_t report_id, usb_hid_report_type_t type);
+
 int usb_hid_report_parse_tag(uint8_t tag, uint8_t class, const uint8_t *data, size_t item_size,
                              usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path);
+
 int usb_hid_report_parse_main_tag(uint8_t tag, const uint8_t *data, size_t item_size,
                              usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path);
+
 int usb_hid_report_parse_global_tag(uint8_t tag, const uint8_t *data, size_t item_size,
                              usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path);
+
 int usb_hid_report_parse_local_tag(uint8_t tag, const uint8_t *data, size_t item_size,
                              usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path);
 
 void usb_hid_descriptor_print_list(link_t *head);
+
 void usb_hid_report_reset_local_items(usb_hid_report_item_t *report_item);
+
 void usb_hid_free_report_list(link_t *head);
+
 usb_hid_report_item_t *usb_hid_report_item_clone(const usb_hid_report_item_t *item);
+
 uint32_t usb_hid_report_tag_data_uint32(const uint8_t *data, size_t size);
 
 usb_hid_report_path_t *usb_hid_report_path_try_insert(usb_hid_report_t *report, usb_hid_report_path_t *cmp_path);
+
+
 #endif
 /**
Index: uspace/lib/usbhid/include/usb/hid/hidpath.h
===================================================================
--- uspace/lib/usbhid/include/usb/hid/hidpath.h	(revision ef90ffb36a666fc9c6a9a42b1148e05fdc9c271e)
+++ uspace/lib/usbhid/include/usb/hid/hidpath.h	(revision 63d4d4fd3e88e94da562806fa61e80068520ae4c)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusbhid
+/** @addtogroup libusb
  * @{
  */
@@ -33,6 +33,6 @@
  * USB HID report descriptor and report data parser
  */
-#ifndef LIBUSBHID_HIDPATH_H_
-#define LIBUSBHID_HIDPATH_H_
+#ifndef LIBUSB_HIDPATH_H_
+#define LIBUSB_HIDPATH_H_
 
 #include <usb/hid/hidparser.h>
@@ -40,73 +40,97 @@
 #include <adt/list.h>
 
+
+/*---------------------------------------------------------------------------*/
 /**
- * Description of path of usage pages and usages in report descriptor
+ * Flags of usage paths comparison modes.
+ *
  */
-/** Wanted usage path must be exactly the same as the searched one */
+/** Wanted usage path must be exactly the same as the searched one.
+ * This option cannot be combined with the others. 
+ */
 #define USB_HID_PATH_COMPARE_STRICT		0
-/** Wanted usage path must be the suffix in the searched one */
+
+/**
+ * Wanted usage path must be the suffix in the searched one.
+ */
 #define USB_HID_PATH_COMPARE_END		1
-/** */
+
+/** 
+ * Only usage page are compared along the usage path. 
+ * This option can be combined with others. 
+ */
 #define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY	2
-/** Searched usage page must be prefix of the other one */
+
+/** 
+ * Searched usage page must be prefix of the other one.
+ */
 #define USB_HID_PATH_COMPARE_BEGIN		4
-/** Searched couple of usage page and usage can be anywhere in usage path */
+
+/** 
+ * Searched couple of usage page and usage can be anywhere in usage path.
+ * This option is deprecated.
+ */
 #define USB_HID_PATH_COMPARE_ANYWHERE		8
 
-
-/** Collection usage path structure */
+/*----------------------------------------------------------------------------*/
+/** 
+ * Item of usage path structure. Last item of linked list describes one item
+ * in report, the others describe superior Collection tags. Usage and Usage
+ * page of report item can be changed due to data in report. 
+ */
 typedef struct {
-	/** */
+	/** Usage page of report item. Zero when usage page can be changed. */
 	uint32_t usage_page;
-	/** */	
+	/** Usage of report item. Zero when usage can be changed. */	
 	uint32_t usage;
 
+	/** Attribute of Collection tag in report descriptor*/
 	uint8_t flags;
-	/** */
+
+	/** Linked list structure*/
 	link_t link;
 } usb_hid_report_usage_path_t;
 
-/** */
+
+/*---------------------------------------------------------------------------*/
+/** 
+ * USB HID usage path structure.
+ * */
 typedef struct {
-	/** */	
+	/** Length of usage path */	
 	int depth;	
+
+	/** Report id. Zero is reserved and means that report id is not used. */
 	uint8_t report_id;
 	
-	/** */	
+	/** Linked list structure. */	
 	link_t link; /* list */
 
-	link_t head; /* head of list of usage paths */
+	/** Head of the list of usage path items. */
+	link_t head;
 
 } usb_hid_report_path_t;
 
-/** */
+/*---------------------------------------------------------------------------*/
 usb_hid_report_path_t *usb_hid_report_path(void);
 
-/** */
 void usb_hid_report_path_free(usb_hid_report_path_t *path);
 
-/** */
 int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path, 
                                       uint8_t report_id);
 
-/** */
 int usb_hid_report_path_append_item(usb_hid_report_path_t *usage_path, 
                                     int32_t usage_page, int32_t usage);
 
-/** */
 void usb_hid_report_remove_last_item(usb_hid_report_path_t *usage_path);
 
-/** */
 void usb_hid_report_null_last_item(usb_hid_report_path_t *usage_path);
 
-/** */
 void usb_hid_report_set_last_item(usb_hid_report_path_t *usage_path, 
                                   int32_t tag, int32_t data);
 
-/** */
 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, 
                                       usb_hid_report_path_t *path, int flags);
 
-/** */
 usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path);
 
Index: uspace/lib/usbhid/include/usb/hid/hidtypes.h
===================================================================
--- uspace/lib/usbhid/include/usb/hid/hidtypes.h	(revision ef90ffb36a666fc9c6a9a42b1148e05fdc9c271e)
+++ uspace/lib/usbhid/include/usb/hid/hidtypes.h	(revision 63d4d4fd3e88e94da562806fa61e80068520ae4c)
@@ -27,22 +27,51 @@
  */
 
-/** @addtogroup libusbhid
+/** @addtogroup libusb
  * @{
  */
 /** @file
- * USB HID report descriptor and report data parser
- */
-#ifndef LIBUSBHID_HIDTYPES_H_
-#define LIBUSBHID_HIDTYPES_H_
+ * Basic data structures for USB HID Report descriptor and report parser.
+ */
+#ifndef LIBUSB_HIDTYPES_H_
+#define LIBUSB_HIDTYPES_H_
 
 #include <stdint.h>
 #include <adt/list.h>
 
+/*---------------------------------------------------------------------------*/
+
+/**
+ * Maximum amount of specified usages for one report item
+ */
 #define USB_HID_MAX_USAGES	0xffff
 
-#define USB_HID_UINT32_TO_INT32(x, size)	((((x) & (1 << ((size) - 1))) != 0) ? -(~(x - 1) & ((1 << size) - 1)) : (x)) //(-(~((x) - 1)))
-#define USB_HID_INT32_TO_UINT32(x, size)	(((x) < 0 ) ? ((1 << (size)) + (x)) : (x))
-
-
+/**
+ * Converts integer from unsigned two's complement format format to signed
+ * one.
+ *
+ * @param x Number to convert
+ * @param size Length of the unsigned number in bites
+ * @return signed int
+ */
+#define USB_HID_UINT32_TO_INT32(x, size)	\
+	((((x) & (1 << ((size) - 1))) != 0) ?   \
+	 -(~((x) - 1) & ((1 << size) - 1)) : (x))
+
+/**
+ * Convert integer from signed format to unsigned. If number is negative the
+ * two's complement format is used.
+ *
+ * @param x Number to convert
+ * @param size Length of result number in bites
+ * @return unsigned int
+ */
+#define USB_HID_INT32_TO_UINT32(x, size)	\
+	(((x) < 0 ) ? ((1 << (size)) + (x)) : (x))
+
+/*---------------------------------------------------------------------------*/
+
+/**
+ * Report type
+ */
 typedef enum {
 	USB_HID_REPORT_TYPE_INPUT = 1,
@@ -51,62 +80,124 @@
 } usb_hid_report_type_t;
 
-
+/*---------------------------------------------------------------------------*/
+
+/**
+ * Description of all reports described in one report descriptor.
+ */
 typedef struct {
-	/** */
+	/** Count of available reports. */
 	int report_count;
-	link_t reports;		/** list of usb_hid_report_description_t */
-
+
+	/** Head of linked list of description of reports. */
+	link_t reports;
+
+	/** Head of linked list of all used usage/collection paths. */
 	link_t collection_paths;
+
+	/** Length of list of usage paths. */
 	int collection_paths_count;
 
+	/** Flag whether report ids are used. */
 	int use_report_ids;
+
+	/** Report id of last parsed report. */
 	uint8_t last_report_id;
 	
 } usb_hid_report_t;
-
+/*---------------------------------------------------------------------------*/
+
+/**
+ * Description of one concrete report
+ */
 typedef struct {
+	/** Report id. Zero when no report id is used. */
 	uint8_t report_id;
+
+	/** Type of report */
 	usb_hid_report_type_t type;
 
+	/** Bit length of the report */
 	size_t bit_length;
+
+	/** Number of items in report */
 	size_t item_length;
 	
-	link_t report_items;	/** list of report items (fields) */
-
+	/** Linked list of report items in report */
+	link_t report_items;
+
+	/** Linked list of descriptions. */
 	link_t link;
 } usb_hid_report_description_t;
-
+/*---------------------------------------------------------------------------*/
+
+/**
+ * Description of one field/item in report 
+ */
 typedef struct {
-
+	/** Bit offset of the field */
 	int offset;
+
+	/** Bit size of the field */
 	size_t size;
 
+	/** Usage page. Zero when usage page can be changed. */
 	uint16_t usage_page;
+
+	/** Usage. Zero when usage can be changed. */
 	uint16_t usage;
 
+	/** Item's attributes */
 	uint8_t item_flags;
+
+	/** Usage/Collection path of the field. */
 	usb_hid_report_path_t *collection_path;
 
+	/** 
+	 * The lowest valid logical value (value with the device operates)
+	 */
 	int32_t logical_minimum;
+
+	/**
+	 * The greatest valid logical value
+	 */
 	int32_t logical_maximum;
+
+	/**
+	 * The lowest valid physical value (value with the system operates)
+	 */
 	int32_t physical_minimum;
+
+	/** The greatest valid physical value */
 	int32_t physical_maximum;
+
+	/** The lowest valid usage index */
 	int32_t usage_minimum;
+
+	/** The greatest valid usage index */
 	int32_t usage_maximum;
+	
+	/** Unit of the value */
 	uint32_t unit;
+
+	/** Unit exponent */
 	uint32_t unit_exponent;
 
+	/** Array of possible usages */
 	uint32_t *usages;
+
+	/** Size of the array of usages */
 	size_t usages_count;
 
+	/** Parsed value */
 	int32_t value;
 
+	/** List to another report items */
 	link_t link;
 } usb_hid_report_field_t;
 
-
-
-/**
- * state table
+/*---------------------------------------------------------------------------*/
+
+/**
+ * State table for report descriptor parsing
  */
 typedef struct {
@@ -114,73 +205,84 @@
 	int32_t id;
 	
-	/** */
+	/** Extended usage page */
 	uint16_t extended_usage_page;
+
+	/** Array of usages specified for this item */
 	uint32_t usages[USB_HID_MAX_USAGES];
+	
+	/** Length of usages array */
 	int usages_count;
 
-	/** */
+	/** Usage page*/
 	uint32_t usage_page;
 
-	/** */	
+	/** Minimum valid usage index */	
 	int32_t usage_minimum;
-	/** */	
+	
+	/** Maximum valid usage index */	
 	int32_t usage_maximum;
-	/** */	
+	
+	/** Minimum valid logical value */	
 	int32_t logical_minimum;
-	/** */	
+	
+	/** Maximum valid logical value */	
 	int32_t logical_maximum;
-	/** */	
+
+	/** Length of the items in bits*/	
 	int32_t size;
-	/** */	
+
+	/** COunt of items*/	
 	int32_t count;
-	/** */	
+
+	/**  Bit offset of the item in report */	
 	size_t offset;
-	/** */	
+
+	/** Unit exponent */	
 	int32_t unit_exponent;
-	/** */	
+	/** Unit of the value */	
 	int32_t unit;
 
-	/** */
+	/** String index */
 	uint32_t string_index;
-	/** */	
+
+	/** Minimum valid string index */	
 	uint32_t string_minimum;
-	/** */	
+
+	/** Maximum valid string index */	
 	uint32_t string_maximum;
-	/** */	
+
+	/** The designator index */	
 	uint32_t designator_index;
-	/** */	
+
+	/** Minimum valid designator value*/	
 	uint32_t designator_minimum;
-	/** */	
+
+	/** Maximum valid designator value*/	
 	uint32_t designator_maximum;
-	/** */	
+
+	/** Minimal valid physical value*/	
 	int32_t physical_minimum;
-	/** */	
+
+	/** Maximal valid physical value */	
 	int32_t physical_maximum;
 
-	/** */	
+	/** Items attributes*/	
 	uint8_t item_flags;
 
+	/** Report type */
 	usb_hid_report_type_t type;
 
 	/** current collection path*/	
 	usb_hid_report_path_t *usage_path;
-	/** */	
+
+	/** Unused*/	
 	link_t link;
 
 	int in_delimiter;
 } usb_hid_report_item_t;
-
-/** HID parser callbacks for IN items. */
-typedef struct {
-	/** Callback for keyboard.
-	 *
-	 * @param key_codes Array of pressed key (including modifiers).
-	 * @param count Length of @p key_codes.
-	 * @param arg Custom argument.
-	 */
-	void (*keyboard)(const uint8_t *key_codes, size_t count, const uint8_t report_id, void *arg);
-} usb_hid_report_in_callbacks_t;
-
-
+/*---------------------------------------------------------------------------*/
+/**
+ * Enum of the keyboard modifiers 
+ */
 typedef enum {
 	USB_HID_MOD_LCTRL = 0x01,
@@ -206,4 +308,6 @@
 	USB_HID_MOD_RGUI
 };
+/*---------------------------------------------------------------------------*/
+
 
 #endif
