2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 #include "ao_product.h"
21 /* Defines which mark this particular AltOS product */
23 const char ao_version[AO_MAX_VERSION] = AO_iVersion_STRING;
24 const char ao_manufacturer[] = AO_iManufacturer_STRING;
25 const char ao_product[] = AO_iProduct_STRING;
27 #define LE_WORD(x) ((x)&0xFF),((uint8_t) (((uint16_t) (x))>>8))
31 /* Maximum power in mA */
32 #ifndef AO_USB_MAX_POWER
33 #define AO_USB_MAX_POWER 100
36 #ifndef AO_USB_INTERFACE_CLASS
37 #define AO_USB_INTERFACE_CLASS 0x02
41 /* USB descriptors in one giant block of bytes */
42 AO_ROMCONFIG_SYMBOL(0x00aa) uint8_t ao_usb_descriptors [] =
44 /* Device descriptor */
47 LE_WORD(0x0110), /* bcdUSB */
48 0x02, /* bDeviceClass */
49 0x00, /* bDeviceSubClass */
50 0x00, /* bDeviceProtocol */
51 AO_USB_CONTROL_SIZE, /* bMaxPacketSize */
52 LE_WORD(AO_idVendor_NUMBER), /* idVendor */
53 LE_WORD(AO_idProduct_NUMBER), /* idProduct */
54 LE_WORD(0x0100), /* bcdDevice */
55 0x01, /* iManufacturer */
57 0x03, /* iSerialNumber */
58 0x01, /* bNumConfigurations */
60 /* Configuration descriptor */
62 AO_USB_DESC_CONFIGURATION,
63 LE_WORD(67), /* wTotalLength */
64 0x02, /* bNumInterfaces */
65 0x01, /* bConfigurationValue */
66 0x00, /* iConfiguration */
67 0xC0, /* bmAttributes */
68 AO_USB_MAX_POWER >> 1, /* bMaxPower, 2mA units */
70 /* Control class interface */
72 AO_USB_DESC_INTERFACE,
73 0x00, /* bInterfaceNumber */
74 0x00, /* bAlternateSetting */
75 0x01, /* bNumEndPoints */
76 AO_USB_INTERFACE_CLASS, /* bInterfaceClass */
77 0x02, /* bInterfaceSubClass */
78 0x01, /* bInterfaceProtocol, linux requires value of 1 for the cdc_acm module */
79 0x00, /* iInterface */
81 /* Header functional descriptor */
84 0x00, /* bDescriptor SubType Header */
85 LE_WORD(0x0110), /* CDC version 1.1 */
87 /* Call management functional descriptor */
90 0x01, /* bDescriptor SubType Call Management */
91 0x01, /* bmCapabilities = device handles call management */
92 0x01, /* bDataInterface call management interface number */
94 /* ACM functional descriptor */
97 0x02, /* bDescriptor SubType Abstract Control Management */
98 0x02, /* bmCapabilities = D1 (Set_line_Coding, Set_Control_Line_State, Get_Line_Coding and Serial_State) */
100 /* Union functional descriptor */
103 0x06, /* bDescriptor SubType Union Functional descriptor */
104 0x00, /* bMasterInterface */
105 0x01, /* bSlaveInterface0 */
107 /* Notification EP */
109 AO_USB_DESC_ENDPOINT,
110 AO_USB_INT_EP|0x80, /* bEndpointAddress */
111 0x03, /* bmAttributes = intr */
112 LE_WORD(8), /* wMaxPacketSize */
113 0xff, /* bInterval */
115 /* Data class interface descriptor */
117 AO_USB_DESC_INTERFACE,
118 0x01, /* bInterfaceNumber */
119 0x00, /* bAlternateSetting */
120 0x02, /* bNumEndPoints */
121 0x0A, /* bInterfaceClass = data */
122 0x00, /* bInterfaceSubClass */
123 0x00, /* bInterfaceProtocol */
124 0x00, /* iInterface */
128 AO_USB_DESC_ENDPOINT,
129 AO_USB_OUT_EP, /* bEndpointAddress */
130 0x02, /* bmAttributes = bulk */
131 LE_WORD(AO_USB_OUT_SIZE),/* wMaxPacketSize */
132 0x00, /* bInterval */
136 AO_USB_DESC_ENDPOINT,
137 AO_USB_IN_EP|0x80, /* bEndpointAddress */
138 0x02, /* bmAttributes = bulk */
139 LE_WORD(AO_USB_IN_SIZE),/* wMaxPacketSize */
140 0x00, /* bInterval */
142 /* String descriptors */
148 AO_iManufacturer_LEN,
150 AO_iManufacturer_UCS2,
162 /* Terminating zero */