aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-08-31 20:32:42 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-09-05 22:42:48 -0400
commitdc9f9ea1d686a8618f60b4c4591231b8713b92c5 (patch)
tree246f1fc9e27cada59b4ecda98a1fb6967cee37df /src
parent12feb6d7fbd85d34a81d23e59472e3083622a206 (diff)
downloadkutter-dc9f9ea1d686a8618f60b4c4591231b8713b92c5.tar.gz
kutter-dc9f9ea1d686a8618f60b4c4591231b8713b92c5.tar.xz
kutter-dc9f9ea1d686a8618f60b4c4591231b8713b92c5.zip
stm32: Add support for SPI3 bus on alternate PC11,PC12,PC10 pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/stm32/spi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/stm32/spi.c b/src/stm32/spi.c
index c5e36022..1b6d8606 100644
--- a/src/stm32/spi.c
+++ b/src/stm32/spi.c
@@ -10,7 +10,7 @@
#include "sched.h" // sched_shutdown
struct spi_info {
- void *spi;
+ SPI_TypeDef *spi;
uint8_t miso_pin, mosi_pin, sck_pin, function;
};
@@ -21,6 +21,10 @@ DECL_CONSTANT_STR("BUS_PINS_spi1", "PA6,PA7,PA5");
#ifdef SPI3
DECL_ENUMERATION("spi_bus", "spi3", 2);
DECL_CONSTANT_STR("BUS_PINS_spi3", "PB4,PB5,PB3");
+ #if CONFIG_MACH_STM32F4
+DECL_ENUMERATION("spi_bus", "spi3a", 3);
+DECL_CONSTANT_STR("BUS_PINS_spi3a", "PC11,PC12,PC10");
+ #endif
#endif
static const struct spi_info spi_bus[] = {
@@ -28,6 +32,9 @@ static const struct spi_info spi_bus[] = {
{ SPI1, GPIO('A', 6), GPIO('A', 7), GPIO('A', 5), GPIO_FUNCTION(5) },
#ifdef SPI3
{ SPI3, GPIO('B', 4), GPIO('B', 5), GPIO('B', 3), GPIO_FUNCTION(6) },
+ #if CONFIG_MACH_STM32F4
+ { SPI3, GPIO('C', 11), GPIO('C', 12), GPIO('C', 10), GPIO_FUNCTION(6) },
+ #endif
#endif
};