Contiki-NG
Toggle main menu visibility
Loading...
Searching...
No Matches
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
*/
95
#define USB_PULLUP_PORT GPIO_C_NUM
96
#define USB_PULLUP_PIN 0
97
/** @} */
98
/*---------------------------------------------------------------------------*/
99
/** \name UART configuration
100
*
101
* On the OpenMote, the UART is connected to the
102
* following ports/pins
103
* - RX: PA0
104
* - TX: PA1
105
* - CTS: PB0 (Can only be used with UART1)
106
* - RTS: PD3 (Can only be used with UART1)
107
*
108
* We configure the port to use UART0. To use UART1, replace UART0_* with
109
* UART1_* below.
110
* @{
111
*/
112
#define UART0_RX_PORT GPIO_A_NUM
113
#define UART0_RX_PIN 0
114
#define UART0_TX_PORT GPIO_A_NUM
115
#define UART0_TX_PIN 1
116
117
#define UART1_RX_PORT GPIO_B_NUM
118
#define UART1_RX_PIN 0
119
#define UART1_TX_PORT GPIO_D_NUM
120
#define UART1_TX_PIN 3
121
#define UART1_CTS_PORT (-1)
122
#define UART1_CTS_PIN (-1)
123
#define UART1_RTS_PORT (-1)
124
#define UART1_RTS_PIN (-1)
125
/** @} */
126
/*---------------------------------------------------------------------------*/
127
/** \name OpenMote-CC2538 Button configuration
128
*
129
* Buttons on the OpenMote-CC2538 are connected as follows:
130
* - BUTTON_USER -> PC3
131
* @{
132
*/
133
/** BUTTON_USER -> PC3 */
134
#define BUTTON_USER_PORT GPIO_C_NUM
135
#define BUTTON_USER_PIN 3
136
#define BUTTON_USER_VECTOR GPIO_C_IRQn
137
/* Notify various examples that we have Buttons */
138
#define PLATFORM_HAS_BUTTON 1
139
#define PLATFORM_SUPPORTS_BUTTON_HAL 1
140
/** @} */
141
/*---------------------------------------------------------------------------*/
142
/**
143
* \name SPI (SSI0) configuration
144
*
145
* These values configure which CC2538 pins to use for the SPI (SSI0) lines.
146
* The SSI0 is currently used to interface with the Ethernet driver (ENC28J60)
147
* on the OpenBase board.
148
* @{
149
*/
150
#define SPI_CLK_PORT GPIO_A_NUM
151
#define SPI_CLK_PIN 2
152
#define SPI_MOSI_PORT GPIO_A_NUM
153
#define SPI_MOSI_PIN 5
154
#define SPI_MISO_PORT GPIO_A_NUM
155
#define SPI_MISO_PIN 4
156
/** @} */
157
/*---------------------------------------------------------------------------*/
158
/**
159
* \name SPI (SSI1) configuration
160
*
161
* These values configure which CC2538 pins to use for the SPI (SSI1) lines.
162
* The SSI1 is currently not used.
163
* @{
164
*/
165
#define SPI1_CLK_PORT GPIO_C_NUM
166
#define SPI1_CLK_PIN 4
167
#define SPI1_TX_PORT GPIO_C_NUM
168
#define SPI1_TX_PIN 5
169
#define SPI1_RX_PORT GPIO_C_NUM
170
#define SPI1_RX_PIN 6
171
/** @} */
172
/*---------------------------------------------------------------------------*/
173
/**
174
* \name I2C configuration
175
*
176
* These values configure which CC2538 pins to use for the I2C lines.
177
* @{
178
*/
179
#define I2C_SCL_PORT GPIO_B_NUM
180
#define I2C_SCL_PIN 3
181
#define I2C_SDA_PORT GPIO_B_NUM
182
#define I2C_SDA_PIN 4
183
/** @} */
184
/*---------------------------------------------------------------------------*/
185
/**
186
* \name CC2538 TSCH configuration
187
*
188
* @{
189
*/
190
#define RADIO_PHY_OVERHEAD CC2538_PHY_OVERHEAD
191
#define RADIO_BYTE_AIR_TIME CC2538_BYTE_AIR_TIME
192
#define RADIO_DELAY_BEFORE_TX CC2538_DELAY_BEFORE_TX
193
#define RADIO_DELAY_BEFORE_RX CC2538_DELAY_BEFORE_RX
194
#define RADIO_DELAY_BEFORE_DETECT CC2538_DELAY_BEFORE_DETECT
195
/** @} */
196
/*---------------------------------------------------------------------------*/
197
/**
198
* \name Device string used on startup
199
* @{
200
*/
201
#define BOARD_STRING "OpenMote-CC2538"
202
/** @} */
203
/*---------------------------------------------------------------------------*/
204
#endif
/* BOARD_H_ */
205
/*---------------------------------------------------------------------------*/
206
/**
207
* @}
208
* @}
209
*/
gpio.h
Header file with register and macro declarations for the cc2538 GPIO module.
nvic.h
Header file for the ARM Nested Vectored Interrupt Controller.
arch
platform
openmote
openmote-cc2538
board.h
Generated on
for Contiki-NG by
1.17.0