From c5d56f4438de4fd9b9a06948415eb5c8f3ecdbd7 Mon Sep 17 00:00:00 2001 From: Matt Baker Date: Wed, 21 Sep 2022 21:45:51 -0700 Subject: stm32g4: implement build,usb,can,i2c,spi,serial,adc. Signed-off-by: Matt Baker --- src/stm32/stm32f0_i2c.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/stm32/stm32f0_i2c.c') diff --git a/src/stm32/stm32f0_i2c.c b/src/stm32/stm32f0_i2c.c index 418e1c1e..6096b673 100644 --- a/src/stm32/stm32f0_i2c.c +++ b/src/stm32/stm32f0_i2c.c @@ -48,6 +48,23 @@ DECL_ENUMERATION("i2c_bus", "i2c2_PB13_PB14", 4); DECL_CONSTANT_STR("BUS_PINS_i2c2_PB13_PB14", "PB13,PB14"); DECL_ENUMERATION("i2c_bus", "i2c1_PA9_PA10", 5); DECL_CONSTANT_STR("BUS_PINS_i2c1_PA9_PA10", "PA9,PA10"); +#elif CONFIG_MACH_STM32G4 +DECL_ENUMERATION("i2c_bus", "i2c1_PA13_PA14", 0); +DECL_CONSTANT_STR("BUS_PINS_i2c1_PA13_PA14", "PA13,PA14"); +DECL_ENUMERATION("i2c_bus", "i2c1_PA15_PA14", 1); +DECL_CONSTANT_STR("BUS_PINS_i2c1_PA15_PA14", "PA15,PA14"); +DECL_ENUMERATION("i2c_bus", "i2c1_PB8_PB7", 2); +DECL_CONSTANT_STR("BUS_PINS_i2c1_PB8_PB7", "PB8,PB7"); +DECL_ENUMERATION("i2c_bus", "i2c1_PB8_PB9", 3); +DECL_CONSTANT_STR("BUS_PINS_i2c1_PB8_PB9", "PB8,PB9"); +DECL_ENUMERATION("i2c_bus", "i2c2_PA9_PA8", 4); +DECL_CONSTANT_STR("BUS_PINS_i2c2_PA9_PA8", "PA9,PA8"); +DECL_ENUMERATION("i2c_bus", "i2c2_PC4_PF0", 5); +DECL_CONSTANT_STR("BUS_PINS_i2c2_PC4_PF0", "PC4,PF0"); +DECL_ENUMERATION("i2c_bus", "i2c3_PC8_PC9", 6); +DECL_CONSTANT_STR("BUS_PINS_i2c3_PC8_PC9", "PC8,PC9"); +DECL_ENUMERATION("i2c_bus", "i2c3_PC8_PC11", 7); +DECL_CONSTANT_STR("BUS_PINS_i2c3_PC8_PC11", "PC8,PC11"); #endif static const struct i2c_info i2c_bus[] = { @@ -67,6 +84,16 @@ static const struct i2c_info i2c_bus[] = { { I2C2, GPIO('B', 10), GPIO('B', 11), GPIO_FUNCTION(GPIO_AF_INDEX) }, { I2C2, GPIO('B', 13), GPIO('B', 14), GPIO_FUNCTION(GPIO_AF_INDEX) }, { I2C1, GPIO('A', 9), GPIO('A', 10), GPIO_FUNCTION(GPIO_AF_INDEX) }, +#elif CONFIG_MACH_STM32G4 + { I2C1, GPIO('A', 13), GPIO('A', 14), GPIO_FUNCTION(4) }, + { I2C1, GPIO('A', 15), GPIO('A', 14), GPIO_FUNCTION(4) }, + { I2C1, GPIO('B', 8), GPIO('B', 7), GPIO_FUNCTION(4) }, + { I2C1, GPIO('B', 8), GPIO('B', 9), GPIO_FUNCTION(4) }, + { I2C2, GPIO('A', 9), GPIO('A', 8), GPIO_FUNCTION(4) }, + { I2C2, GPIO('C', 4), GPIO('F', 0), GPIO_FUNCTION(4) }, + { I2C3, GPIO('C', 8), GPIO('C', 9), GPIO_FUNCTION(8) }, + { I2C3, GPIO('C', 8), GPIO('C', 11), GPIO_FUNCTION(8) }, +// { I2C3, GPIO('A', 8), GPIO('B', 5), GPIO_FUNCTION(4) }, #endif }; -- cgit v1.2.3-70-g09d2