mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-18 21:41:12 +00:00
more shorten name
This commit is contained in:
parent
5f26c57b28
commit
3e5e1f70bf
@ -133,7 +133,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_acm =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_abstract_control_management_t),
|
||||
.bLength = sizeof(cdc_desc_func_acm_t),
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { // 0x02
|
||||
|
@ -87,7 +87,7 @@ typedef struct ATTR_PACKED
|
||||
tusb_desc_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_acm_t cdc_acm;
|
||||
cdc_desc_func_union_t cdc_union;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
|
@ -86,113 +86,116 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
},
|
||||
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc_iad =
|
||||
.cdc =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_interface_assoc_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION,
|
||||
.iad =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_interface_assoc_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION,
|
||||
|
||||
.bFirstInterface = INTERFACE_NO_CDC,
|
||||
.bInterfaceCount = 2,
|
||||
.bFirstInterface = INTERFACE_NO_CDC,
|
||||
.bInterfaceCount = 2,
|
||||
|
||||
.bFunctionClass = TUSB_CLASS_CDC,
|
||||
.bFunctionSubClass = CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL,
|
||||
.bFunctionProtocol = CDC_COMM_PROTOCOL_ATCOMMAND,
|
||||
.iFunction = 0
|
||||
},
|
||||
.bFunctionClass = TUSB_CLASS_CDC,
|
||||
.bFunctionSubClass = CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL,
|
||||
.bFunctionProtocol = CDC_COMM_PROTOCOL_ATCOMMAND,
|
||||
.iFunction = 0
|
||||
},
|
||||
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC,
|
||||
.bAlternateSetting = 0,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = TUSB_CLASS_CDC,
|
||||
.bInterfaceSubClass = CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL,
|
||||
.bInterfaceProtocol = CDC_COMM_PROTOCOL_ATCOMMAND,
|
||||
.iInterface = 0x00
|
||||
},
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.comm_itf =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC,
|
||||
.bAlternateSetting = 0,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = TUSB_CLASS_CDC,
|
||||
.bInterfaceSubClass = CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL,
|
||||
.bInterfaceProtocol = CDC_COMM_PROTOCOL_ATCOMMAND,
|
||||
.iInterface = 0x00
|
||||
},
|
||||
|
||||
.cdc_header =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_header_t),
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_HEADER,
|
||||
.bcdCDC = 0x0120
|
||||
},
|
||||
.header =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_header_t),
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_HEADER,
|
||||
.bcdCDC = 0x0120
|
||||
},
|
||||
|
||||
.cdc_call =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_call_management_t),
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_CALL_MANAGEMENT,
|
||||
.bmCapabilities = { 0 },
|
||||
.bDataInterface = INTERFACE_NO_CDC+1,
|
||||
},
|
||||
.call =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_call_management_t),
|
||||
.bDescriptorType = TUSB_DESC_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_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { // 0x02
|
||||
.support_line_request = 1,
|
||||
}
|
||||
},
|
||||
.acm =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_acm_t),
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { // 0x02
|
||||
.support_line_request = 1,
|
||||
}
|
||||
},
|
||||
|
||||
.cdc_union =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_union_t), // plus number of
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_UNION,
|
||||
.bControlInterface = INTERFACE_NO_CDC,
|
||||
.bSubordinateInterface = INTERFACE_NO_CDC+1,
|
||||
},
|
||||
.union_func =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_union_t), // plus number of
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_UNION,
|
||||
.bControlInterface = INTERFACE_NO_CDC,
|
||||
.bSubordinateInterface = INTERFACE_NO_CDC+1,
|
||||
},
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
.wMaxPacketSize = { .size = 0x08 },
|
||||
.bInterval = 0x10
|
||||
},
|
||||
.ep_notif =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
.wMaxPacketSize = { .size = 0x08 },
|
||||
.bInterval = 0x10
|
||||
},
|
||||
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC+1,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 2,
|
||||
.bInterfaceClass = TUSB_CLASS_CDC_DATA,
|
||||
.bInterfaceSubClass = 0,
|
||||
.bInterfaceProtocol = 0,
|
||||
.iInterface = 0x00
|
||||
},
|
||||
//------------- CDC Data Interface -------------//
|
||||
.data_itf =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC+1,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 2,
|
||||
.bInterfaceClass = TUSB_CLASS_CDC_DATA,
|
||||
.bInterfaceSubClass = 0,
|
||||
.bInterfaceProtocol = 0,
|
||||
.iInterface = 0x00
|
||||
},
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
|
||||
.bInterval = 0
|
||||
},
|
||||
.ep_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
|
||||
.bInterval = 0
|
||||
},
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
|
||||
.bInterval = 0
|
||||
},
|
||||
.ep_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
|
||||
.bInterval = 0
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -78,23 +78,25 @@
|
||||
//--------------------------------------------------------------------+
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
tusb_desc_configuration_t configuration;
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
//------------- CDC -------------//
|
||||
tusb_desc_interface_assoc_t cdc_iad;
|
||||
struct ATTR_PACKED
|
||||
{
|
||||
tusb_desc_interface_assoc_t iad;
|
||||
|
||||
//CDC Control Interface
|
||||
tusb_desc_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_desc_endpoint_t cdc_endpoint_notification;
|
||||
//CDC Control Interface
|
||||
tusb_desc_interface_t comm_itf;
|
||||
cdc_desc_func_header_t header;
|
||||
cdc_desc_func_call_management_t call;
|
||||
cdc_desc_func_acm_t acm;
|
||||
cdc_desc_func_union_t union_func;
|
||||
tusb_desc_endpoint_t ep_notif;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_desc_interface_t cdc_data_interface;
|
||||
tusb_desc_endpoint_t cdc_endpoint_out;
|
||||
tusb_desc_endpoint_t cdc_endpoint_in;
|
||||
//CDC Data Interface
|
||||
tusb_desc_interface_t data_itf;
|
||||
tusb_desc_endpoint_t ep_out;
|
||||
tusb_desc_endpoint_t ep_in;
|
||||
}cdc;
|
||||
|
||||
} app_descriptor_configuration_t;
|
||||
|
||||
|
@ -233,7 +233,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_acm =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_abstract_control_management_t),
|
||||
.bLength = sizeof(cdc_desc_func_acm_t),
|
||||
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { // 0x02
|
||||
|
@ -142,7 +142,7 @@ typedef struct ATTR_PACKED
|
||||
tusb_desc_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_acm_t cdc_acm;
|
||||
cdc_desc_func_union_t cdc_union;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
|
@ -101,7 +101,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
|
||||
.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,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { // 0x06
|
||||
@ -227,7 +227,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
|
||||
.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,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { 0 }
|
||||
|
@ -62,7 +62,7 @@ typedef struct
|
||||
//CDC Control Interface
|
||||
tusb_desc_interface_t cdc_comm_interface;
|
||||
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;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
|
@ -125,7 +125,7 @@ void test_cdch_open_length_check(void)
|
||||
const uint16_t expected_length =
|
||||
//------------- Comm Interface -------------//
|
||||
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) +
|
||||
//------------- Data Interface -------------//
|
||||
sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
|
||||
|
@ -203,7 +203,7 @@ tusb_error_t stub_cdch_open(uint8_t dev_addr, tusb_desc_interface_t const *descr
|
||||
*p_length =
|
||||
//------------- Comm Interface -------------//
|
||||
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) +
|
||||
//------------- Data Interface -------------//
|
||||
sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
|
||||
|
@ -287,7 +287,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.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,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { // 0x06
|
||||
|
@ -103,7 +103,7 @@ typedef struct
|
||||
//CDC Control Interface
|
||||
tusb_desc_interface_t cdc_comm_interface;
|
||||
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;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
|
@ -310,7 +310,7 @@ typedef struct ATTR_PACKED
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
cdc_acm_capability_t bmCapabilities ;
|
||||
}cdc_desc_func_abstract_control_management_t;
|
||||
}cdc_desc_func_acm_t;
|
||||
|
||||
/// \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
|
||||
|
@ -150,7 +150,7 @@ tusb_error_t cdcd_open(uint8_t rhport, tusb_desc_interface_t const * p_interface
|
||||
{ // Communication Functional Descriptors
|
||||
if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) )
|
||||
{ // 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];
|
||||
|
@ -171,7 +171,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_
|
||||
{ // Communication Functional Descriptors
|
||||
if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) )
|
||||
{ // 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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user