board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Benjamin Valentin
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 
9 #pragma once
10 
21 #include "board_common.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 #define LED0_PIN GPIO_PIN(0, 30)
32 #define LED1_PIN GPIO_PIN(0, 31)
33 
34 #define LED_PORT (NRF_P0)
35 #define LED0_MASK (1 << 30)
36 #define LED1_MASK (1 << 31)
37 #define LED_MASK (LED0_MASK | LED1_MASK)
38 
39 #define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
40 #define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
41 #define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
42 
43 #define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
44 #define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
45 #define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
52 #define BTN0_PIN GPIO_PIN(0, 21)
53 #define BTN0_MODE GPIO_IN_PU
54 #define BTN1_PIN GPIO_PIN(0, 29)
55 #define BTN1_MODE GPIO_IN_PU
62 #define WS281X_TIMER_DEV TIMER_DEV(1)
63 #define WS281X_TIMER_MAX_VALUE TIMER_1_MAX_VALUE
66 #ifdef __cplusplus
67 }
68 #endif
69