remote-revb/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 
24 #ifndef BOARD_H
25 #define BOARD_H
26 
27 #include "cpu.h"
28 #include "board_common.h"
29 
30 #ifdef __cplusplus
31  extern "C" {
32 #endif
33 
38 #define LED0_PIN GPIO_PIN(3, 4)
39 #define LED1_PIN GPIO_PIN(1, 7)
40 #define LED2_PIN GPIO_PIN(1, 6)
41 
42 #define LED0_MASK (1 << 4)
43 #define LED1_MASK (1 << 7)
44 #define LED2_MASK (1 << 6)
45 
46 #define LED0_ON (GPIO_D->DATA |= LED0_MASK)
47 #define LED0_OFF (GPIO_D->DATA &= ~LED0_MASK)
48 #define LED0_TOGGLE (GPIO_D->DATA ^= LED0_MASK)
49 
50 #define LED1_ON (GPIO_B->DATA |= LED1_MASK)
51 #define LED1_OFF (GPIO_B->DATA &= ~LED1_MASK)
52 #define LED1_TOGGLE (GPIO_B->DATA ^= LED1_MASK)
53 
54 #define LED2_ON (GPIO_B->DATA |= LED2_MASK)
55 #define LED2_OFF (GPIO_B->DATA &= ~LED2_MASK)
56 #define LED2_TOGGLE (GPIO_B->DATA ^= LED2_MASK)
57 
63 #define BTN0_PIN GPIO_PIN(0, 3)
64 #define BTN0_MODE GPIO_IN_PU
65 
87 #define RF_SWITCH_GPIO GPIO_PD2
88 #define RF_SWITCH_SUB_GHZ gpio_set(RF_SWITCH_GPIO)
89 #define RF_SWITCH_2_4_GHZ gpio_clear(RF_SWITCH_GPIO)
90 #define RF_SWITCH_TOGGLE gpio_toggle(RF_SWITCH_GPIO)
91 
97 #define SHUTDOWN_EN_GPIO GPIO_PD1
98 
104 #define CC1200_SPI_DEV SSI0
105 #define CC1200_MOSI_GPIO GPIO_PB1
106 #define CC1200_MISO_GPIO GPIO_PB3
107 #define CC1200_SCLK_GPIO GPIO_PB2
108 #define CC1200_CSN_GPIO GPIO_PB5
109 #define CC1200_RESET_GPIO GPIO_PC7
110 #define CC1200_GPD0_GPIO GPIO_PB4
111 #define CC1200_GPD2_GPIO GPIO_PB0
112 
118 #define SDCARD_SPI_PARAM_SPI SPI_DEV(1)
119 #define SDCARD_SPI_PARAM_CS GPIO_PIN(0,7)
120 #define SDCARD_SPI_PARAM_CLK GPIO_PIN(2,4)
121 #define SDCARD_SPI_PARAM_MOSI GPIO_PIN(2,5)
122 #define SDCARD_SPI_PARAM_MISO GPIO_PIN(2,6)
123 #define SDCARD_SPI_PARAM_POWER GPIO_PIN(0,6)
124 #define SDCARD_SPI_PARAM_POWER_AH false
125 
130 void board_init(void);
131 
132 #ifdef __cplusplus
133 } /* end extern "C" */
134 #endif
135 #endif /* BOARD_H */
136 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.