cc2531: change cdc-acm descriptor

Change to have a real usb VID/PID and better fit the capabilities
of the CC2531 hardware (enpoint size, location).

Compile only if the cdc-acm class is requested.

See Pull Request #18
This commit is contained in:
Philippe Rétornaz 2012-08-07 15:16:31 +02:00 committed by George Oikonomou
parent 0e55eb0947
commit dec34c21ef

View File

@ -3,20 +3,22 @@
#include "cdc.h" #include "cdc.h"
#include "usb-arch.h" #include "usb-arch.h"
#if USB_CONF_CLASS == 1
const struct usb_st_device_descriptor device_descriptor = const struct usb_st_device_descriptor device_descriptor =
{ {
sizeof(struct usb_st_device_descriptor), sizeof(struct usb_st_device_descriptor),
DEVICE, DEVICE,
0x0210, 0x0200,
CDC, CDC,
0, 0,
0, 0,
CTRL_EP_SIZE, CTRL_EP_SIZE,
0xffff, 0x0617, /* EPFL usb ID */
0xffff, 0x000B, /* Don't mess with it please */
0x0030, 0x0000,
2,
1, 1,
2,
3, 3,
1 1
}; };
@ -45,7 +47,7 @@ const struct configuration_st {
1, 1,
0, 0,
0x80, 0x80,
50 250
}, },
{ {
sizeof(configuration_block.comm), sizeof(configuration_block.comm),
@ -68,7 +70,7 @@ const struct configuration_st {
sizeof(configuration_block.abstract_ctrl), sizeof(configuration_block.abstract_ctrl),
CS_INTERFACE, CS_INTERFACE,
CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT, CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT,
0 0x2, // Set line coding
}, },
{ {
sizeof(configuration_block.union_descr), sizeof(configuration_block.union_descr),
@ -81,16 +83,16 @@ const struct configuration_st {
sizeof(configuration_block.call_mgmt), sizeof(configuration_block.call_mgmt),
CS_INTERFACE, CS_INTERFACE,
CDC_FUNC_DESCR_CALL_MGMNT, CDC_FUNC_DESCR_CALL_MGMNT,
0x02, 0x00,
1 /* data interface */ 1 /* data interface */
}, },
{ {
sizeof(configuration_block.ep_notification), sizeof(configuration_block.ep_notification),
ENDPOINT, ENDPOINT,
0x83, 0x81,
0x03, 0x03,
USB_EP3_SIZE, USB_EP1_SIZE,
100 255 /* 255ms polling, not really used so maximum value used */
}, },
{ {
sizeof(configuration_block.data), sizeof(configuration_block.data),
@ -100,27 +102,29 @@ const struct configuration_st {
2, 2,
CDC_DATA, CDC_DATA,
0, 0,
TRANSPARENT_PROTOCOL, /*TRANSPARENT_PROTOCOL*/ 0,
0 0
}, },
{ {
sizeof(configuration_block.ep_in), sizeof(configuration_block.ep_in),
ENDPOINT, ENDPOINT,
0x81, 0x82,
0x02, 0x02,
USB_EP1_SIZE, USB_EP2_SIZE,
0 0
}, },
{ {
sizeof(configuration_block.ep_out), sizeof(configuration_block.ep_out),
ENDPOINT, ENDPOINT,
0x03,
0x02, 0x02,
0x02, USB_EP3_SIZE,
USB_EP2_SIZE,
0 0
} }
}; };
const struct usb_st_configuration_descriptor const *configuration_head = const struct usb_st_configuration_descriptor const *configuration_head =
(struct usb_st_configuration_descriptor const*)&configuration_block; (struct usb_st_configuration_descriptor const*)&configuration_block;
#endif