Skip to content

Commit e4c2cec

Browse files
andrei-edward-popakartben
authored andcommitted
drivers: i2c: added wch i2c driver
added i2c driver for wch platforms Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
1 parent 1335c3f commit e4c2cec

File tree

4 files changed

+461
-0
lines changed

4 files changed

+461
-0
lines changed

drivers/i2c/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V2
7676
zephyr_library_sources_ifdef(CONFIG_I2C_SY1XX i2c_sy1xx.c)
7777
zephyr_library_sources_ifdef(CONFIG_I2C_TCA954X i2c_tca954x.c)
7878
zephyr_library_sources_ifdef(CONFIG_I2C_TELINK_B91 i2c_b91.c)
79+
zephyr_library_sources_ifdef(CONFIG_I2C_WCH i2c_wch.c)
7980
zephyr_library_sources_ifdef(CONFIG_I2C_XEC i2c_mchp_xec.c)
8081
zephyr_library_sources_ifdef(CONFIG_I2C_XEC_V2 i2c_mchp_xec_v2.c)
8182
zephyr_library_sources_ifdef(CONFIG_I2C_XILINX_AXI i2c_xilinx_axi.c)

drivers/i2c/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ source "drivers/i2c/Kconfig.stm32"
156156
source "drivers/i2c/Kconfig.sy1xx"
157157
source "drivers/i2c/Kconfig.tca954x"
158158
source "drivers/i2c/Kconfig.test"
159+
source "drivers/i2c/Kconfig.wch"
159160
source "drivers/i2c/Kconfig.xec"
160161
source "drivers/i2c/Kconfig.xilinx_axi"
161162
# zephyr-keep-sorted-stop

drivers/i2c/Kconfig.wch

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2025 Andrei-Edward Popa
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config I2C_WCH
5+
bool "WCH I2C driver"
6+
default y
7+
depends on DT_HAS_WCH_I2C_ENABLED
8+
select PINCTRL
9+
help
10+
Enable I2C support on WCH platforms
11+
12+
config I2C_WCH_XFER_TIMEOUT_MS
13+
int "Set the transfer timeout in milliseconds"
14+
depends on I2C_WCH
15+
default 500

0 commit comments

Comments
 (0)