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

View File

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