shorten descriptor type
This commit is contained in:
@@ -41,9 +41,9 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// USB DEVICE DESCRIPTOR
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_descriptor_device_t const desc_device =
|
||||
tusb_desc_device_t const desc_device =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_device_t),
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
|
||||
@@ -73,7 +73,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bLength = sizeof(tusb_desc_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(app_descriptor_configuration_t),
|
||||
@@ -88,7 +88,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc_iad =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_association_t),
|
||||
.bLength = sizeof(tusb_desc_interface_assoc_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION,
|
||||
|
||||
.bFirstInterface = INTERFACE_NO_CDC,
|
||||
@@ -103,7 +103,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC,
|
||||
.bAlternateSetting = 0,
|
||||
@@ -152,7 +152,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -163,7 +163,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC+1,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -176,7 +176,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -186,7 +186,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
@@ -78,23 +78,23 @@
|
||||
//--------------------------------------------------------------------+
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
tusb_descriptor_configuration_t configuration;
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
//------------- CDC -------------//
|
||||
tusb_descriptor_interface_association_t cdc_iad;
|
||||
tusb_desc_interface_assoc_t cdc_iad;
|
||||
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t cdc_comm_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_descriptor_endpoint_t cdc_endpoint_notification;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t cdc_data_interface;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_out;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_in;
|
||||
tusb_desc_interface_t cdc_data_interface;
|
||||
tusb_desc_endpoint_t cdc_endpoint_out;
|
||||
tusb_desc_endpoint_t cdc_endpoint_in;
|
||||
|
||||
} app_descriptor_configuration_t;
|
||||
|
||||
|
@@ -41,9 +41,9 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// USB DEVICE DESCRIPTOR
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_descriptor_device_t const desc_device =
|
||||
tusb_desc_device_t const desc_device =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_device_t),
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
|
||||
@@ -73,7 +73,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bLength = sizeof(tusb_desc_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(app_descriptor_configuration_t),
|
||||
@@ -88,7 +88,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc_iad =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_association_t),
|
||||
.bLength = sizeof(tusb_desc_interface_assoc_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION,
|
||||
|
||||
.bFirstInterface = INTERFACE_NO_CDC,
|
||||
@@ -103,7 +103,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC,
|
||||
.bAlternateSetting = 0,
|
||||
@@ -152,7 +152,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -163,7 +163,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC+1,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -176,7 +176,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -186,7 +186,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
@@ -78,23 +78,23 @@
|
||||
//--------------------------------------------------------------------+
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
tusb_descriptor_configuration_t configuration;
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
//------------- CDC -------------//
|
||||
tusb_descriptor_interface_association_t cdc_iad;
|
||||
tusb_desc_interface_assoc_t cdc_iad;
|
||||
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t cdc_comm_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_descriptor_endpoint_t cdc_endpoint_notification;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t cdc_data_interface;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_out;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_in;
|
||||
tusb_desc_interface_t cdc_data_interface;
|
||||
tusb_desc_endpoint_t cdc_endpoint_out;
|
||||
tusb_desc_endpoint_t cdc_endpoint_in;
|
||||
|
||||
} app_descriptor_configuration_t;
|
||||
|
||||
|
@@ -135,9 +135,9 @@ uint8_t const desc_mouse_report[] = {
|
||||
//--------------------------------------------------------------------+
|
||||
// USB DEVICE DESCRIPTOR
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_descriptor_device_t const desc_device =
|
||||
tusb_desc_device_t const desc_device =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_device_t),
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
#if TUSB_CFG_DEVICE_CDC
|
||||
@@ -172,7 +172,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bLength = sizeof(tusb_desc_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(app_descriptor_configuration_t),
|
||||
@@ -188,7 +188,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc_iad =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_association_t),
|
||||
.bLength = sizeof(tusb_desc_interface_assoc_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION,
|
||||
|
||||
.bFirstInterface = INTERFACE_NO_CDC,
|
||||
@@ -203,7 +203,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC,
|
||||
.bAlternateSetting = 0,
|
||||
@@ -252,7 +252,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -263,7 +263,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC+1,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -276,7 +276,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -286,7 +286,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -299,7 +299,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
.keyboard_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_HID_KEYBOARD,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -323,7 +323,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.keyboard_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = HID_KEYBOARD_EDPT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -336,7 +336,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
.mouse_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_HID_MOUSE,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -360,7 +360,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.mouse_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = HID_MOUSE_EDPT_ADDR, // TODO
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -373,7 +373,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
#if TUSB_CFG_DEVICE_MSC
|
||||
.msc_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_MSC,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -386,7 +386,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.msc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = MSC_EDPT_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -396,7 +396,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
|
||||
.msc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = MSC_EDPT_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
@@ -132,45 +132,45 @@
|
||||
//--------------------------------------------------------------------+
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
tusb_descriptor_configuration_t configuration;
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
//------------- CDC -------------//
|
||||
#if TUSB_CFG_DEVICE_CDC
|
||||
tusb_descriptor_interface_association_t cdc_iad;
|
||||
tusb_desc_interface_assoc_t cdc_iad;
|
||||
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t cdc_comm_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_descriptor_endpoint_t cdc_endpoint_notification;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t cdc_data_interface;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_out;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_in;
|
||||
tusb_desc_interface_t cdc_data_interface;
|
||||
tusb_desc_endpoint_t cdc_endpoint_out;
|
||||
tusb_desc_endpoint_t cdc_endpoint_in;
|
||||
#endif
|
||||
|
||||
//------------- HID Keyboard -------------//
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
tusb_descriptor_interface_t keyboard_interface;
|
||||
tusb_desc_interface_t keyboard_interface;
|
||||
tusb_hid_descriptor_hid_t keyboard_hid;
|
||||
tusb_descriptor_endpoint_t keyboard_endpoint;
|
||||
tusb_desc_endpoint_t keyboard_endpoint;
|
||||
#endif
|
||||
|
||||
//------------- HID Mouse -------------//
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
tusb_descriptor_interface_t mouse_interface;
|
||||
tusb_desc_interface_t mouse_interface;
|
||||
tusb_hid_descriptor_hid_t mouse_hid;
|
||||
tusb_descriptor_endpoint_t mouse_endpoint;
|
||||
tusb_desc_endpoint_t mouse_endpoint;
|
||||
#endif
|
||||
|
||||
//------------- Mass Storage -------------//
|
||||
#if TUSB_CFG_DEVICE_MSC
|
||||
tusb_descriptor_interface_t msc_interface;
|
||||
tusb_descriptor_endpoint_t msc_endpoint_in;
|
||||
tusb_descriptor_endpoint_t msc_endpoint_out;
|
||||
tusb_desc_interface_t msc_interface;
|
||||
tusb_desc_endpoint_t msc_endpoint_in;
|
||||
tusb_desc_endpoint_t msc_endpoint_out;
|
||||
#endif
|
||||
|
||||
} app_descriptor_configuration_t;
|
||||
|
Reference in New Issue
Block a user