Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyUSB host support #2

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/

#ifndef CFG_TUSB_MCU
# if defined(__SAME54P20A__)
# if defined(__SAME54P20A__) || defined(__SAME51N19A__)
# define CFG_TUSB_MCU OPT_MCU_SAME5X
# define CFG_TUSB_MEM_SECTION /* nothing */
# define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
Expand All @@ -56,8 +56,12 @@
# endif
#endif

# if (CFG_TUSB_MCU == OPT_MCU_SAME5X)
//#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_FULL_SPEED)
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE)
# elif (CFG_TUSB_MCU == OPT_MCU_SAMX7X)
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HOST)
#endif

#ifndef CFG_TUSB_OS
# define CFG_TUSB_OS OPT_OS_FREERTOS
Expand All @@ -83,6 +87,12 @@
#define CFG_TUD_MIDI (0)
#define CFG_TUD_VENDOR (0)

#define CFG_TUH_ENUMERATION_BUFSIZE 256
#define CFG_TUH_HUB (1)
#define CFG_TUH_MSC (1)
#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 2 : 1)
#define CFG_TUH_MSC_MAXLUN 1

// CDC FIFO size of TX and RX
#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 128)
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 128)
Expand Down