aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32f0_i2c.c
diff options
context:
space:
mode:
authorMatt Baker <baker.matt.j@gmail.com>2022-09-21 21:45:51 -0700
committerKevinOConnor <kevin@koconnor.net>2022-12-02 11:31:42 -0500
commitc5d56f4438de4fd9b9a06948415eb5c8f3ecdbd7 (patch)
tree68a733022592bf8e671b27172b1d04f7740ea2bd /src/stm32/stm32f0_i2c.c
parent9ab367d8136d059c14f0cc5e9ab0a198d744d5b4 (diff)
downloadkutter-c5d56f4438de4fd9b9a06948415eb5c8f3ecdbd7.tar.gz
kutter-c5d56f4438de4fd9b9a06948415eb5c8f3ecdbd7.tar.xz
kutter-c5d56f4438de4fd9b9a06948415eb5c8f3ecdbd7.zip
stm32g4: implement build,usb,can,i2c,spi,serial,adc.
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
Diffstat (limited to 'src/stm32/stm32f0_i2c.c')
-rw-r--r--src/stm32/stm32f0_i2c.c27
1 files changed, 27 insertions, 0 deletions
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
};