Contiki-NG
board.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Texas Instruments Incorporated - http://www.ti.com/
3  * Copyright (c) 2016, Zolertia <http://www.zolertia.com>
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30  * OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /**
33  * \addtogroup zoul-platforms
34  * @{
35  *
36  * \defgroup zolertia-orion-ethernet-router Zolertia IoT Orion Ethernet Router
37  *
38  * The Zolertia Orion Router includes an Ethernet ENC28J60 controller with
39  * active POE (power over ethernet), operating over IPv4/IP64. It features a
40  * dual RF interface (2.4GHz and 863-950MHz) with external antenna connectors,
41  * a power on/off switch and programable user button.
42  *
43  * This file provides connectivity information on LEDs, Buttons, UART and
44  * other peripherals
45  *
46  * @{
47  *
48  * \file
49  * Header file with definitions related to the I/O connections on the Zolertia's
50  * Orion Ethernet Router, Zoul-based
51  *
52  * \note Do not include this file directly. It gets included by contiki-conf
53  * after all relevant directives have been set.
54  */
55 #ifndef BOARD_H_
56 #define BOARD_H_
57 
58 #include "dev/gpio.h"
59 #include "dev/nvic.h"
60 /*---------------------------------------------------------------------------*/
61 /** \name Orion Ethernet Router LED configuration
62  *
63  * LEDs on the eth-gw are connected as follows:
64  * - LED1 (Red) -> PD5
65  * - LED2 (Green) -> PD4
66  * - LED3 (Blue) -> PD3
67  * @{
68  */
69 /*---------------------------------------------------------------------------*/
70 #define LEDS_ARCH_L1_PORT GPIO_D_NUM
71 #define LEDS_ARCH_L1_PIN 5
72 #define LEDS_ARCH_L2_PORT GPIO_D_NUM
73 #define LEDS_ARCH_L2_PIN 4
74 #define LEDS_ARCH_L3_PORT GPIO_D_NUM
75 #define LEDS_ARCH_L3_PIN 3
76 
77 #define LEDS_CONF_RED 1
78 #define LEDS_CONF_GREEN 2
79 #define LEDS_CONF_BLUE 4
80 
81 #define LEDS_CONF_COUNT 3
82 /** @} */
83 /*---------------------------------------------------------------------------*/
84 /** \name USB configuration
85  *
86  * The USB pullup for D+ is not included in this platform
87  */
88 #ifdef USB_PULLUP_PORT
89 #undef USB_PULLUP_PORT
90 #endif
91 #ifdef USB_PULLUP_PIN
92 #undef USB_PULLUP_PIN
93 #endif
94 /** @} */
95 /*---------------------------------------------------------------------------*/
96 /** \name UART configuration
97  *
98  * On the eth-gw, the UARTs are connected to the following ports/pins:
99  *
100  * - UART0:
101  * - RX: PA0, connected to CP2104 serial-to-usb converter TX pin
102  * - TX: PA1, connected to CP2104 serial-to-usb converter RX pin
103  * - UART1:
104  * - RX: PC1
105  * - TX: PC0
106  * - CTS: not used
107  * - RTS: not used
108  *
109  * We configure the port to use UART0 and UART1, CTS/RTS only for UART1,
110  * both without a HW pull-up resistor.
111  * UART0 is not exposed anywhere, UART1 pins are exposed over the JP9 connector.
112  * @{
113  */
114 #define UART0_RX_PORT GPIO_A_NUM
115 #define UART0_RX_PIN 0
116 #define UART0_TX_PORT GPIO_A_NUM
117 #define UART0_TX_PIN 1
118 
119 #define UART1_RX_PORT GPIO_C_NUM
120 #define UART1_RX_PIN 1
121 #define UART1_TX_PORT GPIO_C_NUM
122 #define UART1_TX_PIN 0
123 #define UART1_CTS_PORT (-1)
124 #define UART1_CTS_PIN (-1)
125 #define UART1_RTS_PORT (-1)
126 #define UART1_RTS_PIN (-1)
127 /** @} */
128 /*---------------------------------------------------------------------------*/
129 /** \name Zolertia Orion Router button configuration
130  *
131  * Buttons on the eth-gw are connected as follows:
132  * - BUTTON_USER -> PA3, S1 user button, shared with bootloader
133  * - BUTTON_RESET -> RESET_N line
134  * @{
135  */
136 /** BUTTON_USER -> PA3 */
137 #define BUTTON_USER_PORT GPIO_A_NUM
138 #define BUTTON_USER_PIN 3
139 #define BUTTON_USER_VECTOR GPIO_A_IRQn
140 
141 /* Notify various examples that we have Buttons */
142 #define PLATFORM_HAS_BUTTON 1
143 /** @} */
144 /*---------------------------------------------------------------------------*/
145 /**
146  * \name ADC configuration
147  *
148  * These values configure which CC2538 pins and ADC channels to use for the ADC
149  * inputs. There pins are suggested as they can be changed, but note that only
150  * pins from PA can be configured as ADC.
151  *
152  * The Zolertia eth-gw, as it is, only allows 3.3VDC sensors.
153  *
154  * The internal ADC reference is 1190mV, use either a voltage divider as input,
155  * or a different voltage reference, like AVDD5 or other externally (AIN7 or
156  * AIN6).
157  *
158  * The ADC1 is exposed over the JP9 connector
159  * @{
160  */
161 #define ADC_SENSORS_PORT GPIO_A_NUM /**< ADC GPIO control port */
162 #define ADC_SENSORS_ADC1_PIN 2 /**< ADC1 to PA2, 3V3 */
163 #define ADC_SENSORS_ADC2_PIN 4 /**< ADC2 to PA4, 3V3 */
164 #define ADC_SENSORS_ADC3_PIN 5 /**< ADC3 to PA5, 3V3 */
165 #define ADC_SENSORS_ADC4_PIN 6 /**< ADC4 to PA6, 3V3 */
166 #define ADC_SENSORS_ADC5_PIN (-1) /**< Not used */
167 #define ADC_SENSORS_ADC6_PIN (-1) /**< Not used */
168 #define ADC_SENSORS_MAX 4 /**< PA2, PA4, PA5, PA6 */
169 
170 
171 /** @} */
172 /*---------------------------------------------------------------------------*/
173 /**
174  * \name SPI (SSI0) configuration
175  *
176  * These values configure which CC2538 pins to use for the SPI (SSI0) lines,
177  * reserved exclusively for the CC1200 RF transceiver.
178  * TX -> MOSI, RX -> MISO
179  * @{
180  */
181 #define SPI0_CLK_PORT GPIO_B_NUM
182 #define SPI0_CLK_PIN 2
183 #define SPI0_TX_PORT GPIO_B_NUM
184 #define SPI0_TX_PIN 1
185 #define SPI0_RX_PORT GPIO_B_NUM
186 #define SPI0_RX_PIN 3
187 /** @} */
188 /*---------------------------------------------------------------------------*/
189 /**
190  * \name SPI (SSI1) configuration
191  *
192  * These values configure which CC2538 pins to use for the SPI (SSI1) lines,
193  * reserved exclusively for the ENC28J60 ethernet module. These pins should not
194  * be used for other use, unless you really know what you are doing
195  * TX -> MOSI, RX -> MISO
196  * @{
197  */
198 #define SPI1_CLK_PORT GPIO_C_NUM
199 #define SPI1_CLK_PIN 4
200 #define SPI1_TX_PORT GPIO_C_NUM
201 #define SPI1_TX_PIN 5
202 #define SPI1_RX_PORT GPIO_C_NUM
203 #define SPI1_RX_PIN 6
204 /** @} */
205 /*---------------------------------------------------------------------------*/
206 /**
207  * \name I2C configuration
208  *
209  * As default there is not a default pin assignment for I2C, change this values
210  * accordingly if mapping either pin to the I2C controller.
211  * @{
212  */
213 #define I2C_SCL_PORT GPIO_C_NUM
214 #define I2C_SCL_PIN 3
215 #define I2C_SDA_PORT GPIO_C_NUM
216 #define I2C_SDA_PIN 2
217 #define I2C_INT_PORT GPIO_D_NUM
218 #define I2C_INT_PIN 2
219 #define I2C_INT_VECTOR GPIO_D_IRQn
220 /** @} */
221 /*---------------------------------------------------------------------------*/
222 /**
223  * \name Dual RF interface support
224  *
225  * Enables support for dual band operation (both CC1200 and 2.4GHz enabled).
226  * @{
227  */
228 #ifndef REMOTE_DUAL_RF_ENABLED
229 #define REMOTE_DUAL_RF_ENABLED 1
230 #endif
231 /** @} */
232 /*---------------------------------------------------------------------------*/
233 /**
234  * \name CC1200 configuration
235  *
236  * These values configure the required pins to drive the CC1200
237  * None of the following pins are exposed to any connector, kept for internal
238  * use only
239  * @{
240  */
241 #define CC1200_SPI_INSTANCE 0
242 #define CC1200_SPI_SCLK_PORT SPI0_CLK_PORT
243 #define CC1200_SPI_SCLK_PIN SPI0_CLK_PIN
244 #define CC1200_SPI_MOSI_PORT SPI0_TX_PORT
245 #define CC1200_SPI_MOSI_PIN SPI0_TX_PIN
246 #define CC1200_SPI_MISO_PORT SPI0_RX_PORT
247 #define CC1200_SPI_MISO_PIN SPI0_RX_PIN
248 #define CC1200_SPI_CSN_PORT GPIO_B_NUM
249 #define CC1200_SPI_CSN_PIN 5
250 #define CC1200_GDO0_PORT GPIO_B_NUM
251 #define CC1200_GDO0_PIN 4
252 #define CC1200_GDO2_PORT GPIO_B_NUM
253 #define CC1200_GDO2_PIN 0
254 #define CC1200_RESET_PORT GPIO_C_NUM
255 #define CC1200_RESET_PIN 7
256 #define CC1200_GPIOx_VECTOR GPIO_B_IRQn
257 /** @} */
258 /*---------------------------------------------------------------------------*/
259 /**
260  * \name Ethernet ENC28J60 configuration
261  *
262  * These values configure the required pins to drive an external Ethernet
263  * module. The implementation can be SPI or GPIO-based, for the first the SPI1
264  * controller should be used
265  * @{
266  */
267 #define ETH_SPI_INSTANCE 1
268 #define ETH_SPI_CLK_PORT SPI1_CLK_PORT
269 #define ETH_SPI_CLK_PIN SPI1_CLK_PIN
270 #define ETH_SPI_MOSI_PORT SPI1_TX_PORT
271 #define ETH_SPI_MOSI_PIN SPI1_TX_PIN
272 #define ETH_SPI_MISO_PORT SPI1_RX_PORT
273 #define ETH_SPI_MISO_PIN SPI1_RX_PIN
274 #define ETH_SPI_CSN_PORT GPIO_A_NUM
275 #define ETH_SPI_CSN_PIN 7
276 #define ETH_INT_PORT GPIO_D_NUM
277 #define ETH_INT_PIN 0
278 #define ETH_RESET_PORT GPIO_D_NUM
279 #define ETH_RESET_PIN 1
280 /** @} */
281 /*---------------------------------------------------------------------------*/
282 /**
283  * \name On-board external WDT
284  * The Orion Ethernet Router has an external WDT and battery monitor, which
285  * adds more robustness and prevents the mote to run wild if any unexpected
286  * problem shows-up.
287  * The external WDT requires a short pulse (<1ms) to be sent before a 2-second
288  * period. The battery monitor keeps the device in Reset if the voltage input
289  * is lower than 2.5V.
290  * @{
291  */
292 #define EXT_WDT_PORT GPIO_D_NUM
293 #define EXT_WDT_PIN 5
294 /** @} */
295 /*---------------------------------------------------------------------------*/
296 /**
297  * \name Device string used on startup
298  * @{
299  */
300 #define BOARD_STRING "Zolertia Orion Ethernet Router"
301 /** @} */
302 
303 #endif /* BOARD_H_ */
304 
305 /**
306  * @}
307  * @}
308  */
309 
Header file for the ARM Nested Vectored Interrupt Controller.
Header file with register and macro declarations for the cc2538 GPIO module.