ESP32 S3 继承了S2的 USB OTG,意味着可以支持将自身设置为 USB Device 和 Host。
为了实现USB Host 的功能, 可以使用 esp32-usb-host-demos-main库【参考1】。
在我自己设计的 S3 最小系统中,运行 descdump 程序,结果没问题:
8ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0x1 (POWERON),boot:0x9 (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode IO, clock div:1 load:0x3fcd0108,len:0x43c load:0x403b6000,len:0xbd0 load:0x403ba000,len:0x29c8 entry 0x403b61d8 [ 114][I][usbhhelp.hpp:77] usbh_setup(): [] usb_host_install: 0 [ 114][I][usbhhelp.hpp:92]usbh_setup(): [] usb_host_client_register: 0 [ 499][I][usbhhelp.hpp:40] _client_event_callback(): [] New deviceaddress: 1 [ 499][I][usbhhelp.hpp:49] _client_event_callback(): [] speed: 1 dev_addr1 vMaxPacketSize0 8 bConfigurationValue 1 [ 505][I][show_desc.hpp:44]show_dev_desc(): [] bLength: 18 [ 511][I][show_desc.hpp:45] show_dev_desc(): [] bDescriptorType(device): 1 [ 517][I][show_desc.hpp:46] show_dev_desc(): [] bcdUSB: 0x200 [ 523][I][show_desc.hpp:47] show_dev_desc(): [] bDeviceClass: 0x00 [ 529][I][show_desc.hpp:48] show_dev_desc(): [] bDeviceSubClass: 0x00 [ 535][I][show_desc.hpp:49] show_dev_desc(): [] bDeviceProtocol: 0x00 [ 542][I][show_desc.hpp:50] show_dev_desc(): [] bMaxPacketSize0: 8 [ 548][I][show_desc.hpp:51] show_dev_desc(): [] idVendor: 0x46d [ 554][I][show_desc.hpp:52] show_dev_desc(): [] idProduct: 0xc52f [ 560][I][show_desc.hpp:53] show_dev_desc(): [] bcdDevice: 0x3000 [ 566][I][show_desc.hpp:54] show_dev_desc(): [] iManufacturer: 1 [ 571][I][show_desc.hpp:55]show_dev_desc(): [] iProduct: 2 [ 577][I][show_desc.hpp:56] show_dev_desc(): [] iSerialNumber: 0 [ 583][I][show_desc.hpp:57] show_dev_desc(): [] bNumConfigurations: 1 [ 589][I][show_desc.hpp:64] show_config_desc(): [] bLength: 9 [ 595][I][show_desc.hpp:65]show_config_desc(): [] bDescriptorType(config): 2 [ 602][I][show_desc.hpp:66] show_config_desc(): [] wTotalLength: 59 [ 608][I][show_desc.hpp:67] show_config_desc(): [] bNumInterfaces: 2 [ 614][I][show_desc.hpp:68] show_config_desc(): [] bConfigurationValue: 1 [ 621][I][show_desc.hpp:69] show_config_desc(): [] iConfiguration: 4 [ 627][I][show_desc.hpp:74] show_config_desc(): [] bmAttributes(, RemoteWakeup): 0xa0 [ 635][I][show_desc.hpp:75] show_config_desc(): [] bMaxPower: 49 = 98 mA [ 642][I][show_desc.hpp:82] show_interface_desc(): [] bLength: 9 [ 648][I][show_desc.hpp:83] show_interface_desc(): [] bDescriptorType(interface): 4 [ 655][I][show_desc.hpp:84] show_interface_desc(): [] bInterfaceNumber: 0 [ 662][I][show_desc.hpp:85]show_interface_desc(): [] bAlternateSetting: 0 [ 669][I][show_desc.hpp:86] show_interface_desc(): [] bNumEndpoints: 1 [ 675][I][show_desc.hpp:87] show_interface_desc(): [] bInterfaceClass:0x03 [ 682][I][show_desc.hpp:88] show_interface_desc(): [] bInterfaceSubClass:0x01 [ 689][I][show_desc.hpp:89] show_interface_desc(): [] bInterfaceProtocol:0x02 [ 696][I][show_desc.hpp:90] show_interface_desc(): [] iInterface: 0 [ 702][I][show_desc.hpp:115] show_hid_desc(): [] bLength: 9 [ 708][I][show_desc.hpp:116] show_hid_desc(): [] bDescriptorType (HID): 33 [ 715][I][show_desc.hpp:117] show_hid_desc(): [] bcdHID: 0x0111 [ 720][I][show_desc.hpp:118] show_hid_desc(): [] bCountryCode: 0 [ 726][I][show_desc.hpp:119] show_hid_desc(): [] bNumDescriptor: 1 [ 732][I][show_desc.hpp:120] show_hid_desc(): [] bDescriptorType: 34 [ 739][I][show_desc.hpp:121] show_hid_desc(): [] wDescriptorLength: 67 [ 745][I][show_desc.hpp:100] show_endpoint_desc(): [] bLength: 7 [ 751][I][show_desc.hpp:101]show_endpoint_desc(): [] bDescriptorType (endpoint): 5 [ 758][I][show_desc.hpp:104] show_endpoint_desc(): []bEndpointAddress(In): 0x81 [ 766][I][show_desc.hpp:107] show_endpoint_desc(): []bmAttributes(Interrupt): 0x03 [ 773][I][show_desc.hpp:108] show_endpoint_desc(): [] wMaxPacketSize: 8 [ 780][I][show_desc.hpp:109] show_endpoint_desc(): [] bInterval: 2 [ 786][I][show_desc.hpp:82] show_interface_desc(): [] bLength: 9 [ 792][I][show_desc.hpp:83] show_interface_desc(): [] bDescriptorType(interface): 4 [ 799][I][show_desc.hpp:84] show_interface_desc(): [] bInterfaceNumber: 1 [ 806][I][show_desc.hpp:85] show_interface_desc(): [] bAlternateSetting: 0 [ 813][I][show_desc.hpp:86] show_interface_desc(): [] bNumEndpoints: 1 [ 819][I][show_desc.hpp:87] show_interface_desc(): [] bInterfaceClass:0x03 [ 826][I][show_desc.hpp:88] show_interface_desc(): [] bInterfaceSubClass:0x00 [ 833][I][show_desc.hpp:89] show_interface_desc(): [] bInterfaceProtocol:0x00 [ 840][I][show_desc.hpp:90] show_interface_desc(): [] iInterface: 0 [ 847][I][show_desc.hpp:115] show_hid_desc(): [] bLength: 9 [ 852][I][show_desc.hpp:116] show_hid_desc(): [] bDescriptorType (HID): 33 [ 859][I][show_desc.hpp:117] show_hid_desc(): [] bcdHID: 0x0111 [ 865][I][show_desc.hpp:118] show_hid_desc(): [] bCountryCode: 0 [ 870][I][show_desc.hpp:119] show_hid_desc(): [] bNumDescriptor: 1 [ 877][I][show_desc.hpp:120] show_hid_desc(): [] bDescriptorType: 34 [ 883][I][show_desc.hpp:121]show_hid_desc(): [] wDescriptorLength: 79 [ 889][I][show_desc.hpp:100] show_endpoint_desc(): [] bLength: 7 [ 895][I][show_desc.hpp:101] show_endpoint_desc(): [] bDescriptorType(endpoint): 5 [ 903][I][show_desc.hpp:104] show_endpoint_desc(): []bEndpointAddress(In): 0x82 [ 910][I][show_desc.hpp:107] show_endpoint_desc(): []bmAttributes(Interrupt): 0x03 [ 918][I][show_desc.hpp:108] show_endpoint_desc(): [] wMaxPacketSize: 20 [ 924][I][show_desc.hpp:109] show_endpoint_desc(): [] bInterval: 2 参考:
|