drivers: i2c: Add STM32G4X I2C support
Add I2C driver support for STM32G4X SoC series. Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
This commit is contained in:
parent
c68e027c28
commit
4ce35300c8
5 changed files with 83 additions and 2 deletions
|
@ -28,5 +28,12 @@ config GPIO_STM32_PORTF
|
|||
config GPIO_STM32_PORTG
|
||||
default y
|
||||
|
||||
if I2C_STM32
|
||||
|
||||
config I2C_STM32_V2
|
||||
default y
|
||||
|
||||
endif # I2C_STM32
|
||||
|
||||
endif # GPIO_STM32
|
||||
endif # SOC_SERIES_STM32G4X
|
||||
|
|
|
@ -119,4 +119,34 @@
|
|||
#define DT_FLASH_DEV_BASE_ADDRESS DT_ST_STM32G4_FLASH_CONTROLLER_40022000_BASE_ADDRESS
|
||||
#define DT_FLASH_DEV_NAME DT_ST_STM32G4_FLASH_CONTROLLER_40022000_LABEL
|
||||
|
||||
#define DT_I2C_1_BASE_ADDRESS DT_ST_STM32_I2C_V2_40005400_BASE_ADDRESS
|
||||
#define DT_I2C_1_EVENT_IRQ_PRI DT_ST_STM32_I2C_V2_40005400_IRQ_EVENT_PRIORITY
|
||||
#define DT_I2C_1_ERROR_IRQ_PRI DT_ST_STM32_I2C_V2_40005400_IRQ_ERROR_PRIORITY
|
||||
#define CONFIG_I2C_1_NAME DT_ST_STM32_I2C_V2_40005400_LABEL
|
||||
#define DT_I2C_1_EVENT_IRQ DT_ST_STM32_I2C_V2_40005400_IRQ_EVENT
|
||||
#define DT_I2C_1_ERROR_IRQ DT_ST_STM32_I2C_V2_40005400_IRQ_ERROR
|
||||
#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_EVENT_IRQ_PRI DT_ST_STM32_I2C_V2_40005800_IRQ_EVENT_PRIORITY
|
||||
#define DT_I2C_2_ERROR_IRQ_PRI DT_ST_STM32_I2C_V2_40005800_IRQ_ERROR_PRIORITY
|
||||
#define CONFIG_I2C_2_NAME DT_ST_STM32_I2C_V2_40005800_LABEL
|
||||
#define DT_I2C_2_EVENT_IRQ DT_ST_STM32_I2C_V2_40005800_IRQ_EVENT
|
||||
#define DT_I2C_2_ERROR_IRQ DT_ST_STM32_I2C_V2_40005800_IRQ_ERROR
|
||||
#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_I2C_3_BASE_ADDRESS DT_ST_STM32_I2C_V2_40007800_BASE_ADDRESS
|
||||
#define DT_I2C_3_EVENT_IRQ_PRI DT_ST_STM32_I2C_V2_40007800_IRQ_EVENT_PRIORITY
|
||||
#define DT_I2C_3_ERROR_IRQ_PRI DT_ST_STM32_I2C_V2_40007800_IRQ_ERROR_PRIORITY
|
||||
#define CONFIG_I2C_3_NAME DT_ST_STM32_I2C_V2_40007800_LABEL
|
||||
#define DT_I2C_3_EVENT_IRQ DT_ST_STM32_I2C_V2_40007800_IRQ_EVENT
|
||||
#define DT_I2C_3_ERROR_IRQ DT_ST_STM32_I2C_V2_40007800_IRQ_ERROR
|
||||
#define DT_I2C_3_BITRATE DT_ST_STM32_I2C_V2_40007800_CLOCK_FREQUENCY
|
||||
#define DT_I2C_3_CLOCK_BITS DT_ST_STM32_I2C_V2_40007800_CLOCK_BITS
|
||||
#define DT_I2C_3_CLOCK_BUS DT_ST_STM32_I2C_V2_40007800_CLOCK_BUS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -48,6 +48,10 @@
|
|||
#include <stm32g4xx_ll_lpuart.h>
|
||||
#endif /* CONFIG_SERIAL_HAS_DRIVER */
|
||||
|
||||
#ifdef CONFIG_I2C
|
||||
#include <stm32g4xx_ll_i2c.h>
|
||||
#endif /* CONFIG_I2C */
|
||||
|
||||
#endif /* !_ASMLANGUAGE */
|
||||
|
||||
#endif /* _STM32G4_SOC_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue