diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-08-26 10:03:11 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-08-26 10:03:11 +0000 |
commit | ccef2d248b7269766f00b9122eb1930aa1100605 (patch) | |
tree | ba8726deab2ac075c6f74cf4cea55551f953fec0 /testhal | |
parent | 9e5337241d7be9c50d97e2562ecd50e09d4c2325 (diff) | |
download | ChibiOS-ccef2d248b7269766f00b9122eb1930aa1100605.tar.gz ChibiOS-ccef2d248b7269766f00b9122eb1930aa1100605.tar.bz2 ChibiOS-ccef2d248b7269766f00b9122eb1930aa1100605.zip |
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
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/STM32F7xx/SPI/main.c | 27 |
1 files changed, 15 insertions, 12 deletions
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.
|