shorten descriptor type
This commit is contained in:
@@ -119,9 +119,9 @@ const uint8_t mouse_report_descriptor[] = {
|
||||
|
||||
|
||||
TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
|
||||
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_TYPE_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
.bDeviceClass = 0x00,
|
||||
@@ -147,7 +147,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bLength = sizeof(tusb_desc_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(app_configuration_desc_t) - 1, // exclude termination
|
||||
@@ -162,7 +162,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- HID Keyboard -------------//
|
||||
.keyboard_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 1,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -186,7 +186,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.keyboard_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -197,7 +197,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- HID Mouse -------------//
|
||||
.mouse_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 2,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -221,7 +221,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.mouse_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x82,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -232,7 +232,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- Mass Storage -------------//
|
||||
.msc_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 3,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -245,7 +245,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.msc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x83,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -255,7 +255,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.msc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x03,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -266,7 +266,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- CDC Serial -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 4,
|
||||
.bAlternateSetting = 0,
|
||||
@@ -307,7 +307,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x84,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -318,7 +318,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 5,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -331,7 +331,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 5,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -341,7 +341,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x85,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
||||
@@ -63,60 +63,60 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
tusb_descriptor_configuration_t configuration;
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
#if 0 //&& IAD_DESC_REQUIRED
|
||||
tusb_descriptor_interface_association_t CDC_IAD;
|
||||
tusb_desc_interface_assoc_t CDC_IAD;
|
||||
#endif
|
||||
|
||||
#if 0 //&& TUSB_CFG_DEVICE_CDC
|
||||
//CDC - Serial
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t CDC_CCI_Interface;
|
||||
tusb_desc_interface_t CDC_CCI_Interface;
|
||||
CDC_HEADER_DESCRIPTOR CDC_Header;
|
||||
CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR CDC_ACM;
|
||||
CDC_UNION_1SLAVE_DESCRIPTOR CDC_Union;
|
||||
tusb_descriptor_endpoint_t CDC_NotificationEndpoint;
|
||||
tusb_desc_endpoint_t CDC_NotificationEndpoint;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t CDC_DCI_Interface;
|
||||
tusb_descriptor_endpoint_t CDC_DataOutEndpoint;
|
||||
tusb_descriptor_endpoint_t CDC_DataInEndpoint;
|
||||
tusb_desc_interface_t CDC_DCI_Interface;
|
||||
tusb_desc_endpoint_t CDC_DataOutEndpoint;
|
||||
tusb_desc_endpoint_t CDC_DataInEndpoint;
|
||||
#endif
|
||||
|
||||
//------------- 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;
|
||||
|
||||
//------------- 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;
|
||||
|
||||
//------------- Mass Storage -------------//
|
||||
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;
|
||||
|
||||
//------------- CDC Serial -------------//
|
||||
//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_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;
|
||||
|
||||
|
||||
unsigned char ConfigDescTermination;
|
||||
} app_configuration_desc_t;
|
||||
|
||||
extern tusb_descriptor_device_t const desc_device;
|
||||
extern tusb_desc_device_t const desc_device;
|
||||
extern app_configuration_desc_t const desc_configuration;
|
||||
extern const uint8_t keyboard_report_descriptor[];
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
#include "usbh.h"
|
||||
|
||||
//------------- core -------------//
|
||||
uint8_t tusbh_device_attached_cb (tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK ATTR_WARN_UNUSED_RESULT;
|
||||
uint8_t tusbh_device_attached_cb (tusb_desc_device_t const *p_desc_device) ATTR_WEAK ATTR_WARN_UNUSED_RESULT;
|
||||
void tusbh_device_mount_succeed_cb (uint8_t dev_addr) ATTR_WEAK;
|
||||
void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK;
|
||||
void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_desc_device_t const *p_desc_device) ATTR_WEAK;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user