no-OS
maxim_usb_uart_descriptors.h
Go to the documentation of this file.
1 /***************************************************************************/
40 /* Define to prevent redundant inclusion */
41 #ifndef MAXIM_USB_CDCACM_DESCRIPTORS_H_
42 #define MAXIM_USB_CDCACM_DESCRIPTORS_H_
43 
44 #include <stdint.h>
45 #include "usb.h"
46 #include "hid_kbd.h"
47 
48 MXC_USB_device_descriptor_t __attribute__((aligned(4))) device_descriptor = {
49  0x12, /* bLength = 18 */
50  0x01, /* bDescriptorType = Device */
51  0x0200, /* bcdUSB USB spec rev (BCD) */
52  0x02, /* bDeviceClass = comm class (2) */
53  0x00, /* bDeviceSubClass */
54  0x00, /* bDeviceProtocol */
55  0x40, /* bMaxPacketSize0 is 64 bytes */
56  0x0B6A, /* idVendor (Maxim Integrated) */
57  0x003C, /* idProduct */
58  0x0100, /* bcdDevice */
59  0x01, /* iManufacturer Descriptor ID */
60  0x02, /* iProduct Descriptor ID */
61  0x00, /* iSerialNumber = (0) No string */
62  0x01 /* bNumConfigurations */
63 };
64 
65 __attribute__((aligned(4))) struct __attribute__((packed))
66 {
67  MXC_USB_configuration_descriptor_t config_descriptor;
68  MXC_USB_interface_descriptor_t comm_interface_descriptor;
73  MXC_USB_endpoint_descriptor_t endpoint_descriptor_3;
74  MXC_USB_interface_descriptor_t data_interface_descriptor;
75  MXC_USB_endpoint_descriptor_t endpoint_descriptor_1;
76  MXC_USB_endpoint_descriptor_t endpoint_descriptor_2;
77 }
79  {
80  0x09, /* bLength = 9 */
81  0x02, /* bDescriptorType = Config (2) */
82  0x0043, /* wTotalLength(L/H) */
83  0x02, /* bNumInterfaces */
84  0x01, /* bConfigValue */
85  0x00, /* iConfiguration */
86  0xE0, /* bmAttributes (self-powered, remote wakeup) */
87  0x01, /* MaxPower is 2ma (units are 2ma/bit) */
88  },
89  {
90  /* First Interface Descriptor For Comm Class Interface */
91  0x09, /* bLength = 9 */
92  0x04, /* bDescriptorType = Interface (4) */
93  0x00, /* bInterfaceNumber */
94  0x00, /* bAlternateSetting */
95  0x01, /* bNumEndpoints (one for OUT) */
96  0x02, /* bInterfaceClass = Communications Interface Class (2) */
97  0x02, /* bInterfaceSubClass = Abstract Control Model (2) */
98  0x01, /* bInterfaceProtocol = Common "AT" commands (1), no class specific protocol (0) */
99  0x00, /* iInterface */
100  },
101  {
102  /* Header Functional Descriptor */
103  0x05, /* bFunctionalLength = 5 */
104  0x24, /* bDescriptorType */
105  0x00, /* bDescriptorSubtype */
106  0x10, 0x01, /* bcdCDC */
107  },
108  {
109  /* Call Management Descriptor */
110  0x05, /* bFunctionalLength = 5 */
111  0x24, /* bDescriptorType */
112  0x01, /* bDescriptorSubtype */
113  0x03, /* bmCapabilities = Device handles call management itself (0x01), management over data class (0x02) */
114  0x01, /* bmDataInterface */
115  },
116  {
117  /* Abstract Control Management Functional Descriptor */
118  0x04, /* bFunctionalLength = 4 */
119  0x24, /* bDescriptorType */
120  0x02, /* bDescriptorSubtype */
121  0x02, /* bmCapabilities */
122  },
123  {
124  /* Union Functional Descriptor */
125  0x05, /* bFunctionalLength = 5 */
126  0x24, /* bDescriptorType */
127  0x06, /* bDescriptorSubtype */
128  0x00, /* bmMasterInterface */
129  0x01, /* bmSlaveInterface0 */
130  },
131  {
132  /* IN Endpoint 3 (Descriptor #1) */
133  0x07, /* bLength */
134  0x05, /* bDescriptorType (Endpoint) */
135  0x83, /* bEndpointAddress (EP3-IN) */
136  0x03, /* bmAttributes (interrupt) */
137  0x0040, /* wMaxPacketSize */
138  0xff, /* bInterval (milliseconds) */
139  },
140  {
141  /* Second Interface Descriptor For Data Interface */
142  0x09, /* bLength */
143  0x04, /* bDescriptorType (Interface) */
144  0x01, /* bInterfaceNumber */
145  0x00, /* bAlternateSetting */
146  0x02, /* bNumEndpoints */
147  0x0a, /* bInterfaceClass = Data Interface (10) */
148  0x00, /* bInterfaceSubClass = none (0) */
149  0x00, /* bInterfaceProtocol = No class specific protocol (0) */
150  0x00, /* biInterface = No Text String (0) */
151  },
152  {
153  /* OUT Endpoint 1 (Descriptor #2) */
154  0x07, /* bLength */
155  0x05, /* bDescriptorType (Endpoint) */
156  0x01, /* bEndpointAddress (EP1-OUT) */
157  0x02, /* bmAttributes (bulk) */
158  0x0040, /* wMaxPacketSize */
159  0x00, /* bInterval (N/A) */
160  },
161  {
162  /* IN Endpoint 2 (Descriptor #3) */
163  0x07, /* bLength */
164  0x05, /* bDescriptorType (Endpoint) */
165  0x82, /* bEndpointAddress (EP2-IN) */
166  0x02, /* bmAttributes (bulk) */
167  0x0040, /* wMaxPacketSize */
168  0x00 /* bInterval (N/A) */
169  }
170 };
171 
172 __attribute__((aligned(4))) uint8_t lang_id_desc[] = {
173  0x04, /* bLength */
174  0x03, /* bDescriptorType */
175  0x09, 0x04 /* bString = wLANGID (see usb_20.pdf 9.6.7 String) */
176 };
177 
178 __attribute__((aligned(4))) uint8_t mfg_id_desc[] = {
179  0x22, /* bLength */
180  0x03, /* bDescriptorType */
181  'M', 0, 'a', 0, 'x', 0, 'i', 0, 'm', 0, ' ', 0, 'I', 0, 'n', 0,
182  't', 0, 'e', 0, 'g', 0, 'r', 0, 'a', 0, 't', 0, 'e', 0, 'd', 0,
183 };
184 
185 __attribute__((aligned(4))) uint8_t prod_id_desc[] = {
186  0x22, /* bLength */
187  0x03, /* bDescriptorType */
188  'M', 0, 'A', 0, 'X', 0, '3', 0, '2', 0, '6', 0, '6', 0, '5', 0,
189  ' ', 0, 'C', 0, 'D', 0, 'C', 0, '-', 0, 'A', 0, 'C', 0, 'M', 0,
190 };
191 
192 /* Not currently used (see device descriptor), but could be enabled if desired */
193 __attribute__((aligned(4))) uint8_t serial_id_desc[] = { 0x14, /* bLength */
194  0x03, /* bDescriptorType */
195  '0', 0, '0', 0, '0', 0, '0', 0, '0', 0,
196  '0', 0, '0', 0, '0', 0, '1', 0
197  };
198 
199 #endif // MAXIM_USB_CDCACM_DESCRIPTORS_H_
serial_id_desc
uint8_t serial_id_desc[]
Definition: maxim_usb_uart_descriptors.h:329
acm_functional_descriptor
uint8_t acm_functional_descriptor[4]
Definition: maxim_usb_uart_descriptors.h:93
mfg_id_desc
uint8_t mfg_id_desc[]
Definition: maxim_usb_uart_descriptors.h:314
endpoint_descriptor_1
MXC_USB_endpoint_descriptor_t endpoint_descriptor_1
Definition: maxim_usb_uart_descriptors.h:75
prod_id_desc
uint8_t prod_id_desc[]
Definition: maxim_usb_uart_descriptors.h:321
endpoint_descriptor_3
MXC_USB_endpoint_descriptor_t endpoint_descriptor_3
Definition: maxim_usb_uart_descriptors.h:96
union_functional_descriptor
uint8_t union_functional_descriptor[5]
Definition: maxim_usb_uart_descriptors.h:94
call_management_descriptor
uint8_t call_management_descriptor[5]
Definition: maxim_usb_uart_descriptors.h:92
device_descriptor
MXC_USB_device_descriptor_t device_descriptor
Definition: maxim_usb_uart_descriptors.h:55
endpoint_descriptor_2
MXC_USB_endpoint_descriptor_t endpoint_descriptor_2
Definition: maxim_usb_uart_descriptors.h:76
data_interface_descriptor
MXC_USB_interface_descriptor_t data_interface_descriptor
Definition: maxim_usb_uart_descriptors.h:97
lang_id_desc
uint8_t lang_id_desc[]
Definition: maxim_usb_uart_descriptors.h:308
config_descriptor
MXC_USB_configuration_descriptor_t config_descriptor
Definition: maxim_usb_uart_descriptors.h:88
comm_interface_descriptor
MXC_USB_interface_descriptor_t comm_interface_descriptor
Definition: maxim_usb_uart_descriptors.h:90
header_functional_descriptor
uint8_t header_functional_descriptor[5]
Definition: maxim_usb_uart_descriptors.h:91