diff --git a/boards/cc2650stk/Makefile b/boards/cc2650stk/Makefile new file mode 100644 index 0000000000..f8fcbb53a0 --- /dev/null +++ b/boards/cc2650stk/Makefile @@ -0,0 +1,3 @@ +MODULE = board + +include $(RIOTBASE)/Makefile.base diff --git a/boards/cc2650stk/Makefile.features b/boards/cc2650stk/Makefile.features new file mode 100644 index 0000000000..8f81826a8b --- /dev/null +++ b/boards/cc2650stk/Makefile.features @@ -0,0 +1,11 @@ +# Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_cpuid +FEATURES_PROVIDED += periph_gpio +FEATURES_PROVIDED += periph_timer +FEATURES_PROVIDED += periph_uart + +# Various other features (if any) +FEATURES_PROVIDED += cpp + +# The board MPU family (used for grouping by the CI system) +FEATURES_MCU_GROUP = cortex_m3_1 diff --git a/boards/cc2650stk/Makefile.include b/boards/cc2650stk/Makefile.include new file mode 100644 index 0000000000..f6cca7a734 --- /dev/null +++ b/boards/cc2650stk/Makefile.include @@ -0,0 +1,14 @@ +export CPU = cc26x0 +export CPU_MODEL = cc26x0f128 + +# set default port depending on operating system +PORT_LINUX ?= /dev/ttyACM0 +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) + +# setup serial terminal +include $(RIOTBOARD)/Makefile.include.serial + +# configure the flash tool +export UNIFLASH_PATH ?= "UNIFLASH_PATH unconfigured" +export FLASHER = $(UNIFLASH_PATH)/uniflash.sh +export FFLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/cc26x0stk.ccxml -program $(ELFFILE) diff --git a/boards/cc2650stk/board.c b/boards/cc2650stk/board.c new file mode 100644 index 0000000000..fcbeb8d96e --- /dev/null +++ b/boards/cc2650stk/board.c @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2016 Leon George + * + * 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_cc2650stk + * @{ + * + * @file + * @brief Board specific implementations for the CC2650STK board + * + * @author Leon M. George + * + * @} + */ + +#include "cpu.h" +#include "board.h" + +/** + * @brief initialise the board + */ +void board_init(void) +{ + cpu_init(); + + gpio_init(LED0_PIN, GPIO_OUT); + gpio_init(LED1_PIN, GPIO_OUT); +} diff --git a/boards/cc2650stk/dist/cc26x0stk.ccxml b/boards/cc2650stk/dist/cc26x0stk.ccxml new file mode 100644 index 0000000000..210180b8b2 --- /dev/null +++ b/boards/cc2650stk/dist/cc26x0stk.ccxml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/boards/cc2650stk/include/board.h b/boards/cc2650stk/include/board.h new file mode 100644 index 0000000000..558cc7b254 --- /dev/null +++ b/boards/cc2650stk/include/board.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2016 Leon George + * + * 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_cc2650stk CC2650STK + * @ingroup boards + * @brief SimpleLinkā„¢ CC2650 sensor tag + * @{ + * + * @file + * @brief Board configuration for the CC2650STK + * + * @author Leon M. George + */ + +#ifndef BOARD_H_ +#define BOARD_H_ + +#include "periph/gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Xtimer configuration + * @{ + */ +#define XTIMER_MASK (0xFFFF0000) +#define XTIMER_SHIFT_ON_COMPARE (7) +/** @} */ + +/** + * @brief On-board button configuration + * @{ + */ +#define BUTTON1_DIO GPIO_PIN(0, 4) +#define BUTTON2_DIO GPIO_PIN(0, 0) +/** @} */ + +/** + * @brief Macros for controlling the on-board LEDs + * @{ + */ +#define LED0_PIN GPIO_PIN(0, 10) +#define LED1_PIN GPIO_PIN(0, 15) + +#define LED0_ON gpio_set(LED0_PIN) +#define LED0_OFF gpio_clear(LED0_PIN) +#define LED0_TOGGLE gpio_toggle(LED0_PIN) + +#define LED1_ON gpio_set(LED1_PIN) +#define LED1_OFF gpio_clear(LED1_PIN) +#define LED1_TOGGLE gpio_toggle(LED1_PIN) +/** @} */ + +/** + * @brief Initialize board specific hardware, including clock, LEDs, and std-IO + */ +void board_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* BOARD_H_ */ +/** @} */ diff --git a/boards/cc2650stk/include/periph_conf.h b/boards/cc2650stk/include/periph_conf.h new file mode 100644 index 0000000000..89a18186e5 --- /dev/null +++ b/boards/cc2650stk/include/periph_conf.h @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2016 Leon George + * + * 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_cc2650stk + * @{ + * + * @file + * @brief Peripheral MCU configuration for the CC2650STK board + * + * @author Leon M. George + */ + +#ifndef PERIPH_CONF_H_ +#define PERIPH_CONF_H_ + +#include "periph_cpu.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Clock configuration + * @{ + */ +/* the main clock is fixed to 48MHZ */ +#define CLOCK_CORECLOCK (48000000U) +/** @} */ + +/** + * @brief Timer configuration + * @{ + */ +static const timer_conf_t timer_config[] = { + { + .dev = GPT0, + .num = 0 + }, + { + .dev = GPT1, + .num = 1 + } +}; + +#define TIMER_0_ISR isr_timer0_chan0 +#define TIMER_1_ISR isr_timer1_chan0 + +#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0])) +/** @} */ + +/** + * @brief UART configuration + * + * The used CC26x0 CPU only supports a single UART device, so all we need to + * configure are the RX and TX pins. + * + * Optionally we can enable hardware flow control, by setting UART_HW_FLOW_CTRL + * to 1 and defining pins for UART_CTS_PIN and UART_RTS_PIN. + * @{ + */ +#define UART_NUMOF (1) +#define UART_RX_PIN (28) +#define UART_TX_PIN (29) +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* PERIPH_CONF_H_ */ +/** @} */