瀏覽代碼

[bsp][stm32] restore soft iic driver

SummerGift 6 年之前
父節點
當前提交
8963bb6966
共有 2 個文件被更改,包括 1 次插入13 次删除
  1. 1 4
      bsp/stm32/libraries/HAL_Drivers/drv_soft_i2c.c
  2. 0 9
      bsp/stm32/libraries/HAL_Drivers/drv_soft_i2c.h

+ 1 - 4
bsp/stm32/libraries/HAL_Drivers/drv_soft_i2c.c

@@ -18,7 +18,7 @@
 #define LOG_TAG              "drv.i2c"
 #include <drv_log.h>
 
-#if !defined(BSP_USING_I2C1) && !defined(BSP_USING_I2C2) && !defined(BSP_USING_I2C3) && !defined(BSP_USING_I2C4) 
+#if !defined(BSP_USING_I2C1) && !defined(BSP_USING_I2C2) && !defined(BSP_USING_I2C3)
 #error "Please define at least one BSP_USING_I2Cx"
 /* this driver can be disabled at menuconfig → RT-Thread Components → Device Drivers */
 #endif
@@ -34,9 +34,6 @@ static const struct stm32_soft_i2c_config soft_i2c_config[] =
 #ifdef BSP_USING_I2C3
     I2C3_BUS_CONFIG,
 #endif
-#ifdef BSP_USING_I2C4
-    I2C4_BUS_CONFIG,
-#endif
 };
 
 static struct stm32_i2c i2c_obj[sizeof(soft_i2c_config) / sizeof(soft_i2c_config[0])];

+ 0 - 9
bsp/stm32/libraries/HAL_Drivers/drv_soft_i2c.h

@@ -56,15 +56,6 @@ struct stm32_i2c
     }
 #endif
 
-#ifdef BSP_USING_I2C4
-#define I2C4_BUS_CONFIG                                  \
-    {                                                    \
-        .scl = BSP_I2C4_SCL_PIN,                         \
-        .sda = BSP_I2C4_SDA_PIN,                         \
-        .bus_name = "i2c4",                              \
-    }
-#endif
-
 int rt_hw_i2c_init(void);
 
 #endif