mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #1623 from haukepetersen/add_board_yunjia
Add board yunjia
This commit is contained in:
commit
0f716ba978
@ -35,6 +35,7 @@
|
||||
#define TIMER_0_DEV NRF_TIMER0
|
||||
#define TIMER_0_CHANNELS 3
|
||||
#define TIMER_0_MAX_VALUE (0xffffffff)
|
||||
#define TIMER_0_BITMODE TIMER_BITMODE_BITMODE_32Bit
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_0_IRQ TIMER0_IRQn
|
||||
|
||||
@ -42,6 +43,7 @@
|
||||
#define TIMER_1_DEV NRF_TIMER1
|
||||
#define TIMER_1_CHANNELS 3
|
||||
#define TIMER_1_MAX_VALUE (0xffff)
|
||||
#define TIEMR_1_BITMODE TIMER_BITMODE_BITMODE_16Bit
|
||||
#define TIMER_1_ISR isr_timer1
|
||||
#define TIMER_1_IRQ TIMER1_IRQn
|
||||
|
||||
@ -49,6 +51,7 @@
|
||||
#define TIMER_2_DEV NRF_TIMER2
|
||||
#define TIMER_2_CHANNELS 3
|
||||
#define TIMER_2_MAX_VALUE (0xffff)
|
||||
#define TIMER_2_BITMODE TIMER_BITMODE_BITMODE_16Bit
|
||||
#define TIMER_2_ISR isr_timer2
|
||||
#define TIMER_2_IRQ TIMER2_IRQn
|
||||
/** @} */
|
||||
@ -115,6 +118,7 @@
|
||||
#define GPIO_15_EN 1
|
||||
#define GPIO_IRQ_PRIO 1
|
||||
|
||||
/* GPIO pin configuration */
|
||||
#define GPIO_0_PIN 0
|
||||
#define GPIO_1_PIN 1
|
||||
#define GPIO_2_PIN 2
|
||||
|
@ -15,6 +15,7 @@
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef __PERIPH_CONF_H
|
||||
@ -26,7 +27,6 @@
|
||||
*/
|
||||
#define TIMER_NUMOF (1U)
|
||||
#define TIMER_0_EN 1
|
||||
/* timers 1 and 2 are not supported yet */
|
||||
#define TIMER_1_EN 0
|
||||
#define TIMER_2_EN 0
|
||||
#define TIMER_IRQ_PRIO 1
|
||||
@ -35,6 +35,7 @@
|
||||
#define TIMER_0_DEV NRF_TIMER0
|
||||
#define TIMER_0_CHANNELS 3
|
||||
#define TIMER_0_MAX_VALUE (0xffffffff)
|
||||
#define TIMER_0_BITMODE TIMER_BITMODE_BITMODE_32Bit
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_0_IRQ TIMER0_IRQn
|
||||
|
||||
@ -42,6 +43,7 @@
|
||||
#define TIMER_1_DEV NRF_TIMER1
|
||||
#define TIMER_1_CHANNELS 3
|
||||
#define TIMER_1_MAX_VALUE (0xffff)
|
||||
#define TIEMR_1_BITMODE TIMER_BITMODE_BITMODE_16Bit
|
||||
#define TIMER_1_ISR isr_timer1
|
||||
#define TIMER_1_IRQ TIMER1_IRQn
|
||||
|
||||
@ -49,11 +51,11 @@
|
||||
#define TIMER_2_DEV NRF_TIMER2
|
||||
#define TIMER_2_CHANNELS 3
|
||||
#define TIMER_2_MAX_VALUE (0xffff)
|
||||
#define TIMER_2_BITMODE TIMER_BITMODE_BITMODE_16Bit
|
||||
#define TIMER_2_ISR isr_timer2
|
||||
#define TIMER_2_IRQ TIMER2_IRQn
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
@ -70,6 +72,21 @@
|
||||
#define UART_0_PIN_TX 9
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Real time counter configuration
|
||||
* @{
|
||||
*/
|
||||
#define RTT_NUMOF (1U)
|
||||
#define RTT_IRQ_PRIO 1
|
||||
|
||||
#define RTT_DEV NRF_RTC0
|
||||
#define RTT_IRQ RTC0_IRQn
|
||||
#define RTT_ISR isr_rtc0
|
||||
#define RTT_MAX_VALUE (0xffffff)
|
||||
#define RTT_FREQUENCY (10) /* in Hz */
|
||||
#define RTT_PRESCALER (3275U) /* run with 10 Hz */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Random Number Generator configuration
|
||||
* @{
|
||||
@ -77,7 +94,6 @@
|
||||
#define RANDOM_NUMOF (1U)
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* @name GPIO configuration
|
||||
* @{
|
||||
|
4
boards/yunjia-nrf51822/Makefile
Normal file
4
boards/yunjia-nrf51822/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# tell the Makefile.base which module to build
|
||||
MODULE = $(BOARD)_base
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
52
boards/yunjia-nrf51822/Makefile.include
Normal file
52
boards/yunjia-nrf51822/Makefile.include
Normal file
@ -0,0 +1,52 @@
|
||||
# define the cpu used by the yunjia-nrf51822 board
|
||||
export CPU = nrf51822
|
||||
export CPU_MODEL = nrf51822qfaa
|
||||
|
||||
#define the default port depending on the host OS
|
||||
OS := $(shell uname)
|
||||
ifeq ($(OS),Linux)
|
||||
PORT ?= /dev/ttyUSB0
|
||||
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
|
||||
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
|
||||
export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
|
||||
export DEBUGSERVER = $(RIOTBOARD)/$(BOARD)/dist/debug-server.sh
|
||||
export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
|
||||
|
||||
# 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
|
||||
export HEXFILE = $(ELFFILE:.elf=.bin)
|
||||
export TERMFLAGS += -p "$(PORT)"
|
||||
export FFLAGS = $(HEXFILE)
|
||||
export DEBUGGER_FLAGS = $(ELFFILE)
|
||||
|
||||
# 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
|
30
boards/yunjia-nrf51822/board.c
Normal file
30
boards/yunjia-nrf51822/board.c
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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_yunjia-nrf51822
|
||||
* @{
|
||||
*
|
||||
* @file board.c
|
||||
* @brief Board specific implementations for the Yunjia NRF51822 board
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include "cpu.h"
|
||||
|
||||
#include "periph/uart.h"
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* initialize the CPU */
|
||||
cpu_init();
|
||||
}
|
14
boards/yunjia-nrf51822/dist/debug
vendored
Executable file
14
boards/yunjia-nrf51822/dist/debug
vendored
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -L "$0" ]; then
|
||||
FILE=$(readlink -e "$0")
|
||||
else
|
||||
FILE="$0"
|
||||
fi
|
||||
|
||||
BIN_FOLDER=$(dirname "${FILE}")
|
||||
|
||||
openocd -f "${BIN_FOLDER}/openocd.cfg" \
|
||||
-c "init" \
|
||||
-c "targets" \
|
||||
-c "reset halt" \
|
17
boards/yunjia-nrf51822/dist/debug-server.sh
vendored
Executable file
17
boards/yunjia-nrf51822/dist/debug-server.sh
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -L "$0" ]; then
|
||||
FILE=$(readlink -e "$0")
|
||||
else
|
||||
FILE="$0"
|
||||
fi
|
||||
|
||||
BIN_FOLDER=$(dirname "${FILE}")
|
||||
|
||||
echo "##"
|
||||
echo "## Starting debug server"
|
||||
echo "##"
|
||||
openocd -f "${BIN_FOLDER}/openocd.cfg" \
|
||||
-c "init" \
|
||||
-c "targets" \
|
||||
-c "reset halt" \
|
19
boards/yunjia-nrf51822/dist/debug.sh
vendored
Executable file
19
boards/yunjia-nrf51822/dist/debug.sh
vendored
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "ELF-file $1 does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -L "$0" ]; then
|
||||
FILE=$(readlink -e "$0")
|
||||
else
|
||||
FILE="$0"
|
||||
fi
|
||||
|
||||
BIN_FOLDER=$(dirname "${FILE}")
|
||||
|
||||
echo "##"
|
||||
echo "## Debugging $1"
|
||||
echo "##"
|
||||
arm-none-eabi-gdb -tui -command="${BIN_FOLDER}/gdb.cfg" $1
|
27
boards/yunjia-nrf51822/dist/flash.sh
vendored
Executable file
27
boards/yunjia-nrf51822/dist/flash.sh
vendored
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "Binary file $1 does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -L "$0" ]; then
|
||||
FILE=$(readlink -e "$0")
|
||||
else
|
||||
FILE="$0"
|
||||
fi
|
||||
|
||||
BIN_FOLDER=$(dirname "${FILE}")
|
||||
|
||||
echo "##"
|
||||
echo "## Flashing $1"
|
||||
echo "##"
|
||||
openocd -f "${BIN_FOLDER}/openocd.cfg" \
|
||||
-c "init" \
|
||||
-c "targets" \
|
||||
-c "flash banks" \
|
||||
-c "reset halt" \
|
||||
-c "flash write_image erase $1 0" \
|
||||
-c "verify_image $1" \
|
||||
-c "reset run"\
|
||||
-c "shutdown"
|
1
boards/yunjia-nrf51822/dist/gdb.cfg
vendored
Normal file
1
boards/yunjia-nrf51822/dist/gdb.cfg
vendored
Normal file
@ -0,0 +1 @@
|
||||
target extended-remote 127.0.0.1:3333
|
8
boards/yunjia-nrf51822/dist/openocd.cfg
vendored
Normal file
8
boards/yunjia-nrf51822/dist/openocd.cfg
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# nRF51822 Target
|
||||
source [find interface/stlink-v2.cfg]
|
||||
|
||||
set WORKAREASIZE 0x4000
|
||||
source [find target/nrf51_stlink.tcl]
|
||||
|
||||
# use hardware reset, connect under reset
|
||||
#reset_config srst_only srst_nogate
|
17
boards/yunjia-nrf51822/dist/reset.sh
vendored
Executable file
17
boards/yunjia-nrf51822/dist/reset.sh
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -L "$0" ]; then
|
||||
FILE=$(readlink "$0")
|
||||
else
|
||||
FILE="$0"
|
||||
fi
|
||||
|
||||
BIN_FOLDER=$(dirname "${FILE}")
|
||||
|
||||
echo "##"
|
||||
echo "## Resetting $BOARD"
|
||||
echo "##"
|
||||
openocd -f "${BIN_FOLDER}/openocd.cfg" \
|
||||
-c "init" \
|
||||
-c "reset run" \
|
||||
-c "shutdown"
|
62
boards/yunjia-nrf51822/include/board.h
Normal file
62
boards/yunjia-nrf51822/include/board.h
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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_yunjia-nrf51822 Yunjia NRF51822
|
||||
* @ingroup boards
|
||||
* @brief Board specific files for the Yunjia NRF51822 board
|
||||
* @{
|
||||
*
|
||||
* @file board.h
|
||||
* @brief Board specific definitions for the Yunjia NRF51822 board
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_H
|
||||
#define __BOARD_H
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
/**
|
||||
* @name Define the nominal CPU core clock in this board
|
||||
*/
|
||||
#define F_CPU (16000000UL)
|
||||
|
||||
/**
|
||||
* @name Define the boards stdio
|
||||
* @{
|
||||
*/
|
||||
#define STDIO UART_0
|
||||
#define STDIO_BAUDRATE (115200U)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Assign the hardware timer
|
||||
*/
|
||||
#define HW_TIMER TIMER_0
|
||||
|
||||
/**
|
||||
* @name Macros for controlling the on-board LEDs.
|
||||
* @{
|
||||
*/
|
||||
#define LED_RED_ON /* not available */
|
||||
#define LED_RED_OFF /* not available */
|
||||
#define LED_RED_TOGGLE /* not available */
|
||||
#define LED_GREEN_ON /* not available */
|
||||
#define LED_GREEN_OFF /* not available */
|
||||
#define LED_GREEN_TOGGLE /* not available */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
||||
*/
|
||||
void board_init(void);
|
||||
|
||||
#endif /** __BOARD_H */
|
||||
/** @} */
|
119
boards/yunjia-nrf51822/include/periph_conf.h
Normal file
119
boards/yunjia-nrf51822/include/periph_conf.h
Normal file
@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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_yunjia-nrf51822
|
||||
* @{
|
||||
*
|
||||
* @file periph_conf.h
|
||||
* @brief Peripheral MCU configuration for the Yunjia NRF51822 board
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@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_BITMODE TIMER_BITMODE_BITMODE_32Bit
|
||||
#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 TIEMR_1_BITMODE TIMER_BITMODE_BITMODE_16Bit
|
||||
#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_BITMODE TIMER_BITMODE_BITMODE_16Bit
|
||||
#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_PIN_RX 1
|
||||
#define UART_0_PIN_TX 2
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Real time counter configuration
|
||||
* @{
|
||||
*/
|
||||
#define RTT_NUMOF (1U)
|
||||
#define RTT_IRQ_PRIO 1
|
||||
|
||||
#define RTT_DEV NRF_RTC0
|
||||
#define RTT_IRQ RTC0_IRQn
|
||||
#define RTT_ISR isr_rtc0
|
||||
#define RTT_MAX_VALUE (0xffffff)
|
||||
#define RTT_FREQUENCY (10) /* in Hz */
|
||||
#define RTT_PRESCALER (3275U) /* run with 10 Hz */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Random Number Generator configuration
|
||||
* @{
|
||||
*/
|
||||
#define RANDOM_NUMOF (1U)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name GPIO configuration
|
||||
* @{
|
||||
*/
|
||||
#define GPIO_NUMOF (8U)
|
||||
#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_IRQ_PRIO 1
|
||||
|
||||
/* GPIO pin configuration */
|
||||
#define GPIO_0_PIN 7
|
||||
#define GPIO_1_PIN 8
|
||||
#define GPIO_2_PIN 9
|
||||
#define GPIO_3_PIN 10
|
||||
#define GPIO_4_PIN 11
|
||||
#define GPIO_5_PIN 12
|
||||
#define GPIO_6_PIN 13
|
||||
#define GPIO_7_PIN 14
|
||||
/** @} */
|
||||
|
||||
#endif /* __PERIPH_CONF_H */
|
@ -29,10 +29,10 @@
|
||||
* TODO: measure and adjust for the cortex-m0
|
||||
* @{
|
||||
*/
|
||||
#define KERNEL_CONF_STACKSIZE_PRINTF (1024)
|
||||
#define KERNEL_CONF_STACKSIZE_PRINTF (524)
|
||||
|
||||
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
|
||||
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
|
||||
#define KERNEL_CONF_STACKSIZE_DEFAULT (524)
|
||||
#endif
|
||||
|
||||
#define KERNEL_CONF_STACKSIZE_IDLE (256)
|
||||
|
@ -34,8 +34,8 @@ SEARCH_DIR(.)
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x40000 /* 256K flash */
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000 /* 16K ram */
|
||||
rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K
|
||||
}
|
||||
|
||||
/* The stack size used by the application. NOTE: you need to adjust */
|
||||
|
@ -43,14 +43,14 @@ static timer_conf_t timer_config[TIMER_NUMOF];
|
||||
|
||||
int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
|
||||
{
|
||||
|
||||
NRF_TIMER_Type *timer;
|
||||
|
||||
switch (dev) {
|
||||
#if TIMER_0_EN
|
||||
case TIMER_0:
|
||||
timer = TIMER_0_DEV;
|
||||
timer->BITMODE = TIMER_BITMODE_BITMODE_32Bit; /* 32 Bit Mode */
|
||||
timer->POWER = 1;
|
||||
timer->BITMODE = TIMER_0_BITMODE;
|
||||
NVIC_SetPriority(TIMER_0_IRQ, TIMER_IRQ_PRIO);
|
||||
NVIC_EnableIRQ(TIMER_0_IRQ);
|
||||
break;
|
||||
@ -58,7 +58,8 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
|
||||
#if TIMER_1_EN
|
||||
case TIMER_1:
|
||||
timer = TIMER_1_DEV;
|
||||
timer->BITMODE = TIMER_BITMODE_BITMODE_16Bit; /* 16 Bit Mode */
|
||||
timer->POWER = 1;
|
||||
timer->BITMODE = TIEMR_1_BITMODE;
|
||||
NVIC_SetPriority(TIMER_1_IRQ, TIMER_IRQ_PRIO);
|
||||
NVIC_EnableIRQ(TIMER_1_IRQ);
|
||||
break;
|
||||
@ -66,7 +67,8 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
|
||||
#if TIMER_2_EN
|
||||
case TIMER_2:
|
||||
timer = TIMER_2_DEV;
|
||||
timer->BITMODE = TIMER_BITMODE_BITMODE_16Bit; /* 16 Bit Mode */
|
||||
timer->POWER = 1;
|
||||
timer->BITMODE = TIMER_2_BITMODE;
|
||||
NVIC_SetPriority(TIMER_2_IRQ, TIMER_IRQ_PRIO);
|
||||
NVIC_EnableIRQ(TIMER_2_IRQ);
|
||||
break;
|
||||
@ -102,14 +104,17 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
/* timer->INTENSET = TIMER_INTENSET_COMPARE0_Enabled << TIMER_INTENSET_COMPARE0_Pos; */
|
||||
|
||||
/* clear all compare channels */
|
||||
timer->SHORTS = (TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos);
|
||||
timer->SHORTS = (TIMER_SHORTS_COMPARE1_CLEAR_Enabled << TIMER_SHORTS_COMPARE1_CLEAR_Pos);
|
||||
timer->SHORTS = (TIMER_SHORTS_COMPARE2_CLEAR_Enabled << TIMER_SHORTS_COMPARE2_CLEAR_Pos);
|
||||
timer->SHORTS = (TIMER_SHORTS_COMPARE3_CLEAR_Enabled << TIMER_SHORTS_COMPARE3_CLEAR_Pos);
|
||||
|
||||
/* start the timer */
|
||||
timer->TASKS_START = 1;
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int timer_set(tim_t dev, int channel, unsigned int timeout)
|
||||
|
@ -15,6 +15,7 @@
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
@ -117,18 +118,29 @@ int uart_init_blocking(uart_t uart, uint32_t baudrate)
|
||||
switch (uart) {
|
||||
#if UART_0_EN
|
||||
case UART_0:
|
||||
/* power on UART device */
|
||||
UART_0_DEV->POWER = 1;
|
||||
|
||||
/* reset configuration registers */
|
||||
UART_0_DEV->CONFIG = 0;
|
||||
|
||||
/* select baudrate */
|
||||
UART_0_DEV->BAUDRATE = baudrate_real;
|
||||
|
||||
/* configure RX/TX pin modes */
|
||||
NRF_GPIO->DIRSET = (1 << UART_0_PIN_TX);
|
||||
NRF_GPIO->DIRCLR = (1 << UART_0_PIN_RX);
|
||||
|
||||
/* configure UART pins to use */
|
||||
UART_0_DEV->PSELTXD = UART_0_PIN_TX;
|
||||
UART_0_DEV->PSELRXD = UART_0_PIN_RX;
|
||||
|
||||
/* enable hw-flow control if defined */
|
||||
#if UART_0_HWFLOWCTRL
|
||||
/* set pin mode for RTS and CTS pins */
|
||||
NRF_GPIO->DIRSET = (1 << UART_0_PIN_RTS);
|
||||
NRF_GPIO->DIRSET = (1 << UART_0_PIN_CTS);
|
||||
/* configure RTS and CTS pins to use */
|
||||
UART_0_DEV->PSELRTS = UART_0_PIN_RTS;
|
||||
UART_0_DEV->PSELCTS = UART_0_PIN_CTS;
|
||||
UART_0_DEV->CONFIG |= 1; /* enable HW flow control */
|
||||
@ -147,8 +159,6 @@ int uart_init_blocking(uart_t uart, uint32_t baudrate)
|
||||
#endif
|
||||
}
|
||||
|
||||
DEBUG("UART INITIALIZATION complete\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -208,4 +218,30 @@ int uart_write_blocking(uart_t uart, char data)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void uart_poweron(uart_t uart)
|
||||
{
|
||||
switch (uart) {
|
||||
#if UART_0_EN
|
||||
case UART_0:
|
||||
UART_0_DEV->POWER = 1;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void uart_poweroff(uart_t uart)
|
||||
{
|
||||
switch (uart) {
|
||||
#if UART_0_EN
|
||||
case UART_0:
|
||||
UART_0_DEV->POWER = 0;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* UART_NUMOF */
|
||||
|
@ -90,8 +90,12 @@ void isr_nmi(void)
|
||||
|
||||
void isr_hard_fault(void)
|
||||
{
|
||||
LED_RED_ON;
|
||||
while (1) {asm ("nop");}
|
||||
while (1) {
|
||||
for (int i = 0; i < 500000; i++) {
|
||||
asm("nop");
|
||||
}
|
||||
LED_RED_TOGGLE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Cortex-M specific interrupt vectors */
|
||||
|
@ -29,8 +29,8 @@ QUIET ?= 1
|
||||
|
||||
BOARD_INSUFFICIENT_RAM := chronos msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1 redbee-econotag
|
||||
BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
|
||||
stm32f0discovery stm32f3discovery stm32f4discovery pca10000 pca10005 arduino-mega2560 \
|
||||
msbiot
|
||||
stm32f0discovery stm32f3discovery stm32f4discovery pca10000 pca10005 \
|
||||
arduino-mega2560 msbiot yunjia-nrf51822
|
||||
# mbed_lpc1768: see https://github.com/RIOT-OS/RIOT/issues/675
|
||||
# msb-430: see https://github.com/RIOT-OS/RIOT/issues/658
|
||||
# pttu: see https://github.com/RIOT-OS/RIOT/issues/659
|
||||
@ -42,6 +42,7 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
|
||||
# pca10005: no transceiver, yet
|
||||
# arduino-mega2560: no transceiver, yet
|
||||
# msbiot: no transceiver, yet
|
||||
# yunjia-nrf51822: no transceiver, yet
|
||||
|
||||
# Modules to include:
|
||||
|
||||
|
@ -30,7 +30,7 @@ QUIET ?= 1
|
||||
BOARD_INSUFFICIENT_RAM := chronos msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1 redbee-econotag
|
||||
BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
|
||||
stm32f0discovery stm32f3discovery stm32f4discovery \
|
||||
pca10000 pca10005 arduino-mega2560 msbiot
|
||||
pca10000 pca10005 arduino-mega2560 msbiot yunjia-nrf51822
|
||||
# mbed_lpc1768: see https://github.com/RIOT-OS/RIOT/issues/675
|
||||
# msb-430: see https://github.com/RIOT-OS/RIOT/issues/658
|
||||
# pttu: see https://github.com/RIOT-OS/RIOT/issues/659
|
||||
@ -41,6 +41,7 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
|
||||
# pca10000/5: no transceiver, yet
|
||||
# arduino-mega2560: no transceiver, yet
|
||||
# msbiot: no transceiver, yet
|
||||
# yunjia-nrf51822: no transceiver, yet
|
||||
|
||||
# Modules to include:
|
||||
|
||||
|
@ -31,7 +31,7 @@ QUIET ?= 1
|
||||
BOARD_BLACKLIST := arduino-due avsextrem chronos mbed_lpc1768 msb-430h msba2 redbee-econotag \
|
||||
telosb wsn430-v1_3b wsn430-v1_4 msb-430 pttu udoo qemu-i386 z1 stm32f0discovery \
|
||||
stm32f3discovery stm32f4discovery pca10000 pca10005 iot-lab_M3 arduino-mega2560 \
|
||||
msbiot
|
||||
msbiot yunjia-nrf51822
|
||||
|
||||
# This example only works with native for now.
|
||||
# msb430-based boards: msp430-g++ is not provided in mspgcc.
|
||||
@ -42,6 +42,7 @@ BOARD_BLACKLIST := arduino-due avsextrem chronos mbed_lpc1768 msb-430h msba2 red
|
||||
# stm32f4discovery: g++ does not support some used flags (e.g. -mthumb...)
|
||||
# pca10000: g++ does not support some used flags (e.g. -mthumb...)
|
||||
# pca10005: g++ does not support some used flags (e.g. -mthumb...)
|
||||
# yunjia-nrf51822: g++ does not support some used flags (e.g. -mthumb...)
|
||||
# iot-lab_M3: g++ does not support some used flags (e.g. -mthumb...)
|
||||
# arduino-mega2560: cstdio header missing from avr-libc
|
||||
# msbiot g++ does not support some used flags (e.g. -mthumb...)
|
||||
|
@ -37,7 +37,7 @@ endif
|
||||
BOARD_INSUFFICIENT_RAM := chronos msb-430h redbee-econotag telosb wsn430-v1_3b wsn430-v1_4 z1
|
||||
BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 stm32f0discovery \
|
||||
stm32f3discovery stm32f4discovery pca10000 pca10005 arduino-mega2560 \
|
||||
msbiot
|
||||
msbiot yunjia-nrf51822
|
||||
# mbed_lpc1768: see https://github.com/RIOT-OS/RIOT/issues/675
|
||||
# msb-430: see https://github.com/RIOT-OS/RIOT/issues/658
|
||||
# pttu: see https://github.com/RIOT-OS/RIOT/issues/659
|
||||
@ -49,6 +49,7 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 stm32f0d
|
||||
# pca10005: no transceiver, yet
|
||||
# arduino-mega2560: time.h missing from avr-libc
|
||||
# msbiot: no transceiver, yet
|
||||
# yunjia-nrf51822: no transceiver, yet
|
||||
|
||||
# Modules to include:
|
||||
|
||||
|
@ -3,7 +3,7 @@ include ../Makefile.tests_common
|
||||
|
||||
BOARD_INSUFFICIENT_RAM := chronos mbed_lpc1768 msb-430 msb-430h redbee-econotag \
|
||||
telosb wsn430-v1_3b wsn430-v1_4 z1 stm32f0discovery \
|
||||
stm32f3discovery pca10000 pca10005
|
||||
stm32f3discovery pca10000 pca10005 yunjia-nrf51822
|
||||
|
||||
BOARD_BLACKLIST := arduino-mega2560
|
||||
# arduino-mega2560: Errors in assembly, e.g:
|
||||
|
@ -3,13 +3,13 @@ include ../Makefile.tests_common
|
||||
|
||||
BOARD_BLACKLIST := arduino-due chronos mbed_lpc1768 msb-430 msb-430h qemu-i386 stm32f0discovery \
|
||||
stm32f3discovery stm32f4discovery telosb wsn430-v1_3b wsn430-v1_4 udoo z1 \
|
||||
pca10000 pca10005 arduino-mega2560 msbiot
|
||||
pca10000 pca10005 arduino-mega2560 msbiot yunjia-nrf51822
|
||||
#arduino-mega2560: missing header sys/types.h
|
||||
|
||||
BOARD_INSUFFICIENT_RAM := redbee-econotag
|
||||
#MSP boards: no assert.h
|
||||
#rest: no radio
|
||||
|
||||
BOARD_INSUFFICIENT_RAM := redbee-econotag
|
||||
|
||||
USEMODULE += defaulttransceiver
|
||||
USEPKG += libcoap
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
APPLICATION = net_if
|
||||
|
||||
BOARD_BLACKLIST = mbed_lpc1768 arduino-due udoo qemu-i386 stm32f0discovery stm32f3discovery \
|
||||
stm32f4discovery pca10000 pca10005 arduino-mega2560 msbiot
|
||||
stm32f4discovery pca10000 pca10005 arduino-mega2560 msbiot yunjia-nrf51822
|
||||
# qemu-i386: no transceiver, yet
|
||||
# stm32f0discovery: no transceiver, yet
|
||||
# stm32f3discovery: no transceiver, yet
|
||||
@ -9,6 +9,8 @@ BOARD_BLACKLIST = mbed_lpc1768 arduino-due udoo qemu-i386 stm32f0discovery stm32
|
||||
# pca10000: no transceiver, yet
|
||||
# pca10005: no transceiver, yet
|
||||
# msbiot: no transceiver, yet
|
||||
# yunjia-nrf51822: no transceiver, yet
|
||||
|
||||
include ../Makefile.tests_common
|
||||
|
||||
ifeq ($(BOARD),stm32f4discovery)
|
||||
|
@ -4,7 +4,7 @@ include ../Makefile.tests_common
|
||||
BOARD_INSUFFICIENT_RAM := chronos msb-430h redbee-econotag telosb wsn430-v1_3b wsn430-v1_4 z1
|
||||
BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 udoo qemu-i386 stm32f0discovery \
|
||||
stm32f3discovery stm32f4discovery pca10000 pca10005 arduino-mega2560 \
|
||||
msbiot
|
||||
msbiot yunjia-nrf51822
|
||||
# mbed_lpc1768: see https://github.com/RIOT-OS/RIOT/issues/675
|
||||
# msb-430: see https://github.com/RIOT-OS/RIOT/issues/658
|
||||
# qemu-i386: no transceiver, yet
|
||||
@ -15,6 +15,7 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 udoo qemu-i386 stm32f0discov
|
||||
# pca10005: no transceiver, yet
|
||||
# arduino-mega2560: unknown type name ‘radio_packet_length_t’
|
||||
# msbiot: no transceiver, yet
|
||||
# yunjia-nrf51822: no transceiver, yet
|
||||
|
||||
USEMODULE += posix
|
||||
USEMODULE += pnet
|
||||
|
@ -2,7 +2,7 @@ APPLICATION = posix_semaphore
|
||||
include ../Makefile.tests_common
|
||||
|
||||
BOARD_INSUFFICIENT_RAM := msb-430 msb-430h mbed_lpc1768 redbee-econotag chronos stm32f0discovery \
|
||||
pca10000 pca10005
|
||||
pca10000 pca10005 yunjia-nrf51822
|
||||
|
||||
USEMODULE += posix
|
||||
|
||||
|
@ -13,6 +13,6 @@ DISABLE_MODULE += auto_init
|
||||
CFLAGS += -DNATIVE_AUTO_EXIT
|
||||
|
||||
BOARD_INSUFFICIENT_RAM += chronos mbed_lpc1768 msb-430 msb-430h stm32f0discovery \
|
||||
pca10000 pca10005
|
||||
pca10000 pca10005 yunjia-nrf51822
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
@ -2,7 +2,7 @@ APPLICATION = thread_cooperation
|
||||
include ../Makefile.tests_common
|
||||
|
||||
BOARD_INSUFFICIENT_RAM := chronos msb-430 msb-430h mbed_lpc1768 redbee-econotag stm32f0discovery \
|
||||
pca10000 pca10005
|
||||
pca10000 pca10005 yunjia-nrf51822
|
||||
|
||||
DISABLE_MODULE += auto_init
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user