diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-04 11:13:44 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-04 11:13:44 +0000 |
commit | c2994bdb33024b71f3ac0b4283994715ce6eb563 (patch) | |
tree | 34f26281efec0dd928589b61664b1907800bb644 /testhal/STM32 | |
parent | ccbf09f1a2abad73c81e5e059b7d3f6d370e3293 (diff) | |
download | ChibiOS-c2994bdb33024b71f3ac0b4283994715ce6eb563.tar.gz ChibiOS-c2994bdb33024b71f3ac0b4283994715ce6eb563.tar.bz2 ChibiOS-c2994bdb33024b71f3ac0b4283994715ce6eb563.zip |
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
Diffstat (limited to 'testhal/STM32')
-rw-r--r-- | testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.c | 20 | ||||
-rw-r--r-- | testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h | 2 |
2 files changed, 9 insertions, 13 deletions
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. */
|