more shorten name

This commit is contained in:
hathach 2018-03-23 12:42:30 +07:00
parent 5f26c57b28
commit 3e5e1f70bf
15 changed files with 128 additions and 123 deletions

View File

@ -133,7 +133,7 @@ app_descriptor_configuration_t const desc_configuration =
.cdc_acm = .cdc_acm =
{ {
.bLength = sizeof(cdc_desc_func_abstract_control_management_t), .bLength = sizeof(cdc_desc_func_acm_t),
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, .bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
.bmCapabilities = { // 0x02 .bmCapabilities = { // 0x02

View File

@ -87,7 +87,7 @@ typedef struct ATTR_PACKED
tusb_desc_interface_t cdc_comm_interface; tusb_desc_interface_t cdc_comm_interface;
cdc_desc_func_header_t cdc_header; cdc_desc_func_header_t cdc_header;
cdc_desc_func_call_management_t cdc_call; cdc_desc_func_call_management_t cdc_call;
cdc_desc_func_abstract_control_management_t cdc_acm; cdc_desc_func_acm_t cdc_acm;
cdc_desc_func_union_t cdc_union; cdc_desc_func_union_t cdc_union;
tusb_desc_endpoint_t cdc_endpoint_notification; tusb_desc_endpoint_t cdc_endpoint_notification;

View File

@ -86,7 +86,9 @@ app_descriptor_configuration_t const desc_configuration =
}, },
// IAD points to CDC Interfaces // IAD points to CDC Interfaces
.cdc_iad = .cdc =
{
.iad =
{ {
.bLength = sizeof(tusb_desc_interface_assoc_t), .bLength = sizeof(tusb_desc_interface_assoc_t),
.bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION, .bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION,
@ -101,7 +103,7 @@ app_descriptor_configuration_t const desc_configuration =
}, },
//------------- CDC Communication Interface -------------// //------------- CDC Communication Interface -------------//
.cdc_comm_interface = .comm_itf =
{ {
.bLength = sizeof(tusb_desc_interface_t), .bLength = sizeof(tusb_desc_interface_t),
.bDescriptorType = TUSB_DESC_INTERFACE, .bDescriptorType = TUSB_DESC_INTERFACE,
@ -114,7 +116,7 @@ app_descriptor_configuration_t const desc_configuration =
.iInterface = 0x00 .iInterface = 0x00
}, },
.cdc_header = .header =
{ {
.bLength = sizeof(cdc_desc_func_header_t), .bLength = sizeof(cdc_desc_func_header_t),
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
@ -122,7 +124,7 @@ app_descriptor_configuration_t const desc_configuration =
.bcdCDC = 0x0120 .bcdCDC = 0x0120
}, },
.cdc_call = .call =
{ {
.bLength = sizeof(cdc_desc_func_call_management_t), .bLength = sizeof(cdc_desc_func_call_management_t),
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
@ -131,9 +133,9 @@ app_descriptor_configuration_t const desc_configuration =
.bDataInterface = INTERFACE_NO_CDC+1, .bDataInterface = INTERFACE_NO_CDC+1,
}, },
.cdc_acm = .acm =
{ {
.bLength = sizeof(cdc_desc_func_abstract_control_management_t), .bLength = sizeof(cdc_desc_func_acm_t),
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, .bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
.bmCapabilities = { // 0x02 .bmCapabilities = { // 0x02
@ -141,7 +143,7 @@ app_descriptor_configuration_t const desc_configuration =
} }
}, },
.cdc_union = .union_func =
{ {
.bLength = sizeof(cdc_desc_func_union_t), // plus number of .bLength = sizeof(cdc_desc_func_union_t), // plus number of
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
@ -150,7 +152,7 @@ app_descriptor_configuration_t const desc_configuration =
.bSubordinateInterface = INTERFACE_NO_CDC+1, .bSubordinateInterface = INTERFACE_NO_CDC+1,
}, },
.cdc_endpoint_notification = .ep_notif =
{ {
.bLength = sizeof(tusb_desc_endpoint_t), .bLength = sizeof(tusb_desc_endpoint_t),
.bDescriptorType = TUSB_DESC_ENDPOINT, .bDescriptorType = TUSB_DESC_ENDPOINT,
@ -161,7 +163,7 @@ app_descriptor_configuration_t const desc_configuration =
}, },
//------------- CDC Data Interface -------------// //------------- CDC Data Interface -------------//
.cdc_data_interface = .data_itf =
{ {
.bLength = sizeof(tusb_desc_interface_t), .bLength = sizeof(tusb_desc_interface_t),
.bDescriptorType = TUSB_DESC_INTERFACE, .bDescriptorType = TUSB_DESC_INTERFACE,
@ -174,7 +176,7 @@ app_descriptor_configuration_t const desc_configuration =
.iInterface = 0x00 .iInterface = 0x00
}, },
.cdc_endpoint_out = .ep_out =
{ {
.bLength = sizeof(tusb_desc_endpoint_t), .bLength = sizeof(tusb_desc_endpoint_t),
.bDescriptorType = TUSB_DESC_ENDPOINT, .bDescriptorType = TUSB_DESC_ENDPOINT,
@ -184,7 +186,7 @@ app_descriptor_configuration_t const desc_configuration =
.bInterval = 0 .bInterval = 0
}, },
.cdc_endpoint_in = .ep_in =
{ {
.bLength = sizeof(tusb_desc_endpoint_t), .bLength = sizeof(tusb_desc_endpoint_t),
.bDescriptorType = TUSB_DESC_ENDPOINT, .bDescriptorType = TUSB_DESC_ENDPOINT,
@ -193,6 +195,7 @@ app_descriptor_configuration_t const desc_configuration =
.wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE }, .wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
.bInterval = 0 .bInterval = 0
}, },
}
}; };
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+

