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-b OpenMote-B
39 * OpenMote-B is a new board by OpenMote Technologies, released in 2018.
40 * @{
41 *
42 * \file
43 * This file provides connectivity information on LEDs, Buttons, UART and
44 * other OpenMote-B peripherals.
45 *
46 * This file can be used as the basis to configure other platforms using the
47 * cc2538 SoC.
48 *
49 * \note Do not include this file directly. It gets included by contiki-conf
50 * after all relevant directives have been set.
51 */
52
53#ifndef BOARD_H_
54#define BOARD_H_
55/*---------------------------------------------------------------------------*/
56#include "dev/gpio.h"
57#include "dev/nvic.h"
58/*---------------------------------------------------------------------------*/
59/**
60 * \name Serial Boot Loader Backdoor configuration
61 *
62 * @{
63 */
64#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN
65#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN 7 /**< Pin PA7 activates the boot loader */
66#endif
67
68#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH
69#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH 0 /**< A logic low level activates the boot loader */
70#endif
71/** @} */
72/*---------------------------------------------------------------------------*/
73/** \name OpenMote-B LED configuration
74 *
75 * LEDs on the OpenMote-B are connected as follows:
76 * - LED1 (Red) -> PC4
77 * - LED2 (Yellow) -> PC6
78 * - LED3 (Green) -> PC7
79 * - LED4 (Orange) -> PC5
80 *
81 * @{
82 */
83/*---------------------------------------------------------------------------*/
84#define LEDS_ARCH_L1_PORT GPIO_C_NUM
85#define LEDS_ARCH_L1_PIN 4
86#define LEDS_ARCH_L2_PORT GPIO_C_NUM
87#define LEDS_ARCH_L2_PIN 6
88#define LEDS_ARCH_L3_PORT GPIO_C_NUM
89#define LEDS_ARCH_L3_PIN 7
90#define LEDS_ARCH_L4_PORT GPIO_C_NUM
91#define LEDS_ARCH_L4_PIN 5
92
93#define LEDS_CONF_RED 1
94#define LEDS_CONF_YELLOW 2
95#define LEDS_CONF_GREEN 4
96#define LEDS_CONF_ORANGE 8
97
98#define LEDS_CONF_COUNT 4
99/** @} */
100/*---------------------------------------------------------------------------*/
101/** \name USB configuration
102 *
103 * The USB pullup is to be enabled by an external resistor, as it is not mapped
104 * to a GPIO.
105 * @{
106 */
107#ifdef USB_PULLUP_PORT
108#undef USB_PULLUP_PORT
109#endif
110#ifdef USB_PULLUP_PIN
111#undef USB_PULLUP_PIN
112#endif
113/** @} */
114/*---------------------------------------------------------------------------*/
115/** \name UART configuration
116 *
117 * On the OpenMote-B, the UART is connected to the
118 * following ports/pins
119 * - RX: PA0
120 * - TX: PA1
121 *
122 * We configure the port to use UART0.
123 * @{
124 */
125#define UART0_RX_PORT GPIO_A_NUM
126#define UART0_RX_PIN 0
127#define UART0_TX_PORT GPIO_A_NUM
128#define UART0_TX_PIN 1
129/** @} */
130/*---------------------------------------------------------------------------*/
131/** \name OpenMote-B Button configuration
132 *
133 * Buttons on the OpenMote-B are connected as follows:
134 * - BUTTON_USER -> PD5
135 * @{
136 */
137/** BUTTON_USER -> PD5 */
138#define BUTTON_USER_PORT GPIO_D_NUM
139#define BUTTON_USER_PIN 5
140#define BUTTON_USER_VECTOR GPIO_D_IRQn
141/* Notify various examples that we have Buttons */
142#define PLATFORM_HAS_BUTTON 1
143#define PLATFORM_SUPPORTS_BUTTON_HAL 1
144/** @} */
145/*---------------------------------------------------------------------------*/
146/**
147 * \name SPI (SSI0) configuration
148 *
149 * These values configure which CC2538 pins to use for the SPI (SSI0) lines.
150 * @{
151 */
152#define SPI_CLK_PORT GPIO_A_NUM
153#define SPI_CLK_PIN 2
154#define SPI_MOSI_PORT GPIO_A_NUM
155#define SPI_MOSI_PIN 5
156#define SPI_MISO_PORT GPIO_A_NUM
157#define SPI_MISO_PIN 4
158/** @} */
159/*---------------------------------------------------------------------------*/
160/**
161 * \name SPI (SSI1) configuration
162 *
163 * These values configure which CC2538 pins to use for the SPI (SSI1) lines.
164 * The SSI1 is currently not used.
165 * @{
166 */
167#define SPI1_CLK_PORT GPIO_C_NUM
168#define SPI1_CLK_PIN 4
169#define SPI1_TX_PORT GPIO_C_NUM
170#define SPI1_TX_PIN 5
171#define SPI1_RX_PORT GPIO_C_NUM
172#define SPI1_RX_PIN 6
173/** @} */
174/*---------------------------------------------------------------------------*/
175/**
176 * \name I2C configuration
177 *
178 * These values configure which CC2538 pins to use for the I2C lines.
179 * @{
180 */
181#define I2C_SCL_PORT GPIO_B_NUM
182#define I2C_SCL_PIN 5
183#define I2C_SDA_PORT GPIO_B_NUM
184#define I2C_SDA_PIN 4
185/** @} */
186/*---------------------------------------------------------------------------*/
187/**
188 * \name OpenMote-B antenna switch configuration
189 *
190 * @{
191 */
192#define ANTENNA_BSP_RADIO_BASE GPIO_PORT_TO_BASE(GPIO_D_NUM)
193#define ANTENNA_BSP_RADIO_INT GPIO_PIN_MASK(3)
194#define ANTENNA_BSP_RADIO_EXT GPIO_PIN_MASK(4)
195/** @} */
196/*---------------------------------------------------------------------------*/
197/**
198 * \name CC2538 TSCH configuration
199 *
200 * @{
201 */
202#define RADIO_PHY_OVERHEAD CC2538_PHY_OVERHEAD
203#define RADIO_BYTE_AIR_TIME CC2538_BYTE_AIR_TIME
204#define RADIO_DELAY_BEFORE_TX CC2538_DELAY_BEFORE_TX
205#define RADIO_DELAY_BEFORE_RX CC2538_DELAY_BEFORE_RX
206#define RADIO_DELAY_BEFORE_DETECT CC2538_DELAY_BEFORE_DETECT
207/** @} */
208/*---------------------------------------------------------------------------*/
209/**
210 * \name Device string used on startup
211 * @{
212 */
213#define BOARD_STRING "OpenMote-B"
214/** @} */
215/*---------------------------------------------------------------------------*/
216#endif /* BOARD_H_ */
217/*---------------------------------------------------------------------------*/
218/**
219 * @}
220 * @}
221 */
Header file with register and macro declarations for the cc2538 GPIO module.
Header file for the ARM Nested Vectored Interrupt Controller.