nrf52840dk/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include "board_common.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define LED0_PIN GPIO_PIN(0, 13)
36 #define LED1_PIN GPIO_PIN(0, 14)
37 #define LED2_PIN GPIO_PIN(0, 15)
38 #define LED3_PIN GPIO_PIN(0, 16)
39 
40 #define LED_PORT (NRF_P0)
41 #define LED0_MASK (1 << 13)
42 #define LED1_MASK (1 << 14)
43 #define LED2_MASK (1 << 15)
44 #define LED3_MASK (1 << 16)
45 
46 #define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
47 #define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
48 #define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
49 
50 #define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
51 #define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
52 #define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
53 
54 #define LED2_ON (LED_PORT->OUTCLR = LED2_MASK)
55 #define LED2_OFF (LED_PORT->OUTSET = LED2_MASK)
56 #define LED2_TOGGLE (LED_PORT->OUT ^= LED2_MASK)
57 
58 #define LED3_ON (LED_PORT->OUTCLR = LED3_MASK)
59 #define LED3_OFF (LED_PORT->OUTSET = LED3_MASK)
60 #define LED3_TOGGLE (LED_PORT->OUT ^= LED3_MASK)
61 
67 #define BTN0_PIN GPIO_PIN(0, 11)
68 #define BTN0_MODE GPIO_IN_PU
69 #define BTN1_PIN GPIO_PIN(0, 12)
70 #define BTN1_MODE GPIO_IN_PU
71 #define BTN2_PIN GPIO_PIN(0, 24)
72 #define BTN2_MODE GPIO_IN_PU
73 #define BTN3_PIN GPIO_PIN(0, 25)
74 #define BTN3_MODE GPIO_IN_PU
75 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* BOARD_H */
82