@@ -71,6 +71,100 @@ menu "On-chip Peripheral Drivers"
7171
7272 source "$(BSP_DIR)/../libraries/gd32_drivers/Kconfig"
7373
74+ menuconfig BSP_USING_I2C
75+ bool "Enable I2C"
76+ default n
77+ if BSP_USING_I2C
78+ menuconfig BSP_USING_HARD_I2C
79+ bool "Enable Hardware I2C"
80+ default n
81+ select RT_USING_I2C
82+ if BSP_USING_HARD_I2C
83+ config BSP_USING_HARD_I2C0
84+ bool "Enable I2C0 Hardware BUS"
85+ default n
86+ config BSP_USING_HARD_I2C1
87+ bool "Enable I2C1 Hardware BUS"
88+ default n
89+ config BSP_USING_HARD_I2C2
90+ bool "Enable I2C2 Hardware BUS"
91+ default n
92+ config BSP_USING_HARD_I2C3
93+ bool "Enable I2C3 Hardware BUS"
94+ default n
95+ config BSP_USING_HARD_I2C4
96+ bool "Enable I2C4 Hardware BUS"
97+ default n
98+ config BSP_USING_HARD_I2C5
99+ bool "Enable I2C5 Hardware BUS"
100+ default n
101+ endif
102+
103+ menuconfig BSP_USING_SOFT_I2C
104+ bool "Enable Software I2C (BitOps)"
105+ default n
106+ select RT_USING_I2C
107+ select RT_USING_I2C_BITOPS
108+ select RT_USING_PIN
109+ if BSP_USING_SOFT_I2C
110+ menuconfig BSP_USING_I2C0
111+ bool "Enable I2C0 BUS (software simulation)"
112+ default n
113+ if BSP_USING_I2C0
114+ config BSP_I2C0_SCL_PIN
115+ int "I2C0 scl pin number"
116+ range 0 240
117+ default 0
118+ config BSP_I2C0_SDA_PIN
119+ int "I2C0 sda pin number"
120+ range 0 240
121+ default 0
122+ endif
123+
124+ menuconfig BSP_USING_I2C1
125+ bool "Enable I2C1 BUS (software simulation)"
126+ default n
127+ if BSP_USING_I2C1
128+ config BSP_I2C1_SCL_PIN
129+ int "I2C1 scl pin number"
130+ range 0 240
131+ default 0
132+ config BSP_I2C1_SDA_PIN
133+ int "I2C1 sda pin number"
134+ range 0 240
135+ default 0
136+ endif
137+
138+ menuconfig BSP_USING_I2C2
139+ bool "Enable I2C2 BUS (software simulation)"
140+ default n
141+ if BSP_USING_I2C2
142+ config BSP_I2C2_SCL_PIN
143+ int "I2C2 scl pin number"
144+ range 0 240
145+ default 0
146+ config BSP_I2C2_SDA_PIN
147+ int "I2C2 sda pin number"
148+ range 0 240
149+ default 0
150+ endif
151+
152+ menuconfig BSP_USING_I2C3
153+ bool "Enable I2C3 BUS (software simulation)"
154+ default n
155+ if BSP_USING_I2C3
156+ config BSP_I2C3_SCL_PIN
157+ int "I2C3 scl pin number"
158+ range 0 240
159+ default 0
160+ config BSP_I2C3_SDA_PIN
161+ int "I2C3 sda pin number"
162+ range 0 240
163+ default 0
164+ endif
165+ endif
166+ endif
167+
74168endmenu
75169
76170menu "Board extended module Drivers"
0 commit comments