Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
peripheral.can0:
kconfig:
- CONFIG_BSP_USING_CAN=y
- CONFIG_BSP_USING_CAN0=y
68 changes: 68 additions & 0 deletions bsp/gd32/arm/gd32450z-eval/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,74 @@ menu "On-chip Peripheral Drivers"
endif
endif

menuconfig BSP_USING_CAN
bool "Enable CAN BUS"
default n
select RT_USING_CAN
select RT_USING_DEVICE_IPC
if BSP_USING_CAN
config BSP_USING_CAN0
bool "Enable CAN0"
default n

if BSP_USING_CAN0
choice
prompt "Select CAN0 TX source"
default BSP_CAN0_TX_PD1

config BSP_CAN0_TX_PA12
bool "GPIOA pin 12"
config BSP_CAN0_TX_PB9
bool "GPIOB pin 9"
config BSP_CAN0_TX_PD1
bool "GPIOD pin 1"
config BSP_CAN0_TX_PH13
bool "GPIOH pin 13"
endchoice

choice
prompt "Select CAN0 RX source"
default BSP_CAN0_RX_PD0

config BSP_CAN0_RX_PA11
bool "GPIOA pin 11"
config BSP_CAN0_RX_PB8
bool "GPIOB pin 8"
config BSP_CAN0_RX_PD0
bool "GPIOD pin 0"
config BSP_CAN0_RX_PI9
bool "GPIOI pin 9"
endchoice
endif

config BSP_USING_CAN1
bool "Enable CAN1"
default n

if BSP_USING_CAN1
choice
prompt "Select CAN1 TX source"
default BSP_CAN1_TX_PB6

config BSP_CAN1_TX_PB6
bool "GPIOB pin 6"
config BSP_CAN1_TX_PB13
bool "GPIOB pin 13"
endchoice

choice
prompt "Select CAN1 RX source"
default BSP_CAN1_RX_PB5

config BSP_CAN1_RX_PB5
bool "GPIOB pin 5"
config BSP_CAN1_RX_PI12
bool "GPIOI pin 12"
endchoice
endif

endif

rsource "../../libraries/gd32_drivers/Kconfig"

endmenu
Expand Down
4 changes: 4 additions & 0 deletions bsp/gd32/arm/libraries/gd32_drivers/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ if GetDepend('RT_USING_SDIO'):
if GetDepend('RT_USING_PWM'):
src += ['drv_pwm.c']

# add can drivers.
if GetDepend('RT_USING_CAN'):
src += ['drv_can.c']

# add sdram drivers.
if GetDepend('BSP_USING_SDRAM'):
src += ['drv_sdram.c']
Expand Down
Loading