From c2994bdb33024b71f3ac0b4283994715ce6eb563 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Thu, 4 Jan 2018 11:13:44 +0000 Subject: Various fixes, H7 SPI does not work yet. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11220 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- .../STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.c | 20 ++++++++------------ .../STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'testhal/STM32') diff --git a/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.c b/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.c index 96a86a2ad..1a7538f77 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.c +++ b/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.c @@ -41,7 +41,7 @@ const SPIConfig hs_spicfg = { NULL, GPIOB, 12, - SPI_CFG1_MBR_DIV8, + SPI_CFG1_MBR_DIV8 | SPI_CFG1_DSIZE_VALUE(7), 0 }; @@ -52,7 +52,7 @@ const SPIConfig ls_spicfg = { NULL, GPIOB, 12, - SPI_CFG1_MBR_DIV128, + SPI_CFG1_MBR_DIV128 | SPI_CFG1_DSIZE_VALUE(7), 0 }; @@ -75,17 +75,13 @@ const SPIConfig ls_spicfg = { void portab_setup(void) { /* - * SPI2 I/O pins setup. + * SPI1 I/O pins setup. */ - palSetPadMode(GPIOB, 13, PAL_MODE_ALTERNATE(5) | - PAL_STM32_OSPEED_HIGHEST); /* New SCK. */ - palSetPadMode(GPIOB, 14, PAL_MODE_ALTERNATE(5) | - PAL_STM32_OSPEED_HIGHEST); /* New MISO. */ - palSetPadMode(GPIOB, 15, PAL_MODE_ALTERNATE(5) | - PAL_STM32_OSPEED_HIGHEST); /* New MOSI. */ - palSetPadMode(GPIOB, 12, PAL_MODE_OUTPUT_PUSHPULL | - PAL_STM32_OSPEED_HIGHEST); /* New CS. */ - palSetPad(GPIOB, 12); + palSetLineMode(LINE_SPI1_SCK, PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); + palSetLineMode(LINE_SPI1_MISO, PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); + palSetLineMode(LINE_SPI1_MOSI, PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); + palSetLineMode(LINE_SPI3_NSS, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); + palSetLine(LINE_SPI3_NSS); } /** @} */ diff --git a/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h b/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h index 882670b1d..901638a7f 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h +++ b/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h @@ -35,7 +35,7 @@ #define PORTAB_LED_ON PAL_HIGH #define PORTAB_LINE_BUTTON LINE_BUTTON #define PORTAB_BUTTON_PRESSED PAL_HIGH -#define PORTAB_SPI1 SPID2 +#define PORTAB_SPI1 SPID1 /*===========================================================================*/ /* Module pre-compile time settings. */ -- cgit v1.2.3