drivers: i2c: add STM32G0X I2C support
Add I2C driver support for STM32G0X SoC series. Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
This commit is contained in:
parent
b0826a7f65
commit
fc2dfae64f
5 changed files with 56 additions and 3 deletions
|
@ -21,6 +21,13 @@ config GPIO_STM32_PORTD
|
|||
config GPIO_STM32_PORTF
|
||||
default y
|
||||
|
||||
if I2C_STM32
|
||||
|
||||
config I2C_STM32_V2
|
||||
default y
|
||||
|
||||
endif # I2C_STM32
|
||||
|
||||
endif # GPIO_STM32
|
||||
|
||||
endif # SOC_SERIES_STM32G0X
|
||||
|
|
|
@ -63,6 +63,22 @@
|
|||
|
||||
/* there is no reference to GPIOE, GPIOG and GPIOH in the dts files */
|
||||
|
||||
#define DT_I2C_1_BASE_ADDRESS DT_ST_STM32_I2C_V2_40005400_BASE_ADDRESS
|
||||
#define DT_I2C_1_COMBINED_IRQ_PRI DT_ST_STM32_I2C_V2_40005400_IRQ_COMBINED_PRIORITY
|
||||
#define DT_I2C_1_NAME DT_ST_STM32_I2C_V2_40005400_LABEL
|
||||
#define DT_I2C_1_COMBINED_IRQ DT_ST_STM32_I2C_V2_40005400_IRQ_COMBINED
|
||||
#define DT_I2C_1_BITRATE DT_ST_STM32_I2C_V2_40005400_CLOCK_FREQUENCY
|
||||
#define DT_I2C_1_CLOCK_BITS DT_ST_STM32_I2C_V2_40005400_CLOCK_BITS
|
||||
#define DT_I2C_1_CLOCK_BUS DT_ST_STM32_I2C_V2_40005400_CLOCK_BUS
|
||||
|
||||
#define DT_I2C_2_BASE_ADDRESS DT_ST_STM32_I2C_V2_40005800_BASE_ADDRESS
|
||||
#define DT_I2C_2_COMBINED_IRQ_PRI DT_ST_STM32_I2C_V2_40005800_IRQ_COMBINED_PRIORITY
|
||||
#define DT_I2C_2_NAME DT_ST_STM32_I2C_V2_40005800_LABEL
|
||||
#define DT_I2C_2_COMBINED_IRQ DT_ST_STM32_I2C_V2_40005800_IRQ_COMBINED
|
||||
#define DT_I2C_2_BITRATE DT_ST_STM32_I2C_V2_40005800_CLOCK_FREQUENCY
|
||||
#define DT_I2C_2_CLOCK_BITS DT_ST_STM32_I2C_V2_40005800_CLOCK_BITS
|
||||
#define DT_I2C_2_CLOCK_BUS DT_ST_STM32_I2C_V2_40005800_CLOCK_BUS
|
||||
|
||||
#define DT_UART_STM32_USART_1_BASE_ADDRESS DT_ST_STM32_USART_40013800_BASE_ADDRESS
|
||||
#define DT_UART_STM32_USART_1_BAUD_RATE DT_ST_STM32_USART_40013800_CURRENT_SPEED
|
||||
#define DT_UART_STM32_USART_1_IRQ_PRI DT_ST_STM32_USART_40013800_IRQ_0_PRIORITY
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
#include <stm32g0xx_ll_gpio.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C
|
||||
#include <stm32g0xx_ll_i2c.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WWDG_STM32
|
||||
#include <stm32g0xx_ll_wwdg.h>
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue