1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

Merge pull request #3208 from haukepetersen/opt_pca10000_cleanup

boards/pca10000: some cleanup
This commit is contained in:
Hauke Petersen 2015-07-14 16:57:21 +02:00
commit 8aa0dde3da
2 changed files with 19 additions and 45 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Freie Universität Berlin
* Copyright (C) 2014-2015 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
@ -11,7 +11,7 @@
* @{
*
* @file
* @brief Board specific implementations for the nRF51822 evaluation board pca10000
* @brief Board initialization code for the Nordic PCA10000 board
*
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
@ -19,39 +19,14 @@
* @}
*/
#include <stdio.h>
#include "board.h"
#include "cpu.h"
#include "periph/uart.h"
extern void SystemInit(void);
void leds_init(void);
#include "board.h"
void board_init(void)
{
/* initialize the boards LEDs */
leds_init();
/* initialize the CPU */
/* initialize the boards LEDs: set pins to output and turn LEDs off */
NRF_GPIO->DIRSET = (LED_RED_PIN | LED_GREEN_PIN | LED_BLUE_PIN);
NRF_GPIO->OUTSET = (LED_RED_PIN | LED_GREEN_PIN | LED_BLUE_PIN);
/* trigger the CPU initialization code */
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);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Freie Universität Berlin
* Copyright (C) 2014-2015 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
@ -7,20 +7,20 @@
*/
/**
* @defgroup boards_pca10000 PCA10000 (nRF51822 Development Kit)
* @defgroup boards_pca10000 Nordic PCA10000
* @ingroup boards
* @brief Board specific files for the nRF51822 board pca10000.
* @brief Board specific files for the Nordic PCA100000
* @{
*
* @file
* @brief Board specific definitions for the nRF51822 evaluation board pca10000.
* @brief Board configuration for the Nordic PCA10000 board
*
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
*/
#ifndef BOARD_H_
#define BOARD_H_
#ifndef BOARD_H
#define BOARD_H
#include "cpu.h"
@ -29,17 +29,17 @@ extern "C" {
#endif
/**
* Define the nominal CPU core clock in this board
* @brief Define the nominal CPU core clock in this board
*/
#define F_CPU (16000000UL)
/**
* @brief Assign the hardware timer
* @brief Assign the hardware timer
*/
#define HW_TIMER TIMER_0
/**
* @name Define the boards stdio
* @name Define the boards stdio
* @{
*/
#define STDIO UART_0
@ -48,7 +48,7 @@ extern "C" {
/** @} */
/**
* @name LED pin definitions
* @name LED pin definitions
* @{
*/
#define ONBOARD_LED 1
@ -72,9 +72,8 @@ extern "C" {
#define LED_BLUE_TOGGLE (NRF_GPIO->OUT ^= LED_BLUE_PIN)
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
* @brief Initialize the board, including triggering the CPU initialization
*/
void board_init(void);
@ -82,5 +81,5 @@ void board_init(void);
}
#endif
#endif /* BOARD_H_ */
#endif /** BOARD_H */
/** @} */