Skip to content

Commit

Permalink
boards: added SPI definitions for NRF based boards
Browse files Browse the repository at this point in the history
added SPI defines for
- yunjia-nrf51822
- pca10005
- airfy-beacon
  • Loading branch information
haukepetersen authored and OlegHahm committed Mar 31, 2015
1 parent dd23234 commit e4fb2a3
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 3 deletions.
3 changes: 2 additions & 1 deletion boards/airfy-beacon/Makefile.features
@@ -1,3 +1,4 @@
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid
FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt \
periph_cpuid periph_spi
FEATURES_MCU_GROUP = cortex_m0
15 changes: 15 additions & 0 deletions boards/airfy-beacon/include/periph_conf.h
Expand Up @@ -108,6 +108,21 @@
#define RANDOM_NUMOF (1U)
/** @} */

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

/* SPI_0 device configuration */
#define SPI_0_DEV NRF_SPI0
#define SPI_0_PIN_MOSI 13
#define SPI_0_PIN_MISO 14
#define SPI_0_PIN_SCK 15
/** @} */

/**
* @name GPIO configuration
* @{
Expand Down
3 changes: 2 additions & 1 deletion boards/pca10005/Makefile.features
@@ -1,3 +1,4 @@
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid
FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt \
periph_cpuid periph_spi
FEATURES_MCU_GROUP = cortex_m0
22 changes: 22 additions & 0 deletions boards/pca10005/include/periph_conf.h
Expand Up @@ -108,6 +108,28 @@ extern "C" {
#define RANDOM_NUMOF (1U)
/** @} */

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

/* SPI_0 device configuration */
#define SPI_0_DEV NRF_SPI0
#define SPI_0_PIN_MOSI 17
#define SPI_0_PIN_MISO 18
#define SPI_0_PIN_SCK 19

/* SPI_1 device configuration */
#define SPI_1_DEV NRF_SPI1
#define SPI_1_PIN_MOSI 20
#define SPI_1_PIN_MISO 21
#define SPI_1_PIN_SCK 22
/** @} */

/**
* @name GPIO configuration
* @{
Expand Down
3 changes: 2 additions & 1 deletion boards/yunjia-nrf51822/Makefile.features
@@ -1,3 +1,4 @@
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid
FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt \
periph_cpuid periph_spi
FEATURES_MCU_GROUP = cortex_m0
23 changes: 23 additions & 0 deletions boards/yunjia-nrf51822/include/periph_conf.h
Expand Up @@ -106,6 +106,29 @@ extern "C" {
#define RANDOM_NUMOF (1U)
/** @} */

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

/* SPI_0 device configuration */
#define SPI_0_DEV NRF_SPI0
#define SPI_0_PIN_MOSI 17
#define SPI_0_PIN_MISO 18
#define SPI_0_PIN_SCK 19

/* SPI_1 device configuration */
#define SPI_1_DEV NRF_SPI1
#define SPI_1_PIN_MOSI 20
#define SPI_1_PIN_MISO 21
#define SPI_1_PIN_SCK 22
/** @} */


/**
* @name GPIO configuration
* @{
Expand Down

0 comments on commit e4fb2a3

Please sign in to comment.