From 386cda3492abb38547866e43f287fc8e1c9b8a28 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Tue, 18 Jul 2017 15:15:00 +0200 Subject: [PATCH] stm32f0: spi: use pin PB6 instead of PA4 --- source/drivers/stm32f0_spi.c | 4 ++-- source/platform/stm32f0/gpio.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/drivers/stm32f0_spi.c b/source/drivers/stm32f0_spi.c index 59f5378..5821151 100644 --- a/source/drivers/stm32f0_spi.c +++ b/source/drivers/stm32f0_spi.c @@ -59,7 +59,7 @@ static int stm32f0_spi_tx_rx(struct spi_dev *dev, void *rx_buf, size_t rx_len, const char *tx = tx_buf; size_t i; - gpio_clear(GPIOA, GPIO4); + gpio_clear(GPIOB, GPIO6); for (i = 0; i < tx_len; ++i) { spi_send8(dev->dev_id, *tx++); @@ -73,7 +73,7 @@ static int stm32f0_spi_tx_rx(struct spi_dev *dev, void *rx_buf, size_t rx_len, } } - gpio_set(GPIOA, GPIO4); + gpio_set(GPIOB, GPIO6); return 0; } diff --git a/source/platform/stm32f0/gpio.c b/source/platform/stm32f0/gpio.c index 31d10a1..da60394 100644 --- a/source/platform/stm32f0/gpio.c +++ b/source/platform/stm32f0/gpio.c @@ -5,8 +5,8 @@ int gpio_init(void) { /* Set up GPIOs for SPI 1 */ - gpio_mode_setup(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO4); - gpio_set(GPIOA, GPIO4); + gpio_mode_setup(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO6); + gpio_set(GPIOB, GPIO6); gpio_mode_setup(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO3 | GPIO4 | GPIO5); gpio_set_af(GPIOB, GPIO_AF0, GPIO3 | GPIO4 | GPIO5);