From 493c21948bdca96c6632a5afcd8c4e63f8151910 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 2 Nov 2009 21:45:32 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1266 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103-GCC/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/demos/ARMCM3-STM32F103-GCC/main.c b/demos/ARMCM3-STM32F103-GCC/main.c index 943509849..d3889251a 100644 --- a/demos/ARMCM3-STM32F103-GCC/main.c +++ b/demos/ARMCM3-STM32F103-GCC/main.c @@ -45,6 +45,9 @@ static SPIConfig spicfg = { 16, IOPORT1, 4, 0 }; +static uint8_t txbuf[8] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; +static uint8_t rxbuf[8]; + /* * Entry point, note, the main() function is already a thread in the system * on entry. @@ -67,6 +70,9 @@ int main(int argc, char **argv) { palSetPadMode(IOPORT1, 4, PAL_MODE_OUTPUT_PUSHPULL); palSetPad(IOPORT1, 4); spiStart(&SPID1, &spicfg); + spiSelect(&SPID1); + spiExchange(&SPID1, 8, txbuf, rxbuf); + spiUnselect(&SPID1); spiStop(&SPID1); /* -- cgit v1.2.3