Contiki 2.6

cdc-acm-descriptors.c

00001 #include "descriptors.h"
00002 #include <contiki-conf.h>
00003 #include <cdc.h>
00004 #include <usb-arch.h>
00005 
00006 const struct usb_st_device_descriptor device_descriptor =
00007   {
00008     sizeof(struct usb_st_device_descriptor),
00009     DEVICE,
00010     0x0210,
00011     CDC,
00012     0,
00013     0,
00014     CTRL_EP_SIZE,
00015     0xffff,
00016     0xffff,
00017     0x0030,
00018     2,
00019     1,
00020     3,
00021     1
00022   };
00023 
00024 const struct configuration_st {
00025   struct usb_st_configuration_descriptor configuration;
00026   struct usb_st_interface_descriptor comm;
00027   struct usb_cdc_header_func_descriptor header;
00028   struct usb_cdc_abstract_ctrl_mgmnt_func_descriptor abstract_ctrl;
00029   struct usb_cdc_union_func_descriptor union_descr;
00030   struct usb_cdc_call_mgmnt_func_descriptor call_mgmt;
00031 #if 1
00032   struct usb_st_endpoint_descriptor ep_notification;
00033 #endif
00034   struct usb_st_interface_descriptor data;
00035   struct usb_st_endpoint_descriptor ep_in;
00036   struct usb_st_endpoint_descriptor ep_out;
00037 } BYTE_ALIGNED configuration_block =
00038   {
00039     /* Configuration */
00040     {
00041       sizeof(configuration_block.configuration),
00042       CONFIGURATION,
00043       sizeof(configuration_block),
00044       2,
00045       1,
00046       0,
00047       0x80,
00048       50
00049     },
00050     {
00051       sizeof(configuration_block.comm),
00052       INTERFACE,
00053       0,
00054       0,
00055       1,
00056       CDC,
00057       ABSTRACT_CONTROL_MODEL,
00058       V_25TER_PROTOCOL,
00059       0
00060     },
00061     {
00062       sizeof(configuration_block.header),
00063       CS_INTERFACE,
00064       CDC_FUNC_DESCR_HEADER,
00065       0x0110
00066     },
00067     {
00068       sizeof(configuration_block.abstract_ctrl),
00069       CS_INTERFACE,
00070       CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT,
00071       0
00072     },
00073     {
00074       sizeof(configuration_block.union_descr),
00075       CS_INTERFACE,
00076       CDC_FUNC_DESCR_UNION,
00077       0, /* Master */
00078       {1}  /* Slave */
00079     },
00080     {
00081       sizeof(configuration_block.call_mgmt),
00082       CS_INTERFACE,
00083       CDC_FUNC_DESCR_CALL_MGMNT,
00084       0x02,
00085       1 /* data interface */
00086     },
00087     {
00088       sizeof(configuration_block.ep_notification),
00089       ENDPOINT,
00090       0x83,
00091       0x03,
00092       USB_EP3_SIZE,
00093       100
00094     },
00095     {
00096       sizeof(configuration_block.data),
00097       INTERFACE,
00098       1,
00099       0,
00100       2,
00101       CDC_DATA,
00102       0,
00103       TRANSPARENT_PROTOCOL,
00104       0
00105     },
00106     {
00107       sizeof(configuration_block.ep_in),
00108       ENDPOINT,
00109       0x81,
00110       0x02,
00111       USB_EP1_SIZE,
00112       0
00113     },
00114     {
00115       sizeof(configuration_block.ep_out),
00116       ENDPOINT,
00117       0x02,
00118       0x02,
00119       USB_EP2_SIZE,
00120       0
00121     }
00122           
00123   };
00124 
00125 const struct usb_st_configuration_descriptor const *configuration_head =
00126 (struct usb_st_configuration_descriptor const*)&configuration_block;