Skip to content
Closed
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions drivers/usb/udc/udc_gd32.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2023 BrainCo Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/kernel.h>
#include <zephyr/drivers/usb/udc.h>

#include <gd32_usb.h>
4 changes: 4 additions & 0 deletions modules/hal_gigadevice/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ zephyr_include_directories(${gd32_std_dir}/include)
zephyr_include_directories(${ZEPHYR_HAL_GIGADEVICE_MODULE_DIR}/include)
zephyr_include_directories(${ZEPHYR_HAL_GIGADEVICE_MODULE_DIR}/common_include)

if (${CONFIG_GD32_USB_SUPPORT})
zephyr_include_directories(${gd32_soc_dir}/usb_drivers/include)
endif()

zephyr_library_sources(${gd32_soc_sys_dir}/source/system_${CONFIG_SOC_SERIES}.c)

zephyr_library_sources_ifdef(CONFIG_USE_GD32_ADC ${gd32_std_src_dir}/${CONFIG_SOC_SERIES}_adc.c)
Expand Down
5 changes: 5 additions & 0 deletions modules/hal_gigadevice/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ config GD32_DBG_SUPPORT
This option makes allows using functions that access to
DBG_CTL register such as dbg_periph_enable().

config GD32_USB_SUPPORT
bool "USB driver support"
help
Enable this if usb driver is supported for certain gd32 soc.

config USE_GD32_ADC
bool
help
Expand Down
1 change: 1 addition & 0 deletions soc/arm/gigadevice/gd32f4xx/Kconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ config SOC_SERIES_GD32F4XX
select SOC_FAMILY_GD32_ARM
select GD32_HAS_AF_PINMUX
select GD32_HAS_IRC_32K
select GD32_USB_SUPPORT
help
Enable support for GigaDevice GD32F4XX MCU series