Contiki-Inga 3.x
board.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, 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  *
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29  * OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 /** \addtogroup cc2538
32  * @{
33  *
34  * \defgroup cc2538-smartrf SmartRF06EB Peripherals
35  *
36  * Defines related to the SmartRF06EB
37  *
38  * This file provides connectivity information on LEDs, Buttons, UART and
39  * other SmartRF peripherals
40  *
41  * Notably, PC0 is used to drive LED1 as well as the USB D+ pullup. Therefore
42  * when USB is enabled, LED1 can not be driven by firmware.
43  *
44  * This file can be used as the basis to configure other platforms using the
45  * cc2538 SoC.
46  * @{
47  *
48  * \file
49  * Header file with definitions related to the I/O connections on the TI
50  * SmartRF06EB
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 SmartRF LED configuration
62  *
63  * LEDs on the SmartRF06 (EB and BB) are connected as follows:
64  * - LED1 (Red) -> PC0
65  * - LED2 (Yellow) -> PC1
66  * - LED3 (Green) -> PC2
67  * - LED4 (Orange) -> PC3
68  *
69  * LED1 shares the same pin with the USB pullup
70  * @{
71  */
72 /*---------------------------------------------------------------------------*/
73 /* Some files include leds.h before us, so we need to get rid of defaults in
74  * leds.h before we provide correct definitions */
75 #undef LEDS_GREEN
76 #undef LEDS_YELLOW
77 #undef LEDS_RED
78 #undef LEDS_CONF_ALL
79 
80 #define LEDS_YELLOW 2 /**< LED2 (Yellow) -> PC1 */
81 #define LEDS_GREEN 4 /**< LED3 (Green) -> PC2 */
82 #define LEDS_ORANGE 8 /**< LED4 (Orange) -> PC3 */
83 
84 #if USB_SERIAL_CONF_ENABLE
85 #define LEDS_CONF_ALL 14
86 #define LEDS_RED LEDS_ORANGE
87 #else
88 #define LEDS_CONF_ALL 15
89 #define LEDS_RED 1 /**< LED1 (Red) -> PC0 */
90 #endif
91 
92 /* Notify various examples that we have LEDs */
93 #define PLATFORM_HAS_LEDS 1
94 /** @} */
95 /*---------------------------------------------------------------------------*/
96 /** \name USB configuration
97  *
98  * The USB pullup is driven by PC0 and is shared with LED1
99  */
100 #define USB_PULLUP_PORT GPIO_C_NUM
101 #define USB_PULLUP_PIN 0
102 /** @} */
103 /*---------------------------------------------------------------------------*/
104 /** \name UART configuration
105  *
106  * On the SmartRF06EB, the UART (XDS back channel) is connected to the
107  * following ports/pins
108  * - RX: PA0
109  * - TX: PA1
110  * - CTS: PB0 (Can only be used with UART1)
111  * - RTS: PD3 (Can only be used with UART1)
112  *
113  * We configure the port to use UART0. To use UART1, change UART_CONF_BASE
114  * @{
115  */
116 #define UART_CONF_BASE UART_0_BASE
117 
118 #define UART_RX_PORT GPIO_A_NUM
119 #define UART_RX_PIN 0
120 
121 #define UART_TX_PORT GPIO_A_NUM
122 #define UART_TX_PIN 1
123 
124 #define UART_CTS_PORT GPIO_B_NUM
125 #define UART_CTS_PIN 0
126 
127 #define UART_RTS_PORT GPIO_D_NUM
128 #define UART_RTS_PIN 3
129 /** @} */
130 /*---------------------------------------------------------------------------*/
131 /** \name SmartRF Button configuration
132  *
133  * Buttons on the SmartRF06 are connected as follows:
134  * - BUTTON_SELECT -> PA3
135  * - BUTTON_LEFT -> PC4
136  * - BUTTON_RIGHT -> PC5
137  * - BUTTON_UP -> PC6
138  * - BUTTON_DOWN -> PC7
139  * @{
140  */
141 /** BUTTON_SELECT -> PA3 */
142 #define BUTTON_SELECT_PORT GPIO_A_NUM
143 #define BUTTON_SELECT_PIN 3
144 #define BUTTON_SELECT_VECTOR NVIC_INT_GPIO_PORT_A
145 
146 /** BUTTON_LEFT -> PC4 */
147 #define BUTTON_LEFT_PORT GPIO_C_NUM
148 #define BUTTON_LEFT_PIN 4
149 #define BUTTON_LEFT_VECTOR NVIC_INT_GPIO_PORT_C
150 
151 /** BUTTON_RIGHT -> PC5 */
152 #define BUTTON_RIGHT_PORT GPIO_C_NUM
153 #define BUTTON_RIGHT_PIN 5
154 #define BUTTON_RIGHT_VECTOR NVIC_INT_GPIO_PORT_C
155 
156 /** BUTTON_UP -> PC6 */
157 #define BUTTON_UP_PORT GPIO_C_NUM
158 #define BUTTON_UP_PIN 6
159 #define BUTTON_UP_VECTOR NVIC_INT_GPIO_PORT_C
160 
161 /** BUTTON_DOWN -> PC7 */
162 #define BUTTON_DOWN_PORT GPIO_C_NUM
163 #define BUTTON_DOWN_PIN 7
164 #define BUTTON_DOWN_VECTOR NVIC_INT_GPIO_PORT_C
165 
166 /* Notify various examples that we have Buttons */
167 #define PLATFORM_HAS_BUTTON 1
168 /** @} */
169 /*---------------------------------------------------------------------------*/
170 /**
171  * \name SPI configuration
172  *
173  * These values configure which CC2538 pins to use for the SPI lines.
174  * @{
175  */
176 #define SPI_CLK_PORT GPIO_A_NUM
177 #define SPI_CLK_PIN 2
178 #define SPI_MOSI_PORT GPIO_A_NUM
179 #define SPI_MOSI_PIN 4
180 #define SPI_MISO_PORT GPIO_A_NUM
181 #define SPI_MISO_PIN 5
182 #define SPI_SEL_PORT GPIO_B_NUM
183 #define SPI_SEL_PIN 5
184 /** @} */
185 /*---------------------------------------------------------------------------*/
186 /**
187  * \name Device string used on startup
188  * @{
189  */
190 #define BOARD_STRING "TI SmartRF06 + cc2538EM"
191 /** @} */
192 
193 #endif /* BOARD_H_ */
194 
195 /**
196  * @}
197  * @}
198  */