Ignore:
Timestamp:
2011-05-28T14:30:58Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3fb5a3e
Parents:
e8f826b (diff), 48141f0 (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 development/ changes

File:
1 edited

Legend:

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

    re8f826b r400735e  
    2727 */
    2828
    29 /** @addtogroup libusbhid
     29/** @addtogroup libusb
    3030 * @{
    3131 */
     
    3333 * USB HID report descriptor and report data parser
    3434 */
    35 #ifndef LIBUSBHID_HIDPATH_H_
    36 #define LIBUSBHID_HIDPATH_H_
     35#ifndef LIBUSB_HIDPATH_H_
     36#define LIBUSB_HIDPATH_H_
    3737
    3838#include <usb/hid/hidparser.h>
     
    4040#include <adt/list.h>
    4141
     42
     43/*---------------------------------------------------------------------------*/
     44/*
     45 * Flags of usage paths comparison modes.
     46 *
     47 */
     48/** Wanted usage path must be exactly the same as the searched one.  This
     49 * option cannot be combined with the others.
     50 */
     51#define USB_HID_PATH_COMPARE_STRICT             0
     52
    4253/**
    43  * Description of path of usage pages and usages in report descriptor
     54 * Wanted usage path must be the suffix in the searched one.
    4455 */
    45 /** Wanted usage path must be exactly the same as the searched one */
    46 #define USB_HID_PATH_COMPARE_STRICT             0
    47 /** Wanted usage path must be the suffix in the searched one */
    4856#define USB_HID_PATH_COMPARE_END                1
    49 /** */
     57
     58/**
     59 * Only usage page are compared along the usage path.  This option can be
     60 * combined with others.
     61 */
    5062#define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY    2
    51 /** Searched usage page must be prefix of the other one */
     63
     64/**
     65 * Searched usage page must be prefix of the other one.
     66 */
    5267#define USB_HID_PATH_COMPARE_BEGIN              4
    53 /** Searched couple of usage page and usage can be anywhere in usage path */
     68
     69/**
     70 * Searched couple of usage page and usage can be anywhere in usage path.
     71 * This option is deprecated.
     72 */
    5473#define USB_HID_PATH_COMPARE_ANYWHERE           8
    5574
    56 
    57 /** Collection usage path structure */
     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 */
    5881typedef struct {
    59         /** */
     82        /** Usage page of report item. Zero when usage page can be changed. */
    6083        uint32_t usage_page;
    61         /** */ 
     84        /** Usage of report item. Zero when usage can be changed. */   
    6285        uint32_t usage;
    6386
     87        /** Attribute of Collection tag in report descriptor*/
    6488        uint8_t flags;
    65         /** */
     89
     90        /** Linked list structure*/
    6691        link_t link;
    6792} usb_hid_report_usage_path_t;
    6893
    69 /** */
     94
     95/*---------------------------------------------------------------------------*/
     96/**
     97 * USB HID usage path structure.
     98 * */
    7099typedef struct {
    71         /** */ 
     100        /** Length of usage path */     
    72101        int depth;     
     102
     103        /** Report id. Zero is reserved and means that report id is not used.
     104         * */
    73105        uint8_t report_id;
    74106       
    75         /** */ 
     107        /** Linked list structure. */   
    76108        link_t link; /* list */
    77109
    78         link_t head; /* head of list of usage paths */
     110        /** Head of the list of usage path items. */
     111        link_t head;
    79112
    80113} usb_hid_report_path_t;
    81114
    82 /** */
     115/*---------------------------------------------------------------------------*/
    83116usb_hid_report_path_t *usb_hid_report_path(void);
    84117
    85 /** */
    86118void usb_hid_report_path_free(usb_hid_report_path_t *path);
    87119
    88 /** */
    89 int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path,
    90                                       uint8_t report_id);
     120int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path,
     121                uint8_t report_id);
    91122
    92 /** */
    93123int usb_hid_report_path_append_item(usb_hid_report_path_t *usage_path,
    94                                     int32_t usage_page, int32_t usage);
     124                int32_t usage_page, int32_t usage);
    95125
    96 /** */
    97126void usb_hid_report_remove_last_item(usb_hid_report_path_t *usage_path);
    98127
    99 /** */
    100128void usb_hid_report_null_last_item(usb_hid_report_path_t *usage_path);
    101129
    102 /** */
    103130void usb_hid_report_set_last_item(usb_hid_report_path_t *usage_path,
    104                                   int32_t tag, int32_t data);
     131                int32_t tag, int32_t data);
    105132
    106 /** */
    107 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path,
    108                                       usb_hid_report_path_t *path, int flags);
     133int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path,
     134                usb_hid_report_path_t *path, int flags);
    109135
    110 /** */
    111 usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path);
     136usb_hid_report_path_t *usb_hid_report_path_clone(
     137                usb_hid_report_path_t *usage_path);
    112138
    113139void usb_hid_print_usage_path(usb_hid_report_path_t *path);
Note: See TracChangeset for help on using the changeset viewer.