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-cc13xx-peripherals CC1350 Sensortag Peripherals
35  *
36  * Defines related to the CC1350 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 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 1
67 #define LEDS_CONF_RED 1
68 /** @} */
69 /*---------------------------------------------------------------------------*/
70 /**
71  * \name LED IOID mappings
72  *
73  * Those values are not meant to be modified by the user
74  * @{
75  */
76 #define BOARD_IOID_LED_1 IOID_10
77 /** @} */
78 /*---------------------------------------------------------------------------*/
79 /**
80  * \name UART IOID mapping
81  *
82  * Those values are not meant to be modified by the user
83  * @{
84  */
85 #define BOARD_IOID_DP4_UARTRX IOID_28
86 #define BOARD_IOID_DP5_UARTTX IOID_29
87 
88 #if BOARD_CONF_DEBUGGER_DEVPACK
89 #define BOARD_IOID_UART_RX BOARD_IOID_DP4_UARTRX
90 #define BOARD_IOID_UART_TX BOARD_IOID_DP5_UARTTX
91 #else
92 #define BOARD_IOID_UART_RX IOID_17
93 #define BOARD_IOID_UART_TX IOID_16
94 #endif
95 
96 #define BOARD_IOID_UART_CTS IOID_UNUSED
97 #define BOARD_IOID_UART_RTS IOID_UNUSED
98 #define BOARD_UART_RX (1 << BOARD_IOID_UART_RX)
99 #define BOARD_UART_TX (1 << BOARD_IOID_UART_TX)
100 #define BOARD_UART_CTS (1 << BOARD_IOID_UART_CTS)
101 #define BOARD_UART_RTS (1 << BOARD_IOID_UART_RTS)
102 /** @} */
103 /*---------------------------------------------------------------------------*/
104 /**
105  * \name Button IOID mapping
106  *
107  * Those values are not meant to be modified by the user
108  * @{
109  */
110 #define BOARD_IOID_KEY_LEFT IOID_15
111 #define BOARD_IOID_KEY_RIGHT IOID_4
112 #define BOARD_KEY_LEFT (1 << BOARD_IOID_KEY_LEFT)
113 #define BOARD_KEY_RIGHT (1 << BOARD_IOID_KEY_RIGHT)
114 /** @} */
115 /*---------------------------------------------------------------------------*/
116 /**
117  * \name Buzzer configuration
118  * @{
119  */
120 #define BOARD_IOID_BUZZER IOID_21 /**< Buzzer Pin */
121 /** @} */
122 /*---------------------------------------------------------------------------*/
123 /**
124  * \name Reed Relay IOID mapping
125  *
126  * Those values are not meant to be modified by the user
127  * @{
128  */
129 #define BOARD_IOID_REED_RELAY IOID_1
130 /** @} */
131 /*---------------------------------------------------------------------------*/
132 /**
133  * \name External flash IOID mapping and part-related constants
134  *
135  * Those values are not meant to be modified by the user
136  * @{
137  */
138 #define EXT_FLASH_SPI_CONTROLLER SPI_CONTROLLER_SPI0
139 
140 #define BOARD_IOID_FLASH_SCK IOID_17
141 #define BOARD_IOID_FLASH_MOSI IOID_19
142 #define BOARD_IOID_FLASH_MISO IOID_18
143 #define BOARD_IOID_FLASH_CS IOID_14
144 
145 #define EXT_FLASH_SPI_PIN_SCK 17
146 #define EXT_FLASH_SPI_PIN_MOSI 19
147 #define EXT_FLASH_SPI_PIN_MISO 18
148 #define EXT_FLASH_SPI_PIN_CS 14
149 
150 #define EXT_FLASH_DEVICE_ID 0x14
151 #define EXT_FLASH_MID 0xC2
152 
153 #define EXT_FLASH_PROGRAM_PAGE_SIZE 256
154 #define EXT_FLASH_ERASE_SECTOR_SIZE 4096
155 /** @} */
156 /*---------------------------------------------------------------------------*/
157 /**
158  * \brief I2C IOID mappings
159  *
160  * Those values are not meant to be modified by the user
161  * @{
162  */
163 #define BOARD_IOID_SDA IOID_5 /**< Interface 0 SDA: All sensors bar MPU */
164 #define BOARD_IOID_SCL IOID_6 /**< Interface 0 SCL: All sensors bar MPU */
165 #define BOARD_IOID_SDA_HP IOID_8 /**< Interface 1 SDA: MPU */
166 #define BOARD_IOID_SCL_HP IOID_9 /**< Interface 1 SCL: MPU */
167 /** @} */
168 /*---------------------------------------------------------------------------*/
169 /**
170  * \brief MPU IOID mappings
171  *
172  * Those values are not meant to be modified by the user
173  * @{
174  */
175 #define BOARD_IOID_MPU_INT IOID_7
176 #define BOARD_IOID_MPU_POWER IOID_12
177 #define BOARD_MPU_INT (1 << BOARD_IOID_MPU_INT)
178 #define BOARD_MPU_POWER (1 << BOARD_IOID_MPU_POWER)
179 /** @} */
180 /*---------------------------------------------------------------------------*/
181 /**
182  * \brief Board devpack IOID mappings (LCD etc.)
183  *
184  * Those values are not meant to be modified by the user
185  * @{
186  */
187 #define BOARD_IOID_AUDIOFS_TDO IOID_16
188 #define BOARD_IOID_DEVPACK_CS IOID_20
189 #define BOARD_IOID_DEVPK_LCD_EXTCOMIN IOID_22
190 #define BOARD_IOID_AUDIODO IOID_22
191 #define BOARD_IOID_DP2 IOID_23
192 #define BOARD_IOID_DP1 IOID_24
193 #define BOARD_IOID_DP0 IOID_25
194 #define BOARD_IOID_DP3 IOID_27
195 #define BOARD_IOID_DEVPK_ID IOID_30
196 #define BOARD_DEVPACK_CS (1 << BOARD_IOID_DEVPACK_CS)
197 /** @} */
198 /*---------------------------------------------------------------------------*/
199 /**
200  * \brief TMP Sensor
201  *
202  * Those values are not meant to be modified by the user
203  * @{
204  */
205 #define BOARD_IOID_TMP_RDY IOID_11
206 /** @} */
207 /*---------------------------------------------------------------------------*/
208 /**
209  * \brief Digital Microphone
210  *
211  * Those values are not meant to be modified by the user
212  * @{
213  */
214 #define BOARD_IOID_MIC_POWER IOID_13
215 #define BOARD_IOID_AUDIO_DI IOID_2
216 #define BOARD_IOID_AUDIO_CLK IOID_3
217 /** @} */
218 /*---------------------------------------------------------------------------*/
219 /**
220  * \name RF Front End configuration
221  *
222  * Those values are not meant to be modified by the user
223  * @{
224  */
225 #define RF_CORE_CONF_RADIO_SETUP_FRONT_END_MODE 0x01 /* Single-Ended, RFP */
226 #define RF_CORE_CONF_RADIO_SETUP_BIAS_MODE 0x01 /* External */
227 #define RF_CORE_CONF_PROP_FRONT_END_MODE 0x02 /* Single-Ended, RFN */
228 #define RF_CORE_CONF_PROP_BIAS_MODE 0x01 /* External */
229 /** @} */
230 /*---------------------------------------------------------------------------*/
231 /**
232  * \name Board-specific overrides
233  *
234  * Those values are not meant to be modified by the user
235  * @{
236  */
237 #define IEEE_MODE_CONF_BOARD_OVERRIDES ADI_HALFREG_OVERRIDE(0, 16, 0x7, 1),
238 #define RF_BLE_CONF_BOARD_OVERRIDES ADI_HALFREG_OVERRIDE(0, 16, 0x7, 1),
239 #define SMARTRF_SETTINGS_CONF_BOARD_OVERRIDES ADI_HALFREG_OVERRIDE(0, 16, 0x7, 2),
240 
241 #define SMARTRF_SETTINGS_CONF_RSSI_OFFSET_779_930 0x00F688A3
242 #define SMARTRF_SETTINGS_CONF_OVERRIDE_TRIM_OFFSET 0x00018883
243 /** @} */
244 /*---------------------------------------------------------------------------*/
245 /**
246  * \brief Board indices for the button HAL
247  *
248  * Those values are not meant to be modified by the user
249  * @{
250  */
251 #define BOARD_BUTTON_HAL_INDEX_KEY_LEFT 0x00
252 #define BOARD_BUTTON_HAL_INDEX_KEY_RIGHT 0x01
253 #define BOARD_BUTTON_HAL_INDEX_REED_RELAY 0xFF
254 /** @} */
255 /*---------------------------------------------------------------------------*/
256 /**
257  * \name Device string used on startup
258  * @{
259  */
260 #define BOARD_STRING "TI CC1350 SensorTag"
261 
262 /** @} */
263 /*---------------------------------------------------------------------------*/
264 /**
265  * \brief Board specific iniatialisation
266  * @{
267  */
268 void board_init(void);
269 /** @} */
270 /*---------------------------------------------------------------------------*/
271 #endif /* BOARD_H_ */
272 /*---------------------------------------------------------------------------*/
273 /**
274  * @}
275  * @}
276  */
Header file with declarations for the I/O Control module.
void board_init(void)
Board specific iniatialisation.
Definition: board.c:54