Skip to content

Commit

Permalink
boards/pca10000: some cleanup
Browse files Browse the repository at this point in the history
- fixed some doxygen style issues
- fixed some newline issues
- compacted the board initialization code
  • Loading branch information
haukepetersen committed Jul 14, 2015
1 parent ec7c9ab commit b7bf9c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 44 deletions.
37 changes: 6 additions & 31 deletions boards/pca10000/board.c
@@ -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
Expand All @@ -11,47 +11,22 @@
* @{
*
* @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>
*
* @}
*/

#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 */
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 */
/* initialize the boards LEDs: set pins to output and turn LEDs off */
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);
/* trigger the CPU initialization code */
cpu_init();
}
25 changes: 12 additions & 13 deletions boards/pca10000/include/board.h
@@ -1,26 +1,26 @@
/*
* 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
* details.
*/

/**
* @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"

Expand All @@ -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
Expand All @@ -48,7 +48,7 @@ extern "C" {
/** @} */

/**
* @name LED pin definitions
* @name LED pin definitions
* @{
*/
#define ONBOARD_LED 1
Expand All @@ -72,15 +72,14 @@ 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);

#ifdef __cplusplus
}
#endif

#endif /* BOARD_H_ */
#endif /** BOARD_H */
/** @} */

0 comments on commit b7bf9c3

Please sign in to comment.