Skip to content

Commit ce03586

Browse files
sgilbert182carlescufi
authored andcommitted
i2c: stm32: Add dma settings structs to config and data structs
Add initial DMA settings structs to stm32 i2c config and data structs Signed-off-by: Simon Gilbert <[email protected]>
1 parent 5fb2767 commit ce03586

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/i2c/i2c_ll_stm32.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <zephyr/drivers/gpio.h>
1616
#endif /* CONFIG_I2C_STM32_BUS_RECOVERY */
1717

18+
#include <zephyr/drivers/dma.h>
19+
1820
typedef 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+
3443
struct 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

5366
struct 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

96113
int stm32_i2c_transaction(const struct device *dev,

0 commit comments

Comments
 (0)