nrf51dongle/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include "cpu.h"
25 #include "periph_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define XTIMER_WIDTH (24)
36 #define XTIMER_BACKOFF (40)
37 
43 #define LED0_PIN GPIO_PIN(0, 21)
44 #define LED1_PIN GPIO_PIN(0, 22)
45 #define LED2_PIN GPIO_PIN(0, 23)
46 
47 #define LED0_MASK (1 << 21)
48 #define LED1_MASK (1 << 22)
49 #define LED2_MASK (1 << 23)
50 
51 #define LED0_ON (NRF_GPIO->OUTCLR = LED0_MASK)
52 #define LED0_OFF (NRF_GPIO->OUTSET = LED0_MASK)
53 #define LED0_TOGGLE (NRF_GPIO->OUT ^= LED0_MASK)
54 
55 #define LED1_ON (NRF_GPIO->OUTCLR = LED1_MASK)
56 #define LED1_OFF (NRF_GPIO->OUTSET = LED1_MASK)
57 #define LED1_TOGGLE (NRF_GPIO->OUT ^= LED1_MASK)
58 
59 #define LED2_ON (NRF_GPIO->OUTCLR = LED2_MASK)
60 #define LED2_OFF (NRF_GPIO->OUTSET = LED2_MASK)
61 #define LED2_TOGGLE (NRF_GPIO->OUT ^= LED2_MASK)
62 
67 void board_init(void);
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* BOARD_H */
74 
Peripheral configuration for the Nordic nRF51 Dongle.
void board_init(void)
Initialize the board, also triggers the CPU initialization.