From 82cf0cb1de14c8d210d679dd408a4b5610ef9cb8 Mon Sep 17 00:00:00 2001 From: ccx-lan <58350098+ccx-lan@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:14:55 +0800 Subject: [PATCH] [GD32] fix bug on spi driver (#6636) * fix bug on spi driver * [gd32] fix bugs on spi driver --- bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c b/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c index fcbf523f88..d317c8c531 100644 --- a/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c +++ b/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c @@ -96,8 +96,8 @@ static void gd32_spi_init(struct gd32_spi *gd32_spi) /*GPIO pin configuration*/ gpio_af_set(gd32_spi->spi_port, GPIO_AF_5, gd32_spi->sck_pin | gd32_spi->mosi_pin | gd32_spi->miso_pin); - gpio_mode_set(gd32_spi->spi_port, GPIO_MODE_AF, GPIO_PUPD_NONE, gd32_spi->miso_pin| gd32_spi->miso_pin); - gpio_output_options_set(gd32_spi->spi_port, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,gd32_spi->miso_pin| gd32_spi->miso_pin); + gpio_mode_set(gd32_spi->spi_port, GPIO_MODE_AF, GPIO_PUPD_NONE, gd32_spi->sck_pin | gd32_spi->mosi_pin | gd32_spi->miso_pin); + gpio_output_options_set(gd32_spi->spi_port, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ, gd32_spi->sck_pin | gd32_spi->mosi_pin | gd32_spi->miso_pin); #else /* Init SPI SCK MOSI */