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