From fc783f9b8350aa0eda3b8de8e5697c1b3ea449e4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 12 Feb 2021 17:31:32 -0500 Subject: [PATCH] stm32: Add support for spi bus on stm32f407 pins PI2,PI3,PI1 Signed-off-by: Kevin O'Connor --- src/stm32/spi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stm32/spi.c b/src/stm32/spi.c index cdc57341..3e9ba71a 100644 --- a/src/stm32/spi.c +++ b/src/stm32/spi.c @@ -34,6 +34,9 @@ DECL_CONSTANT_STR("BUS_PINS_spi1", "PA6,PA7,PA5"); #ifdef SPI4 DECL_ENUMERATION("spi_bus", "spi4", 6); DECL_CONSTANT_STR("BUS_PINS_spi4", "PE13,PE14,PE12"); + #elif defined(GPIOI) + DECL_ENUMERATION("spi_bus", "spi2b", 6); + DECL_CONSTANT_STR("BUS_PINS_spi2b", "PI2,PI3,PI1"); #endif #endif #endif @@ -51,6 +54,8 @@ static const struct spi_info spi_bus[] = { { SPI3, GPIO('C', 11), GPIO('C', 12), GPIO('C', 10), GPIO_FUNCTION(6) }, #ifdef SPI4 { SPI4, GPIO('E', 13), GPIO('E', 14), GPIO('E', 12), GPIO_FUNCTION(5) }, + #elif defined(GPIOI) + { SPI2, GPIO('I', 2), GPIO('I', 3), GPIO('I', 1), GPIO_FUNCTION(5) }, #endif #endif #endif