From ccef2d248b7269766f00b9122eb1930aa1100605 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 26 Aug 2015 10:03:11 +0000 Subject: SPI working on F7 but cache handling unfinished. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8241 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/STM32F7xx/SPI/main.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'testhal') diff --git a/testhal/STM32/STM32F7xx/SPI/main.c b/testhal/STM32/STM32F7xx/SPI/main.c index 4e14474e4..996b3c9b7 100644 --- a/testhal/STM32/STM32F7xx/SPI/main.c +++ b/testhal/STM32/STM32F7xx/SPI/main.c @@ -26,9 +26,9 @@ */ static const SPIConfig hs_spicfg = { NULL, - GPIOI, - GPIOI_ARD_D13, - 0, + GPIOB, + GPIOB_ARD_D15, + SPI_CR1_BR_0, SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0 }; @@ -37,8 +37,8 @@ static const SPIConfig hs_spicfg = { */ static const SPIConfig ls_spicfg = { NULL, - GPIOI, - GPIOI_ARD_D13, + GPIOB, + GPIOB_ARD_D14, SPI_CR1_BR_2 | SPI_CR1_BR_1, SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0 }; @@ -114,8 +114,8 @@ int main(void) { */ palSetPadMode(GPIOI, GPIOI_ARD_D13, - PAL_MODE_OUTPUT_PUSHPULL | - PAL_STM32_OSPEED_HIGHEST); /* LED over SPI SCK. */ + PAL_MODE_ALTERNATE(5) | + PAL_STM32_OSPEED_HIGHEST); /* SPI SCK. */ palSetPadMode(GPIOB, GPIOB_ARD_D12, PAL_MODE_ALTERNATE(5) | @@ -124,11 +124,14 @@ int main(void) { GPIOB_ARD_D11, PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); /* MOSI. */ - palSetPadMode(GPIOI, - GPIOI_ARD_D10, - PAL_MODE_OUTPUT_PUSHPULL | - PAL_STM32_OSPEED_HIGHEST); /* CS. */ - palSetPad(GPIOI, GPIOI_ARD_D10); + palSetPad(GPIOB, GPIOB_ARD_D15); + palSetPadMode(GPIOB, + GPIOB_ARD_D15, + PAL_MODE_OUTPUT_PUSHPULL); /* CS0. */ + palSetPad(GPIOB, GPIOB_ARD_D14); + palSetPadMode(GPIOB, + GPIOB_ARD_D14, + PAL_MODE_OUTPUT_PUSHPULL); /* CS1. */ /* * Prepare transmit pattern. -- cgit v1.2.3