board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Inria
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 
19 #ifndef BOARD_H
20 #define BOARD_H
21 
22 #include "board_common.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define LED0_PIN GPIO_PIN(0, 21)
33 #define LED1_PIN GPIO_PIN(0, 22)
34 #define LED2_PIN GPIO_PIN(0, 23)
35 #define LED3_PIN GPIO_PIN(0, 24)
36 
37 #define LED0_MASK (1 << 21)
38 #define LED1_MASK (1 << 22)
39 #define LED2_MASK (1 << 23)
40 #define LED3_MASK (1 << 24)
41 
42 #define LED0_ON (NRF_GPIO->OUTCLR = LED0_MASK)
43 #define LED0_OFF (NRF_GPIO->OUTSET = LED0_MASK)
44 #define LED0_TOGGLE (NRF_GPIO->OUT ^= LED0_MASK)
45 
46 #define LED1_ON (NRF_GPIO->OUTCLR = LED1_MASK)
47 #define LED1_OFF (NRF_GPIO->OUTSET = LED1_MASK)
48 #define LED1_TOGGLE (NRF_GPIO->OUT ^= LED1_MASK)
49 
50 #define LED2_ON (NRF_GPIO->OUTCLR = LED2_MASK)
51 #define LED2_OFF (NRF_GPIO->OUTSET = LED2_MASK)
52 #define LED2_TOGGLE (NRF_GPIO->OUT ^= LED2_MASK)
53 
54 #define LED3_ON (NRF_GPIO->OUTCLR = LED3_MASK)
55 #define LED3_OFF (NRF_GPIO->OUTSET = LED3_MASK)
56 #define LED3_TOGGLE (NRF_GPIO->OUT ^= LED3_MASK)
57 
63 #define BTN0_PIN GPIO_PIN(0, 17)
64 #define BTN0_MODE GPIO_IN_PU
65 #define BTN1_PIN GPIO_PIN(0, 18)
66 #define BTN1_MODE GPIO_IN_PU
67 #define BTN2_PIN GPIO_PIN(0, 19)
68 #define BTN2_MODE GPIO_IN_PU
69 #define BTN3_PIN GPIO_PIN(0, 20)
70 #define BTN3_MODE GPIO_IN_PU
71 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* BOARD_H */
78