Skip to content

Commit 456ae96

Browse files
committed
Merge branch 'refactor/remove_i2c_slave_v1' into 'master'
refactor(i2c): Remove i2c slave v1 driver See merge request espressif/esp-idf!39329
2 parents b356086 + 1f37a8d commit 456ae96

File tree

14 files changed

+324
-877
lines changed

14 files changed

+324
-877
lines changed

components/esp_driver_i2c/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ if(CONFIG_SOC_I2C_SUPPORTED)
1010
"i2c_common.c"
1111
)
1212
if(CONFIG_SOC_I2C_SUPPORT_SLAVE)
13-
if(CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2)
14-
list(APPEND srcs "i2c_slave_v2.c")
15-
else()
16-
list(APPEND srcs "i2c_slave.c")
17-
endif()
13+
list(APPEND srcs "i2c_slave.c")
1814
endif()
1915

2016
endif()

components/esp_driver_i2c/Kconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ menu "ESP-Driver:I2C Configurations"
1818

1919
note: This cannot be used in the I2C legacy driver.
2020

21-
config I2C_ENABLE_SLAVE_DRIVER_VERSION_2
22-
bool "Enable I2C slave driver version 2"
23-
default n
24-
help
25-
I2C slave version 2 solves some existing known issues. Such as write/read workflow, stretch handling, etc.
26-
2721
config I2C_MASTER_ISR_HANDLER_IN_IRAM
2822
bool "Place I2C master ISR handler into IRAM"
2923
default y

components/esp_driver_i2c/i2c_private.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -193,27 +193,6 @@ typedef struct {
193193
uint32_t rcv_fifo_cnt; // receive fifo count.
194194
} i2c_slave_receive_t;
195195

196-
#if !CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2
197-
198-
struct i2c_slave_dev_t {
199-
i2c_bus_t *base; // bus base class
200-
SemaphoreHandle_t slv_rx_mux; // Mutex for slave rx direction
201-
SemaphoreHandle_t slv_tx_mux; // Mutex for slave tx direction
202-
RingbufHandle_t rx_ring_buf; // Handle for rx ringbuffer
203-
RingbufHandle_t tx_ring_buf; // Handle for tx ringbuffer
204-
uint8_t data_buf[SOC_I2C_FIFO_LEN]; // Data buffer for slave
205-
uint32_t trans_data_length; // Send data length
206-
i2c_slave_event_callbacks_t callbacks; // I2C slave callbacks
207-
void *user_ctx; // Callback user context
208-
i2c_slave_fifo_mode_t fifo_mode; // Slave fifo mode.
209-
QueueHandle_t slv_evt_queue; // Event Queue used in slave nonfifo mode.
210-
i2c_slave_evt_t slave_evt; // Slave event structure.
211-
i2c_slave_receive_t receive_desc; // Slave receive descriptor
212-
uint32_t already_receive_len; // Data length already received in ISR.
213-
};
214-
215-
#else // CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2
216-
217196
struct i2c_slave_dev_t {
218197
i2c_bus_t *base; // bus base class
219198
SemaphoreHandle_t operation_mux; // Mux for i2c slave operation
@@ -226,8 +205,6 @@ struct i2c_slave_dev_t {
226205
i2c_slave_receive_t receive_desc; // slave receive descriptor
227206
};
228207

229-
#endif // CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2
230-
231208
/**
232209
* @brief Acquire I2C bus handle
233210
*

0 commit comments

Comments
 (0)