Root/atusb/fw/atspi/descr.c

Source at commit b493f093636595a76b3d1be612df018fa77c7474 created 8 years 8 months ago.
By Werner Almesberger, Great renaming: atrf/wpan-atrf* becomes atusb/atusb*
1/*
2 * atspi/descr.c - USB descriptors
3 *
4 * Written 2008-2010 by Werner Almesberger
5 * Copyright 2008-2010 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#include "config.h"
17
18
19/*
20 * Device descriptor
21 */
22
23const uint8_t device_descriptor[18] = {
24    18, /* bLength */
25    USB_DT_DEVICE, /* bDescriptorType */
26    LE(0x200), /* bcdUSB */
27    USB_CLASS_VENDOR_SPEC, /* bDeviceClass */
28    0x00, /* bDeviceSubClass */
29    0x00, /* bDeviceProtocol */
30    EP0_SIZE, /* bMaxPacketSize */
31    LE(USB_VENDOR), /* idVendor */
32    LE(USB_PRODUCT), /* idProduct */
33    LE(0x0001), /* bcdDevice */
34    0, /* iManufacturer */
35    0, /* iProduct */
36    0, /* iSerialNumber */
37    1 /* bNumConfigurations */
38};
39
40
41/*
42 * Our configuration
43 *
44 * We're always bus-powered.
45 */
46
47const uint8_t config_descriptor[] = {
48    9, /* bLength */
49    USB_DT_CONFIG, /* bDescriptorType */
50#if 0
51    LE(9+9+7+7), /* wTotalLength */
52#else
53    LE(9+9), /* wTotalLength */
54#endif
55    1, /* bNumInterfaces */
56    1, /* bConfigurationValue (> 0 !) */
57    0, /* iConfiguration */
58    USB_ATTR_BUS_POWERED, /* bmAttributes */
59    50/2, /* bMaxPower (50 mA) */
60
61    /* Interface #0 */
62
63    9, /* bLength */
64    USB_DT_INTERFACE, /* bDescriptorType */
65    0, /* bInterfaceNumber */
66    0, /* bAlternateSetting */
67#if 0
68    2, /* bNumEndpoints */
69#else
70    0,
71#endif
72    USB_CLASS_VENDOR_SPEC, /* bInterfaceClass */
73    0, /* bInterfaceSubClass */
74    0, /* bInterfaceProtocol */
75    0, /* iInterface */
76
77#if 0
78    /* EP OUT */
79
80    7, /* bLength */
81    USB_DT_ENDPOINT, /* bDescriptorType */
82    0x01, /* bEndPointAddress */
83    0x02, /* bmAttributes (bulk) */
84    LE(EP1_SIZE), /* wMaxPacketSize */
85    0, /* bInterval */
86
87    /* EP IN */
88
89    7, /* bLength */
90    USB_DT_ENDPOINT, /* bDescriptorType */
91    0x81, /* bEndPointAddress */
92    0x02, /* bmAttributes (bulk) */
93    LE(EP1_SIZE), /* wMaxPacketSize */
94    0, /* bInterval */
95#endif
96};
97

Archive Download this file



interactive