8000 boards: add acd52832/nrf52832 · Pull Request #7501 · RIOT-OS/RIOT · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

boards: add acd52832/nrf52832 #7501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/acd52832/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = board

include $(RIOTBASE)/Makefile.base
13 changes: 13 additions & 0 deletions boards/acd52832/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

ifeq (,$(filter nrfmin,$(USEMODULE)))
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
USEPKG += nordic_softdevice_ble
endif
else
ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE)))
USEMODULE += nrfmin
endif
endif
16 changes: 16 additions & 0 deletions boards/acd52832/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_hwrng
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Various other features (if any)
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += radio_nrfmin

# The board MPU family (used for grouping by the CI system)
FEATURES_MCU_GROUP = cortex_m4_3
21 changes: 21 additions & 0 deletions boards/acd52832/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# define the cpu used by the acd52832
export CPU = nrf52
export CPU_MODEL = nrf52832xxaa

# set default port depending on operating system
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))

# setup JLink for flashing
export JLINK_DEVICE := nrf52

# special options when using SoftDevice
ifneq (,$(filter nordic_softdevice_ble,$(USEPKG)))
export JLINK_PRE_FLASH := erase\nloadfile $(BINDIR)/softdevice.hex
export JLINK_FLASH_ADDR := 0x1f000
export LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld
endif
include $(RIOTMAKE)/tools/jlink.inc.mk

# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
32 changes: 32 additions & 0 deletions boards/acd52832/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2017 HAW Hamburg
*
* 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_acd52832
* @{
*
* @file
* @brief Board initialization for the ACD52832
*
* @author Dimitri Nahm <dimitri.nahm@haw-hamburg.de>
*
* @}
*/

#include "board.h"
#include "periph/gpio.h"

void board_init(void)
{
/* initialize the boards LEDs */
gpio_init(LED0_PIN, GPIO_OUT);
gpio_set(LED0_PIN);

/* initialize the CPU */
cpu_init();
}
60 changes: 60 additions & 0 deletions boards/acd52832/include/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2017 HAW Hamburg
*
* 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.
*/

/**
* @defgroup boards_acd52832 ACD52832
* @ingroup boards
* @{
*
* @file
* @brief Board specific configuaration for the ACD52832
*
* @author Dimitri Nahm <dimitri.nahm@haw-hamburg.de>
*/

#ifndef BOARD_H
#define BOARD_H

#include "cpu.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @name LED pin configuration
* @{
*/
#define LED0_PIN GPIO_PIN(0, 26)

#define LED0_MASK (1 << 26)

#define LED0_ON (NRF_P0->OUTCLR = LED0_MASK)
#define LED0_OFF (NRF_P0->OUTSET = LED0_MASK)
#define LED0_TOGGLE (NRF_P0->OUT ^= LED0_MASK)
/** @} */

/**
* @name Button pin configuration
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 25)
#define BTN0_MODE GPIO_IN_PU
/** @} */

/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);

#ifdef __cplusplus
}
#endif

#endif /* BOARD_H */
/** @} */
52 changes: 52 additions & 0 deletions boards/acd52832/include/gpio_params.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2017 HAW Hamburg
*
* 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_acd52832
* @{
*
* @file
* @brief Configuration of SAUL mapped GPIO pins
*
* @author Dimitri Nahm <dimitri.nahm@haw-hamburg.de>
*/

#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H

#include "board.h"
#include "saul/periph.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief LED configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 1",
.pin = LED0_PIN,
.mode = GPIO_OUT
},
{
.name = "Button 1",
.pin = BTN0_PIN,
.mode = BTN0_MODE
}
};


#ifdef __cplusplus
}
#endif

#endif /* GPIO_PARAMS_H */
/** @} */
103 changes: 103 additions & 0 deletions boards/acd52832/include/periph_conf.h
9E7A
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Copyright (C) 2016-2017 Freie Universität Berlin
* 2017 HAW Hamburg
*
* 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_acd52832
* @{
*
* @file
* @brief Peripheral configuration for the ACD52832
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Dimitri Nahm <dimitri.nahm@haw-hamburg.de>
*
*/

#ifndef PERIPH_CONF_H
#define PERIPH_CONF_H

#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @name Clock configuration
*
* @note The radio will not work with the internal RC oscillator!
*
* @{
*/
#define CLOCK_CORECLOCK (64000000U) /* fixed for all nRF52832 */
#define CLOCK_HFCLK (32U) /* set to 0: internal RC oscillator
* 32: 32MHz crystal */
#define CLOCK_LFCLK (1) /* set to 0: internal RC oscillator
* 1: 32.768 kHz crystal
* 2: derived from HFCLK */
/** @} */

/**
* @name Timer configuration
* @{
*/
static const timer_conf_t timer_config[] = {
{
.dev = NRF_TIMER1,
.channels = 3,
.bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER1_IRQn
}
};

#define TIMER_0_ISR isr_timer1

#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
/** @} */

/**
* @name Real time counter configuration
* @{
*/
#define RTT_NUMOF (1U)
#define RTT_DEV (1) /* NRF_RTC1 */
#define RTT_MAX_VALUE (0x00ffffff)
#define RTT_FREQUENCY (1024)
/** @} */

/**
* @name UART configuration
* @{
*/
#define UART_NUMOF (1U)
#define UART_PIN_RX GPIO_PIN(0, 30)
#define UART_PIN_TX GPIO_PIN(0, 31)
/** @} */

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

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

#ifdef __cplusplus
}
#endif

#endif /* PERIPH_CONF_H */
8 changes: 4 additions & 4 deletions examples/default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ USEMODULE += ps
# include and auto-initialize all available sensors
USEMODULE += saul_default

BOARD_PROVIDES_NETIF := airfy-beacon cc2538dk fox iotlab-m3 iotlab-a8-m3 mulle \
microbit native nrf51dongle nrf52dk nrf6310 openmote-cc2538 pba-d-01-kw2x \
pca10000 pca10005 remote-pa remote-reva samr21-xpro \
spark-core telosb yunjia-nrf51822 z1
BOARD_PROVIDES_NETIF := acd52832 airfy-beacon cc2538dk fox iotlab-m3 \
iotlab-a8-m3 mulle microbit native nrf51dongle nrf52dk nrf6310 \
openmote-cc2538 pba-d-01-kw2x pca10000 pca10005 remote-pa remote-reva \
saml21-xpro samr21-xpro spark-core telosb yunjia-nrf51822 z1

ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF)))
# Use modules for networking
Expand Down
0