From 29226ecec7052b72ba82e8ba2eedb4c91d27ff28 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 Aug 2010 07:40:01 +0000 Subject: Small fix to the SPI demo. SPI I/O pins were no initialized as alternate. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2135 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/SPI/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'testhal') diff --git a/testhal/STM32/SPI/main.c b/testhal/STM32/SPI/main.c index 1ebf1b45e..a8a8595f1 100644 --- a/testhal/STM32/SPI/main.c +++ b/testhal/STM32/SPI/main.c @@ -94,6 +94,15 @@ int main(int argc, char **argv) { (void)argc; (void)argv; + /* + * SPI1 I/O pins setup. + */ + palSetPadMode(IOPORT1, 5, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* SCK. */ + palSetPadMode(IOPORT1, 6, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* MISO.*/ + palSetPadMode(IOPORT1, 7, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* MOSI.*/ + palSetPadMode(IOPORT1, GPIOA_SPI1NSS, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(IOPORT1, GPIOA_SPI1NSS); + /* * Prepare transmit pattern. */ -- cgit v1.2.3