Skip to content

Commit

Permalink
Merge pull request #1897 from PeterKietzmann/add_udoo_spi
Browse files Browse the repository at this point in the history
boards/udoo: added peripheral SPI definitions
  • Loading branch information
haukepetersen committed Oct 30, 2014
2 parents c6599a6 + 590b6f8 commit fea597b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion boards/udoo/Makefile.features
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_gpio periph_spi
30 changes: 28 additions & 2 deletions boards/udoo/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef __PERIPH_CONF_H
#define __PERIPH_CONF_H


/**
* @name Timer peripheral configuration
* @{
Expand Down Expand Up @@ -51,7 +50,6 @@
#define TIMER_2_ISR2 isr_tc7
/** @} */


/**
* @name UART configuration
* @{
Expand Down Expand Up @@ -80,6 +78,34 @@
#define UART_1_PINS (GPIO_Pin_2 | GPIO_Pin_3)
/** @} */

/**
* @name SPI configuration
* @{
*/
#define SPI_NUMOF (1U)
#define SPI_0_EN 1

/* SPI 0 device config */
#define SPI_0_DEV SPI0
#define SPI_0_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_SPI0));
#define SPI_0_CLKDIS() (PMC->PMC_PCER0 &= ~(1 << ID_SPI0));
#define SPI_0_IRQ SPI0_IRQn
#define SPI_0_IRQ_HANDLER isr_spi0
#define SPI_0_IRQ_PRIO 1

/* SPI 0 pin configuration */
#define SPI_0_MISO_PIN PIO_PA25A_SPI0_MISO
#define SPI_0_MOSI_PIN PIO_PA26A_SPI0_MOSI
#define SPI_0_SCK_PIN PIO_PA27A_SPI0_SPCK

#define SPI_0_MISO_PORT PIOA
#define SPI_0_MOSI_PORT PIOA
#define SPI_0_SCK_PORT PIOA

#define SPI_0_MISO_PORT_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_PIOA));
#define SPI_0_MOSI_PORT_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_PIOA));
#define SPI_0_SCK_PORT_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_PIOA));
/** @} */

/**
* @name GPIO configuration
Expand Down

0 comments on commit fea597b

Please sign in to comment.