好用的 ESP32 S3 USB Host 库-Arduino中文社区 - Powered by Discuz! Archiver

Zoologist 发表于 2022-6-20 09:08

好用的 ESP32 S3 USB Host 库

ESP32 S3 继承了S2的 USB OTG,意味着可以支持将自身设置为 USB Device 和 Host。
为了实现USB Host 的功能, 可以使用 esp32-usb-host-demos-main库【参考1】。

在我自己设计的 S3 最小系统中,运行 descdump 程序,结果没问题:
8ESP-ROM:esp32s3-20210327Build:Mar 27 2021rst:0x1 (POWERON),boot:0x9 (SPI_FAST_FLASH_BOOT)SPIWP:0xeemode:DIO, clock div:1load:0x3fcd0108,len:0x43cload:0x403b6000,len:0xbd0load:0x403ba000,len:0x29c8entry 0x403b61d8 usbh_setup(): [] usb_host_install: 0[   114]usbh_setup(): [] usb_host_client_register: 0 _client_event_callback(): [] New deviceaddress: 1 _client_event_callback(): [] speed: 1 dev_addr1 vMaxPacketSize0 8 bConfigurationValue 1[   505]show_dev_desc(): [] bLength: 18 show_dev_desc(): [] bDescriptorType(device): 1 show_dev_desc(): [] bcdUSB: 0x200 show_dev_desc(): [] bDeviceClass: 0x00 show_dev_desc(): [] bDeviceSubClass: 0x00 show_dev_desc(): [] bDeviceProtocol: 0x00 show_dev_desc(): [] bMaxPacketSize0: 8 show_dev_desc(): [] idVendor: 0x46d show_dev_desc(): [] idProduct: 0xc52f show_dev_desc(): [] bcdDevice: 0x3000 show_dev_desc(): [] iManufacturer: 1[   571]show_dev_desc(): [] iProduct: 2 show_dev_desc(): [] iSerialNumber: 0 show_dev_desc(): [] bNumConfigurations: 1 show_config_desc(): [] bLength: 9[   595]show_config_desc(): [] bDescriptorType(config): 2 show_config_desc(): [] wTotalLength: 59 show_config_desc(): [] bNumInterfaces: 2 show_config_desc(): [] bConfigurationValue: 1 show_config_desc(): [] iConfiguration: 4 show_config_desc(): [] bmAttributes(, RemoteWakeup): 0xa0 show_config_desc(): [] bMaxPower: 49 = 98 mA show_interface_desc(): [] bLength: 9 show_interface_desc(): [] bDescriptorType(interface): 4 show_interface_desc(): [] bInterfaceNumber: 0[   662]show_interface_desc(): [] bAlternateSetting: 0 show_interface_desc(): [] bNumEndpoints: 1 show_interface_desc(): [] bInterfaceClass:0x03 show_interface_desc(): [] bInterfaceSubClass:0x01 show_interface_desc(): [] bInterfaceProtocol:0x02 show_interface_desc(): [] iInterface: 0 show_hid_desc(): [] bLength: 9 show_hid_desc(): [] bDescriptorType (HID): 33 show_hid_desc(): [] bcdHID: 0x0111 show_hid_desc(): [] bCountryCode: 0 show_hid_desc(): [] bNumDescriptor: 1 show_hid_desc(): [] bDescriptorType: 34 show_hid_desc(): [] wDescriptorLength: 67 show_endpoint_desc(): [] bLength: 7[   751]show_endpoint_desc(): [] bDescriptorType (endpoint): 5 show_endpoint_desc(): []bEndpointAddress(In): 0x81 show_endpoint_desc(): []bmAttributes(Interrupt): 0x03 show_endpoint_desc(): [] wMaxPacketSize: 8 show_endpoint_desc(): [] bInterval: 2 show_interface_desc(): [] bLength: 9 show_interface_desc(): [] bDescriptorType(interface): 4 show_interface_desc(): [] bInterfaceNumber: 1 show_interface_desc(): [] bAlternateSetting: 0 show_interface_desc(): [] bNumEndpoints: 1 show_interface_desc(): [] bInterfaceClass:0x03 show_interface_desc(): [] bInterfaceSubClass:0x00 show_interface_desc(): [] bInterfaceProtocol:0x00 show_interface_desc(): [] iInterface: 0 show_hid_desc(): [] bLength: 9 show_hid_desc(): [] bDescriptorType (HID): 33 show_hid_desc(): [] bcdHID: 0x0111 show_hid_desc(): [] bCountryCode: 0 show_hid_desc(): [] bNumDescriptor: 1 show_hid_desc(): [] bDescriptorType: 34[   883]show_hid_desc(): [] wDescriptorLength: 79 show_endpoint_desc(): [] bLength: 7 show_endpoint_desc(): [] bDescriptorType(endpoint): 5 show_endpoint_desc(): []bEndpointAddress(In): 0x82 show_endpoint_desc(): []bmAttributes(Interrupt): 0x03 show_endpoint_desc(): [] wMaxPacketSize: 20 show_endpoint_desc(): [] bInterval: 2 参考:1. https://github.com/touchgadget/esp32-usb-host-demos

Highnose 发表于 2022-6-20 11:43

给力,谢谢分享
页: [1]
查看完整版本: 好用的 ESP32 S3 USB Host 库