board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  * Copyright (C) 2015 Zolertia SL
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
10 #pragma once
11 
24 #include "cpu.h"
25 #include "board_common.h"
26 
27 #ifdef __cplusplus
28  extern "C" {
29 #endif
30 
35 #define LED0_PIN GPIO_PIN(3, 2)
36 #define LED1_PIN GPIO_PIN(3, 5)
37 #define LED2_PIN GPIO_PIN(2, 3)
38 
39 #define LED0_MASK (1 << 2)
40 #define LED1_MASK (1 << 5)
41 #define LED2_MASK (1 << 3)
42 
43 #define LED0_ON (GPIO_D->DATA &= ~LED0_MASK)
44 #define LED0_OFF (GPIO_D->DATA |= LED0_MASK)
45 #define LED0_TOGGLE (GPIO_D->DATA ^= LED0_MASK)
46 
47 #define LED1_ON (GPIO_D->DATA &= ~LED1_MASK)
48 #define LED1_OFF (GPIO_D->DATA |= LED1_MASK)
49 #define LED1_TOGGLE (GPIO_D->DATA ^= LED1_MASK)
50 
51 #define LED2_ON (GPIO_C->DATA &= ~LED2_MASK)
52 #define LED2_OFF (GPIO_C->DATA |= LED2_MASK)
53 #define LED2_TOGGLE (GPIO_C->DATA ^= LED2_MASK)
60 #define BTN0_PIN GPIO_PIN(0, 3)
61 #define BTN0_MODE GPIO_IN_PU
70  #define RF_SWITCH_GPIO GPIO_PIN(3, 4)
71  #define RF_SWITCH_SUB_GHZ gpio_set(RF_SWITCH_GPIO)
72  #define RF_SWITCH_2_4_GHZ gpio_clear(RF_SWITCH_GPIO)
73  #define RF_SWITCH_TOGGLE gpio_toggle(RF_SWITCH_GPIO)
76 #ifdef __cplusplus
77 } /* end extern "C" */
78 #endif