stm32f0: gpio: use PA4-PA7 for SPI1 to be compatible with tbm-schematics

This commit is contained in:
S.J.R. van Schaik 2017-07-28 14:37:56 +02:00
parent 33373dd250
commit 07e6cadae9
2 changed files with 6 additions and 6 deletions

View file

@ -5,10 +5,10 @@
int gpio_init(void)
{
/* Set up GPIOs for SPI 1 */
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);
gpio_mode_setup(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO4);
gpio_set(GPIOA, GPIO4);
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO5 | GPIO6 | GPIO7);
gpio_set_af(GPIOA, GPIO_AF0, GPIO5 | GPIO6 | GPIO7);
/* Set up GPIOs for user console (USART 1) */
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO9 | GPIO10);

View file

@ -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(GPIOB, GPIO6);
gpio_clear(GPIOA, GPIO4);
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(GPIOB, GPIO6);
gpio_set(GPIOA, GPIO4);
return 0;
}