boards/e104-bt5010a-tb: add support for the E104-BT5010A Test Board

This adds support for the nRF52810 based E104-BT5010A break-out board.
This commit is contained in:
Benjamin Valentin 2020-07-09 21:41:39 +02:00 committed by Benjamin Valentin
parent f0e77840dc
commit d5690ee4cd
20 changed files with 348 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# Copyright (c) 2020 Benjamin Valentin
#
# 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.
config BOARD
default "e104-bt5010a-tb" if BOARD_E104_BT5010A_TB
config BOARD_E104_BT5010A_TB
bool
default y
select BOARD_COMMON_NRF52
select CPU_MODEL_NRF52810XXAA
select HAS_PERIPH_I2C
select HAS_PERIPH_SPI
select HAS_PERIPH_UART
source "$(RIOTBOARD)/common/nrf52/Kconfig"

View File

@ -0,0 +1,2 @@
MODULE = board
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,5 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/nrf52/Makefile.dep

View File

@ -0,0 +1,9 @@
CPU_MODEL = nrf52810xxaa
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_uart
include $(RIOTBOARD)/common/nrf52/Makefile.features

View File

@ -0,0 +1,4 @@
# external programmer required
DEBUG_ADAPTER ?= jlink
include $(RIOTBOARD)/common/nrf52/Makefile.include

View File

@ -0,0 +1,32 @@
/*
* Copyright (C) 2020 Benjamin Valentin
*
* 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_e104-bt5010a-tb
* @{
*
* @file
* @brief Board initialization for the E104-BT5010A Test Board
*
* @author Benjamin Valentin <benpicco@googlemail.com>
*
* @}
*/
#include "cpu.h"
#include "board.h"
void board_init(void)
{
/* initialize the boards LEDs */
LED_PORT->DIRSET = (LED_MASK);
LED_PORT->OUTSET = (LED_MASK);
/* initialize the CPU */
cpu_init();
}

View File

@ -0,0 +1,31 @@
/**
@defgroup boards_e104-bt5010a-tb E104-BT5010A Test Board
@ingroup boards
@brief Support for the Ebyte E104-BT5010A Test Board (nRF52810)
## General information
The E104-BT5010A Test Board is a cheap break-out board for the E104-BT5010A module.
It's based on the nRF52810 and by default comes with a Firmware that accepts AT
commands over UART, but it can be flashed with RIOT easily.
- [Module Datasheet](http://www.ebyte.com/en/downpdf.aspx?id=832)
- [Module Website](http://www.ebyte.com/en/product-view-news.aspx?id=832)
## Flashing the board
To flash the board, you have to connect a SWD programmer to the pins labeled SWDIO and
SWCLK. Also make sure to connect GND.
P0.21 is Reset.
## Accessing STDIO via UART
The STDIO is directly accessible via the USB port. On a Linux host, it's
generally mapped to `/dev/ttyUSB0`.
Use the `term` target to connect to the board serial port<br/>
```
make BOARD=e104-bt5010a-tb -C examples/hello-world term
```
*/

View File

@ -0,0 +1,64 @@
/*
* Copyright (C) 2020 Benjamin Valentin
*
* 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_e104-bt5010a-tb
* @{
*
* @file
* @brief Board specific configuration for the E104-BT5010A Test Board
*
* @author Benjamin Valentin <benpicco@googlemail.com>
*/
#ifndef BOARD_H
#define BOARD_H
#include "board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name LED pin configuration
* @{
*/
#define LED0_PIN GPIO_PIN(0, 30)
#define LED1_PIN GPIO_PIN(0, 31)
#define LED_PORT (NRF_P0)
#define LED0_MASK (1 << 30)
#define LED1_MASK (1 << 31)
#define LED_MASK (LED0_MASK | LED1_MASK)
#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
#define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
#define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
#define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
#define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
/** @} */
/**
* @name Button pin configuration
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 21)
#define BTN0_MODE GPIO_IN_PU
#define BTN1_PIN GPIO_PIN(0, 29)
#define BTN1_MODE GPIO_IN_PU
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */

View File

@ -0,0 +1,65 @@
/*
* Copyright (C) 2020 Benjamin Valentin
*
* 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_e104-bt5010a-tb
* @{
*
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Benjamin Valentin <benpicco@googlemail.com>
*/
#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H
#include "board.h"
#include "saul/periph.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief GPIO pin configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED (link)",
.pin = LED0_PIN,
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INVERTED,
},
{
.name = "LED (data)",
.pin = LED1_PIN,
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INVERTED,
},
{
.name = "BTN (RTS)",
.pin = BTN0_PIN,
.mode = BTN0_MODE,
.flags = SAUL_GPIO_INVERTED,
},
{
.name = "BTN (DBG)",
.pin = BTN1_PIN,
.mode = BTN1_MODE,
.flags = SAUL_GPIO_INVERTED,
},
};
#ifdef __cplusplus
}
#endif
#endif /* GPIO_PARAMS_H */
/** @} */

