diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-09-17 07:22:40 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-09-17 07:22:40 +0000 |
commit | 16224e72a4a567fa5b2f829ffc38917af9fd7a1a (patch) | |
tree | c7ac089fd2b794d004a9af091214b1ab4301290f /testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64 | |
parent | 726f224d164b92586435822b9e3e58359000c58c (diff) | |
download | ChibiOS-16224e72a4a567fa5b2f829ffc38917af9fd7a1a.tar.gz ChibiOS-16224e72a4a567fa5b2f829ffc38917af9fd7a1a.tar.bz2 ChibiOS-16224e72a4a567fa5b2f829ffc38917af9fd7a1a.zip |
Demo working now.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10606 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64')
-rw-r--r-- | testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c | 16 | ||||
-rw-r--r-- | testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h | 7 |
2 files changed, 19 insertions, 4 deletions
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
|