summaryrefslogtreecommitdiff
path: root/examples/device/device_virtual_com
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-23 14:15:35 +0700
committerhathach <[email protected]>2018-03-23 14:15:35 +0700
commite8b0500d403e71da5898cdce01708e0f8111813c (patch)
tree00398807f5412ae27c9464dd69a6da2a9f077aad /examples/device/device_virtual_com
parent3e5e1f70bfc320b1940a2ab0771b1dd23e6744f3 (diff)
MSC tested with nrf52840
Diffstat (limited to 'examples/device/device_virtual_com')
-rw-r--r--examples/device/device_virtual_com/src/tusb_descriptors.c24
-rw-r--r--examples/device/device_virtual_com/src/tusb_descriptors.h12
2 files changed, 18 insertions, 18 deletions
diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.c b/examples/device/device_virtual_com/src/tusb_descriptors.c
index 5f502fc6a..74954ba1c 100644
--- a/examples/device/device_virtual_com/src/tusb_descriptors.c
+++ b/examples/device/device_virtual_com/src/tusb_descriptors.c
@@ -77,7 +77,7 @@ app_descriptor_configuration_t const desc_configuration =
.bDescriptorType = TUSB_DESC_CONFIGURATION,
.wTotalLength = sizeof(app_descriptor_configuration_t),
- .bNumInterfaces = TOTAL_INTEFACES,
+ .bNumInterfaces = ITF_TOTAL,
.bConfigurationValue = 1,
.iConfiguration = 0x00,
@@ -91,7 +91,7 @@ app_descriptor_configuration_t const desc_configuration =
.bLength = sizeof(tusb_desc_interface_assoc_t),
.bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION,
- .bFirstInterface = INTERFACE_NO_CDC,
+ .bFirstInterface = ITF_NUM_CDC,
.bInterfaceCount = 2,
.bFunctionClass = TUSB_CLASS_CDC,
@@ -105,7 +105,7 @@ app_descriptor_configuration_t const desc_configuration =
{
.bLength = sizeof(tusb_desc_interface_t),
.bDescriptorType = TUSB_DESC_INTERFACE,
- .bInterfaceNumber = INTERFACE_NO_CDC,
+ .bInterfaceNumber = ITF_NUM_CDC,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = TUSB_CLASS_CDC,
@@ -128,7 +128,7 @@ app_descriptor_configuration_t const desc_configuration =
.bDescriptorType = TUSB_DESC_CLASS_SPECIFIC,
.bDescriptorSubType = CDC_FUNC_DESC_CALL_MANAGEMENT,
.bmCapabilities = { 0 },
- .bDataInterface = INTERFACE_NO_CDC+1,
+ .bDataInterface = ITF_NUM_CDC+1,
},
.cdc_acm =
@@ -146,15 +146,15 @@ app_descriptor_configuration_t const desc_configuration =
.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,
+ .bControlInterface = ITF_NUM_CDC,
+ .bSubordinateInterface = ITF_NUM_CDC+1,
},
.cdc_endpoint_notification =
{
.bLength = sizeof(tusb_desc_endpoint_t),
.bDescriptorType = TUSB_DESC_ENDPOINT,
- .bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
+ .bEndpointAddress = CDC_EDPT_NOTIF,
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
.wMaxPacketSize = { .size = 0x08 },
.bInterval = 0x10
@@ -165,7 +165,7 @@ app_descriptor_configuration_t const desc_configuration =
{
.bLength = sizeof(tusb_desc_interface_t),
.bDescriptorType = TUSB_DESC_INTERFACE,
- .bInterfaceNumber = INTERFACE_NO_CDC+1,
+ .bInterfaceNumber = ITF_NUM_CDC+1,
.bAlternateSetting = 0x00,
.bNumEndpoints = 2,
.bInterfaceClass = TUSB_CLASS_CDC_DATA,
@@ -178,9 +178,9 @@ app_descriptor_configuration_t const desc_configuration =
{
.bLength = sizeof(tusb_desc_endpoint_t),
.bDescriptorType = TUSB_DESC_ENDPOINT,
- .bEndpointAddress = CDC_EDPT_DATA_OUT_ADDR,
+ .bEndpointAddress = CDC_EDPT_OUT,
.bmAttributes = { .xfer = TUSB_XFER_BULK },
- .wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
+ .wMaxPacketSize = { .size = CDC_EDPT_SIZE },
.bInterval = 0
},
@@ -188,9 +188,9 @@ app_descriptor_configuration_t const desc_configuration =
{
.bLength = sizeof(tusb_desc_endpoint_t),
.bDescriptorType = TUSB_DESC_ENDPOINT,
- .bEndpointAddress = CDC_EDPT_DATA_IN_ADDR,
+ .bEndpointAddress = CDC_EDPT_IN,
.bmAttributes = { .xfer = TUSB_XFER_BULK },
- .wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
+ .wMaxPacketSize = { .size = CDC_EDPT_SIZE },
.bInterval = 0
},
};
diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.h b/examples/device/device_virtual_com/src/tusb_descriptors.h
index db7b00051..af200946c 100644
--- a/examples/device/device_virtual_com/src/tusb_descriptors.h
+++ b/examples/device/device_virtual_com/src/tusb_descriptors.h
@@ -56,8 +56,8 @@
PRODUCTID_BITMAP(MSC, 4) ) )
#endif
-#define INTERFACE_NO_CDC 0
-#define TOTAL_INTEFACES 2
+#define ITF_NUM_CDC 0
+#define ITF_TOTAL 2
//--------------------------------------------------------------------+
// Endpoints Address & Max Packet Size
@@ -65,12 +65,12 @@
#define EDPT_IN(x) (0x80 | (x))
#define EDPT_OUT(x) (x)
-#define CDC_EDPT_NOTIFICATION_ADDR EDPT_IN (1)
+#define CDC_EDPT_NOTIF EDPT_IN (1)
#define CDC_EDPT_NOTIFICATION_PACKETSIZE 64
-#define CDC_EDPT_DATA_OUT_ADDR EDPT_OUT(2)
-#define CDC_EDPT_DATA_IN_ADDR EDPT_IN (2)
-#define CDC_EDPT_DATA_PACKETSIZE 64
+#define CDC_EDPT_OUT EDPT_OUT(2)
+#define CDC_EDPT_IN EDPT_IN (2)
+#define CDC_EDPT_SIZE 64
//--------------------------------------------------------------------+