View File

@ -0,0 +1,97 @@
/*
* Copyright (C) 2020 Benjamin Valentin
*
* 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_e104-bt5010a-tb
* @{
*
* @file
* @brief Peripheral configuration for the E104-BT5010A Test Board
*
* @author Benjamin Valentin <benpicco@googlemail.com>
*
*/
#ifndef PERIPH_CONF_H
#define PERIPH_CONF_H
#include "periph_cpu.h"
#include "cfg_rtt_default.h"
#include "cfg_timer_default.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Clock configuration
* The E104-BT5010A module does not have any external oscillators
* @{
*/
#define CLOCK_HFCLK (0U) /* internal RC oscillator */
#define CLOCK_LFCLK (0) /* internal RC oscillator */
/** @} */
/**
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
{
.dev = NRF_SPIM0,
.sclk = GPIO_PIN(0, 26),
.mosi = GPIO_PIN(0, 27),
.miso = GPIO_PIN(0, 28),
},
};
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
* @name I2C configuration
* @{
*/
static const i2c_conf_t i2c_config[] = {
{
.dev = NRF_TWIM0,
.scl = GPIO_PIN(0, 6),
.sda = GPIO_PIN(0, 7),
.speed = I2C_SPEED_NORMAL
}
};
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
/** @} */
/**
* @name UART configuration
* @{
*/
static const uart_conf_t uart_config[] = {
{ /* Mapped to USB virtual COM port */
.dev = NRF_UARTE0,
.rx_pin = GPIO_PIN(0,14),
.tx_pin = GPIO_PIN(0,18),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.irqn = UARTE0_UART0_IRQn,
},
};
#define UART_0_ISR (isr_uart0)
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CONF_H */
/** @} */

View File

@ -8,6 +8,7 @@ BOARD_INSUFFICIENT_MEMORY := \
calliope-mini \
cc2650-launchpad \
cc2650stk \
e104-bt5010a-tb \
hifive1 \
hifive1b \
i-nucleo-lrwan1 \

View File

@ -14,6 +14,7 @@ BOARD_INSUFFICIENT_MEMORY := \
cc2538dk \
cc2650-launchpad \
cc2650stk \
e104-bt5010a-tb \
ek-lm4f120xl \
esp8266-esp-12x \
esp8266-olimex-mod \

View File

@ -5,6 +5,7 @@ BOARD_INSUFFICIENT_MEMORY := \
arduino-uno \
atmega328p \
b-l072z-lrwan1 \
e104-bt5010a-tb \
lsn50 \
msb-430 \
msb-430h \

View File

@ -22,6 +22,7 @@ LOW_MEMORY_BOARDS += \
cc1352-launchpad \
cc2650-launchpad \
cc2650stk \
e104-bt5010a-tb \
derfmega128 \
feather-m0 \
feather-m0-wifi \

View File

@ -0,0 +1,3 @@
BOARD_INSUFFICIENT_MEMORY := \
e104-bt5010a-tb \
#

View File

@ -0,0 +1,3 @@
BOARD_INSUFFICIENT_MEMORY := \
e104-bt5010a-tb \
#

View File

@ -0,0 +1,3 @@
BOARD_INSUFFICIENT_MEMORY := \
e104-bt5010a-tb \
#

View File

@ -0,0 +1,3 @@
BOARD_INSUFFICIENT_MEMORY := \
e104-bt5010a-tb \
#

View File

@ -0,0 +1,3 @@
BOARD_INSUFFICIENT_MEMORY := \
e104-bt5010a-tb \
#

View File

@ -22,6 +22,7 @@ BOARD_INSUFFICIENT_MEMORY := \
cc2650stk \
derfmega128 \
derfmega256 \
e104-bt5010a-tb \
ek-lm4f120xl \
esp8266-esp-12x \
esp8266-olimex-mod \