Contiki 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, replace UART0_* with
114  * UART1_* below.
115  * @{
116  */
117 #define UART0_RX_PORT GPIO_A_NUM
118 #define UART0_RX_PIN 0
119 
120 #define UART0_TX_PORT GPIO_A_NUM
121 #define UART0_TX_PIN 1
122 
123 #define UART1_CTS_PORT GPIO_B_NUM
124 #define UART1_CTS_PIN 0
125 
126 #define UART1_RTS_PORT GPIO_D_NUM
127 #define UART1_RTS_PIN 3
128 /** @} */
129 /*---------------------------------------------------------------------------*/
130 /** \name SmartRF Button configuration
131  *
132  * Buttons on the SmartRF06 are connected as follows:
133  * - BUTTON_SELECT -> PA3
134  * - BUTTON_LEFT -> PC4
135  * - BUTTON_RIGHT -> PC5
136  * - BUTTON_UP -> PC6
137  * - BUTTON_DOWN -> PC7
138  * @{
139  */
140 /** BUTTON_SELECT -> PA3 */
141 #define BUTTON_SELECT_PORT GPIO_A_NUM
142 #define BUTTON_SELECT_PIN 3
143 #define BUTTON_SELECT_VECTOR NVIC_INT_GPIO_PORT_A
144 
145 /** BUTTON_LEFT -> PC4 */
146 #define BUTTON_LEFT_PORT GPIO_C_NUM
147 #define BUTTON_LEFT_PIN 4
148 #define BUTTON_LEFT_VECTOR NVIC_INT_GPIO_PORT_C
149 
150 /** BUTTON_RIGHT -> PC5 */
151 #define BUTTON_RIGHT_PORT GPIO_C_NUM
152 #define BUTTON_RIGHT_PIN 5
153 #define BUTTON_RIGHT_VECTOR NVIC_INT_GPIO_PORT_C
154 
155 /** BUTTON_UP -> PC6 */
156 #define BUTTON_UP_PORT GPIO_C_NUM
157 #define BUTTON_UP_PIN 6
158 #define BUTTON_UP_VECTOR NVIC_INT_GPIO_PORT_C
159 
160 /** BUTTON_DOWN -> PC7 */
161 #define BUTTON_DOWN_PORT GPIO_C_NUM
162 #define BUTTON_DOWN_PIN 7
163 #define BUTTON_DOWN_VECTOR NVIC_INT_GPIO_PORT_C
164 
165 /* Notify various examples that we have Buttons */
166 #define PLATFORM_HAS_BUTTON 1
167 /** @} */
168 /*---------------------------------------------------------------------------*/
169 /**
170  * \name ADC configuration
171  *
172  * These values configure which CC2538 pins and ADC channels to use for the ADC
173  * inputs.
174  *
175  * ADC inputs can only be on port A.
176  * @{
177  */
178 #define ADC_ALS_PWR_PORT GPIO_A_NUM /**< ALS power GPIO control port */
179 #define ADC_ALS_PWR_PIN 7 /**< ALS power GPIO control pin */
180 #define ADC_ALS_OUT_PIN 6 /**< ALS output ADC input pin on port A */
181 /** @} */
182 /*---------------------------------------------------------------------------*/
183 /**
184  * \name SPI configuration
185  *
186  * These values configure which CC2538 pins to use for the SPI lines.
187  * @{
188  */
189 #define SPI_CLK_PORT GPIO_A_NUM
190 #define SPI_CLK_PIN 2
191 #define SPI_MOSI_PORT GPIO_A_NUM
192 #define SPI_MOSI_PIN 4
193 #define SPI_MISO_PORT GPIO_A_NUM
194 #define SPI_MISO_PIN 5
195 /** @} */
196 /*---------------------------------------------------------------------------*/
197 /**
198  * \name Device string used on startup
199  * @{
200  */
201 #define BOARD_STRING "TI SmartRF06 + cc2538EM"
202 /** @} */
203 
204 #endif /* BOARD_H_ */
205 
206 /**
207  * @}
208  * @}
209  */
Header file for the ARM Nested Vectored Interrupt Controller.
Header file with register and macro declarations for the cc2538 GPIO module.