[KINETIS] K20x SPI demo converted to use DMA.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7301 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
spacecoaster 2014-09-21 15:47:24 +00:00
parent ee3f9cf124
commit 49d1458e83
2 changed files with 6 additions and 9 deletions

View File

@ -26,12 +26,10 @@ void spicb(SPIDriver *spip) {
/*
* SPI1 configuration structure.
* The slave select line is the PCS4 pin also assigned to GPIOC pin 0.
*/
static const SPIConfig spi1cfg = {
spicb,
/* HW dependent part.*/
KINETIS_SPI_PCS4,
GPIOC,
0,
KINETIS_SPI_TAR_8BIT_SLOW
@ -76,13 +74,12 @@ int main(void) {
chSysInit();
/*
* Activates SPID1. Slave select is configured on GPIOC pin 0. This is
* PCS4 for the KINETIS DSPI managed slave select.
* Activates SPID1. Slave select is configured on GPIOC pin 0.
*/
palSetPadMode(GPIOC, 5, PAL_MODE_ALTERNATIVE_2); /* SCK */
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATIVE_2); /* MOSI */
palSetPadMode(GPIOD, 3, PAL_MODE_ALTERNATIVE_2); /* MISO */
palSetPadMode(GPIOC, 0, PAL_MODE_ALTERNATIVE_2); /* SS */
palSetPadMode(GPIOC, 5, PAL_MODE_ALTERNATIVE_2); /* SCK */
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATIVE_2); /* MOSI */
palSetPadMode(GPIOD, 3, PAL_MODE_ALTERNATIVE_2); /* MISO */
palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL); /* SS */
/*
* Initializes the SPI driver 1.

View File

@ -14,4 +14,4 @@ The pin connections are
C5 is connected to SCK
C6 is connected to MOSI
D3 is connected to MISO
D0 is connected to SS
C0 is connected to SS