boards/ACD52832: add new NRF52 based developement board
This commit is contained in:
parent
29f5de38d1
commit
201d532251
3
boards/acd52832/Makefile
Normal file
3
boards/acd52832/Makefile
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
MODULE = board
|
||||||
|
|
||||||
|
include $(RIOTBASE)/Makefile.base
|
||||||
1
boards/acd52832/Makefile.dep
Normal file
1
boards/acd52832/Makefile.dep
Normal file
@ -0,0 +1 @@
|
|||||||
|
include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.dep
|
||||||
1
boards/acd52832/Makefile.features
Normal file
1
boards/acd52832/Makefile.features
Normal file
@ -0,0 +1 @@
|
|||||||
|
include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.features
|
||||||
7
boards/acd52832/Makefile.include
Normal file
7
boards/acd52832/Makefile.include
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# define the cpu used by the acd52832
|
||||||
|
export CPU_MODEL = nrf52832xxaa
|
||||||
|
|
||||||
|
# set default port depending on operating system
|
||||||
|
PORT_LINUX ?= /dev/ttyUSB0
|
||||||
|
|
||||||
|
include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.include
|
||||||
32
boards/acd52832/board.c
Normal file
32
boards/acd52832/board.c
Normal file
@ -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();
|
||||||
|
}
|
||||||
61
boards/acd52832/include/board.h
Normal file
61
boards/acd52832/include/board.h
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* 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 LED_PORT (NRF_P0)
|
||||||
|
#define LED0_MASK (1 << 26)
|
||||||
|
|
||||||
|
#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
|
||||||
|
#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
|
||||||
|
#define LED0_TOGGLE (LED_PORT->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 */
|
||||||
|
/** @} */
|
||||||
55
boards/acd52832/include/gpio_params.h
Normal file
55
boards/acd52832/include/gpio_params.h
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* 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>
|
||||||
|
* @author Peter Kietzmann <peter.kietzmann@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,
|
||||||
|
.flags = (SAUL_GPIO_INVERTED | SAUL_GPIO_INIT_CLEAR),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "Button 1",
|
||||||
|
.pin = BTN0_PIN,
|
||||||
|
.mode = BTN0_MODE,
|
||||||
|
.flags = SAUL_GPIO_INVERTED,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* GPIO_PARAMS_H */
|
||||||
|
/** @} */
|
||||||
103
boards/acd52832/include/periph_conf.h
Normal file
103
boards/acd52832/include/periph_conf.h
Normal file
@ -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 */
|
||||||
@ -2,8 +2,10 @@
|
|||||||
export CPU = nrf52
|
export CPU = nrf52
|
||||||
|
|
||||||
# include this module into the build
|
# include this module into the build
|
||||||
INCLUDES += -I$(RIOTBOARD)/common/nrf52xxxdk/include
|
ifeq (,$(filter acd52832,$(BOARD)))
|
||||||
USEMODULE += boards_common_nrf52
|
INCLUDES += -I$(RIOTBOARD)/common/nrf52xxxdk/include
|
||||||
|
USEMODULE += boards_common_nrf52
|
||||||
|
endif
|
||||||
|
|
||||||
# set default port depending on operating system
|
# set default port depending on operating system
|
||||||
PORT_LINUX ?= /dev/ttyACM0
|
PORT_LINUX ?= /dev/ttyACM0
|
||||||
|
|||||||
@ -34,7 +34,7 @@ USEMODULE += ps
|
|||||||
# include and auto-initialize all available sensors
|
# include and auto-initialize all available sensors
|
||||||
USEMODULE += saul_default
|
USEMODULE += saul_default
|
||||||
|
|
||||||
BOARD_PROVIDES_NETIF := airfy-beacon b-l072z-lrwan1 cc2538dk fox iotlab-m3 iotlab-a8-m3 mulle \
|
BOARD_PROVIDES_NETIF := acd52832 airfy-beacon b-l072z-lrwan1 cc2538dk fox iotlab-m3 iotlab-a8-m3 mulle \
|
||||||
microbit native nrf51dongle nrf52dk nrf6310 openmote-cc2538 pba-d-01-kw2x \
|
microbit native nrf51dongle nrf52dk nrf6310 openmote-cc2538 pba-d-01-kw2x \
|
||||||
remote-pa remote-reva samr21-xpro \
|
remote-pa remote-reva samr21-xpro \
|
||||||
spark-core telosb yunjia-nrf51822 z1
|
spark-core telosb yunjia-nrf51822 z1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user