Contiki-NG
board.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Texas Instruments Incorporated - http://www.ti.com/
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * This file is part of the Contiki operating system.
31  *
32  */
33 /* -------------------------------------------------------------------------- */
34 /**
35  * \addtogroup openmote-boards
36  * @{
37  *
38  * \defgroup openmote-cc2538 OpenMote-CC2538
39  * The OpenMote-CC2538 board was designed at UC Berkeley in 2013 and
40  * is comercialized by OpenMote Technologies since 2014. It is the first
41  * commercial platform based on the powerful TI CC2538 SoC. It uses a
42  * XBee form-factor to ease prototyping.
43  * @{
44  *
45  * \file
46  * This file provides connectivity information on LEDs, Buttons, UART and
47  * other OpenMote-CC2538 peripherals.
48  *
49  * This file can be used as the basis to configure other platforms using the
50  * cc2538 SoC.
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 
56 #ifndef BOARD_H_
57 #define BOARD_H_
58 /*---------------------------------------------------------------------------*/
59 #include "dev/gpio.h"
60 #include "dev/nvic.h"
61 /*---------------------------------------------------------------------------*/
62 /** \name OpenMote-CC2538 LED configuration
63  *
64  * LEDs on the OpenMote-CC2538 are connected as follows:
65  * - LED1 (Red) -> PC4
66  * - LED2 (Yellow) -> PC6
67  * - LED3 (Green) -> PC7
68  * - LED4 (Orange) -> PC5
69  *
70  * @{
71  */
72 /*---------------------------------------------------------------------------*/
73 #define LEDS_ARCH_L1_PORT GPIO_C_NUM
74 #define LEDS_ARCH_L1_PIN 4
75 #define LEDS_ARCH_L2_PORT GPIO_C_NUM
76 #define LEDS_ARCH_L2_PIN 6
77 #define LEDS_ARCH_L3_PORT GPIO_C_NUM
78 #define LEDS_ARCH_L3_PIN 7
79 #define LEDS_ARCH_L4_PORT GPIO_C_NUM
80 #define LEDS_ARCH_L4_PIN 5
81 
82 #define LEDS_CONF_RED 1
83 #define LEDS_CONF_YELLOW 2
84 #define LEDS_CONF_GREEN 4
85 #define LEDS_CONF_ORANGE 8
86 
87 #define LEDS_CONF_COUNT 4
88 /** @} */
89 /*---------------------------------------------------------------------------*/
90 /** \name USB configuration
91  *
92  * The USB pullup is driven by PC0
93  */
94 #define USB_PULLUP_PORT GPIO_C_NUM
95 #define USB_PULLUP_PIN 0
96 /** @} */
97 /*---------------------------------------------------------------------------*/
98 /** \name UART configuration
99  *
100  * On the OpenMote, the UART is connected to the
101  * following ports/pins
102  * - RX: PA0
103  * - TX: PA1
104  * - CTS: PB0 (Can only be used with UART1)
105  * - RTS: PD3 (Can only be used with UART1)
106  *
107  * We configure the port to use UART0. To use UART1, replace UART0_* with
108  * UART1_* below.
109  * @{
110  */
111 #define UART0_RX_PORT GPIO_A_NUM
112 #define UART0_RX_PIN 0
113 #define UART0_TX_PORT GPIO_A_NUM
114 #define UART0_TX_PIN 1
115 
116 #define UART1_RX_PORT GPIO_B_NUM
117 #define UART1_RX_PIN 0
118 #define UART1_TX_PORT GPIO_D_NUM
119 #define UART1_TX_PIN 3
120 #define UART1_CTS_PORT (-1)
121 #define UART1_CTS_PIN (-1)
122 #define UART1_RTS_PORT (-1)
123 #define UART1_RTS_PIN (-1)
124 /** @} */
125 /*---------------------------------------------------------------------------*/
126 /** \name OpenMote-CC2538 Button configuration
127  *
128  * Buttons on the OpenMote-CC2538 are connected as follows:
129  * - BUTTON_USER -> PC3
130  * @{
131  */
132 /** BUTTON_USER -> PC3 */
133 #define BUTTON_USER_PORT GPIO_C_NUM
134 #define BUTTON_USER_PIN 3
135 #define BUTTON_USER_VECTOR GPIO_C_IRQn
136 /* Notify various examples that we have Buttons */
137 #define PLATFORM_HAS_BUTTON 1
138 #define PLATFORM_SUPPORTS_BUTTON_HAL 1
139 /** @} */
140 /*---------------------------------------------------------------------------*/
141 /**
142  * \name SPI (SSI0) configuration
143  *
144  * These values configure which CC2538 pins to use for the SPI (SSI0) lines.
145  * The SSI0 is currently used to interface with the Ethernet driver (ENC28J60)
146  * on the OpenBase board.
147  * @{
148  */
149 #define SPI_CLK_PORT GPIO_A_NUM
150 #define SPI_CLK_PIN 2
151 #define SPI_MOSI_PORT GPIO_A_NUM
152 #define SPI_MOSI_PIN 5
153 #define SPI_MISO_PORT GPIO_A_NUM
154 #define SPI_MISO_PIN 4
155 /** @} */
156 /*---------------------------------------------------------------------------*/
157 /**
158  * \name SPI (SSI1) configuration
159  *
160  * These values configure which CC2538 pins to use for the SPI (SSI1) lines.
161  * The SSI1 is currently not used.
162  * @{
163  */
164 #define SPI1_CLK_PORT GPIO_C_NUM
165 #define SPI1_CLK_PIN 4
166 #define SPI1_TX_PORT GPIO_C_NUM
167 #define SPI1_TX_PIN 5
168 #define SPI1_RX_PORT GPIO_C_NUM
169 #define SPI1_RX_PIN 6
170 /** @} */
171 /*---------------------------------------------------------------------------*/
172 /**
173  * \name I2C configuration
174  *
175  * These values configure which CC2538 pins to use for the I2C lines.
176  * @{
177  */
178 #define I2C_SCL_PORT GPIO_B_NUM
179 #define I2C_SCL_PIN 3
180 #define I2C_SDA_PORT GPIO_B_NUM
181 #define I2C_SDA_PIN 4
182 /** @} */
183 /*---------------------------------------------------------------------------*/
184 /**
185  * \name OpenMote-CC2538 antenna switch configuration
186  *
187  * @{
188  */
189 #define ANTENNA_BSP_RADIO_BASE GPIO_PORT_TO_BASE(GPIO_D_NUM)
190 #define ANTENNA_BSP_RADIO_INT GPIO_PIN_MASK(5)
191 #define ANTENNA_BSP_RADIO_EXT GPIO_PIN_MASK(4)
192 /** @} */
193 /*---------------------------------------------------------------------------*/
194 /**
195  * \name CC2538 TSCH configuration
196  *
197  * @{
198  */
199 #define RADIO_PHY_OVERHEAD CC2538_PHY_OVERHEAD
200 #define RADIO_BYTE_AIR_TIME CC2538_BYTE_AIR_TIME
201 #define RADIO_DELAY_BEFORE_TX CC2538_DELAY_BEFORE_TX
202 #define RADIO_DELAY_BEFORE_RX CC2538_DELAY_BEFORE_RX
203 #define RADIO_DELAY_BEFORE_DETECT CC2538_DELAY_BEFORE_DETECT
204 /** @} */
205 /*---------------------------------------------------------------------------*/
206 /**
207  * \name Device string used on startup
208  * @{
209  */
210 #define BOARD_STRING "OpenMote-CC2538"
211 /** @} */
212 /*---------------------------------------------------------------------------*/
213 #endif /* BOARD_H_ */
214 /*---------------------------------------------------------------------------*/
215 /**
216  * @}
217  * @}
218  */
Header file for the ARM Nested Vectored Interrupt Controller.
Header file with register and macro declarations for the cc2538 GPIO module.