summaryrefslogtreecommitdiff
path: root/bsp/Infineon
diff options
context:
space:
mode:
authorCYFS <[email protected]>2026-07-15 17:54:33 +0800
committerRbb666 <[email protected]>2026-07-16 13:19:57 +0800
commit414ff7f3710168dbf99a398e18b2a4ff8448b005 (patch)
tree4d29ff0dadc5cb4aa74941deb4e28bb46ff5ad6d /bsp/Infineon
parent997de9433af42aacb1988489ccb08b6688f440cc (diff)
[bsp][drivers][soft_i2c] unify the software I2C driver
Diffstat (limited to 'bsp/Infineon')
-rw-r--r--bsp/Infineon/libraries/HAL_Drivers/SConscript4
-rw-r--r--bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.c192
-rw-r--r--bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.h43
-rw-r--r--bsp/Infineon/libraries/templates/PSOC62/.ci/attachconfig/ci.attachconfig.yml8
-rw-r--r--bsp/Infineon/libraries/templates/PSOC62/board/Kconfig51
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-BLE/.ci/attachconfig/ci.attachconfig.yml8
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig51
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/.ci/attachconfig/ci.attachconfig.yml8
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig51
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062S2-43012/.ci/attachconfig/ci.attachconfig.yml8
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig51
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062s4/.ci/attachconfig/ci.attachconfig.yml10
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig51
-rw-r--r--bsp/Infineon/psoc6-cy8cproto-062S3-4343W/.ci/attachconfig/ci.attachconfig.yml8
-rw-r--r--bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig51
-rw-r--r--bsp/Infineon/psoc6-evaluationkit-062S2/.ci/attachconfig/ci.attachconfig.yml8
-rw-r--r--bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig53
17 files changed, 269 insertions, 387 deletions
diff --git a/bsp/Infineon/libraries/HAL_Drivers/SConscript b/bsp/Infineon/libraries/HAL_Drivers/SConscript
index 017b3cb4d7..280ee05b70 100644
--- a/bsp/Infineon/libraries/HAL_Drivers/SConscript
+++ b/bsp/Infineon/libraries/HAL_Drivers/SConscript
@@ -18,10 +18,6 @@ if GetDepend(['RT_USING_SERIAL']):
else:
src += ['drv_uart.c']
-if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
- if GetDepend('BSP_USING_I2C1'):
- src += ['drv_soft_i2c.c']
-
if GetDepend(['RT_USING_I2C']):
if GetDepend('BSP_USING_HW_I2C1') or GetDepend('BSP_USING_HW_I2C3') or GetDepend('BSP_USING_HW_I2C4') or GetDepend('BSP_USING_HW_I2C6'):
src += ['drv_i2c.c']
diff --git a/bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.c b/bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.c
deleted file mode 100644
index 9c20a54ca1..0000000000
--- a/bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2006-2024 RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2022-07-20 Rbb666 first version
- */
-
-#include <board.h>
-#include "drv_soft_i2c.h"
-
-#ifdef RT_USING_I2C
-
-/*#define DRV_DEBUG*/
-#define LOG_TAG "drv.i2c"
-#include <drv_log.h>
-
-#if !defined(BSP_USING_I2C1)
- #error "Please define at least one BSP_USING_I2Cx"
- /* this driver can be disabled at menuconfig -> RT-Thread Components -> Device Drivers */
-#endif
-
-static const struct ifx_soft_i2c_config soft_i2c_config[] =
-{
- #ifdef BSP_USING_I2C1
- I2C1_BUS_CONFIG,
- #endif
-};
-
-static struct ifx_i2c i2c_obj[sizeof(soft_i2c_config) / sizeof(soft_i2c_config[0])];
-
-/**
- * This function initializes the i2c pin.
- *
- * @param ifx i2c dirver class.
- */
-static void ifx_i2c_gpio_init(struct ifx_i2c *i2c)
-{
- struct ifx_soft_i2c_config *cfg = (struct ifx_soft_i2c_config *)i2c->ops.data;
-
- rt_pin_mode(cfg->scl, PIN_MODE_OUTPUT_OD);
- rt_pin_mode(cfg->sda, PIN_MODE_OUTPUT_OD);
-
- rt_pin_write(cfg->scl, PIN_HIGH);
- rt_pin_write(cfg->sda, PIN_HIGH);
-}
-
-static void ifx_i2c_pin_init(void)
-{
- rt_size_t obj_num = sizeof(i2c_obj) / sizeof(struct ifx_i2c);
-
- for(rt_size_t i = 0; i < obj_num; i++)
- {
- ifx_i2c_gpio_init(&i2c_obj[i]);
- }
-}
-
-/**
- * This function sets the sda pin.
- *
- * @param ifx config class.
- * @param The sda pin state.
- */
-static void ifx_set_sda(void *data, rt_int32_t state)
-{
- struct ifx_soft_i2c_config *cfg = (struct ifx_soft_i2c_config *)data;
-
- if (state)
- {
- rt_pin_write(cfg->sda, PIN_HIGH);
- }
- else
- {
- rt_pin_write(cfg->sda, PIN_LOW);
- }
-}
-
-/**
- * This function sets the scl pin.
- *
- * @param ifx config class.
- * @param The scl pin state.
- */
-static void ifx_set_scl(void *data, rt_int32_t state)
-{
- struct ifx_soft_i2c_config *cfg = (struct ifx_soft_i2c_config *)data;
-
- if (state)
- {
- rt_pin_write(cfg->scl, PIN_HIGH);
- }
- else
- {
- rt_pin_write(cfg->scl, PIN_LOW);
- }
-}
-
-/**
- * This function gets the sda pin state.
- *
- * @param The sda pin state.
- */
-static rt_int32_t ifx_get_sda(void *data)
-{
- struct ifx_soft_i2c_config *cfg = (struct ifx_soft_i2c_config *)data;
- return rt_pin_read(cfg->sda);
-}
-
-/**
- * This function gets the scl pin state.
- *
- * @param The scl pin state.
- */
-static rt_int32_t ifx_get_scl(void *data)
-{
- struct ifx_soft_i2c_config *cfg = (struct ifx_soft_i2c_config *)data;
- return rt_pin_read(cfg->scl);
-}
-
-static const struct rt_i2c_bit_ops ifx_bit_ops_default =
-{
- .data = RT_NULL,
- .pin_init = ifx_i2c_pin_init,
- .set_sda = ifx_set_sda,
- .set_scl = ifx_set_scl,
- .get_sda = ifx_get_sda,
- .get_scl = ifx_get_scl,
- .udelay = rt_hw_us_delay,
- .delay_us = 1,
- .timeout = 100,
- .i2c_pin_init_flag = RT_FALSE
-};
-
-/**
- * if i2c is locked, this function will unlock it
- *
- * @param ifx config class
- *
- * @return RT_EOK indicates successful unlock.
- */
-static rt_err_t ifx_i2c_bus_unlock(const struct ifx_soft_i2c_config *cfg)
-{
- rt_int32_t i = 0;
-
- if (PIN_LOW == rt_pin_read(cfg->sda))
- {
- while (i++ < 9)
- {
- rt_pin_write(cfg->scl, PIN_HIGH);
- rt_hw_us_delay(100);
- rt_pin_write(cfg->scl, PIN_LOW);
- rt_hw_us_delay(100);
- }
- }
-
- if (PIN_LOW == rt_pin_read(cfg->sda))
- {
- return -RT_ERROR;
- }
-
- return RT_EOK;
-}
-
-/* I2C initialization function */
-int rt_hw_i2c_init(void)
-{
- rt_size_t obj_num = sizeof(i2c_obj) / sizeof(struct ifx_i2c);
- rt_err_t result;
-
- for (int i = 0; i < obj_num; i++)
- {
- i2c_obj[i].ops = ifx_bit_ops_default;
- i2c_obj[i].ops.data = (void *)&soft_i2c_config[i];
- i2c_obj[i].i2c_bus.priv = &i2c_obj[i].ops;
-
- result = rt_i2c_bit_add_bus(&i2c_obj[i].i2c_bus, soft_i2c_config[i].bus_name);
- RT_ASSERT(result == RT_EOK);
- ifx_i2c_bus_unlock(&soft_i2c_config[i]);
-
- LOG_D("software simulation %s init done, pin scl: %d, pin sda %d",
- soft_i2c_config[i].bus_name,
- soft_i2c_config[i].scl,
- soft_i2c_config[i].sda);
- }
-
- return RT_EOK;
-}
-INIT_BOARD_EXPORT(rt_hw_i2c_init);
-
-#endif /* RT_USING_I2C */
diff --git a/bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.h b/bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.h
deleted file mode 100644
index 2e49a62c2f..0000000000
--- a/bsp/Infineon/libraries/HAL_Drivers/drv_soft_i2c.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2006-2024 RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2022-07-20 Rbb666 first version
- */
-
-#ifndef __DRV_I2C__
-#define __DRV_I2C__
-
-#include <rtthread.h>
-#include <rthw.h>
-#include <rtdevice.h>
-
-/* ifx config class */
-struct ifx_soft_i2c_config
-{
- rt_uint8_t scl;
- rt_uint8_t sda;
- const char *bus_name;
-};
-/* ifx i2c dirver class */
-struct ifx_i2c
-{
- struct rt_i2c_bit_ops ops;
- struct rt_i2c_bus_device i2c_bus;
-};
-
-#ifdef BSP_USING_I2C1
-#define I2C1_BUS_CONFIG \
- { \
- .scl = BSP_I2C1_SCL_PIN, \
- .sda = BSP_I2C1_SDA_PIN, \
- .bus_name = "i2c1", \
- }
-#endif
-
-int rt_hw_i2c_init(void);
-
-#endif
diff --git a/bsp/Infineon/libraries/templates/PSOC62/.ci/attachconfig/ci.attachconfig.yml b/bsp/Infineon/libraries/templates/PSOC62/.ci/attachconfig/ci.attachconfig.yml
new file mode 100644
index 0000000000..6cbc2bc3c3
--- /dev/null
+++ b/bsp/Infineon/libraries/templates/PSOC62/.ci/attachconfig/ci.attachconfig.yml
@@ -0,0 +1,8 @@
+devices.soft_i2c:
+ kconfig:
+ - CONFIG_RT_USING_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C1=y
+ - CONFIG_RT_SOFT_I2C1_SCL_PIN=105
+ - CONFIG_RT_SOFT_I2C1_SDA_PIN=106
+ - CONFIG_RT_SOFT_I2C1_BUS_NAME="swi2c1"
diff --git a/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig b/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig
index 07a230d796..5a771696dd 100644
--- a/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig
+++ b/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig
@@ -173,29 +173,26 @@ menu "On-chip Peripheral Drivers"
default 105
endif
endif
-
- menuconfig BSP_USING_I2C
- bool "Enable Software I2C Bus"
+ menuconfig BSP_USING_SOFT_I2C
+ bool "Enable software I2C (swi2c)"
default n
select RT_USING_I2C
- select RT_USING_I2C_BITOPS
- select RT_USING_PIN
- if BSP_USING_I2C
- config BSP_USING_I2C1
- bool "Enable I2C1 Bus (User I2C)"
- default n
- if BSP_USING_I2C1
- comment "Notice: P13_1 --> 105; P13_2 --> 106"
- config BSP_I2C1_SCL_PIN
- int "i2c1 SCL pin number"
- range 1 113
- default 105
- config BSP_I2C1_SDA_PIN
- int "i2c1 SDA pin number"
- range 1 113
- default 106
- endif
- endif
+ select RT_USING_SOFT_I2C
+ if BSP_USING_SOFT_I2C
+ menuconfig BSP_USING_SOFT_I2C1
+ bool "Enable software I2C1 Bus (swi2c1)"
+ default n
+ select RT_USING_SOFT_I2C1
+ if BSP_USING_SOFT_I2C1
+ config RT_SOFT_I2C1_SCL_PIN
+ int "swi2c1 SCL pin number"
+ default 105
+ config RT_SOFT_I2C1_SDA_PIN
+ int "swi2c1 SDA pin number"
+ default 106
+ endif
+ endif
+
menuconfig BSP_USING_RTC
bool "Enable RTC"
@@ -250,4 +247,16 @@ menu "On-chip Peripheral Drivers"
endif
endmenu
+ config RT_SOFT_I2C1_HAS_PIN_DEFAULT
+ bool
+ default y if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SCL_PIN_DEFAULT
+ int
+ default 105 if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SDA_PIN_DEFAULT
+ int
+ default 106 if RT_USING_SOFT_I2C1
+
endmenu
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-BLE/.ci/attachconfig/ci.attachconfig.yml b/bsp/Infineon/psoc6-cy8ckit-062-BLE/.ci/attachconfig/ci.attachconfig.yml
new file mode 100644
index 0000000000..6cbc2bc3c3
--- /dev/null
+++ b/bsp/Infineon/psoc6-cy8ckit-062-BLE/.ci/attachconfig/ci.attachconfig.yml
@@ -0,0 +1,8 @@
+devices.soft_i2c:
+ kconfig:
+ - CONFIG_RT_USING_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C1=y
+ - CONFIG_RT_SOFT_I2C1_SCL_PIN=105
+ - CONFIG_RT_SOFT_I2C1_SDA_PIN=106
+ - CONFIG_RT_SOFT_I2C1_BUS_NAME="swi2c1"
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig
index 77a4380e4a..3acbc9e3c2 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig
@@ -173,29 +173,26 @@ menu "On-chip Peripheral Drivers"
default 105
endif
endif
-
- menuconfig BSP_USING_I2C
- bool "Enable Software I2C Bus"
+ menuconfig BSP_USING_SOFT_I2C
+ bool "Enable software I2C (swi2c)"
default n
select RT_USING_I2C
- select RT_USING_I2C_BITOPS
- select RT_USING_PIN
- if BSP_USING_I2C
- config BSP_USING_I2C1
- bool "Enable I2C1 Bus (User I2C)"
- default n
- if BSP_USING_I2C1
- comment "Notice: P13_1 --> 105; P13_2 --> 106"
- config BSP_I2C1_SCL_PIN
- int "i2c1 SCL pin number"
- range 1 113
- default 105
- config BSP_I2C1_SDA_PIN
- int "i2c1 SDA pin number"
- range 1 113
- default 106
- endif
- endif
+ select RT_USING_SOFT_I2C
+ if BSP_USING_SOFT_I2C
+ menuconfig BSP_USING_SOFT_I2C1
+ bool "Enable software I2C1 Bus (swi2c1)"
+ default n
+ select RT_USING_SOFT_I2C1
+ if BSP_USING_SOFT_I2C1
+ config RT_SOFT_I2C1_SCL_PIN
+ int "swi2c1 SCL pin number"
+ default 105
+ config RT_SOFT_I2C1_SDA_PIN
+ int "swi2c1 SDA pin number"
+ default 106
+ endif
+ endif
+
menuconfig BSP_USING_RTC
bool "Enable RTC"
@@ -250,4 +247,16 @@ menu "On-chip Peripheral Drivers"
endif
endmenu
+ config RT_SOFT_I2C1_HAS_PIN_DEFAULT
+ bool
+ default y if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SCL_PIN_DEFAULT
+ int
+ default 105 if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SDA_PIN_DEFAULT
+ int
+ default 106 if RT_USING_SOFT_I2C1
+
endmenu
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/.ci/attachconfig/ci.attachconfig.yml b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/.ci/attachconfig/ci.attachconfig.yml
new file mode 100644
index 0000000000..6cbc2bc3c3
--- /dev/null
+++ b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/.ci/attachconfig/ci.attachconfig.yml
@@ -0,0 +1,8 @@
+devices.soft_i2c:
+ kconfig:
+ - CONFIG_RT_USING_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C1=y
+ - CONFIG_RT_SOFT_I2C1_SCL_PIN=105
+ - CONFIG_RT_SOFT_I2C1_SDA_PIN=106
+ - CONFIG_RT_SOFT_I2C1_BUS_NAME="swi2c1"
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig
index 6b19951456..c1bda32bfa 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig
@@ -181,29 +181,26 @@ menu "On-chip Peripheral Drivers"
default 105
endif
endif
-
- menuconfig BSP_USING_I2C
- bool "Enable Software I2C Bus"
+ menuconfig BSP_USING_SOFT_I2C
+ bool "Enable software I2C (swi2c)"
default n
select RT_USING_I2C
- select RT_USING_I2C_BITOPS
- select RT_USING_PIN
- if BSP_USING_I2C
- config BSP_USING_I2C1
- bool "Enable I2C1 Bus (User I2C)"
- default n
- if BSP_USING_I2C1
- comment "Notice: P13_1 --> 105; P13_2 --> 106"
- config BSP_I2C1_SCL_PIN
- int "i2c1 SCL pin number"
- range 1 113
- default 105
- config BSP_I2C1_SDA_PIN
- int "i2c1 SDA pin number"
- range 1 113
- default 106
- endif
- endif
+ select RT_USING_SOFT_I2C
+ if BSP_USING_SOFT_I2C
+ menuconfig BSP_USING_SOFT_I2C1
+ bool "Enable software I2C1 Bus (swi2c1)"
+ default n
+ select RT_USING_SOFT_I2C1
+ if BSP_USING_SOFT_I2C1
+ config RT_SOFT_I2C1_SCL_PIN
+ int "swi2c1 SCL pin number"
+ default 105
+ config RT_SOFT_I2C1_SDA_PIN
+ int "swi2c1 SDA pin number"
+ default 106
+ endif
+ endif
+
menuconfig BSP_USING_RTC
bool "Enable RTC"
@@ -258,4 +255,16 @@ menu "On-chip Peripheral Drivers"
endif
endmenu
+ config RT_SOFT_I2C1_HAS_PIN_DEFAULT
+ bool
+ default y if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SCL_PIN_DEFAULT
+ int
+ default 105 if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SDA_PIN_DEFAULT
+ int
+ default 106 if RT_USING_SOFT_I2C1
+
endmenu
diff --git a/bsp/Infineon/psoc6-cy8ckit-062S2-43012/.ci/attachconfig/ci.attachconfig.yml b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/.ci/attachconfig/ci.attachconfig.yml
new file mode 100644
index 0000000000..6cbc2bc3c3
--- /dev/null
+++ b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/.ci/attachconfig/ci.attachconfig.yml
@@ -0,0 +1,8 @@
+devices.soft_i2c:
+ kconfig:
+ - CONFIG_RT_USING_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C1=y
+ - CONFIG_RT_SOFT_I2C1_SCL_PIN=105
+ - CONFIG_RT_SOFT_I2C1_SDA_PIN=106
+ - CONFIG_RT_SOFT_I2C1_BUS_NAME="swi2c1"
diff --git a/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig
index 0a5cec3667..7378d38f77 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig
@@ -180,29 +180,26 @@ menu "On-chip Peripheral Drivers"
default 105
endif
endif
-
- menuconfig BSP_USING_I2C
- bool "Enable Software I2C Bus"
+ menuconfig BSP_USING_SOFT_I2C
+ bool "Enable software I2C (swi2c)"
default n
select RT_USING_I2C
- select RT_USING_I2C_BITOPS
- select RT_USING_PIN
- if BSP_USING_I2C
- config BSP_USING_I2C1
- bool "Enable I2C1 Bus (User I2C)"
- default n
- if BSP_USING_I2C1
- comment "Notice: P13_1 --> 105; P13_2 --> 106"
- config BSP_I2C1_SCL_PIN
- int "i2c1 SCL pin number"
- range 1 113
- default 105
- config BSP_I2C1_SDA_PIN
- int "i2c1 SDA pin number"
- range 1 113
- default 106
- endif
- endif
+ select RT_USING_SOFT_I2C
+ if BSP_USING_SOFT_I2C
+ menuconfig BSP_USING_SOFT_I2C1
+ bool "Enable software I2C1 Bus (swi2c1)"
+ default n
+ select RT_USING_SOFT_I2C1
+ if BSP_USING_SOFT_I2C1
+ config RT_SOFT_I2C1_SCL_PIN
+ int "swi2c1 SCL pin number"
+ default 105
+ config RT_SOFT_I2C1_SDA_PIN
+ int "swi2c1 SDA pin number"
+ default 106
+ endif
+ endif
+
config BSP_USING_USBD
bool "Enable USB Device"
@@ -325,4 +322,16 @@ menu "Board extended module Drivers"
endif
endmenu
+ config RT_SOFT_I2C1_HAS_PIN_DEFAULT
+ bool
+ default y if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SCL_PIN_DEFAULT
+ int
+ default 105 if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SDA_PIN_DEFAULT
+ int
+ default 106 if RT_USING_SOFT_I2C1
+
endmenu
diff --git a/bsp/Infineon/psoc6-cy8ckit-062s4/.ci/attachconfig/ci.attachconfig.yml b/bsp/Infineon/psoc6-cy8ckit-062s4/.ci/attachconfig/ci.attachconfig.yml
index d453530aff..ab4f866f4e 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062s4/.ci/attachconfig/ci.attachconfig.yml
+++ b/bsp/Infineon/psoc6-cy8ckit-062s4/.ci/attachconfig/ci.attachconfig.yml
@@ -9,3 +9,13 @@ utest.pin:
- CONFIG_RT_USING_UTESTCASES=y
- CONFIG_RT_CONSOLEBUF_SIZE=256
- CONFIG_RT_UTEST_PIN=y
+
+# ------ devices CI ------
+devices.soft_i2c:
+ kconfig:
+ - CONFIG_RT_USING_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C1=y
+ - CONFIG_RT_SOFT_I2C1_SCL_PIN=105
+ - CONFIG_RT_SOFT_I2C1_SDA_PIN=106
+ - CONFIG_RT_SOFT_I2C1_BUS_NAME="swi2c1"
diff --git a/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig
index bfe1fd8b86..9de4f6fd81 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig
@@ -173,29 +173,26 @@ menu "On-chip Peripheral Drivers"
default 105
endif
endif
-
- menuconfig BSP_USING_I2C
- bool "Enable Software I2C Bus"
+ menuconfig BSP_USING_SOFT_I2C
+ bool "Enable software I2C (swi2c)"
default n
select RT_USING_I2C
- select RT_USING_I2C_BITOPS
- select RT_USING_PIN
- if BSP_USING_I2C
- config BSP_USING_I2C1
- bool "Enable I2C1 Bus (User I2C)"
- default n
- if BSP_USING_I2C1
- comment "Notice: P13_1 --> 105; P13_2 --> 106"
- config BSP_I2C1_SCL_PIN
- int "i2c1 SCL pin number"
- range 1 113
- default 105
- config BSP_I2C1_SDA_PIN
- int "i2c1 SDA pin number"
- range 1 113
- default 106
- endif
- endif
+ select RT_USING_SOFT_I2C
+ if BSP_USING_SOFT_I2C
+ menuconfig BSP_USING_SOFT_I2C1
+ bool "Enable software I2C1 Bus (swi2c1)"
+ default n
+ select RT_USING_SOFT_I2C1
+ if BSP_USING_SOFT_I2C1
+ config RT_SOFT_I2C1_SCL_PIN
+ int "swi2c1 SCL pin number"
+ default 105
+ config RT_SOFT_I2C1_SDA_PIN
+ int "swi2c1 SDA pin number"
+ default 106
+ endif
+ endif
+
menuconfig BSP_USING_RTC
bool "Enable RTC"
@@ -250,4 +247,16 @@ menu "On-chip Peripheral Drivers"
endif
endmenu
+ config RT_SOFT_I2C1_HAS_PIN_DEFAULT
+ bool
+ default y if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SCL_PIN_DEFAULT
+ int
+ default 105 if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SDA_PIN_DEFAULT
+ int
+ default 106 if RT_USING_SOFT_I2C1
+
endmenu
diff --git a/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/.ci/attachconfig/ci.attachconfig.yml b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/.ci/attachconfig/ci.attachconfig.yml
new file mode 100644
index 0000000000..6cbc2bc3c3
--- /dev/null
+++ b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/.ci/attachconfig/ci.attachconfig.yml
@@ -0,0 +1,8 @@
+devices.soft_i2c:
+ kconfig:
+ - CONFIG_RT_USING_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C1=y
+ - CONFIG_RT_SOFT_I2C1_SCL_PIN=105
+ - CONFIG_RT_SOFT_I2C1_SDA_PIN=106
+ - CONFIG_RT_SOFT_I2C1_BUS_NAME="swi2c1"
diff --git a/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig
index 6006e7e97d..4bfbbf1433 100644
--- a/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig
@@ -180,29 +180,26 @@ menu "On-chip Peripheral Drivers"
default 105
endif
endif
-
- menuconfig BSP_USING_I2C
- bool "Enable Software I2C Bus"
+ menuconfig BSP_USING_SOFT_I2C
+ bool "Enable software I2C (swi2c)"
default n
select RT_USING_I2C
- select RT_USING_I2C_BITOPS
- select RT_USING_PIN
- if BSP_USING_I2C
- config BSP_USING_I2C1
- bool "Enable I2C1 Bus (User I2C)"
- default n
- if BSP_USING_I2C1
- comment "Notice: P13_1 --> 105; P13_2 --> 106"
- config BSP_I2C1_SCL_PIN
- int "i2c1 SCL pin number"
- range 1 113
- default 105
- config BSP_I2C1_SDA_PIN
- int "i2c1 SDA pin number"
- range 1 113
- default 106
- endif
- endif
+ select RT_USING_SOFT_I2C
+ if BSP_USING_SOFT_I2C
+ menuconfig BSP_USING_SOFT_I2C1
+ bool "Enable software I2C1 Bus (swi2c1)"
+ default n
+ select RT_USING_SOFT_I2C1
+ if BSP_USING_SOFT_I2C1
+ config RT_SOFT_I2C1_SCL_PIN
+ int "swi2c1 SCL pin number"
+ default 105
+ config RT_SOFT_I2C1_SDA_PIN
+ int "swi2c1 SDA pin number"
+ default 106
+ endif
+ endif
+
config BSP_USING_USBD
bool "Enable USB Device"
@@ -325,4 +322,16 @@ menu "Board extended module Drivers"
endif
endmenu
+ config RT_SOFT_I2C1_HAS_PIN_DEFAULT
+ bool
+ default y if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SCL_PIN_DEFAULT
+ int
+ default 105 if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SDA_PIN_DEFAULT
+ int
+ default 106 if RT_USING_SOFT_I2C1
+
endmenu
diff --git a/bsp/Infineon/psoc6-evaluationkit-062S2/.ci/attachconfig/ci.attachconfig.yml b/bsp/Infineon/psoc6-evaluationkit-062S2/.ci/attachconfig/ci.attachconfig.yml
new file mode 100644
index 0000000000..6cbc2bc3c3
--- /dev/null
+++ b/bsp/Infineon/psoc6-evaluationkit-062S2/.ci/attachconfig/ci.attachconfig.yml
@@ -0,0 +1,8 @@
+devices.soft_i2c:
+ kconfig:
+ - CONFIG_RT_USING_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C=y
+ - CONFIG_RT_USING_SOFT_I2C1=y
+ - CONFIG_RT_SOFT_I2C1_SCL_PIN=105
+ - CONFIG_RT_SOFT_I2C1_SDA_PIN=106
+ - CONFIG_RT_SOFT_I2C1_BUS_NAME="swi2c1"
diff --git a/bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig b/bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig
index ef00b67eba..d98584b94b 100644
--- a/bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig
+++ b/bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig
@@ -229,29 +229,26 @@ menu "On-chip Peripheral Drivers"
default 65
endif
endif
-
- menuconfig BSP_USING_I2C
- bool "Enable Software I2C Bus"
+ menuconfig BSP_USING_SOFT_I2C
+ bool "Enable software I2C (swi2c)"
default n
select RT_USING_I2C
- select RT_USING_I2C_BITOPS
- select RT_USING_PIN
- if BSP_USING_I2C
- config BSP_USING_I2C1
- bool "Enable I2C1 Bus (User I2C)"
- default n
- if BSP_USING_I2C1
- comment "Notice: P13_1 --> 105; P13_2 --> 106"
- config BSP_I2C1_SCL_PIN
- int "i2c1 SCL pin number"
- range 1 113
- default 105
- config BSP_I2C1_SDA_PIN
- int "i2c1 SDA pin number"
- range 1 113
- default 106
- endif
- endif
+ select RT_USING_SOFT_I2C
+ if BSP_USING_SOFT_I2C
+ menuconfig BSP_USING_SOFT_I2C1
+ bool "Enable software I2C1 Bus (swi2c1)"
+ default n
+ select RT_USING_SOFT_I2C1
+ if BSP_USING_SOFT_I2C1
+ config RT_SOFT_I2C1_SCL_PIN
+ int "swi2c1 SCL pin number"
+ default 105
+ config RT_SOFT_I2C1_SDA_PIN
+ int "swi2c1 SDA pin number"
+ default 106
+ endif
+ endif
+
menuconfig BSP_USING_RTC
bool "Enable RTC"
@@ -487,4 +484,16 @@ menu "Board extended module Drivers"
default n
endmenu
-endmenu \ No newline at end of file
+ config RT_SOFT_I2C1_HAS_PIN_DEFAULT
+ bool
+ default y if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SCL_PIN_DEFAULT
+ int
+ default 105 if RT_USING_SOFT_I2C1
+
+ config RT_SOFT_I2C1_SDA_PIN_DEFAULT
+ int
+ default 106 if RT_USING_SOFT_I2C1
+
+endmenu