Skip to content

Commit

Permalink
Merge pull request #11206 from maribu/nrf52840dk
Browse files Browse the repository at this point in the history
boards/common/nrf52xxxdk: Fixed periph conf
  • Loading branch information
aabadie committed Jun 14, 2019
2 parents f44740e + 04b7ab1 commit 7408f04
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 48 deletions.
50 changes: 50 additions & 0 deletions boards/common/nrf52/include/cfg_spi_default.h
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2016-2018 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup boards_common_nrf52
* @{
*
* @file
* @brief Default SPI config for nRF52 based boards
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
*/

#ifndef CFG_SPI_DEFAULT_H
#define CFG_SPI_DEFAULT_H

#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = NRF_SPI0,
.sclk = GPIO_PIN(0, 15),
.mosi = GPIO_PIN(0, 13),
.miso = GPIO_PIN(0, 14),
}
};

#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
/** @} */

#ifdef __cplusplus
}
#endif

#endif /* CFG_SPI_DEFAULT_H */
/** @} */
16 changes: 0 additions & 16 deletions boards/common/nrf52xxxdk/include/periph_conf_common.h
Expand Up @@ -30,22 +30,6 @@
extern "C" {
#endif

/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = NRF_SPI0,
.sclk = 15,
.mosi = 13,
.miso = 14
}
};

#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
/** @} */

/**
* @name I2C configuration
* @{
Expand Down
17 changes: 1 addition & 16 deletions boards/nrf52832-mdk/include/periph_conf.h
Expand Up @@ -23,6 +23,7 @@
#include "periph_cpu.h"
#include "cfg_clock_32_1.h"
#include "cfg_rtt_default.h"
#include "cfg_spi_default.h"
#include "cfg_timer_default.h"

#ifdef __cplusplus
Expand All @@ -38,22 +39,6 @@ extern "C" {
#define UART_PIN_TX GPIO_PIN(0,20)
/** @} */

/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = NRF_SPI0,
.sclk = 15,
.mosi = 13,
.miso = 14
}
};

#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
17 changes: 1 addition & 16 deletions boards/nrf52840-mdk/include/periph_conf.h
Expand Up @@ -23,6 +23,7 @@
#include "periph_cpu.h"
#include "cfg_clock_32_1.h"
#include "cfg_rtt_default.h"
#include "cfg_spi_default.h"
#include "cfg_timer_default.h"

#ifdef __cplusplus
Expand All @@ -49,22 +50,6 @@ static const uart_conf_t uart_config[] = {
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
/** @} */

/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = NRF_SPI0,
.sclk = 15,
.mosi = 13,
.miso = 14
}
};

#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
/** @} */

/**
* @name I2C configuration
* @{
Expand Down
15 changes: 15 additions & 0 deletions boards/nrf52840dk/include/periph_conf.h
Expand Up @@ -26,6 +26,21 @@
extern "C" {
#endif

/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = NRF_SPI0,
.sclk = GPIO_PIN(1, 15),
.mosi = GPIO_PIN(1, 13),
.miso = GPIO_PIN(1, 14),
}
};
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
/** @} */

/**
* @name UART configuration
* @{
Expand Down
15 changes: 15 additions & 0 deletions boards/nrf52dk/include/periph_conf.h
Expand Up @@ -28,6 +28,21 @@
extern "C" {
#endif

/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = NRF_SPI0,
.sclk = GPIO_PIN(0, 25),
.mosi = GPIO_PIN(0, 23),
.miso = GPIO_PIN(0, 24),
}
};
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
/** @} */

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

0 comments on commit 7408f04

Please sign in to comment.