Skip to content

Commit f32e8fe

Browse files
committed
[bsp/gd32] update gd32 i2c driver
1 parent 98cb15a commit f32e8fe

File tree

12 files changed

+973
-921
lines changed

12 files changed

+973
-921
lines changed

bsp/gd32/arm/gd32h759i-eval/.config

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@
104104
#
105105
# CONFIG_RT_KLIBC_USING_USER_STRNLEN is not set
106106
# end of rt_strnlen options
107-
108-
# CONFIG_RT_UTEST_TC_USING_KLIBC is not set
109107
# end of klibc options
110108

111-
CONFIG_RT_NAME_MAX=8
109+
CONFIG_RT_NAME_MAX=16
112110
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
113111
# CONFIG_RT_USING_NANO is not set
114112
# CONFIG_RT_USING_SMART is not set
@@ -1443,6 +1441,15 @@ CONFIG_BSP_USING_UART0=y
14431441
# CONFIG_BSP_USING_UART1 is not set
14441442
# CONFIG_BSP_USING_UART2 is not set
14451443
# CONFIG_BSP_USING_UART3 is not set
1444+
CONFIG_BSP_USING_I2C=y
1445+
# CONFIG_BSP_USING_HARD_I2C is not set
1446+
CONFIG_BSP_USING_SOFT_I2C=y
1447+
CONFIG_BSP_USING_I2C0=y
1448+
CONFIG_BSP_I2C0_SCL_PIN=116
1449+
CONFIG_BSP_I2C0_SDA_PIN=27
1450+
# CONFIG_BSP_USING_I2C1 is not set
1451+
# CONFIG_BSP_USING_I2C2 is not set
1452+
# CONFIG_BSP_USING_I2C3 is not set
14461453
# end of On-chip Peripheral Drivers
14471454

14481455
#

bsp/gd32/arm/gd32h759i-eval/board/Kconfig

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
74168
endmenu
75169

76170
menu "Board extended module Drivers"

0 commit comments

Comments
 (0)