drivers: udc: add UDC driver for RP2040 USB device controller

This driver is mostly rewritten from scratch, with some parts borrowed
from the usb_dc_rpi_pico driver implemented by Pete Johanson.
This driver does not use any function from RPI PICO HAL and actually
could be furter improved to not use any defines or types from the HAL as
they are confusing and overdo it with volatile qualifiers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2024-08-19 19:13:28 +02:00 committed by Anas Nashif
commit c41071d2ac
4 changed files with 1185 additions and 0 deletions

View file

@ -16,3 +16,4 @@ zephyr_library_sources_ifdef(CONFIG_UDC_IT82XX2 udc_it82xx2.c)
zephyr_library_sources_ifdef(CONFIG_UDC_NXP_EHCI udc_mcux_ehci.c)
zephyr_library_sources_ifdef(CONFIG_UDC_NXP_IP3511 udc_mcux_ip3511.c)
zephyr_library_sources_ifdef(CONFIG_UDC_NUMAKER udc_numaker.c)
zephyr_library_sources_ifdef(CONFIG_UDC_RPI_PICO udc_rpi_pico.c)

View file

@ -63,5 +63,6 @@ source "drivers/usb/udc/Kconfig.stm32"
source "drivers/usb/udc/Kconfig.it82xx2"
source "drivers/usb/udc/Kconfig.mcux"
source "drivers/usb/udc/Kconfig.numaker"
source "drivers/usb/udc/Kconfig.rpi_pico"
endif # UDC_DRIVER

View file

@ -0,0 +1,26 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config UDC_RPI_PICO
bool "Driver for an Raspberry PI Pico USB device controller"
default y
depends on DT_HAS_RASPBERRYPI_PICO_USBD_ENABLED
select SYS_MEM_BLOCKS
help
Driver for an Raspberry PI Pico USB device controller.
if UDC_RPI_PICO
config UDC_RPI_PICO_STACK_SIZE
int "UDC controller driver internal thread stack size"
default 512
help
Device controller driver internal thread stack size.
config UDC_RPI_PICO_THREAD_PRIORITY
int "UDC controller driver thread priority"
default 8
help
Device controller driver thread priority.
endif # UDC_RPI_PICO

File diff suppressed because it is too large Load diff