usbhid.h (187994) | usbhid.h (205728) |
---|---|
1/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */ 2 3/* 4 * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */ 2 3/* 4 * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/lib/libusbhid/usbhid.h 187994 2009-02-02 00:49:39Z alfred $ | 28 * $FreeBSD: head/lib/libusbhid/usbhid.h 205728 2010-03-27 08:00:16Z kaiw $ |
29 * 30 */ 31 | 29 * 30 */ 31 |
32#include <sys/cdefs.h> | 32#include <sys/types.h> |
33 34typedef struct report_desc *report_desc_t; 35 36typedef struct hid_data *hid_data_t; 37 38typedef enum hid_kind { | 33 34typedef struct report_desc *report_desc_t; 35 36typedef struct hid_data *hid_data_t; 37 38typedef enum hid_kind { |
39 hid_input = 0, 40 hid_output = 1, 41 hid_feature = 2, 42 hid_collection, 43 hid_endcollection | 39 hid_input, hid_output, hid_feature, hid_collection, hid_endcollection |
44} hid_kind_t; 45 46typedef struct hid_item { 47 /* Global */ | 40} hid_kind_t; 41 42typedef struct hid_item { 43 /* Global */ |
48 unsigned int _usage_page; 49 int logical_minimum; 50 int logical_maximum; 51 int physical_minimum; 52 int physical_maximum; 53 int unit_exponent; 54 int unit; 55 int report_size; 56 int report_ID; | 44 uint32_t _usage_page; 45 int32_t logical_minimum; 46 int32_t logical_maximum; 47 int32_t physical_minimum; 48 int32_t physical_maximum; 49 int32_t unit_exponent; 50 int32_t unit; 51 int32_t report_size; 52 int32_t report_ID; |
57#define NO_REPORT_ID 0 | 53#define NO_REPORT_ID 0 |
58 int report_count; | 54 int32_t report_count; |
59 /* Local */ | 55 /* Local */ |
60 unsigned int usage; 61 int usage_minimum; 62 int usage_maximum; 63 int designator_index; 64 int designator_minimum; 65 int designator_maximum; 66 int string_index; 67 int string_minimum; 68 int string_maximum; 69 int set_delimiter; | 56 uint32_t usage; 57 int32_t usage_minimum; 58 int32_t usage_maximum; 59 int32_t designator_index; 60 int32_t designator_minimum; 61 int32_t designator_maximum; 62 int32_t string_index; 63 int32_t string_minimum; 64 int32_t string_maximum; 65 int32_t set_delimiter; |
70 /* Misc */ | 66 /* Misc */ |
71 int collection; 72 int collevel; | 67 int32_t collection; 68 int collevel; |
73 enum hid_kind kind; | 69 enum hid_kind kind; |
74 unsigned int flags; 75 /* Absolute data position (bits) */ 76 unsigned int pos; 77 /* */ | 70 uint32_t flags; 71 /* Location */ 72 uint32_t pos; 73 /* unused */ |
78 struct hid_item *next; 79} hid_item_t; 80 81#define HID_PAGE(u) (((u) >> 16) & 0xffff) 82#define HID_USAGE(u) ((u) & 0xffff) 83 84__BEGIN_DECLS 85 --- 4 unchanged lines hidden (view full) --- 90int hid_get_report_id(int file); 91int hid_set_immed(int fd, int enable); 92 93/* Parsing of a HID report descriptor, parse.c: */ 94hid_data_t hid_start_parse(report_desc_t d, int kindset, int id); 95void hid_end_parse(hid_data_t s); 96int hid_get_item(hid_data_t s, hid_item_t *h); 97int hid_report_size(report_desc_t d, enum hid_kind k, int id); | 74 struct hid_item *next; 75} hid_item_t; 76 77#define HID_PAGE(u) (((u) >> 16) & 0xffff) 78#define HID_USAGE(u) ((u) & 0xffff) 79 80__BEGIN_DECLS 81 --- 4 unchanged lines hidden (view full) --- 86int hid_get_report_id(int file); 87int hid_set_immed(int fd, int enable); 88 89/* Parsing of a HID report descriptor, parse.c: */ 90hid_data_t hid_start_parse(report_desc_t d, int kindset, int id); 91void hid_end_parse(hid_data_t s); 92int hid_get_item(hid_data_t s, hid_item_t *h); 93int hid_report_size(report_desc_t d, enum hid_kind k, int id); |
98int hid_locate(report_desc_t d, unsigned int usage, enum hid_kind k, hid_item_t *h, int id); | 94int hid_locate(report_desc_t d, unsigned int usage, enum hid_kind k, 95 hid_item_t *h, int id); |
99 100/* Conversion to/from usage names, usage.c: */ 101const char *hid_usage_page(int i); 102const char *hid_usage_in_page(unsigned int u); 103void hid_init(const char *file); 104int hid_parse_usage_in_page(const char *name); 105int hid_parse_usage_page(const char *name); 106 107/* Extracting/insertion of data, data.c: */ 108int hid_get_data(const void *p, const hid_item_t *h); 109void hid_set_data(void *p, const hid_item_t *h, int data); 110 111__END_DECLS | 96 97/* Conversion to/from usage names, usage.c: */ 98const char *hid_usage_page(int i); 99const char *hid_usage_in_page(unsigned int u); 100void hid_init(const char *file); 101int hid_parse_usage_in_page(const char *name); 102int hid_parse_usage_page(const char *name); 103 104/* Extracting/insertion of data, data.c: */ 105int hid_get_data(const void *p, const hid_item_t *h); 106void hid_set_data(void *p, const hid_item_t *h, int data); 107 108__END_DECLS |