aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/ARMCM3-STM32F103-GCC/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/demos/ARMCM3-STM32F103-GCC/main.c b/demos/ARMCM3-STM32F103-GCC/main.c
index fcc496648..943509849 100644
--- a/demos/ARMCM3-STM32F103-GCC/main.c
+++ b/demos/ARMCM3-STM32F103-GCC/main.c
@@ -19,15 +19,16 @@
#include <ch.h>
#include <pal.h>
+#include <serial.h>
+#include <spi.h>
#include <test.h>
#include "board.h"
-#include "serial.h"
/*
* Red LEDs blinker thread, times are in milliseconds.
*/
-static WORKING_AREA(waThread1, 128);
+static WORKING_AREA(waThread1, 512);
static msg_t Thread1(void *arg) {
(void)arg;
@@ -40,6 +41,10 @@ static msg_t Thread1(void *arg) {
return 0;
}
+static SPIConfig spicfg = {
+ 16, IOPORT1, 4, 0
+};
+
/*
* Entry point, note, the main() function is already a thread in the system
* on entry.
@@ -59,6 +64,11 @@ int main(int argc, char **argv) {
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
+ palSetPadMode(IOPORT1, 4, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPad(IOPORT1, 4);
+ spiStart(&SPID1, &spicfg);
+ spiStop(&SPID1);
+
/*
* Normal main() thread activity, in this demo it does nothing except
* sleeping in a loop and check the button state.