Root/labsw/fw/descr.c

Source at commit a27d1958fb3a238dcdc9fe15e0d0649448409129 created 5 years 11 months ago.
By Werner Almesberger, ircstat/ML: update for 12/2013
1/*
2 * 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#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    LE(9+9), /* wTotalLength */
51    1, /* bNumInterfaces */
52    1, /* bConfigurationValue (> 0 !) */
53    0, /* iConfiguration */
54    USB_ATTR_BUS_POWERED, /* bmAttributes */
55    15, /* bMaxPower */
56
57    /* Interface #0 */
58
59    9, /* bLength */
60    USB_DT_INTERFACE, /* bDescriptorType */
61    0, /* bInterfaceNumber */
62    0, /* bAlternateSetting */
63    0, /* bNumEndpoints */
64    USB_CLASS_VENDOR_SPEC, /* bInterfaceClass */
65    0, /* bInterfaceSubClass */
66    0, /* bInterfaceProtocol */
67    0, /* iInterface */
68};
69

Archive Download this file

Branches:
master



interactive