diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2022-04-11 10:58:11 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2022-04-11 10:58:34 -0400 |
commit | 38e82e8d8f4d27edbefaa822d8ecce229c4ce8c5 (patch) | |
tree | e47d5f6be041e8e5746d145a0d06672121248f27 /src/stm32 | |
parent | 5d82be2f5d0f339505e4b9bbcaf292e340a4f9f5 (diff) | |
download | kutter-38e82e8d8f4d27edbefaa822d8ecce229c4ce8c5.tar.gz kutter-38e82e8d8f4d27edbefaa822d8ecce229c4ce8c5.tar.xz kutter-38e82e8d8f4d27edbefaa822d8ecce229c4ce8c5.zip |
stm32: Add support for additional i2c buses
Reported by @StoneColdCrazy.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32')
-rw-r--r-- | src/stm32/i2c.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/stm32/i2c.c b/src/stm32/i2c.c index d333d4b7..d9583694 100644 --- a/src/stm32/i2c.c +++ b/src/stm32/i2c.c @@ -23,11 +23,28 @@ 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"); +#if CONFIG_MACH_STM32F2 || CONFIG_MACH_STM324 +DECL_ENUMERATION("i2c_bus", "i2c3", 3); +DECL_CONSTANT_STR("BUS_PINS_i2c3", "PA8,PC9"); + #if CONFIG_MACH_STM32F2 || CONFIG_MACH_STM32F4x5 +DECL_ENUMERATION("i2c_bus", "i2c2a", 4); +DECL_CONSTANT_STR("BUS_PINS_i2c2a", "PH4,PH5"); +DECL_ENUMERATION("i2c_bus", "i2c3a", 5); +DECL_CONSTANT_STR("BUS_PINS_i2c3a", "PH7,PH8"); + #endif +#endif 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) }, +#if CONFIG_MACH_STM32F2 || CONFIG_MACH_STM324 + { I2C3, GPIO('A', 8), GPIO('C', 9) }, + #if CONFIG_MACH_STM32F2 || CONFIG_MACH_STM32F4x5 + { I2C2, GPIO('H', 4), GPIO('H', 5) }, + { I2C3, GPIO('H', 7), GPIO('H', 8) }, + #endif +#endif }; // Work around stm32 errata causing busy bit to be stuck |