board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  * Copyright (C) 2018 HAW Hamburg
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 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include "cpu.h"
25 #include "periph/gpio.h"
26 #include "cc2538_eui_primary.h"
27 
28 #ifdef __cplusplus
29  extern "C" {
30 #endif
31 
36 #define LED0_PIN GPIO_PIN(2, 4)
37 #define LED1_PIN GPIO_PIN(2, 7)
38 #define LED2_PIN GPIO_PIN(2, 6)
39 #define LED3_PIN GPIO_PIN(2, 5)
40 #define BTN0_PIN GPIO_PIN(3, 5)
41 #define BTN0_MODE GPIO_IN
42 #define RF24_SWITCH_CC2538_PIN GPIO_PIN(3, 4)
43 #define RF24_SWITCH_AT86RF215_PIN GPIO_PIN(3, 3)
45 #define LED_PORT GPIO_C
46 #define LED0_MASK (1 << 4)
47 #define LED1_MASK (1 << 7)
48 #define LED2_MASK (1 << 6)
49 #define LED3_MASK (1 << 5)
50 
51 #define RF_SWITCH_PORT GPIO_D
52 #define RF24_SWITCH_CC2538_MASK (1 << 4)
53 #define RF24_SWITCH_AT86RF215_MASK (1 << 3)
54 
55 #define LED0_ON (LED_PORT->DATA &= ~LED0_MASK)
56 #define LED0_OFF (LED_PORT->DATA |= LED0_MASK)
57 #define LED0_TOGGLE (LED_PORT->DATA ^= LED0_MASK)
58 
59 #define LED1_ON (LED_PORT->DATA &= ~LED1_MASK)
60 #define LED1_OFF (LED_PORT->DATA |= LED1_MASK)
61 #define LED1_TOGGLE (LED_PORT->DATA ^= LED1_MASK)
62 
63 #define LED2_ON (LED_PORT->DATA &= ~LED2_MASK)
64 #define LED2_OFF (LED_PORT->DATA |= LED2_MASK)
65 #define LED2_TOGGLE (LED_PORT->DATA ^= LED2_MASK)
66 
67 #define LED3_ON (LED_PORT->DATA &= ~LED3_MASK)
68 #define LED3_OFF (LED_PORT->DATA |= LED3_MASK)
69 #define LED3_TOGGLE (LED_PORT->DATA ^= LED3_MASK)
70 
71 #define RF24_SWITCH_CC2538_ON (RF_SWITCH_PORT->DATA &= ~RF24_SWITCH_CC2538_MASK)
72 #define RF24_SWITCH_CC2538_OFF (RF_SWITCH_PORT->DATA |= RF24_SWITCH_CC2538_MASK)
73 #define RF24_SWITCH_CC2538_TOGGLE (RF_SWITCH_PORT->DATA ^= RF24_SWITCH_CC2538_MASK)
74 
75 #define RF24_SWITCH_AT86RF215_ON (RF_SWITCH_PORT->DATA &= ~RF24_SWITCH_AT86RF215_MASK)
76 #define RF24_SWITCH_AT86RF215_OFF (RF_SWITCH_PORT->DATA |= RF24_SWITCH_AT86RF215_MASK)
77 #define RF24_SWITCH_AT86RF215_TOGGLE (RF_SWITCH_PORT->DATA ^= RF24_SWITCH_AT86RF215_MASK)
78 
84 #define CONFIG_CC2538_RF_OBS_SIG_0_PCX 5 /* PC5 */
85 #define CONFIG_CC2538_RF_OBS_SIG_1_PCX 6 /* PC6 */
86 #define CONFIG_CC2538_RF_OBS_SIG_2_PCX 7 /* PC7 */
87 
96 #define OPENWSN_LEDPIN_ERROR LED0_PIN
97 #define OPENWSN_LEDPIN_SYNC LED1_PIN
98 #define OPENWSN_LEDPIN_RADIO LED3_PIN
99 #define OPENWSN_LEDPIN_DEBUG LED2_PIN
100 
109 #define OPENWSN_DEBUGPIN_FRAME GPIO_PIN(0, 7) /* A7 */
110 #define OPENWSN_DEBUGPIN_ISR GPIO_PIN(2, 3) /* C3 */
111 #define OPENWSN_DEBUGPIN_SLOT GPIO_PIN(1, 3) /* B3 */
112 #define OPENWSN_DEBUGPIN_FSM GPIO_PIN(1, 2) /* B2 */
113 #define OPENWSN_DEBUGPIN_TASK GPIO_PIN(1, 1) /* B1 */
114 #define OPENWSN_DEBUGPIN_RADIO GPIO_PIN(1, 0) /* B0 */
115 
120 #define AT86RF215_PARAM_SPI SPI_DEV(0)
121 #define AT86RF215_PARAM_CS GPIO_PIN(0, 3) /* A3 */
122 #define AT86RF215_PARAM_INT GPIO_PIN(3, 0) /* D0 */
123 #define AT86RF215_PARAM_RESET GPIO_PIN(3, 1) /* D1 */
124 
130 #define XTIMER_WIDTH (16)
131 #define XTIMER_BACKOFF (50)
132 #define XTIMER_ISR_BACKOFF (40)
133 
139 #ifndef UPDATE_CCA
140 #define UPDATE_CCA (1)
141 #endif
142 
143 #define CCA_BACKDOOR_ENABLE (1)
144 #define CCA_BACKDOOR_PORT_A_PIN (6)
145 #define CCA_BACKDOOR_ACTIVE_LEVEL (0)
147 #define BOOT_PIN GPIO_PIN(0, CCA_BACKDOOR_PORT_A_PIN)
153 void board_init(void);
154 
155 #ifdef __cplusplus
156 } /* end extern "C" */
157 #endif
158 
159 #endif /* BOARD_H */
160 
gpio.h
Low-level GPIO peripheral driver interface definitions.
cc2538_eui_primary.h
CC2538 EUI-64 provider.