1# Copyright (c) 2018 Intel Corporation
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig I2C_STM32
5	bool "STM32 I2C driver"
6	default y
7	depends on DT_HAS_ST_STM32_I2C_V1_ENABLED || DT_HAS_ST_STM32_I2C_V2_ENABLED
8	select PINCTRL
9	help
10	  Enable I2C support on the STM32 SoCs
11
12if I2C_STM32
13
14config I2C_STM32_V1
15	bool
16	default y
17	depends on DT_HAS_ST_STM32_I2C_V1_ENABLED
18	select I2C_STM32_INTERRUPT if I2C_TARGET
19	help
20	  Driver variant matching `st,stm32-i2c-v1` compatible.
21
22config I2C_STM32_V2
23	bool
24	default y
25	depends on DT_HAS_ST_STM32_I2C_V2_ENABLED
26	select I2C_STM32_INTERRUPT if I2C_TARGET
27	help
28	  Driver variant matching `st,stm32-i2c-v2` compatible.
29	  If I2C_TARGET is enabled it selects I2C_STM32_INTERRUPT, since target mode
30	  is only supported by this driver with interrupts enabled.
31
32config I2C_STM32_INTERRUPT
33	bool "STM32 MCU I2C Interrupt Support"
34	depends on I2C_STM32_V1 || I2C_STM32_V2
35	default y
36	help
37	  Enable Interrupt support for the I2C Driver
38
39config I2C_STM32_COMBINED_INTERRUPT
40	bool
41	depends on I2C_STM32_INTERRUPT
42	default y if SOC_SERIES_STM32C0X || SOC_SERIES_STM32F0X || \
43		     SOC_SERIES_STM32G0X || SOC_SERIES_STM32L0X || \
44		     SOC_SERIES_STM32U0X || SOC_SERIES_STM32WB0X
45
46config I2C_STM32_BUS_RECOVERY
47	bool "Bus recovery support"
48	select I2C_BITBANG
49	help
50	  Enable STM32 driver bus recovery support via GPIO bitbanging.
51
52config I2C_STM32_V2_TIMING
53	bool "compute the I2C V2 bus timing"
54	depends on I2C_STM32_V2
55	help
56	  Enable STM32 driver bus to calculate the Timing.
57
58endif # I2C_STM32
59