The friendly Operating System for the Internet of Things
remote-reva/include/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 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include "cpu.h"
26 #include "board_common.h"
27 
28 #ifdef __cplusplus
29  extern "C" {
30 #endif
31 
36 #define LED0_PIN GPIO_PD5
37 #define LED1_PIN GPIO_PD4
38 #define LED2_PIN GPIO_PD3
39 
40 #define LED0_MASK (1 << 5)
41 #define LED1_MASK (1 << 4)
42 #define LED2_MASK (1 << 3)
43 
44 #define LED0_ON (GPIO_D->DATA |= LED0_MASK)
45 #define LED0_OFF (GPIO_D->DATA &= ~LED0_MASK)
46 #define LED0_TOGGLE (GPIO_D->DATA ^= LED0_MASK)
47 
48 #define LED1_ON (GPIO_D->DATA |= LED1_MASK)
49 #define LED1_OFF (GPIO_D->DATA &= ~LED1_MASK)
50 #define LED1_TOGGLE (GPIO_D->DATA ^= LED1_MASK)
51 
52 #define LED2_ON (GPIO_D->DATA |= LED2_MASK)
53 #define LED2_OFF (GPIO_D->DATA &= ~LED2_MASK)
54 #define LED2_TOGGLE (GPIO_D->DATA ^= LED2_MASK)
55 
61 #define BTN0_PIN GPIO_PIN(0, 3)
62 
84 #define RF_SWITCH_GPIO GPIO_PD2
85 #define RF_SWITCH_SUB_GHZ gpio_set(RF_SWITCH_GPIO)
86 #define RF_SWITCH_2_4_GHZ gpio_clear(RF_SWITCH_GPIO)
87 #define RF_SWITCH_TOGGLE gpio_toggle(RF_SWITCH_GPIO)
88 
94 #define SHUTDOWN_DONE_GPIO GPIO_PD0
95 #define SHUTDOWN_EN_GPIO GPIO_PD1
96 
102 #define CC1200_SPI_DEV SSI0
103 #define CC1200_MOSI_GPIO GPIO_PB1
104 #define CC1200_MISO_GPIO GPIO_PB3
105 #define CC1200_SCLK_GPIO GPIO_PB2
106 #define CC1200_CSN_GPIO GPIO_PB5
107 #define CC1200_RESET_GPIO GPIO_PC7
108 #define CC1200_GPD0_GPIO GPIO_PB4
109 #define CC1200_GPD2_GPIO GPIO_PB0
110 
115 void board_init(void);
116 
117 #ifdef __cplusplus
118 } /* end extern "C" */
119 #endif
120 #endif /* BOARD_H */
121 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.