summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-07 11:01:23 +0700
committerhathach <[email protected]>2018-03-07 11:01:23 +0700
commit321324a485190a9dce2c49ef7019fc0eda83299b (patch)
tree26273c02d1aa5585b842c9e69a55c0ec54e272ab /examples/device
parent7928eaf58a7ef4bd34ac14a2f82102d41484e817 (diff)
enhance cdc implementation
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/src/tusb_descriptors.c20
-rw-r--r--examples/device/src/tusb_descriptors.h3
2 files changed, 16 insertions, 7 deletions
diff --git a/examples/device/src/tusb_descriptors.c b/examples/device/src/tusb_descriptors.c
index 4a58161f1..82d9d1fbe 100644
--- a/examples/device/src/tusb_descriptors.c
+++ b/examples/device/src/tusb_descriptors.c
@@ -181,7 +181,7 @@ app_descriptor_configuration_t const desc_configuration =
.bConfigurationValue = 1,
.iConfiguration = 0x00,
.bmAttributes = TUSB_DESC_CONFIG_ATT_BUS_POWER,
- .bMaxPower = TUSB_DESC_CONFIG_POWER_MA(100)
+ .bMaxPower = TUSB_DESC_CONFIG_POWER_MA(500)
},
#if TUSB_CFG_DEVICE_CDC
@@ -222,14 +222,22 @@ app_descriptor_configuration_t const desc_configuration =
.bcdCDC = 0x0120
},
+ .cdc_call =
+ {
+ .bLength = sizeof(cdc_desc_func_call_management_t),
+ .bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
+ .bDescriptorSubType = CDC_FUNC_DESC_CALL_MANAGEMENT,
+ .bmCapabilities = { 0 },
+ .bDataInterface = INTERFACE_NO_CDC+1,
+ },
+
.cdc_acm =
{
.bLength = sizeof(cdc_desc_func_abstract_control_management_t),
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
- .bmCapabilities = { // 0x06
+ .bmCapabilities = { // 0x02
.support_line_request = 1,
- .support_send_break = 1
}
},
@@ -238,8 +246,8 @@ app_descriptor_configuration_t const desc_configuration =
.bLength = sizeof(cdc_desc_func_union_t), // plus number of
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_UNION,
- .bControlInterface = 0,
- .bSubordinateInterface = 1,
+ .bControlInterface = INTERFACE_NO_CDC,
+ .bSubordinateInterface = INTERFACE_NO_CDC+1,
},
.cdc_endpoint_notification =
@@ -249,7 +257,7 @@ app_descriptor_configuration_t const desc_configuration =
.bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
.wMaxPacketSize = { .size = 0x08 },
- .bInterval = 0x0a
+ .bInterval = 0x10
},
//------------- CDC Data Interface -------------//
diff --git a/examples/device/src/tusb_descriptors.h b/examples/device/src/tusb_descriptors.h
index e6a9c01a2..322af0392 100644
--- a/examples/device/src/tusb_descriptors.h
+++ b/examples/device/src/tusb_descriptors.h
@@ -130,7 +130,7 @@
//--------------------------------------------------------------------+
// CONFIGURATION DESCRIPTOR
//--------------------------------------------------------------------+
-typedef ATTR_PACKED_STRUCT(struct)
+typedef struct ATTR_PACKED
{
tusb_descriptor_configuration_t configuration;
@@ -141,6 +141,7 @@ typedef ATTR_PACKED_STRUCT(struct)
//CDC Control Interface
tusb_descriptor_interface_t cdc_comm_interface;
cdc_desc_func_header_t cdc_header;
+ cdc_desc_func_call_management_t cdc_call;
cdc_desc_func_abstract_control_management_t cdc_acm;
cdc_desc_func_union_t cdc_union;
tusb_descriptor_endpoint_t cdc_endpoint_notification;