Skip to content

Commit 70ac86a

Browse files
authored
Enable host configuration options in tinyusb
1 parent e7cfd15 commit 70ac86a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

components/arduino_tinyusb/include/tusb_config.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ extern "C" {
7676
# define CONFIG_TINYUSB_NCM_ENABLED 0
7777
#endif
7878

79+
#if CONFIG_TINYUSB_ENABLED
80+
# define CFG_TUD_ENABLED 1
81+
#endif
82+
7983
/* */
8084
/* COMMON CONFIGURATION */
8185
/* */
@@ -162,6 +166,27 @@ extern "C" {
162166
#define CFG_TUD_VENDOR_RX_BUFSIZE CONFIG_TINYUSB_VENDOR_RX_BUFSIZE
163167
#define CFG_TUD_VENDOR_TX_BUFSIZE CONFIG_TINYUSB_VENDOR_TX_BUFSIZE
164168

169+
/* */
170+
/* HOST CONFIGURATION */
171+
/* */
172+
173+
#define CFG_TUH_ENABLED CFG_TUD_ENABLED
174+
#define CFG_TUSB_RHPORT1_MODE OPT_MODE_HOST
175+
#define BOARD_TUH_RHPORT 1
176+
#define BOARD_TUH_MAX_SPEED CFG_TUD_MAX_SPEED
177+
#define CFG_TUH_ENUMERATION_BUFSIZE 256
178+
179+
#define CFG_TUH_HUB 2 // number of supported hubs
180+
#define CFG_TUH_CDC 1 // CDC ACM
181+
#define CFG_TUH_CDC_FTDI 1 // FTDI Serial. FTDI is not part of CDC class, only to re-use CDC driver API
182+
#define CFG_TUH_CDC_CP210X 1 // CP210x Serial. CP210X is not part of CDC class, only to re-use CDC driver API
183+
#define CFG_TUH_CDC_CH34X 1 // CH340 or CH341 Serial. CH34X is not part of CDC class, only to re-use CDC driver API
184+
#define CFG_TUH_HID 1 // typical keyboard + mouse device can have 3-4 HID interfaces
185+
#define CFG_TUH_MSC 1
186+
//#define CFG_TUH_VENDOR 3
187+
188+
#define CFG_TUH_DEVICE_MAX (3*CFG_TUH_HUB + 1)
189+
165190
//------------- HID -------------//
166191
#define CFG_TUH_HID_EPIN_BUFSIZE 64
167192
#define CFG_TUH_HID_EPOUT_BUFSIZE 64

0 commit comments

Comments
 (0)