View File

@ -80,21 +80,23 @@ typedef struct ATTR_PACKED
{ {
tusb_desc_configuration_t configuration; tusb_desc_configuration_t configuration;
//------------- CDC -------------// struct ATTR_PACKED
tusb_desc_interface_assoc_t cdc_iad; {
tusb_desc_interface_assoc_t iad;
//CDC Control Interface //CDC Control Interface
tusb_desc_interface_t cdc_comm_interface; tusb_desc_interface_t comm_itf;
cdc_desc_func_header_t cdc_header; cdc_desc_func_header_t header;
cdc_desc_func_call_management_t cdc_call; cdc_desc_func_call_management_t call;
cdc_desc_func_abstract_control_management_t cdc_acm; cdc_desc_func_acm_t acm;
cdc_desc_func_union_t cdc_union; cdc_desc_func_union_t union_func;
tusb_desc_endpoint_t cdc_endpoint_notification; tusb_desc_endpoint_t ep_notif;
//CDC Data Interface //CDC Data Interface
tusb_desc_interface_t cdc_data_interface; tusb_desc_interface_t data_itf;
tusb_desc_endpoint_t cdc_endpoint_out; tusb_desc_endpoint_t ep_out;
tusb_desc_endpoint_t cdc_endpoint_in; tusb_desc_endpoint_t ep_in;
}cdc;
} app_descriptor_configuration_t; } app_descriptor_configuration_t;

View File

