Root/atrf/fw/atspi/descr.c

Source at commit c2dd23840ce5875deca09673fcb8abb8dc3a8e7a created 9 years 1 month ago.
By Werner Almesberger, Moved fw/ and tools/ into atrf/ as well.
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 * While in DFU mode, we're always bus-powered.
45 */
46
47const uint8_t config_descriptor[] = {
48    9, /* bLength */
49    USB_DT_CONFIG, /* bDescriptorType */
50    LE(9+9+7+7), /* wTotalLength */
51    1, /* bNumInterfaces */
52    1, /* bConfigurationValue (> 0 !) */
53    0, /* iConfiguration */
54// USB_ATTR_SELF_POWERED | USB_ATTR_BUS_POWERED,
55    USB_ATTR_BUS_POWERED, /* bmAttributes */
56    15, /* bMaxPower */
57
58    /* Interface #0 */
59
60    9, /* bLength */
61    USB_DT_INTERFACE, /* bDescriptorType */
62    0, /* bInterfaceNumber */
63    0, /* bAlternateSetting */
64    2, /* bNumEndpoints */
65    USB_CLASS_VENDOR_SPEC, /* bInterfaceClass */
66    0, /* bInterfaceSubClass */
67    0, /* bInterfaceProtocol */
68    0, /* iInterface */
69
70    /* EP OUT */
71
72    7, /* bLength */
73    USB_DT_ENDPOINT, /* bDescriptorType */
74    0x01, /* bEndPointAddress */
75    0x02, /* bmAttributes (bulk) */
76    LE(EP1_SIZE), /* wMaxPacketSize */
77    0, /* bInterval */
78
79    /* EP IN */
80
81    7, /* bLength */
82    USB_DT_ENDPOINT, /* bDescriptorType */
83    0x81, /* bEndPointAddress */
84    0x02, /* bmAttributes (bulk) */
85    LE(EP1_SIZE), /* wMaxPacketSize */
86    0, /* bInterval */
87
88};
89

Archive Download this file



interactive