Merge pull request #16401 from haukepetersen/opt_nrf52840dongle_pinconfig
board/nrf52840dongle: fix and enhance pin mapping for I2C and SPI
This commit is contained in:
commit
0fdee54cfa
@ -12,6 +12,7 @@ config BOARD_NRF52840DONGLE
|
|||||||
default y
|
default y
|
||||||
select BOARD_COMMON_NRF52
|
select BOARD_COMMON_NRF52
|
||||||
select CPU_MODEL_NRF52840XXAA
|
select CPU_MODEL_NRF52840XXAA
|
||||||
|
select HAS_PERIPH_I2C
|
||||||
select HAS_PERIPH_PWM
|
select HAS_PERIPH_PWM
|
||||||
select HAS_PERIPH_UART
|
select HAS_PERIPH_UART
|
||||||
select HAS_PERIPH_SPI
|
select HAS_PERIPH_SPI
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
CPU_MODEL = nrf52840xxaa
|
CPU_MODEL = nrf52840xxaa
|
||||||
|
|
||||||
# Put defined MCU peripherals here (in alphabetical order)
|
# Put defined MCU peripherals here (in alphabetical order)
|
||||||
|
FEATURES_PROVIDED += periph_i2c
|
||||||
FEATURES_PROVIDED += periph_pwm
|
FEATURES_PROVIDED += periph_pwm
|
||||||
FEATURES_PROVIDED += periph_uart
|
FEATURES_PROVIDED += periph_uart
|
||||||
FEATURES_PROVIDED += periph_usbdev
|
FEATURES_PROVIDED += periph_usbdev
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 Christian Amsüss <chrysn@fsfe.org>
|
* Copyright (C) 2019 Christian Amsüss <chrysn@fsfe.org>
|
||||||
|
* 2021 Freie Universität Berlin
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU Lesser
|
* 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
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
@ -14,6 +15,7 @@
|
|||||||
* @brief Peripheral configuration for the nRF52840-Dongle
|
* @brief Peripheral configuration for the nRF52840-Dongle
|
||||||
*
|
*
|
||||||
* @author Christian Amsüss <chrysn@fsfe.org>
|
* @author Christian Amsüss <chrysn@fsfe.org>
|
||||||
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -24,7 +26,6 @@
|
|||||||
#include "cfg_clock_32_1.h"
|
#include "cfg_clock_32_1.h"
|
||||||
#include "cfg_rtt_default.h"
|
#include "cfg_rtt_default.h"
|
||||||
#include "cfg_timer_default.h"
|
#include "cfg_timer_default.h"
|
||||||
#include "cfg_spi_default.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -67,11 +68,50 @@ static const uart_conf_t uart_config[] = {
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
static const pwm_conf_t pwm_config[] = {
|
static const pwm_conf_t pwm_config[] = {
|
||||||
{ NRF_PWM0, { GPIO_PIN(0, 6), GPIO_PIN(0, 8), GPIO_PIN(1, 9), GPIO_PIN(0, 12) } }
|
{
|
||||||
|
NRF_PWM0,
|
||||||
|
{
|
||||||
|
GPIO_PIN(0, 6),
|
||||||
|
GPIO_PIN(0, 8),
|
||||||
|
GPIO_PIN(1, 9),
|
||||||
|
GPIO_PIN(0, 12),
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
|
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name SPI configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
static const spi_conf_t spi_config[] = {
|
||||||
|
{
|
||||||
|
.dev = NRF_SPIM0,
|
||||||
|
.sclk = GPIO_PIN(0, 20),
|
||||||
|
.mosi = GPIO_PIN(0, 22),
|
||||||
|
.miso = GPIO_PIN(0, 24),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SPI_NUMOF ARRAY_SIZE(spi_config)
|
||||||
|
/** @} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name I2C configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
static const i2c_conf_t i2c_config[] = {
|
||||||
|
{
|
||||||
|
.dev = NRF_TWIM1,
|
||||||
|
.scl = GPIO_PIN(0, 29),
|
||||||
|
.sda = GPIO_PIN(0, 31),
|
||||||
|
.speed = I2C_SPEED_NORMAL
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||||
|
/** @} */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user