@ -233,7 +233,7 @@ app_descriptor_configuration_t const desc_configuration =
.cdc_acm = .cdc_acm =
{ {
.bLength = sizeof(cdc_desc_func_abstract_control_management_t), .bLength = sizeof(cdc_desc_func_acm_t),
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, .bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
.bmCapabilities = { // 0x02 .bmCapabilities = { // 0x02

View File

@ -142,7 +142,7 @@ typedef struct ATTR_PACKED
tusb_desc_interface_t cdc_comm_interface; tusb_desc_interface_t cdc_comm_interface;
cdc_desc_func_header_t cdc_header; cdc_desc_func_header_t cdc_header;
cdc_desc_func_call_management_t cdc_call; cdc_desc_func_call_management_t cdc_call;
cdc_desc_func_abstract_control_management_t cdc_acm; cdc_desc_func_acm_t cdc_acm;
cdc_desc_func_union_t cdc_union; cdc_desc_func_union_t cdc_union;
tusb_desc_endpoint_t cdc_endpoint_notification; tusb_desc_endpoint_t cdc_endpoint_notification;

View File

@ -101,7 +101,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
.cdc_acm = .cdc_acm =
{ {
.bLength = sizeof(cdc_desc_func_abstract_control_management_t), .bLength = sizeof(cdc_desc_func_acm_t),
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, .bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
.bmCapabilities = { // 0x06 .bmCapabilities = { // 0x06
@ -227,7 +227,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
.cdc_acm = .cdc_acm =
{ {
.bLength = sizeof(cdc_desc_func_abstract_control_management_t), .bLength = sizeof(cdc_desc_func_acm_t),
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, .bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
.bmCapabilities = { 0 } .bmCapabilities = { 0 }

View File

@ -62,7 +62,7 @@ typedef struct
//CDC Control Interface //CDC Control Interface
tusb_desc_interface_t cdc_comm_interface; tusb_desc_interface_t cdc_comm_interface;
cdc_desc_func_header_t cdc_header; cdc_desc_func_header_t cdc_header;
cdc_desc_func_abstract_control_management_t cdc_acm; cdc_desc_func_acm_t cdc_acm;
cdc_desc_func_union_t cdc_union; cdc_desc_func_union_t cdc_union;
tusb_desc_endpoint_t cdc_endpoint_notification; tusb_desc_endpoint_t cdc_endpoint_notification;

View File

@ -125,7 +125,7 @@ void test_cdch_open_length_check(void)
const uint16_t expected_length = const uint16_t expected_length =
//------------- Comm Interface -------------// //------------- Comm Interface -------------//
sizeof(tusb_desc_interface_t) + sizeof(cdc_desc_func_header_t) + sizeof(tusb_desc_interface_t) + sizeof(cdc_desc_func_header_t) +
sizeof(cdc_desc_func_abstract_control_management_t) + sizeof(cdc_desc_func_union_t) + sizeof(cdc_desc_func_acm_t) + sizeof(cdc_desc_func_union_t) +
sizeof(tusb_desc_endpoint_t) + sizeof(tusb_desc_endpoint_t) +
//------------- Data Interface -------------// //------------- Data Interface -------------//
sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t); sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);

View File

@ -203,7 +203,7 @@ tusb_error_t stub_cdch_open(uint8_t dev_addr, tusb_desc_interface_t const *descr
*p_length = *p_length =
//------------- Comm Interface -------------// //------------- Comm Interface -------------//
sizeof(tusb_desc_interface_t) + sizeof(cdc_desc_func_header_t) + sizeof(tusb_desc_interface_t) + sizeof(cdc_desc_func_header_t) +
sizeof(cdc_desc_func_abstract_control_management_t) + sizeof(cdc_desc_func_union_t) + sizeof(cdc_desc_func_acm_t) + sizeof(cdc_desc_func_union_t) +
sizeof(tusb_desc_endpoint_t) + sizeof(tusb_desc_endpoint_t) +
//------------- Data Interface -------------// //------------- Data Interface -------------//
sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t); sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);

View File

@ -287,7 +287,7 @@ const app_configuration_desc_t desc_configuration =
.cdc_acm = .cdc_acm =
{ {
.bLength = sizeof(cdc_desc_func_abstract_control_management_t), .bLength = sizeof(cdc_desc_func_acm_t),
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC, .bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, .bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
.bmCapabilities = { // 0x06 .bmCapabilities = { // 0x06

View File

@ -103,7 +103,7 @@ typedef struct
//CDC Control Interface //CDC Control Interface
tusb_desc_interface_t cdc_comm_interface; tusb_desc_interface_t cdc_comm_interface;
cdc_desc_func_header_t cdc_header; cdc_desc_func_header_t cdc_header;
cdc_desc_func_abstract_control_management_t cdc_acm; cdc_desc_func_acm_t cdc_acm;
cdc_desc_func_union_t cdc_union; cdc_desc_func_union_t cdc_union;
tusb_desc_endpoint_t cdc_endpoint_notification; tusb_desc_endpoint_t cdc_endpoint_notification;

View File

@ -310,7 +310,7 @@ typedef struct ATTR_PACKED
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_ uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
cdc_acm_capability_t bmCapabilities ; cdc_acm_capability_t bmCapabilities ;
}cdc_desc_func_abstract_control_management_t; }cdc_desc_func_acm_t;
/// \brief Direct Line Management Functional Descriptor /// \brief Direct Line Management Functional Descriptor
/// \details This functional descriptor describes the commands supported by the Communications Class interface with SubClass code of \ref CDC_FUNC_DESC_DIRECT_LINE_MANAGEMENT /// \details This functional descriptor describes the commands supported by the Communications Class interface with SubClass code of \ref CDC_FUNC_DESC_DIRECT_LINE_MANAGEMENT

View File

@ -150,7 +150,7 @@ tusb_error_t cdcd_open(uint8_t rhport, tusb_desc_interface_t const * p_interface
{ // Communication Functional Descriptors { // Communication Functional Descriptors
if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) ) if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) )
{ // save ACM bmCapabilities { // save ACM bmCapabilities
p_cdc->acm_capability = ((cdc_desc_func_abstract_control_management_t const *) p_desc)->bmCapabilities; p_cdc->acm_capability = ((cdc_desc_func_acm_t const *) p_desc)->bmCapabilities;
} }
(*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH]; (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH];

View File

@ -171,7 +171,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
{ // Communication Functional Descriptors { // Communication Functional Descriptors
if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) ) if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) )
{ // save ACM bmCapabilities { // save ACM bmCapabilities
p_cdc->acm_capability = ((cdc_desc_func_abstract_control_management_t const *) p_desc)->bmCapabilities; p_cdc->acm_capability = ((cdc_desc_func_acm_t const *) p_desc)->bmCapabilities;
} }
(*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH]; (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH];