Skip to content

Commit

Permalink
feat(usb/esp_tinyusb): v1.4.3, ESP32P4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-jam committed Jan 10, 2024
1 parent 22e2825 commit 4a5e6b9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
5 changes: 5 additions & 0 deletions usb/esp_tinyusb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.4.3
- esp_tinyusb: ESP32P4 support
- esp_tinyusb: USB PHY configuration options for TinyUSB
- esp_tinyusb: EP size depend on PHY speed (64 bytes for FullSpeed or 512 for HighSpeed)

## 1.4.2

- MSC: Fix maximum files open
Expand Down
16 changes: 16 additions & 0 deletions usb/esp_tinyusb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ menu "TinyUSB Stack"
help
Specify verbosity of TinyUSB log output.

choice TINYUSB_RHPORT
depends on IDF_TARGET_ESP32P4
prompt "TinyUSB PHY"
default TINYUSB_RHPORT_HS
help
Allows set the USB PHY Controller for TinyUSB: HS (USB OTG2.0 PHY for HighSpeed) or FS (USB OTG1.1 PHY for FullSpeed).
USB OTG2.0 PHY Controller pad numbers: DM - 50, DP - 51
USB OTG1.1 PHY Controller pad numbers: DM - 53, DP - 54


config TINYUSB_RHPORT_FS
bool "FS"
config TINYUSB_RHPORT_HS
bool "HS"
endchoice

menu "TinyUSB task configuration"
config TINYUSB_NO_DEFAULT_TASK
bool "Do not create a TinyUSB task"
Expand Down
2 changes: 1 addition & 1 deletion usb/esp_tinyusb/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
description: Espressif's additions to TinyUSB
documentation: "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/peripherals/usb_device.html"
version: "1.4.2~2"
version: "1.4.3"
url: https://github.com/espressif/idf-extra-components/tree/master/usb/esp_tinyusb
dependencies:
idf: '>=5.0' # IDF 4.x contains TinyUSB as submodule
Expand Down
19 changes: 13 additions & 6 deletions usb/esp_tinyusb/include/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ extern "C" {
# define CONFIG_TINYUSB_DEBUG_LEVEL 0
#endif

#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE | OPT_MODE_FULL_SPEED
#ifdef CONFIG_TINYUSB_RHPORT_HS
# define CFG_TUSB_RHPORT1_MODE OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED
# define CFG_TUSB_EP_SIZE 512
#else
# define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE | OPT_MODE_FULL_SPEED
# define CFG_TUSB_EP_SIZE 64
#endif

#define CFG_TUSB_OS OPT_OS_FREERTOS

/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
Expand Down Expand Up @@ -115,15 +122,15 @@ extern "C" {
#define CFG_TUD_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE

// MIDI macros
#define CFG_TUD_MIDI_EP_BUFSIZE 64
#define CFG_TUD_MIDI_EP_BUFSIZE CFG_TUSB_EP_SIZE
#define CFG_TUD_MIDI_EPSIZE CFG_TUD_MIDI_EP_BUFSIZE
#define CFG_TUD_MIDI_RX_BUFSIZE 64
#define CFG_TUD_MIDI_TX_BUFSIZE 64
#define CFG_TUD_MIDI_RX_BUFSIZE CFG_TUSB_EP_SIZE
#define CFG_TUD_MIDI_TX_BUFSIZE CFG_TUSB_EP_SIZE

// Vendor FIFO size of TX and RX
// If not configured vendor endpoints will not be buffered
#define CFG_TUD_VENDOR_RX_BUFSIZE 64
#define CFG_TUD_VENDOR_TX_BUFSIZE 64
#define CFG_TUD_VENDOR_RX_BUFSIZE CFG_TUSB_EP_SIZE
#define CFG_TUD_VENDOR_TX_BUFSIZE CFG_TUSB_EP_SIZE

// DFU macros
#define CFG_TUD_DFU_XFER_BUFSIZE CONFIG_TINYUSB_DFU_BUFSIZE
Expand Down

0 comments on commit 4a5e6b9

Please sign in to comment.