drivers: i2c: Add STM32L1X I2C support
Add I2C support for STM32L1X SoC series based on I2C_STM32_V1 driver. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
parent
0525019b23
commit
b31adf2d33
5 changed files with 60 additions and 2 deletions
|
@ -12,4 +12,11 @@ source "soc/arm/st_stm32/stm32l1/Kconfig.defconfig.stm32l1*"
|
|||
config SOC_SERIES
|
||||
default "stm32l1"
|
||||
|
||||
if I2C_STM32
|
||||
|
||||
config I2C_STM32_V1
|
||||
default y
|
||||
|
||||
endif # I2C_STM32
|
||||
|
||||
endif # SOC_SERIES_STM32L1X
|
||||
|
|
|
@ -89,4 +89,24 @@
|
|||
#define DT_UART_STM32_USART_3_CLOCK_BUS DT_ST_STM32_USART_40004800_CLOCK_BUS
|
||||
#define DT_UART_STM32_USART_3_HW_FLOW_CONTROL DT_ST_STM32_USART_40004800_HW_FLOW_CONTROL
|
||||
|
||||
#define DT_I2C_1_BASE_ADDRESS DT_ST_STM32_I2C_V1_40005400_BASE_ADDRESS
|
||||
#define DT_I2C_1_EVENT_IRQ_PRI DT_ST_STM32_I2C_V1_40005400_IRQ_EVENT_PRIORITY
|
||||
#define DT_I2C_1_ERROR_IRQ_PRI DT_ST_STM32_I2C_V1_40005400_IRQ_ERROR_PRIORITY
|
||||
#define CONFIG_I2C_1_NAME DT_ST_STM32_I2C_V1_40005400_LABEL
|
||||
#define DT_I2C_1_EVENT_IRQ DT_ST_STM32_I2C_V1_40005400_IRQ_EVENT
|
||||
#define DT_I2C_1_ERROR_IRQ DT_ST_STM32_I2C_V1_40005400_IRQ_ERROR
|
||||
#define DT_I2C_1_BITRATE DT_ST_STM32_I2C_V1_40005400_CLOCK_FREQUENCY
|
||||
#define DT_I2C_1_CLOCK_BITS DT_ST_STM32_I2C_V1_40005400_CLOCK_BITS
|
||||
#define DT_I2C_1_CLOCK_BUS DT_ST_STM32_I2C_V1_40005400_CLOCK_BUS
|
||||
|
||||
#define DT_I2C_2_BASE_ADDRESS DT_ST_STM32_I2C_V1_40005800_BASE_ADDRESS
|
||||
#define DT_I2C_2_EVENT_IRQ_PRI DT_ST_STM32_I2C_V1_40005800_IRQ_EVENT_PRIORITY
|
||||
#define DT_I2C_2_ERROR_IRQ_PRI DT_ST_STM32_I2C_V1_40005800_IRQ_ERROR_PRIORITY
|
||||
#define CONFIG_I2C_2_NAME DT_ST_STM32_I2C_V1_40005800_LABEL
|
||||
#define DT_I2C_2_EVENT_IRQ DT_ST_STM32_I2C_V1_40005800_IRQ_EVENT
|
||||
#define DT_I2C_2_ERROR_IRQ DT_ST_STM32_I2C_V1_40005800_IRQ_ERROR
|
||||
#define DT_I2C_2_BITRATE DT_ST_STM32_I2C_V1_40005800_CLOCK_FREQUENCY
|
||||
#define DT_I2C_2_CLOCK_BITS DT_ST_STM32_I2C_V1_40005800_CLOCK_BITS
|
||||
#define DT_I2C_2_CLOCK_BUS DT_ST_STM32_I2C_V1_40005800_CLOCK_BUS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
#include <stm32l1xx_ll_exti.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C
|
||||
#include <stm32l1xx_ll_i2c.h>
|
||||
#endif
|
||||
|
||||
#endif /* !_ASMLANGUAGE */
|
||||
|
||||
#endif /* _STM32L1_SOC_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue