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