diff options
| author | hathach <[email protected]> | 2018-03-23 12:42:30 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-23 12:42:30 +0700 |
| commit | 3e5e1f70bfc320b1940a2ab0771b1dd23e6744f3 (patch) | |
| tree | 52c0db749eec3a85542ddcd4513b98cec352d533 /examples/device | |
| parent | 5f26c57b286ecdc555856c1e3e486923a43f4d04 (diff) | |
more shorten name
Diffstat (limited to 'examples/device')
4 files changed, 116 insertions, 111 deletions
diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.c b/examples/device/device_virtual_com/src/tusb_descriptors.c index 253bed21d..5f502fc6a 100644 --- a/examples/device/device_virtual_com/src/tusb_descriptors.c +++ b/examples/device/device_virtual_com/src/tusb_descriptors.c @@ -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 diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.h b/examples/device/device_virtual_com/src/tusb_descriptors.h index ae6872900..db7b00051 100644 --- a/examples/device/device_virtual_com/src/tusb_descriptors.h +++ b/examples/device/device_virtual_com/src/tusb_descriptors.h @@ -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; diff --git a/examples/device/nrf52840/src/tusb_descriptors.c b/examples/device/nrf52840/src/tusb_descriptors.c index 253bed21d..5e1e421f1 100644 --- a/examples/device/nrf52840/src/tusb_descriptors.c +++ b/examples/device/nrf52840/src/tusb_descriptors.c @@ -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 + }, + } }; //--------------------------------------------------------------------+ diff --git a/examples/device/nrf52840/src/tusb_descriptors.h b/examples/device/nrf52840/src/tusb_descriptors.h index ae6872900..5a82764f4 100644 --- a/examples/device/nrf52840/src/tusb_descriptors.h +++ b/examples/device/nrf52840/src/tusb_descriptors.h @@ -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; |
