aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32f4/spi.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-07-28 11:32:56 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-07-28 11:32:56 -0400
commitef0784afe6f142b8549ecf7630cbbd5ed627bd36 (patch)
treec852aa7e7d8d4de7eeced3c571868b493ab2aebb /src/stm32f4/spi.c
parent7d4c475e52a17d5511288c41a0b6abff46bb675f (diff)
downloadkutter-ef0784afe6f142b8549ecf7630cbbd5ed627bd36.tar.gz
kutter-ef0784afe6f142b8549ecf7630cbbd5ed627bd36.tar.xz
kutter-ef0784afe6f142b8549ecf7630cbbd5ed627bd36.zip
stm32f4: Encode mode/func into single parameter of gpio_peripheral
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32f4/spi.c')
-rw-r--r--src/stm32f4/spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stm32f4/spi.c b/src/stm32f4/spi.c
index 3759f286..a7e96874 100644
--- a/src/stm32f4/spi.c
+++ b/src/stm32f4/spi.c
@@ -20,9 +20,9 @@ spi_setup(uint32_t bus, uint8_t mode, uint32_t rate)
// Enable SPI
enable_pclock(SPI2_BASE);
- gpio_peripheral(GPIO('B', 14), GPIO_FUNCTION, 5, 1);
- gpio_peripheral(GPIO('B', 15), GPIO_FUNCTION, 5, 0);
- gpio_peripheral(GPIO('B', 13), GPIO_FUNCTION, 5, 0);
+ gpio_peripheral(GPIO('B', 14), GPIO_FUNCTION(5), 1);
+ gpio_peripheral(GPIO('B', 15), GPIO_FUNCTION(5), 0);
+ gpio_peripheral(GPIO('B', 13), GPIO_FUNCTION(5), 0);
// Calculate CR1 register
uint32_t pclk = get_pclock_frequency(SPI2_BASE);