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 /*---------------------------------------------------------------------------*/
31 /** \addtogroup cc26xx-srf-tag
32  * @{
33  *
34  * \defgroup sensortag-cc26xx-specific CC2650 Sensortag Peripherals
35  *
36  * Defines related to the CC2650 Sensortag
37  *
38  * This file provides connectivity information on LEDs, Buttons, UART and
39  * other peripherals
40  *
41  * This file can be used as the basis to configure other boards using the
42  * CC13xx/CC26xx code as their basis.
43  *
44  * This file is not meant to be modified by the user.
45  * @{
46  *
47  * \file
48  * Header file with definitions related to the I/O connections on the TI
49  * Sensortag
50  *
51  * \note Do not include this file directly. It gets included by contiki-conf
52  * after all relevant directives have been set.
53  */
54 /*---------------------------------------------------------------------------*/
55 #ifndef BOARD_H_
56 #define BOARD_H_
57 /*---------------------------------------------------------------------------*/
58 #include "ioc.h"
59 /*---------------------------------------------------------------------------*/
60 /**
61  * \name LED HAL configuration
62  *
63  * Those values are not meant to be modified by the user
64  * @{
65  */
66 #define LEDS_CONF_COUNT 2
67 #define LEDS_CONF_RED 1
68 #define LEDS_CONF_GREEN 2
69 /** @} */
70 /*---------------------------------------------------------------------------*/
71 /**
72  * \name LED IOID mappings
73  *
74  * Those values are not meant to be modified by the user
75  * @{
76  */
77 #define BOARD_IOID_LED_1 IOID_10
78 #define BOARD_IOID_LED_2 IOID_15
79 /** @} */
80 /*---------------------------------------------------------------------------*/
81 /**
82  * \name UART IOID mapping
83  *
84  * Those values are not meant to be modified by the user
85  * @{
86  */
87 #define BOARD_IOID_DP4_UARTRX IOID_28
88 #define BOARD_IOID_DP5_UARTTX IOID_29
89 
90 #if BOARD_CONF_DEBUGGER_DEVPACK
91 #define BOARD_IOID_UART_RX BOARD_IOID_DP4_UARTRX
92 #define BOARD_IOID_UART_TX BOARD_IOID_DP5_UARTTX
93 #else
94 #define BOARD_IOID_UART_RX IOID_17
95 #define BOARD_IOID_UART_TX IOID_16
96 #endif
97 
98 #define BOARD_IOID_UART_CTS IOID_UNUSED
99 #define BOARD_IOID_UART_RTS IOID_UNUSED
100 #define BOARD_UART_RX (1 << BOARD_IOID_UART_RX)
101 #define BOARD_UART_TX (1 << BOARD_IOID_UART_TX)
102 #define BOARD_UART_CTS (1 << BOARD_IOID_UART_CTS)
103 #define BOARD_UART_RTS (1 << BOARD_IOID_UART_RTS)
104 /** @} */
105 /*---------------------------------------------------------------------------*/
106 /**
107  * \name Button IOID mapping
108  *
109  * Those values are not meant to be modified by the user
110  * @{
111  */
112 #define BOARD_IOID_KEY_LEFT IOID_0
113 #define BOARD_IOID_KEY_RIGHT IOID_4
114 #define BOARD_KEY_LEFT (1 << BOARD_IOID_KEY_LEFT)
115 #define BOARD_KEY_RIGHT (1 << BOARD_IOID_KEY_RIGHT)
116 /** @} */
117 /*---------------------------------------------------------------------------*/
118 /**
119  * \name Buzzer configuration
120  * @{
121  */
122 #define BOARD_IOID_BUZZER IOID_21 /**< Buzzer Pin */
123 /** @} */
124 /*---------------------------------------------------------------------------*/
125 /**
126  * \name Reed Relay IOID mapping
127  *
128  * Those values are not meant to be modified by the user
129  * @{
130  */
131 #define BOARD_IOID_REED_RELAY IOID_3
132 /** @} */
133 /*---------------------------------------------------------------------------*/
134 /**
135  * \name External flash IOID mapping
136  *
137  * Those values are not meant to be modified by the user
138  * @{
139  */
140 #define EXT_FLASH_SPI_CONTROLLER SPI_CONTROLLER_SPI0
141 
142 #define EXT_FLASH_SPI_PIN_SCK IOID_17
143 #define EXT_FLASH_SPI_PIN_MOSI IOID_19
144 #define EXT_FLASH_SPI_PIN_MISO IOID_18
145 #define EXT_FLASH_SPI_PIN_CS IOID_14
146 
147 #if SENSORTAG_CC2650_REV_1_2_0
148 #define EXT_FLASH_DEVICE_ID 0x12
149 #define EXT_FLASH_MID 0xEF
150 #else
151 #define EXT_FLASH_DEVICE_ID 0x14
152 #define EXT_FLASH_MID 0xC2
153 #endif
154 
155 #define EXT_FLASH_PROGRAM_PAGE_SIZE 256
156 #define EXT_FLASH_ERASE_SECTOR_SIZE 4096
157 /** @} */
158 /*---------------------------------------------------------------------------*/
159 /**
160  * \brief I2C IOID mappings
161  *
162  * Those values are not meant to be modified by the user
163  * @{
164  */
165 #define BOARD_IOID_SDA IOID_5 /**< Interface 0 SDA: All sensors bar MPU */
166 #define BOARD_IOID_SCL IOID_6 /**< Interface 0 SCL: All sensors bar MPU */
167 #define BOARD_IOID_SDA_HP IOID_8 /**< Interface 1 SDA: MPU */
168 #define BOARD_IOID_SCL_HP IOID_9 /**< Interface 1 SCL: MPU */
169 /** @} */
170 /*---------------------------------------------------------------------------*/
171 /**
172  * \brief MPU IOID mappings
173  *
174  * Those values are not meant to be modified by the user
175  * @{
176  */
177 #define BOARD_IOID_MPU_INT IOID_7
178 #define BOARD_IOID_MPU_POWER IOID_12
179 #define BOARD_MPU_INT (1 << BOARD_IOID_MPU_INT)
180 #define BOARD_MPU_POWER (1 << BOARD_IOID_MPU_POWER)
181 /** @} */
182 /*---------------------------------------------------------------------------*/
183 /**
184  * \brief Board devpack IOID mappings (LCD etc.)
185  *
186  * Those values are not meant to be modified by the user
187  * @{
188  */
189 #define BOARD_IOID_AUDIOFS_TDO IOID_16
190 #define BOARD_IOID_DEVPACK_CS IOID_20
191 #define BOARD_IOID_DEVPK_LCD_EXTCOMIN IOID_22
192 #define BOARD_IOID_AUDIODO IOID_22
193 #define BOARD_IOID_DP2 IOID_23
194 #define BOARD_IOID_DP1 IOID_24
195 #define BOARD_IOID_DP0 IOID_25
196 #define BOARD_IOID_DP3 IOID_27
197 #define BOARD_IOID_DEVPK_ID IOID_30
198 #define BOARD_DEVPACK_CS (1 << BOARD_IOID_DEVPACK_CS)
199 /** @} */
200 /*---------------------------------------------------------------------------*/
201 /**
202  * \brief TMP Sensor
203  *
204  * Those values are not meant to be modified by the user
205  * @{
206  */
207 #define BOARD_IOID_TMP_RDY IOID_1
208 /** @} */
209 /*---------------------------------------------------------------------------*/
210 /**
211  * \brief Digital Microphone
212  *
213  * Those values are not meant to be modified by the user
214  * @{
215  */
216 #define BOARD_IOID_MIC_POWER IOID_13
217 #define BOARD_IOID_AUDIO_DI IOID_2
218 #define BOARD_IOID_AUDIO_CLK IOID_11
219 /** @} */
220 /*---------------------------------------------------------------------------*/
221 /**
222  * \brief Board indices for the button HAL
223  *
224  * Those values are not meant to be modified by the user
225  * @{
226  */
227 #define BOARD_BUTTON_HAL_INDEX_KEY_LEFT 0x00
228 #define BOARD_BUTTON_HAL_INDEX_KEY_RIGHT 0x01
229 #define BOARD_BUTTON_HAL_INDEX_REED_RELAY 0xFF
230 /** @} */
231 /*---------------------------------------------------------------------------*/
232 /**
233  * \brief ROM bootloader configuration
234  *
235  * Sensortags do not support the bootloader
236  * @{
237  */
238 #define CCXXWARE_CONF_BL_PIN_NUMBER IOID_UNUSED
239 #define CCXXWARE_CONF_BL_LEVEL 0
240 /** @} */
241 /*---------------------------------------------------------------------------*/
242 /**
243  * \name Device string used on startup
244  * @{
245  */
246 #define BOARD_STRING "TI CC2650 SensorTag"
247 
248 /** @} */
249 /*---------------------------------------------------------------------------*/
250 #endif /* BOARD_H_ */
251 /*---------------------------------------------------------------------------*/
252 /**
253  * @}
254  * @}
255  */
Header file with declarations for the I/O Control module.