IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
Source at commit 78cfc8ffeb03a6fd6a1e63295c9d807eda84017d created 13 years 1 month ago. By Werner Almesberger, moved atusb/fw3/ to atusb/fw/ | |
---|---|
1 | /* |
2 | * fw/descr.c - USB descriptors |
3 | * |
4 | * Written 2008-2011 by Werner Almesberger |
5 | * Copyright 2008-2011 Werner Almesberger |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. |
11 | */ |
12 | |
13 | |
14 | #include "usb.h" |
15 | |
16 | |
17 | #define USB_VENDOR 0x20b7 /* Qi Hardware */ |
18 | #define USB_PRODUCT 0x1540 /* ben-wpan atusb */ |
19 | |
20 | #define LE(x) ((uint16_t) (x) & 0xff), ((uint16_t) (x) >> 8) |
21 | |
22 | /* |
23 | * Device descriptor |
24 | */ |
25 | |
26 | const uint8_t device_descriptor[18] = { |
27 | 18, /* bLength */ |
28 | USB_DT_DEVICE, /* bDescriptorType */ |
29 | LE(0x200), /* bcdUSB */ |
30 | USB_CLASS_VENDOR_SPEC, /* bDeviceClass */ |
31 | 0x00, /* bDeviceSubClass */ |
32 | 0x00, /* bDeviceProtocol */ |
33 | EP0_SIZE, /* bMaxPacketSize */ |
34 | LE(USB_VENDOR), /* idVendor */ |
35 | LE(USB_PRODUCT), /* idProduct */ |
36 | LE(0x0001), /* bcdDevice */ |
37 | 0, /* iManufacturer */ |
38 | 0, /* iProduct */ |
39 | 0, /* iSerialNumber */ |
40 | 1 /* bNumConfigurations */ |
41 | }; |
42 | |
43 | |
44 | /* |
45 | * Our configuration |
46 | * |
47 | * We're always bus-powered. |
48 | */ |
49 | |
50 | const uint8_t config_descriptor[] = { |
51 | 9, /* bLength */ |
52 | USB_DT_CONFIG, /* bDescriptorType */ |
53 | #if 0 |
54 | LE(9+9+7+7), /* wTotalLength */ |
55 | #else |
56 | LE(9+9), /* wTotalLength */ |
57 | #endif |
58 | 1, /* bNumInterfaces */ |
59 | 1, /* bConfigurationValue (> 0 !) */ |
60 | 0, /* iConfiguration */ |
61 | USB_ATTR_BUS_POWERED, /* bmAttributes */ |
62 | 50/2, /* bMaxPower (50 mA) */ |
63 | |
64 | /* Interface #0 */ |
65 | |
66 | 9, /* bLength */ |
67 | USB_DT_INTERFACE, /* bDescriptorType */ |
68 | 0, /* bInterfaceNumber */ |
69 | 0, /* bAlternateSetting */ |
70 | #if 0 |
71 | 2, /* bNumEndpoints */ |
72 | #else |
73 | 0, |
74 | #endif |
75 | USB_CLASS_VENDOR_SPEC, /* bInterfaceClass */ |
76 | 0, /* bInterfaceSubClass */ |
77 | 0, /* bInterfaceProtocol */ |
78 | 0, /* iInterface */ |
79 | |
80 | #if 0 |
81 | /* EP OUT */ |
82 | |
83 | 7, /* bLength */ |
84 | USB_DT_ENDPOINT, /* bDescriptorType */ |
85 | 0x01, /* bEndPointAddress */ |
86 | 0x02, /* bmAttributes (bulk) */ |
87 | LE(EP1_SIZE), /* wMaxPacketSize */ |
88 | 0, /* bInterval */ |
89 | |
90 | /* EP IN */ |
91 | |
92 | 7, /* bLength */ |
93 | USB_DT_ENDPOINT, /* bDescriptorType */ |
94 | 0x81, /* bEndPointAddress */ |
95 | 0x02, /* bmAttributes (bulk) */ |
96 | LE(EP1_SIZE), /* wMaxPacketSize */ |
97 | 0, /* bInterval */ |
98 | #endif |
99 | }; |
100 |