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

Add usb2uart serial host driver #2046

Merged
merged 13 commits into from Apr 27, 2023
1 change: 1 addition & 0 deletions .codespell/ignore-words.txt
@@ -1,6 +1,7 @@
synopsys
sie
tre
thre
hsi
fro
dout
Expand Down
2 changes: 1 addition & 1 deletion examples/host/cdc_msc_hid/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)

Expand Down
4 changes: 3 additions & 1 deletion examples/host/cdc_msc_hid/src/tusb_config.h
Expand Up @@ -96,7 +96,9 @@
#define CFG_TUH_ENUMERATION_BUFSIZE 256

#define CFG_TUH_HUB 1 // number of supported hubs
#define CFG_TUH_CDC 1
#define CFG_TUH_CDC 1 // CDC ACM
#define CFG_TUH_CDC_FTDI 1 // FTDI Serial. FTDI is not part of CDC class, only to re-use CDC driver API
#define CFG_TUH_CDC_CP210X 1 // CP210x Serial. CP210X is not part of CDC class, only to re-use CDC driver API
#define CFG_TUH_HID (3*CFG_TUH_DEVICE_MAX) // typical keyboard + mouse device can have 3-4 HID interfaces
#define CFG_TUH_MSC 1
#define CFG_TUH_VENDOR 0
Expand Down
4 changes: 2 additions & 2 deletions hw/bsp/rp2040/family.c
Expand Up @@ -125,10 +125,10 @@ void board_init(void)
// Set the system clock to a multiple of 120mhz for bitbanging USB with pico-usb
set_sys_clock_khz(120000, true);

#ifdef PIO_USB_VBUSEN_PIN
#ifdef PICO_DEFAULT_PIO_USB_VBUSEN_PIN
gpio_init(PICO_DEFAULT_PIO_USB_VBUSEN_PIN);
gpio_set_dir(PICO_DEFAULT_PIO_USB_VBUSEN_PIN, GPIO_OUT);
gpio_put(PICO_DEFAULT_PIO_USB_VBUSEN_PIN, PIO_USB_VBUSEN_STATE);
gpio_put(PICO_DEFAULT_PIO_USB_VBUSEN_PIN, PICO_DEFAULT_PIO_USB_VBUSEN_STATE);
#endif

// rp2040 use pico-pio-usb for host tuh_configure() can be used to passed pio configuration to the host stack
Expand Down