diff --git a/components/driver/i2c/include/driver/i2c.h b/components/driver/i2c/include/driver/i2c.h index 6d2add0db5..8cbd0664b8 100644 --- a/components/driver/i2c/include/driver/i2c.h +++ b/components/driver/i2c/include/driver/i2c.h @@ -1,29 +1,20 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ -#ifndef _DRIVER_I2C_H_ -#define _DRIVER_I2C_H_ +#pragma once -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include "esp_err.h" -#include "esp_intr_alloc.h" #include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "freertos/task.h" -#include "freertos/queue.h" -#include "driver/gpio.h" +#include "esp_types.h" +#include "esp_err.h" +#include "esp_intr_alloc.h" // for intr_alloc_flags #include "soc/soc_caps.h" #include "hal/i2c_types.h" -#if SOC_I2C_SUPPORT_APB -#define I2C_APB_CLK_FREQ _Pragma ("GCC warning \"'I2C_APB_CLK_FREQ' macro is deprecated\"") (APB_CLK_FREQ) /*!< I2C source clock is APB clock, 80MHz, deprecated */ +#ifdef __cplusplus +extern "C" { #endif // I2C clk flags for users to use, can be expanded in the future. @@ -630,5 +621,3 @@ esp_err_t i2c_get_data_mode(i2c_port_t i2c_num, i2c_trans_mode_t *tx_trans_mode, #ifdef __cplusplus } #endif - -#endif /*_DRIVER_I2C_H_*/ diff --git a/tools/test_apps/peripherals/i2c_wifi/main/i2c_wifi_main.c b/tools/test_apps/peripherals/i2c_wifi/main/i2c_wifi_main.c index fcf1770a24..0467a5374d 100644 --- a/tools/test_apps/peripherals/i2c_wifi/main/i2c_wifi_main.c +++ b/tools/test_apps/peripherals/i2c_wifi/main/i2c_wifi_main.c @@ -106,9 +106,9 @@ static esp_err_t i2c_master_init(void) i2c_config_t conf_master = { .mode = I2C_MODE_MASTER, .sda_io_num = I2C_SDA_GPIO, - .sda_pullup_en = GPIO_PULLUP_ENABLE, + .sda_pullup_en = true, .scl_io_num = I2C_SCL_GPIO, - .scl_pullup_en = GPIO_PULLUP_ENABLE, + .scl_pullup_en = true, .master.clk_speed = I2C_CLK_FREQUENCY, };