@@ -22,27 +22,6 @@ menu "On-chip Peripheral Drivers"
2222 select RT_USING_PIN
2323 default n
2424
25- menuconfig BSP_USING_SPI
26- bool "Enable SPI BUS"
27- default n
28- select RT_USING_SPI
29- if BSP_USING_SPI
30- config BSP_USING_SPI0
31- bool "Enable SPI0 BUS"
32- default n
33-
34- config BSP_SPI0_TX_USING_DMA
35- bool "Enable SPI0 TX DMA"
36- depends on BSP_USING_SPI0
37- default n
38-
39- config BSP_SPI0_RX_USING_DMA
40- bool "Enable SPI0 RX DMA"
41- depends on BSP_USING_SPI0
42- select BSP_SPI0_TX_USING_DMA
43- default n
44- endif
45-
4625 menuconfig BSP_USING_UART
4726 bool "Enable UART"
4827 default n
@@ -77,35 +56,138 @@ menu "On-chip Peripheral Drivers"
7756 depends on BSP_USING_UART2
7857 select RT_SERIAL_USING_DMA
7958 default n
59+ endif
60+
61+ menuconfig BSP_USING_PWM
62+ bool "Enable PWM"
63+ default n
64+ select RT_USING_PWM
65+ if BSP_USING_PWM
66+ config BSP_USING_PWM0
67+ bool "Enable PWM0"
68+ default y
69+ config BSP_USING_PWM1
70+ bool "Enable PWM1"
71+ default n
72+ config BSP_USING_PWM2
73+ bool "Enable PWM2"
74+ default n
75+ config BSP_USING_PWM15
76+ bool "Enable PWM15"
77+ default n
78+ config BSP_USING_PWM16
79+ bool "Enable PWM16"
80+ default n
81+ endif
82+
83+ menuconfig BSP_USING_HW_I2C
84+ bool "Enable Hardware I2C"
85+ default n
86+ select RT_USING_I2C
87+ if BSP_USING_HW_I2C
88+ config BSP_USING_HW_I2C0
89+ bool "Enable Hardware I2C0"
90+ default n
8091
81- config BSP_USING_UART3
82- bool "Enable UART3"
92+ # config i2c0 pins
93+ choice
94+ prompt "Select I2C0 pins"
95+ depends on BSP_USING_HW_I2C0
96+ config BSP_HW_I2C0_PIN_PA2_PA3
97+ bool "SCL=PA2, SDA=PA3"
98+ config BSP_HW_I2C0_PIN_PA15_PC8
99+ bool "SCL=PA15, SDA=PC8"
100+ config BSP_HW_I2C0_PIN_PB0_PB1
101+ bool "SCL=PB0, SDA=PB1"
102+ config BSP_HW_I2C0_PIN_PB15_PA8
103+ bool "SCL=PB15, SDA=PA8"
104+ endchoice
105+
106+ # config i2c0 clock
107+ config BSP_HW_I2C0_CLK
108+ int "I2C0 clock frequency(KHz)"
109+ default 100
110+ depends on BSP_USING_HW_I2C0
111+ range 10 1000
112+
113+ config BSP_USING_HW_I2C1
114+ bool "Enable Hardware I2C1"
83115 default n
84116
85- config BSP_UART3_RX_USING_DMA
86- bool "Enable UART3 RX DMA"
87- depends on BSP_USING_UART3
88- select RT_SERIAL_USING_DMA
117+ # config i2c1 pins
118+ choice
119+ prompt "Select I2C1 pins"
120+ depends on BSP_USING_HW_I2C1
121+ config BSP_HW_I2C1_PIN_PA6_PA7
122+ bool "SCL=PA6, SDA=PA7"
123+ config BSP_HW_I2C1_PIN_PA13_PA14
124+ bool "SCL=PA13, SDA=PA14"
125+ config BSP_HW_I2C1_PIN_PA15_PC8
126+ bool "SCL=PA15, SDA=PC8"
127+ config BSP_HW_I2C1_PIN_PB12_PB13
128+ bool "SCL=PB12, SDA=PB13"
129+ config BSP_HW_I2C1_PIN_PB15_PA8
130+ bool "SCL=PB15, SDA=PA8"
131+ endchoice
132+
133+ # config i2c1 clock
134+ config BSP_HW_I2C1_CLK
135+ int "I2C1 clock frequency(KHz)"
136+ default 100
137+ depends on BSP_USING_HW_I2C1
138+ range 10 1000
139+ endif
140+
141+ menuconfig BSP_USING_SPI
142+ bool "Enable SPI BUS"
143+ default n
144+ select RT_USING_SPI
145+ if BSP_USING_SPI
146+ config BSP_USING_SPI0
147+ bool "Enable SPI0 BUS"
89148 default n
90149
91- config BSP_USING_UART4
92- bool "Enable UART4"
150+ config BSP_SPI0_TX_USING_DMA
151+ bool "Enable SPI0 TX DMA"
152+ depends on BSP_USING_SPI0
93153 default n
94154
95- config BSP_UART4_RX_USING_DMA
96- bool "Enable UART4 RX DMA"
97- depends on BSP_USING_UART4
98- select RT_SERIAL_USING_DMA
155+ config BSP_SPI0_RX_USING_DMA
156+ bool "Enable SPI0 RX DMA"
157+ depends on BSP_USING_SPI0
158+ select BSP_SPI0_TX_USING_DMA
99159 default n
100160 endif
101161
102- source "$(BSP_DIR)/libraries/gd32_drivers/Kconfig"
162+ source "$(BSP_DIR)/../ libraries/gd32_drivers/Kconfig"
103163
104164endmenu
105165
106166menu "Board extended module Drivers"
107167
108- endmenu
168+ menuconfig BSP_USING_AT24C02
169+ bool "Enable AT24C02 I2C0( SCL[PA2 : 2] SDA[PA3 : 3] )"
170+ default n
171+ select BSP_USING_HW_I2C
172+ select BSP_USING_HW_I2C0
173+ select PKG_USING_AT24CXX
174+ select PKG_AT24CXX_EE_TYPE_AT24C02
175+
176+ if BSP_USING_AT24C02
177+
178+ config BSP_USING_AT24C02_UTEST
179+ bool "Enable the utest of AT24C02"
180+ default n
181+ select RT_USING_UTEST
182+ select RT_USING_ULOG
183+ select ULOG_USING_ISR_LOG
184+
185+ config BSP_USING_AT24C02_INIT
186+ bool "Init the model and check it"
187+ default y
188+
189+ endif
109190
110191endmenu
111192
193+ endmenu
0 commit comments