The friendly Operating System for the Internet of Things
nrf52dk/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Feie 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 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #define LED0_PIN GPIO_PIN(0, 17)
35 #define LED1_PIN GPIO_PIN(0, 18)
36 #define LED2_PIN GPIO_PIN(0, 19)
37 #define LED3_PIN GPIO_PIN(0, 20)
38 
39 #define LED0_MASK (1 << 17)
40 #define LED1_MASK (1 << 18)
41 #define LED2_MASK (1 << 19)
42 #define LED3_MASK (1 << 20)
43 
44 #define LED0_ON (NRF_P0->OUTCLR = LED0_MASK)
45 #define LED0_OFF (NRF_P0->OUTSET = LED0_MASK)
46 #define LED0_TOGGLE (NRF_P0->OUT ^= LED0_MASK)
47 
48 #define LED1_ON (NRF_P0->OUTCLR = LED1_MASK)
49 #define LED1_OFF (NRF_P0->OUTSET = LED1_MASK)
50 #define LED1_TOGGLE (NRF_P0->OUT ^= LED1_MASK)
51 
52 #define LED2_ON (NRF_P0->OUTCLR = LED2_MASK)
53 #define LED2_OFF (NRF_P0->OUTSET = LED2_MASK)
54 #define LED2_TOGGLE (NRF_P0->OUT ^= LED2_MASK)
55 
56 #define LED3_ON (NRF_P0->OUTCLR = LED3_MASK)
57 #define LED3_OFF (NRF_P0->OUTSET = LED3_MASK)
58 #define LED3_TOGGLE (NRF_P0->OUT ^= LED3_MASK)
59 
65 #define BUTTON1_PIN (GPIO_PIN(0, 13))
66 #define BUTTON2_PIN (GPIO_PIN(0, 14))
67 #define BUTTON3_PIN (GPIO_PIN(0, 15))
68 #define BUTTON4_PIN (GPIO_PIN(0, 16))
69 
74 void board_init(void);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.