aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32f1.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-05-25 23:28:48 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-05-26 00:04:30 -0400
commit4ea434796bb1f5bcc9d44bfcd0d9d66b8476faa9 (patch)
tree17d30ab429199b258f248d06acf2340b69e85aeb /src/stm32/stm32f1.c
parentf99dca09181bd3967913ec6f214216f80b8cfae2 (diff)
downloadkutter-4ea434796bb1f5bcc9d44bfcd0d9d66b8476faa9.tar.gz
kutter-4ea434796bb1f5bcc9d44bfcd0d9d66b8476faa9.tar.xz
kutter-4ea434796bb1f5bcc9d44bfcd0d9d66b8476faa9.zip
stm32: Support spi1 on PB4/PB5/PB3 on stm32f103 and stm32f2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/stm32f1.c')
-rw-r--r--src/stm32/stm32f1.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stm32/stm32f1.c b/src/stm32/stm32f1.c
index 57007615..c0ae35fa 100644
--- a/src/stm32/stm32f1.c
+++ b/src/stm32/stm32f1.c
@@ -154,6 +154,12 @@ gpio_peripheral(uint32_t gpio, uint32_t mode, int pullup)
if (gpio == GPIO('B', 8) || gpio == GPIO('B', 9))
stm32f1_alternative_remap(AFIO_MAPR_I2C1_REMAP_Msk,
AFIO_MAPR_I2C1_REMAP);
+ } else if (func == 5) {
+ // SPI
+ if (gpio == GPIO('B', 3) || gpio == GPIO('B', 4)
+ || gpio == GPIO('B', 5))
+ stm32f1_alternative_remap(AFIO_MAPR_SPI1_REMAP_Msk,
+ AFIO_MAPR_SPI1_REMAP);
} else if (func == 7) {
// USART
if (gpio == GPIO('B', 6) || gpio == GPIO('B', 7))