git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1266 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2009-11-02 21:45:32 +00:00
parent c692c27eab
commit 493c21948b
1 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,9 @@ static SPIConfig spicfg = {
16, IOPORT1, 4, 0 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 * Entry point, note, the main() function is already a thread in the system
* on entry. * on entry.
@ -67,6 +70,9 @@ int main(int argc, char **argv) {
palSetPadMode(IOPORT1, 4, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(IOPORT1, 4, PAL_MODE_OUTPUT_PUSHPULL);
palSetPad(IOPORT1, 4); palSetPad(IOPORT1, 4);
spiStart(&SPID1, &spicfg); spiStart(&SPID1, &spicfg);
spiSelect(&SPID1);
spiExchange(&SPID1, 8, txbuf, rxbuf);
spiUnselect(&SPID1);
spiStop(&SPID1); spiStop(&SPID1);
/* /*