Ignore:
File:
1 edited

Legend:

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

    r74b1e40 r160b75e  
    2727 */
    2828
    29 /** @addtogroup libusb
     29/** @addtogroup libusbhid
    3030 * @{
    3131 */
     
    3333 * USB HID report descriptor and report data parser
    3434 */
    35 #ifndef LIBUSB_HIDPATH_H_
    36 #define LIBUSB_HIDPATH_H_
     35#ifndef LIBUSBHID_HIDPATH_H_
     36#define LIBUSBHID_HIDPATH_H_
    3737
    3838#include <usb/hid/hidparser.h>
     
    4040#include <adt/list.h>
    4141
    42 
    43 /*---------------------------------------------------------------------------*/
    4442/**
    45  * Flags of usage paths comparison modes.
    46  *
     43 * Description of path of usage pages and usages in report descriptor
    4744 */
    48 /** Wanted usage path must be exactly the same as the searched one.
    49  * This option cannot be combined with the others.
    50  */
     45/** Wanted usage path must be exactly the same as the searched one */
    5146#define USB_HID_PATH_COMPARE_STRICT             0
    52 
    53 /**
    54  * Wanted usage path must be the suffix in the searched one.
    55  */
     47/** Wanted usage path must be the suffix in the searched one */
    5648#define USB_HID_PATH_COMPARE_END                1
    57 
    58 /**
    59  * Only usage page are compared along the usage path.
    60  * This option can be combined with others.
    61  */
     49/** */
    6250#define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY    2
    63 
    64 /**
    65  * Searched usage page must be prefix of the other one.
    66  */
     51/** Searched usage page must be prefix of the other one */
    6752#define USB_HID_PATH_COMPARE_BEGIN              4
    68 
    69 /**
    70  * Searched couple of usage page and usage can be anywhere in usage path.
    71  * This option is deprecated.
    72  */
     53/** Searched couple of usage page and usage can be anywhere in usage path */
    7354#define USB_HID_PATH_COMPARE_ANYWHERE           8
    7455
    75 /*----------------------------------------------------------------------------*/
    76 /**
    77  * Item of usage path structure. Last item of linked list describes one item
    78  * in report, the others describe superior Collection tags. Usage and Usage
    79  * page of report item can be changed due to data in report.
    80  */
     56
     57/** Collection usage path structure */
    8158typedef struct {
    82         /** Usage page of report item. Zero when usage page can be changed. */
     59        /** */
    8360        uint32_t usage_page;
    84         /** Usage of report item. Zero when usage can be changed. */   
     61        /** */ 
    8562        uint32_t usage;
    8663
    87         /** Attribute of Collection tag in report descriptor*/
    8864        uint8_t flags;
    89 
    90         /** Linked list structure*/
     65        /** */
    9166        link_t link;
    9267} usb_hid_report_usage_path_t;
    9368
    94 
    95 /*---------------------------------------------------------------------------*/
    96 /**
    97  * USB HID usage path structure.
    98  * */
     69/** */
    9970typedef struct {
    100         /** Length of usage path */     
     71        /** */ 
    10172        int depth;     
    102 
    103         /** Report id. Zero is reserved and means that report id is not used. */
    10473        uint8_t report_id;
    10574       
    106         /** Linked list structure. */   
     75        /** */ 
    10776        link_t link; /* list */
    10877
    109         /** Head of the list of usage path items. */
    110         link_t head;
     78        link_t head; /* head of list of usage paths */
    11179
    11280} usb_hid_report_path_t;
    11381
    114 /*---------------------------------------------------------------------------*/
     82/** */
    11583usb_hid_report_path_t *usb_hid_report_path(void);
    11684
     85/** */
    11786void usb_hid_report_path_free(usb_hid_report_path_t *path);
    11887
     88/** */
    11989int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path,
    12090                                      uint8_t report_id);
    12191
     92/** */
    12293int usb_hid_report_path_append_item(usb_hid_report_path_t *usage_path,
    12394                                    int32_t usage_page, int32_t usage);
    12495
     96/** */
    12597void usb_hid_report_remove_last_item(usb_hid_report_path_t *usage_path);
    12698
     99/** */
    127100void usb_hid_report_null_last_item(usb_hid_report_path_t *usage_path);
    128101
     102/** */
    129103void usb_hid_report_set_last_item(usb_hid_report_path_t *usage_path,
    130104                                  int32_t tag, int32_t data);
    131105
     106/** */
    132107int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path,
    133108                                      usb_hid_report_path_t *path, int flags);
    134109
     110/** */
    135111usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path);
    136112
Note: See TracChangeset for help on using the changeset viewer.