1515#include <zephyr/drivers/gpio.h>
1616#endif /* CONFIG_I2C_STM32_BUS_RECOVERY */
1717
18+ #include <zephyr/drivers/dma.h>
19+
1820typedef void (* irq_config_func_t )(const struct device * port );
1921
2022#if DT_HAS_COMPAT_STATUS_OKAY (st_stm32_i2c_v2 )
@@ -31,6 +33,13 @@ struct i2c_config_timing {
3133};
3234#endif
3335
36+ #ifdef CONFIG_I2C_STM32_V2_DMA
37+ struct stream {
38+ const struct device * dev_dma ;
39+ int32_t dma_channel ;
40+ };
41+ #endif /* CONFIG_I2C_STM32_V2_DMA */
42+
3443struct i2c_stm32_config {
3544#ifdef CONFIG_I2C_STM32_INTERRUPT
3645 irq_config_func_t irq_config_func ;
@@ -48,6 +57,10 @@ struct i2c_stm32_config {
4857 const struct i2c_config_timing * timings ;
4958 size_t n_timings ;
5059#endif
60+ #ifdef CONFIG_I2C_STM32_V2_DMA
61+ struct stream tx_dma ;
62+ struct stream rx_dma ;
63+ #endif /* CONFIG_I2C_STM32_V2_DMA */
5164};
5265
5366struct i2c_stm32_data {
@@ -91,6 +104,10 @@ struct i2c_stm32_data {
91104 i2c_stm32_smbalert_cb_func_t smbalert_cb_func ;
92105 const struct device * smbalert_cb_dev ;
93106#endif
107+ #ifdef CONFIG_I2C_STM32_V2_DMA
108+ struct dma_config dma_cfg ;
109+ struct dma_block_config dma_blk_cfg ;
110+ #endif /* CONFIG_I2C_STM32_V2_DMA */
94111};
95112
96113int stm32_i2c_transaction (const struct device * dev ,
0 commit comments