2010-08-19 15:04:51 +03:00
|
|
|
/*
|
|
|
|
* atspi/descr.c - USB descriptors
|
|
|
|
*
|
|
|
|
* Written 2008-2010 by Werner Almesberger
|
|
|
|
* Copyright 2008-2010 Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "usb.h"
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Device descriptor
|
|
|
|
*/
|
|
|
|
|
|
|
|
const uint8_t device_descriptor[18] = {
|
|
|
|
18, /* bLength */
|
|
|
|
USB_DT_DEVICE, /* bDescriptorType */
|
|
|
|
LE(0x200), /* bcdUSB */
|
|
|
|
USB_CLASS_VENDOR_SPEC, /* bDeviceClass */
|
|
|
|
0x00, /* bDeviceSubClass */
|
|
|
|
0x00, /* bDeviceProtocol */
|
|
|
|
EP0_SIZE, /* bMaxPacketSize */
|
|
|
|
LE(USB_VENDOR), /* idVendor */
|
|
|
|
LE(USB_PRODUCT), /* idProduct */
|
|
|
|
LE(0x0001), /* bcdDevice */
|
|
|
|
0, /* iManufacturer */
|
|
|
|
0, /* iProduct */
|
|
|
|
0, /* iSerialNumber */
|
|
|
|
1 /* bNumConfigurations */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Our configuration
|
|
|
|
*
|
2010-08-25 00:31:58 +03:00
|
|
|
* We're always bus-powered.
|
2010-08-19 15:04:51 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
const uint8_t config_descriptor[] = {
|
|
|
|
9, /* bLength */
|
|
|
|
USB_DT_CONFIG, /* bDescriptorType */
|
2010-08-25 00:31:58 +03:00
|
|
|
#if 0
|
2010-08-19 15:04:51 +03:00
|
|
|
LE(9+9+7+7), /* wTotalLength */
|
2010-08-25 00:31:58 +03:00
|
|
|
#else
|
|
|
|
LE(9+9), /* wTotalLength */
|
|
|
|
#endif
|
2010-08-19 15:04:51 +03:00
|
|
|
1, /* bNumInterfaces */
|
|
|
|
1, /* bConfigurationValue (> 0 !) */
|
|
|
|
0, /* iConfiguration */
|
|
|
|
USB_ATTR_BUS_POWERED, /* bmAttributes */
|
2010-08-25 00:31:58 +03:00
|
|
|
50/2, /* bMaxPower (50 mA) */
|
2010-08-19 15:04:51 +03:00
|
|
|
|
|
|
|
/* Interface #0 */
|
|
|
|
|
|
|
|
9, /* bLength */
|
|
|
|
USB_DT_INTERFACE, /* bDescriptorType */
|
|
|
|
0, /* bInterfaceNumber */
|
|
|
|
0, /* bAlternateSetting */
|
2010-08-25 00:31:58 +03:00
|
|
|
#if 0
|
2010-08-19 15:04:51 +03:00
|
|
|
2, /* bNumEndpoints */
|
2010-08-25 00:31:58 +03:00
|
|
|
#else
|
|
|
|
0,
|
|
|
|
#endif
|
2010-08-19 15:04:51 +03:00
|
|
|
USB_CLASS_VENDOR_SPEC, /* bInterfaceClass */
|
|
|
|
0, /* bInterfaceSubClass */
|
|
|
|
0, /* bInterfaceProtocol */
|
|
|
|
0, /* iInterface */
|
|
|
|
|
2010-08-25 00:31:58 +03:00
|
|
|
#if 0
|
2010-08-19 15:04:51 +03:00
|
|
|
/* EP OUT */
|
|
|
|
|
|
|
|
7, /* bLength */
|
|
|
|
USB_DT_ENDPOINT, /* bDescriptorType */
|
|
|
|
0x01, /* bEndPointAddress */
|
|
|
|
0x02, /* bmAttributes (bulk) */
|
|
|
|
LE(EP1_SIZE), /* wMaxPacketSize */
|
|
|
|
0, /* bInterval */
|
|
|
|
|
|
|
|
/* EP IN */
|
|
|
|
|
|
|
|
7, /* bLength */
|
|
|
|
USB_DT_ENDPOINT, /* bDescriptorType */
|
|
|
|
0x81, /* bEndPointAddress */
|
|
|
|
0x02, /* bmAttributes (bulk) */
|
|
|
|
LE(EP1_SIZE), /* wMaxPacketSize */
|
|
|
|
0, /* bInterval */
|
2010-08-25 00:31:58 +03:00
|
|
|
#endif
|
2010-08-19 15:04:51 +03:00
|
|
|
};
|