Skip to content

Commit 5a7aeb9

Browse files
cameledMaureenHelm
authored andcommitted
drivers: i2c: introduce GD32 I2C driver
Add an interrupt driven i2c driver for gd32 i2c peripheral. The transmit and reception method refer from GD32 SoCs user manual. Particularly, reception method choose the solution B. There have some wait for state ready logic in the driver. It cause by i2c device internal state change slower than i2c driver. Signed-off-by: HaiLong Yang <[email protected]>
1 parent 48af32d commit 5a7aeb9

File tree

4 files changed

+737
-0
lines changed

4 files changed

+737
-0
lines changed

drivers/i2c/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ zephyr_library_sources_ifdef(CONFIG_I2C_DW i2c_dw.c)
3636
zephyr_library_sources_ifdef(CONFIG_I2C_RCAR i2c_rcar.c)
3737
zephyr_library_sources_ifdef(CONFIG_I2C_TCA954X i2c_tca954x.c)
3838
zephyr_library_sources_ifdef(CONFIG_I2C_XEC_V2 i2c_mchp_xec_v2.c)
39+
zephyr_library_sources_ifdef(CONFIG_I2C_GD32 i2c_gd32.c)
3940

4041
zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V1
4142
i2c_ll_stm32_v1.c

drivers/i2c/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ source "drivers/i2c/Kconfig.npcx"
5050
source "drivers/i2c/Kconfig.test"
5151
source "drivers/i2c/Kconfig.rcar"
5252
source "drivers/i2c/Kconfig.tca954x"
53+
source "drivers/i2c/Kconfig.gd32"
5354

5455
config I2C_INIT_PRIORITY
5556
int "Init priority"

drivers/i2c/Kconfig.gd32

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2021 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
DT_COMPAT_GD32_I2C := gd,gd32-i2c
5+
6+
config I2C_GD32
7+
bool "GigaDevice GD32 I2C driver"
8+
depends on (SOC_FAMILY_GD32 || SOC_SERIES_GD32VF103)
9+
default $(dt_compat_enabled,$(DT_COMPAT_GD32_I2C))
10+
help
11+
Enables GigaDevice GD32 I2C driver

0 commit comments

Comments
 (0)