File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ peripheral.can0 :
2+ kconfig :
3+ - CONFIG_BSP_USING_CAN=y
4+ - CONFIG_BSP_USING_CAN0=y
Original file line number Diff line number Diff line change @@ -374,6 +374,74 @@ menu "On-chip Peripheral Drivers"
374374 endif
375375 endif
376376
377+ menuconfig BSP_USING_CAN
378+ bool "Enable CAN BUS"
379+ default n
380+ select RT_USING_CAN
381+ select RT_USING_DEVICE_IPC
382+ if BSP_USING_CAN
383+ config BSP_USING_CAN0
384+ bool "Enable CAN0"
385+ default n
386+
387+ if BSP_USING_CAN0
388+ choice
389+ prompt "Select CAN0 TX source"
390+ default BSP_CAN0_TX_PD1
391+
392+ config BSP_CAN0_TX_PA12
393+ bool "GPIOA pin 12"
394+ config BSP_CAN0_TX_PB9
395+ bool "GPIOB pin 9"
396+ config BSP_CAN0_TX_PD1
397+ bool "GPIOD pin 1"
398+ config BSP_CAN0_TX_PH13
399+ bool "GPIOH pin 13"
400+ endchoice
401+
402+ choice
403+ prompt "Select CAN0 RX source"
404+ default BSP_CAN0_RX_PD0
405+
406+ config BSP_CAN0_RX_PA11
407+ bool "GPIOA pin 11"
408+ config BSP_CAN0_RX_PB8
409+ bool "GPIOB pin 8"
410+ config BSP_CAN0_RX_PD0
411+ bool "GPIOD pin 0"
412+ config BSP_CAN0_RX_PI9
413+ bool "GPIOI pin 9"
414+ endchoice
415+ endif
416+
417+ config BSP_USING_CAN1
418+ bool "Enable CAN1"
419+ default n
420+
421+ if BSP_USING_CAN1
422+ choice
423+ prompt "Select CAN1 TX source"
424+ default BSP_CAN1_TX_PB6
425+
426+ config BSP_CAN1_TX_PB6
427+ bool "GPIOB pin 6"
428+ config BSP_CAN1_TX_PB13
429+ bool "GPIOB pin 13"
430+ endchoice
431+
432+ choice
433+ prompt "Select CAN1 RX source"
434+ default BSP_CAN1_RX_PB5
435+
436+ config BSP_CAN1_RX_PB5
437+ bool "GPIOB pin 5"
438+ config BSP_CAN1_RX_PI12
439+ bool "GPIOI pin 12"
440+ endchoice
441+ endif
442+
443+ endif
444+
377445 rsource "../../libraries/gd32_drivers/Kconfig"
378446
379447endmenu
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ if GetDepend('RT_USING_SDIO'):
5656if GetDepend ('RT_USING_PWM' ):
5757 src += ['drv_pwm.c' ]
5858
59+ # add can drivers.
60+ if GetDepend ('RT_USING_CAN' ):
61+ src += ['drv_can.c' ]
62+
5963# add sdram drivers.
6064if GetDepend ('BSP_USING_SDRAM' ):
6165 src += ['drv_sdram.c' ]
You can’t perform that action at this time.
0 commit comments