aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/i2c.c
diff options
context:
space:
mode:
authorMichael Kurz <michi.kurz@googlemail.com>2021-03-03 05:02:20 +0100
committerGitHub <noreply@github.com>2021-03-02 23:02:20 -0500
commitab979a52cfdbc8184c9ad1747210d2a49bf719a2 (patch)
tree8c5c767db399a24168df5b4e2975f629f9fd8242 /src/stm32/i2c.c
parent5f80c84309f30a6363d1b9cd9999749b57de0ef0 (diff)
downloadkutter-ab979a52cfdbc8184c9ad1747210d2a49bf719a2.tar.gz
kutter-ab979a52cfdbc8184c9ad1747210d2a49bf719a2.tar.xz
kutter-ab979a52cfdbc8184c9ad1747210d2a49bf719a2.zip
stm32: Add support for STM32F1 I2C1 alternate pin mapping (#4012)
This adds support for the alternate pin mapping of I2C1 on PB8/9 in STM32F1 devices Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
Diffstat (limited to 'src/stm32/i2c.c')
-rw-r--r--src/stm32/i2c.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stm32/i2c.c b/src/stm32/i2c.c
index 72e3d251..d333d4b7 100644
--- a/src/stm32/i2c.c
+++ b/src/stm32/i2c.c
@@ -17,12 +17,16 @@ struct i2c_info {
uint8_t scl_pin, sda_pin;
};
-DECL_ENUMERATION_RANGE("i2c_bus", "i2c1", 0, 2);
+DECL_ENUMERATION("i2c_bus", "i2c1", 0);
DECL_CONSTANT_STR("BUS_PINS_i2c1", "PB6,PB7");
+DECL_ENUMERATION("i2c_bus", "i2c1a", 1);
+DECL_CONSTANT_STR("BUS_PINS_i2c1a", "PB8,PB9");
+DECL_ENUMERATION("i2c_bus", "i2c2", 2);
DECL_CONSTANT_STR("BUS_PINS_i2c2", "PB10,PB11");
static const struct i2c_info i2c_bus[] = {
{ I2C1, GPIO('B', 6), GPIO('B', 7) },
+ { I2C1, GPIO('B', 8), GPIO('B', 9) },
{ I2C2, GPIO('B', 10), GPIO('B', 11) },
};