aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32f0_i2c.c
diff options
context:
space:
mode:
authorBIGTREETECH <38851044+bigtreetech@users.noreply.github.com>2023-03-28 09:32:42 +0800
committerGitHub <noreply@github.com>2023-03-27 21:32:42 -0400
commitd518152ab27637c306eb1a275c5211e5fd5d2a2a (patch)
treee8d4a3801b755f24b00a797da1dce5f808323f56 /src/stm32/stm32f0_i2c.c
parent346e3901f6076987bdb8a6ec391f00f07e5c45e2 (diff)
downloadkutter-d518152ab27637c306eb1a275c5211e5fd5d2a2a.tar.gz
kutter-d518152ab27637c306eb1a275c5211e5fd5d2a2a.tar.xz
kutter-d518152ab27637c306eb1a275c5211e5fd5d2a2a.zip
stm32: Enable I2C on stm32h7 (#6130)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
Diffstat (limited to 'src/stm32/stm32f0_i2c.c')
-rw-r--r--src/stm32/stm32f0_i2c.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/stm32/stm32f0_i2c.c b/src/stm32/stm32f0_i2c.c
index a37306e8..48c3ae3e 100644
--- a/src/stm32/stm32f0_i2c.c
+++ b/src/stm32/stm32f0_i2c.c
@@ -72,6 +72,13 @@ struct i2c_info {
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");
+#elif CONFIG_MACH_STM32H7
+ DECL_ENUMERATION("i2c_bus", "i2c1_PB6_PB7", 0);
+ DECL_CONSTANT_STR("BUS_PINS_i2c1_PB6_PB7", "PB6,PB7");
+ DECL_ENUMERATION("i2c_bus", "i2c1_PB8_PB9", 1);
+ DECL_CONSTANT_STR("BUS_PINS_i2c1_PB8_PB9", "PB8,PB9");
+ DECL_ENUMERATION("i2c_bus", "i2c2_PB10_PB11", 2);
+ DECL_CONSTANT_STR("BUS_PINS_i2c2_PB10_PB11", "PB10,PB11");
#endif
static const struct i2c_info i2c_bus[] = {
@@ -104,6 +111,10 @@ static const struct i2c_info i2c_bus[] = {
{ 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) },
+#elif CONFIG_MACH_STM32H7
+ { I2C1, GPIO('B', 6), GPIO('B', 7), GPIO_FUNCTION(4) },
+ { I2C1, GPIO('B', 8), GPIO('B', 9), GPIO_FUNCTION(4) },
+ { I2C2, GPIO('B', 10), GPIO('B', 11), GPIO_FUNCTION(4) },
#endif
};