From 16224e72a4a567fa5b2f829ffc38917af9fd7a1a Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 17 Sep 2017 07:22:40 +0000 Subject: Demo working now. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10606 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c | 16 ++++++++++++++++ testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h | 7 +++---- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64') diff --git a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c index 9c2a831a4..8c5f7426e 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c +++ b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c @@ -72,4 +72,20 @@ const SPIConfig ls_spicfg = { /* Module exported functions. */ /*===========================================================================*/ +void portab_setup(void) { + + /* + * SPI2 I/O pins setup. + */ + palSetPadMode(GPIOB, 13, PAL_MODE_ALTERNATE(0) | + PAL_STM32_OSPEED_HIGHEST); /* New SCK. */ + palSetPadMode(GPIOB, 14, PAL_MODE_ALTERNATE(0) | + PAL_STM32_OSPEED_HIGHEST); /* New MISO. */ + palSetPadMode(GPIOB, 15, PAL_MODE_ALTERNATE(0) | + PAL_STM32_OSPEED_HIGHEST); /* New MOSI. */ + palSetPad(GPIOB, 12); + palSetPadMode(GPIOB, 12, PAL_MODE_OUTPUT_PUSHPULL | + PAL_STM32_OSPEED_HIGHEST); /* New CS. */ +} + /** @} */ diff --git a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h index df5c9e77d..3283d07a9 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h +++ b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h @@ -29,13 +29,12 @@ /* Module constants. */ /*===========================================================================*/ -#define PORTAB_LINE_LED1 GPIOA_LED_GREEN +#define PORTAB_LINE_LED1 LINE_LED_GREEN //#define PORTAB_LINE_LED2 #define PORTAB_LED_OFF PAL_LOW #define PORTAB_LED_ON PAL_HIGH -#define PORTAB_LINE_BUTTON LINE_BUTTON -#define PORTAB_BUTTON_PRESSED PAL_HIGH +#define PORTAB_SPI1 SPID2 /*===========================================================================*/ /* Module pre-compile time settings. */ @@ -63,7 +62,7 @@ extern const SPIConfig ls_spicfg; #ifdef __cplusplus extern "C" { #endif - + void portab_setup(void); #ifdef __cplusplus } #endif -- cgit v1.2.3