mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 01:53:51 +01:00
boards/pca10000: squash added support for Nordic Dev Kit p1
This commit is contained in:
parent
1154bd5a50
commit
c1993b1bf6
4
boards/pca10000/Makefile
Normal file
4
boards/pca10000/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# tell the Makefile.base which module to build
|
||||
MODULE = $(BOARD)_base
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
46
boards/pca10000/Makefile.include
Normal file
46
boards/pca10000/Makefile.include
Normal file
@ -0,0 +1,46 @@
|
||||
# define the cpu used by the nRF51822 board pca10000
|
||||
export CPU = nrf51822
|
||||
export CPU_MODEL = nrf51822qfaa
|
||||
|
||||
#define the default port depending on the host OS
|
||||
OS := $(shell uname)
|
||||
ifeq ($(OS),Linux)
|
||||
PORT ?= /dev/ttyACM0
|
||||
else ifeq ($(OS),Darwin)
|
||||
PORT ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
|
||||
else
|
||||
$(info CAUTION: No flash tool for your host system found!)
|
||||
# TODO: add support for windows as host platform
|
||||
endif
|
||||
export PORT
|
||||
|
||||
# define tools used for building the project
|
||||
export PREFIX = arm-none-eabi-
|
||||
export CC = $(PREFIX)gcc
|
||||
export AR = $(PREFIX)ar
|
||||
export AS = $(PREFIX)as
|
||||
export LINK = $(PREFIX)gcc
|
||||
export SIZE = $(PREFIX)size
|
||||
export OBJCOPY = $(PREFIX)objcopy
|
||||
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm.py
|
||||
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh $(BINDIR) $(RIOTBASE) $(APPLICATION) $(BOARD)
|
||||
export HEXFILE = $(ELFFILE:.elf=.bin)
|
||||
|
||||
# define build specific options
|
||||
CPU_USAGE = -mcpu=cortex-m0
|
||||
FPU_USAGE =
|
||||
export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles
|
||||
export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin
|
||||
export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian
|
||||
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles
|
||||
# $(LINKERSCRIPT) is specified in cpu/Makefile.include
|
||||
export LINKFLAGS += -T$(LINKERSCRIPT)
|
||||
export OFLAGS = -O binary
|
||||
|
||||
# use the nano-specs of the NewLib when available
|
||||
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
|
||||
export LINKFLAGS += -specs=nano.specs -lc -lnosys
|
||||
endif
|
||||
|
||||
# export board specific includes to the global includes-listing
|
||||
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
|
||||
57
boards/pca10000/board.c
Normal file
57
boards/pca10000/board.c
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Freie Universität Berlin
|
||||
*
|
||||
* 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 board_pca10000
|
||||
* @{
|
||||
*
|
||||
* @file board.c
|
||||
* @brief Board specific implementations for the nRF51822 evaluation board pca10000
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "board.h"
|
||||
#include "cpu.h"
|
||||
#include "periph/uart.h"
|
||||
|
||||
extern void SystemInit(void);
|
||||
|
||||
void leds_init(void);
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* initialize the boards LEDs */
|
||||
leds_init();
|
||||
|
||||
/* initialize the CPU */
|
||||
cpu_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the boards on-board RGB LED
|
||||
*
|
||||
* The LED initialization is hard-coded in this function.
|
||||
*
|
||||
* The LED channels are connected to the following pins:
|
||||
* - RED: 21
|
||||
* - GREEN: 22
|
||||
* - BLUE: 23
|
||||
*/
|
||||
void leds_init(void)
|
||||
{
|
||||
/* set LED pins to function as output */
|
||||
NRF_GPIO->DIRSET = (LED_RED_PIN | LED_GREEN_PIN | LED_BLUE_PIN);
|
||||
|
||||
/* turn all LEDs off (low active) */
|
||||
NRF_GPIO->OUTSET = (LED_RED_PIN | LED_GREEN_PIN | LED_BLUE_PIN);
|
||||
}
|
||||
39
boards/pca10000/dist/flash.sh
vendored
Executable file
39
boards/pca10000/dist/flash.sh
vendored
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This flash script dynamically generates a file with a set of commands which
|
||||
# have to be handed to the flashing script of SEGGER (JLinkExe).
|
||||
# After that, JLinkExe will be executed with that set of commands to flash the
|
||||
# latest .bin file to the board.
|
||||
|
||||
# @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
RIOTBASE=$2
|
||||
APPLICATION=$3
|
||||
BOARD=$4
|
||||
|
||||
if [[ $APPLICATION == test_* ]]
|
||||
then
|
||||
TYPE=tests
|
||||
else
|
||||
TYPE=examples
|
||||
fi
|
||||
|
||||
echo "log /dev/null" > $BINDIR/burn.seg
|
||||
echo "device nrf51822" >> $BINDIR/burn.seg
|
||||
echo "speed 1000" >> $BINDIR/burn.seg
|
||||
echo "w4 4001e504 1" >> $BINDIR/burn.seg
|
||||
echo "loadbin $RIOTBASE/$TYPE/$APPLICATION/bin/$BOARD/$APPLICATION.bin 0" >> $BINDIR/burn.seg
|
||||
echo "r" >> $BINDIR/burn.seg
|
||||
echo "g" >> $BINDIR/burn.seg
|
||||
echo "exit" >> $BINDIR/burn.seg
|
||||
echo "" >> $BINDIR/burn.seg
|
||||
JLinkExe < $BINDIR/burn.seg
|
||||
if [ -f JLink.log ]
|
||||
then
|
||||
rm JLink.log
|
||||
fi
|
||||
if [ -f ~/JLink.log ]
|
||||
then
|
||||
rm ~/JLink.log
|
||||
fi
|
||||
77
boards/pca10000/include/board.h
Normal file
77
boards/pca10000/include/board.h
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Freie Universität Berlin
|
||||
*
|
||||
* 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 board_pca10000
|
||||
* @ingroup boards
|
||||
* @brief Board specific files for the nRF51822 board pca10000.
|
||||
* @{
|
||||
*
|
||||
* @file board.h
|
||||
* @brief Board specific definitions for the nRF51822 evaluation board pca10000.
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_H
|
||||
#define __BOARD_H
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
|
||||
/**
|
||||
* Define the nominal CPU core clock in this board
|
||||
*/
|
||||
#define F_CPU (16000000UL)
|
||||
|
||||
/**
|
||||
* @name Assign the hardware timer
|
||||
*/
|
||||
#define HW_TIMER TIMER_0
|
||||
|
||||
/**
|
||||
* @name Define the boards stdio
|
||||
* @{
|
||||
*/
|
||||
#define STDIO UART_0
|
||||
#define STDIO_BAUDRATE (115200U)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name LED pin definitions
|
||||
* @{
|
||||
*/
|
||||
#define ONBOARD_LED 1
|
||||
#define LED_RED_PIN (1 << 21)
|
||||
#define LED_GREEN_PIN (1 << 22)
|
||||
#define LED_BLUE_PIN (1 << 23)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Macros for controlling the on-board LEDs.
|
||||
* @{
|
||||
*/
|
||||
#define LED_RED_ON (NRF_GPIO->OUTCLR = LED_RED_PIN)
|
||||
#define LED_RED_OFF (NRF_GPIO->OUTSET = LED_RED_PIN)
|
||||
#define LED_RED_TOGGLE (NRF_GPIO->OUT ^= LED_RED_PIN)
|
||||
#define LED_GREEN_ON (NRF_GPIO->OUTCLR = LED_GREEN_PIN)
|
||||
#define LED_GREEN_OFF (NRF_GPIO->OUTSET = LED_GREEN_PIN)
|
||||
#define LED_GREEN_TOGGLE (NRF_GPIO->OUT ^= LED_GREEN_PIN)
|
||||
#define LED_BLUE_ON (NRF_GPIO->OUTCLR = LED_BLUE_PIN)
|
||||
#define LED_BLUE_OFF (NRF_GPIO->OUTSET = LED_BLUE_PIN)
|
||||
#define LED_BLUE_TOGGLE (NRF_GPIO->OUT ^= LED_BLUE_PIN)
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
||||
*/
|
||||
void board_init(void);
|
||||
|
||||
#endif /** __BOARD_H */
|
||||
/** @} */
|
||||
115
boards/pca10000/include/periph_conf.h
Normal file
115
boards/pca10000/include/periph_conf.h
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Freie Universität Berlin
|
||||
*
|
||||
* 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 board_pca10000
|
||||
* @{
|
||||
*
|
||||
* @file periph_conf.h
|
||||
* @brief Peripheral MCU configuration for the nRF51822 board pca10000
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef __PERIPH_CONF_H
|
||||
#define __PERIPH_CONF_H
|
||||
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
#define TIMER_NUMOF (1U)
|
||||
#define TIMER_0_EN 1
|
||||
#define TIMER_1_EN 0
|
||||
#define TIMER_2_EN 0
|
||||
#define TIMER_IRQ_PRIO 1
|
||||
|
||||
/* Timer 0 configuration */
|
||||
#define TIMER_0_DEV NRF_TIMER0
|
||||
#define TIMER_0_CHANNELS 3
|
||||
#define TIMER_0_MAX_VALUE (0xffffffff)
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_0_IRQ TIMER0_IRQn
|
||||
|
||||
/* Timer 1 configuration */
|
||||
#define TIMER_1_DEV NRF_TIMER1
|
||||
#define TIMER_1_CHANNELS 3
|
||||
#define TIMER_1_MAX_VALUE (0xffff)
|
||||
#define TIMER_1_ISR isr_timer1
|
||||
#define TIMER_1_IRQ TIMER1_IRQn
|
||||
|
||||
/* Timer 2 configuration */
|
||||
#define TIMER_2_DEV NRF_TIMER2
|
||||
#define TIMER_2_CHANNELS 3
|
||||
#define TIMER_2_MAX_VALUE (0xffff)
|
||||
#define TIMER_2_ISR isr_timer2
|
||||
#define TIMER_2_IRQ TIMER2_IRQn
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
*/
|
||||
#define UART_NUMOF (1U)
|
||||
#define UART_0_EN 1
|
||||
#define UART_IRQ_PRIO 1
|
||||
|
||||
/* UART 0 device configuration */
|
||||
#define UART_0_DEV NRF_UART0
|
||||
#define UART_0_HWFLOWCTRL 1
|
||||
#define UART_0_PIN_RX 11
|
||||
#define UART_0_PIN_TX 9
|
||||
#define UART_0_PIN_RTS 8
|
||||
#define UART_0_PIN_CTS 10
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name GPIO configuration
|
||||
* @{
|
||||
*/
|
||||
#define GPIO_NUMOF 16
|
||||
#define GPIO_0_EN 1
|
||||
#define GPIO_1_EN 1
|
||||
#define GPIO_2_EN 1
|
||||
#define GPIO_3_EN 1
|
||||
#define GPIO_4_EN 1
|
||||
#define GPIO_5_EN 1
|
||||
#define GPIO_6_EN 1
|
||||
#define GPIO_7_EN 1
|
||||
#define GPIO_8_EN 1
|
||||
#define GPIO_9_EN 1
|
||||
#define GPIO_10_EN 1
|
||||
#define GPIO_11_EN 1
|
||||
#define GPIO_12_EN 1
|
||||
#define GPIO_13_EN 1
|
||||
#define GPIO_14_EN 1
|
||||
#define GPIO_15_EN 1
|
||||
#define GPIO_IRQ_PRIO 1
|
||||
|
||||
#define GPIO_0_PIN 0
|
||||
#define GPIO_1_PIN 1
|
||||
#define GPIO_2_PIN 2
|
||||
#define GPIO_3_PIN 3
|
||||
#define GPIO_4_PIN 4
|
||||
#define GPIO_5_PIN 5
|
||||
#define GPIO_6_PIN 6
|
||||
#define GPIO_7_PIN 7
|
||||
#define GPIO_8_PIN 8
|
||||
#define GPIO_9_PIN 9
|
||||
#define GPIO_10_PIN 10
|
||||
#define GPIO_11_PIN 11
|
||||
#define GPIO_12_PIN 12
|
||||
#define GPIO_13_PIN 13
|
||||
#define GPIO_14_PIN 14
|
||||
#define GPIO_15_PIN 15
|
||||
/** @} */
|
||||
|
||||
#endif /* __PERIPH_CONF_H */
|
||||
Loading…
x
Reference in New Issue
Block a user