Contiki-NG
cdc-acm-descriptors.c
1 #include "descriptors.h"
2 #include <contiki-conf.h>
3 #include <cdc.h>
4 #include <usb-arch.h>
5 
6 const struct usb_st_device_descriptor device_descriptor =
7  {
8  sizeof(struct usb_st_device_descriptor),
9  DEVICE,
10  0x0210,
11  CDC,
12  0,
13  0,
14  CTRL_EP_SIZE,
15  0xffff,
16  0xffff,
17  0x0030,
18  2,
19  1,
20  3,
21  1
22  };
23 
24 const struct configuration_st {
25  struct usb_st_configuration_descriptor configuration;
26  struct usb_st_interface_descriptor comm;
27  struct usb_cdc_header_func_descriptor header;
28  struct usb_cdc_abstract_ctrl_mgmnt_func_descriptor abstract_ctrl;
29  struct usb_cdc_union_func_descriptor union_descr;
30  struct usb_cdc_call_mgmnt_func_descriptor call_mgmt;
31 #if 1
32  struct usb_st_endpoint_descriptor ep_notification;
33 #endif
34  struct usb_st_interface_descriptor data;
35  struct usb_st_endpoint_descriptor ep_in;
36  struct usb_st_endpoint_descriptor ep_out;
37 } BYTE_ALIGNED configuration_block =
38  {
39  /* Configuration */
40  {
41  sizeof(configuration_block.configuration),
42  CONFIGURATION,
43  sizeof(configuration_block),
44  2,
45  1,
46  0,
47  0x80,
48  50
49  },
50  {
51  sizeof(configuration_block.comm),
52  INTERFACE,
53  0,
54  0,
55  1,
56  CDC,
57  ABSTRACT_CONTROL_MODEL,
58  V_25TER_PROTOCOL,
59  0
60  },
61  {
62  sizeof(configuration_block.header),
63  CS_INTERFACE,
64  CDC_FUNC_DESCR_HEADER,
65  0x0110
66  },
67  {
68  sizeof(configuration_block.abstract_ctrl),
69  CS_INTERFACE,
70  CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT,
71  0
72  },
73  {
74  sizeof(configuration_block.union_descr),
75  CS_INTERFACE,
76  CDC_FUNC_DESCR_UNION,
77  0, /* Master */
78  {1} /* Slave */
79  },
80  {
81  sizeof(configuration_block.call_mgmt),
82  CS_INTERFACE,
83  CDC_FUNC_DESCR_CALL_MGMNT,
84  0x02,
85  1 /* data interface */
86  },
87  {
88  sizeof(configuration_block.ep_notification),
89  ENDPOINT,
90  0x83,
91  0x03,
92  USB_EP3_SIZE,
93  100
94  },
95  {
96  sizeof(configuration_block.data),
97  INTERFACE,
98  1,
99  0,
100  2,
101  CDC_DATA,
102  0,
103  TRANSPARENT_PROTOCOL,
104  0
105  },
106  {
107  sizeof(configuration_block.ep_in),
108  ENDPOINT,
109  0x81,
110  0x02,
111  USB_EP1_SIZE,
112  0
113  },
114  {
115  sizeof(configuration_block.ep_out),
116  ENDPOINT,
117  0x02,
118  0x02,
119  USB_EP2_SIZE,
120  0
121  }
122 
123  };
124 
125 const struct usb_st_configuration_descriptor* const configuration_head =
126 (const struct usb_st_configuration_descriptor*)&configuration_block;