Contiki-NG
Loading...
Searching...
No Matches
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 */
89#ifdef USB_PULLUP_PORT
90#undef USB_PULLUP_PORT
91#endif
92#ifdef USB_PULLUP_PIN
93#undef USB_PULLUP_PIN
94#endif
95/** @} */
96/*---------------------------------------------------------------------------*/
97/** \name UART configuration
98 *
99 * On the eth-gw, the UARTs are connected to the following ports/pins:
100 *
101 * - UART0:
102 * - RX: PA0, connected to CP2104 serial-to-usb converter TX pin
103 * - TX: PA1, connected to CP2104 serial-to-usb converter RX pin
104 * - UART1:
105 * - RX: PC1
106 * - TX: PC0
107 * - CTS: not used
108 * - RTS: not used
109 *
110 * We configure the port to use UART0 and UART1, CTS/RTS only for UART1,
111 * both without a HW pull-up resistor.
112 * UART0 is not exposed anywhere, UART1 pins are exposed over the JP9 connector.
113 * @{
114 */
115#define UART0_RX_PORT GPIO_A_NUM
116#define UART0_RX_PIN 0
117#define UART0_TX_PORT GPIO_A_NUM
118#define UART0_TX_PIN 1
119
120#define UART1_RX_PORT GPIO_C_NUM
121#define UART1_RX_PIN 1
122#define UART1_TX_PORT GPIO_C_NUM
123#define UART1_TX_PIN 0
124#define UART1_CTS_PORT (-1)
125#define UART1_CTS_PIN (-1)
126#define UART1_RTS_PORT (-1)
127#define UART1_RTS_PIN (-1)
128/** @} */
129/*---------------------------------------------------------------------------*/
130/** \name Zolertia Orion Router button configuration
131 *
132 * Buttons on the eth-gw are connected as follows:
133 * - BUTTON_USER -> PA3, S1 user button, shared with bootloader
134 * - BUTTON_RESET -> RESET_N line
135 * @{
136 */
137/** BUTTON_USER -> PA3 */
138#define BUTTON_USER_PORT GPIO_A_NUM
139#define BUTTON_USER_PIN 3
140#define BUTTON_USER_VECTOR GPIO_A_IRQn
141
142/* Notify various examples that we have Buttons */
143#define PLATFORM_HAS_BUTTON 1
144/** @} */
145/*---------------------------------------------------------------------------*/
146/**
147 * \name ADC configuration
148 *
149 * These values configure which CC2538 pins and ADC channels to use for the ADC
150 * inputs. There pins are suggested as they can be changed, but note that only
151 * pins from PA can be configured as ADC.
152 *
153 * The Zolertia eth-gw, as it is, only allows 3.3VDC sensors.
154 *
155 * The internal ADC reference is 1190mV, use either a voltage divider as input,
156 * or a different voltage reference, like AVDD5 or other externally (AIN7 or
157 * AIN6).
158 *
159 * The ADC1 is exposed over the JP9 connector
160 * @{
161 */
162#define ADC_SENSORS_PORT GPIO_A_NUM /**< ADC GPIO control port */
163#define ADC_SENSORS_ADC1_PIN 2 /**< ADC1 to PA2, 3V3 */
164#define ADC_SENSORS_ADC2_PIN 4 /**< ADC2 to PA4, 3V3 */
165#define ADC_SENSORS_ADC3_PIN 5 /**< ADC3 to PA5, 3V3 */
166#define ADC_SENSORS_ADC4_PIN 6 /**< ADC4 to PA6, 3V3 */
167#define ADC_SENSORS_ADC5_PIN (-1) /**< Not used */
168#define ADC_SENSORS_ADC6_PIN (-1) /**< Not used */
169#define ADC_SENSORS_MAX 4 /**< PA2, PA4, PA5, PA6 */
170
171
172/** @} */
173/*---------------------------------------------------------------------------*/
174/**
175 * \name SPI (SSI0) configuration
176 *
177 * These values configure which CC2538 pins to use for the SPI (SSI0) lines,
178 * reserved exclusively for the CC1200 RF transceiver.
179 * TX -> MOSI, RX -> MISO
180 * @{
181 */
182#define SPI0_CLK_PORT GPIO_B_NUM
183#define SPI0_CLK_PIN 2
184#define SPI0_TX_PORT GPIO_B_NUM
185#define SPI0_TX_PIN 1
186#define SPI0_RX_PORT GPIO_B_NUM
187#define SPI0_RX_PIN 3
188/** @} */
189/*---------------------------------------------------------------------------*/
190/**
191 * \name SPI (SSI1) configuration
192 *
193 * These values configure which CC2538 pins to use for the SPI (SSI1) lines,
194 * reserved exclusively for the ENC28J60 ethernet module. These pins should not
195 * be used for other use, unless you really know what you are doing
196 * TX -> MOSI, RX -> MISO
197 * @{
198 */
199#define SPI1_CLK_PORT GPIO_C_NUM
200#define SPI1_CLK_PIN 4
201#define SPI1_TX_PORT GPIO_C_NUM
202#define SPI1_TX_PIN 5
203#define SPI1_RX_PORT GPIO_C_NUM
204#define SPI1_RX_PIN 6
205/** @} */
206/*---------------------------------------------------------------------------*/
207/**
208 * \name I2C configuration
209 *
210 * As default there is not a default pin assignment for I2C, change this values
211 * accordingly if mapping either pin to the I2C controller.
212 * @{
213 */
214#define I2C_SCL_PORT GPIO_C_NUM
215#define I2C_SCL_PIN 3
216#define I2C_SDA_PORT GPIO_C_NUM
217#define I2C_SDA_PIN 2
218#define I2C_INT_PORT GPIO_D_NUM
219#define I2C_INT_PIN 2
220#define I2C_INT_VECTOR GPIO_D_IRQn
221/** @} */
222/*---------------------------------------------------------------------------*/
223/**
224 * \name Dual RF interface support
225 *
226 * Enables support for dual band operation (both CC1200 and 2.4GHz enabled).
227 * @{
228 */
229#ifndef REMOTE_DUAL_RF_ENABLED
230#define REMOTE_DUAL_RF_ENABLED 1
231#endif
232/** @} */
233/*---------------------------------------------------------------------------*/
234/**
235 * \name CC1200 configuration
236 *
237 * These values configure the required pins to drive the CC1200
238 * None of the following pins are exposed to any connector, kept for internal
239 * use only
240 * @{
241 */
242#define CC1200_SPI_INSTANCE 0
243#define CC1200_SPI_SCLK_PORT SPI0_CLK_PORT
244#define CC1200_SPI_SCLK_PIN SPI0_CLK_PIN
245#define CC1200_SPI_MOSI_PORT SPI0_TX_PORT
246#define CC1200_SPI_MOSI_PIN SPI0_TX_PIN
247#define CC1200_SPI_MISO_PORT SPI0_RX_PORT
248#define CC1200_SPI_MISO_PIN SPI0_RX_PIN
249#define CC1200_SPI_CSN_PORT GPIO_B_NUM
250#define CC1200_SPI_CSN_PIN 5
251#define CC1200_GDO0_PORT GPIO_B_NUM
252#define CC1200_GDO0_PIN 4
253#define CC1200_GDO2_PORT GPIO_B_NUM
254#define CC1200_GDO2_PIN 0
255#define CC1200_RESET_PORT GPIO_C_NUM
256#define CC1200_RESET_PIN 7
257#define CC1200_GPIOx_VECTOR GPIO_B_IRQn
258/** @} */
259/*---------------------------------------------------------------------------*/
260/**
261 * \name Ethernet ENC28J60 configuration
262 *
263 * These values configure the required pins to drive an external Ethernet
264 * module. The implementation can be SPI or GPIO-based, for the first the SPI1
265 * controller should be used
266 * @{
267 */
268#define ETH_SPI_INSTANCE 1
269#define ETH_SPI_CLK_PORT SPI1_CLK_PORT
270#define ETH_SPI_CLK_PIN SPI1_CLK_PIN
271#define ETH_SPI_MOSI_PORT SPI1_TX_PORT
272#define ETH_SPI_MOSI_PIN SPI1_TX_PIN
273#define ETH_SPI_MISO_PORT SPI1_RX_PORT
274#define ETH_SPI_MISO_PIN SPI1_RX_PIN
275#define ETH_SPI_CSN_PORT GPIO_A_NUM
276#define ETH_SPI_CSN_PIN 7
277#define ETH_INT_PORT GPIO_D_NUM
278#define ETH_INT_PIN 0
279#define ETH_RESET_PORT GPIO_D_NUM
280#define ETH_RESET_PIN 1
281/** @} */
282/*---------------------------------------------------------------------------*/
283/**
284 * \name On-board external WDT
285 * The Orion Ethernet Router has an external WDT and battery monitor, which
286 * adds more robustness and prevents the mote to run wild if any unexpected
287 * problem shows-up.
288 * The external WDT requires a short pulse (<1ms) to be sent before a 2-second
289 * period. The battery monitor keeps the device in Reset if the voltage input
290 * is lower than 2.5V.
291 * @{
292 */
293#define EXT_WDT_PORT GPIO_D_NUM
294#define EXT_WDT_PIN 5
295/** @} */
296/*---------------------------------------------------------------------------*/
297/**
298 * \name Device string used on startup
299 * @{
300 */
301#define BOARD_STRING "Zolertia Orion Ethernet Router"
302/** @} */
303
304#endif /* BOARD_H_ */
305
306/**
307 * @}
308 * @}
309 */
310
Header file with register and macro declarations for the cc2538 GPIO module.
Header file for the ARM Nested Vectored Interrupt Controller.