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 EXT_FLASH_SPI_PIN_SCK IOID_17
141 #define EXT_FLASH_SPI_PIN_MOSI IOID_19
142 #define EXT_FLASH_SPI_PIN_MISO IOID_18
143 #define EXT_FLASH_SPI_PIN_CS IOID_14
144 
145 #define EXT_FLASH_DEVICE_ID 0x14
146 #define EXT_FLASH_MID 0xC2
147 
148 #define EXT_FLASH_PROGRAM_PAGE_SIZE 256
149 #define EXT_FLASH_ERASE_SECTOR_SIZE 4096
150 /** @} */
151 /*---------------------------------------------------------------------------*/
152 /**
153  * \brief I2C IOID mappings
154  *
155  * Those values are not meant to be modified by the user
156  * @{
157  */
158 #define BOARD_IOID_SDA IOID_5 /**< Interface 0 SDA: All sensors bar MPU */
159 #define BOARD_IOID_SCL IOID_6 /**< Interface 0 SCL: All sensors bar MPU */
160 #define BOARD_IOID_SDA_HP IOID_8 /**< Interface 1 SDA: MPU */
161 #define BOARD_IOID_SCL_HP IOID_9 /**< Interface 1 SCL: MPU */
162 /** @} */
163 /*---------------------------------------------------------------------------*/
164 /**
165  * \brief MPU IOID mappings
166  *
167  * Those values are not meant to be modified by the user
168  * @{
169  */
170 #define BOARD_IOID_MPU_INT IOID_7
171 #define BOARD_IOID_MPU_POWER IOID_12
172 #define BOARD_MPU_INT (1 << BOARD_IOID_MPU_INT)
173 #define BOARD_MPU_POWER (1 << BOARD_IOID_MPU_POWER)
174 /** @} */
175 /*---------------------------------------------------------------------------*/
176 /**
177  * \brief Board devpack IOID mappings (LCD etc.)
178  *
179  * Those values are not meant to be modified by the user
180  * @{
181  */
182 #define BOARD_IOID_AUDIOFS_TDO IOID_16
183 #define BOARD_IOID_DEVPACK_CS IOID_20
184 #define BOARD_IOID_DEVPK_LCD_EXTCOMIN IOID_22
185 #define BOARD_IOID_AUDIODO IOID_22
186 #define BOARD_IOID_DP2 IOID_23
187 #define BOARD_IOID_DP1 IOID_24
188 #define BOARD_IOID_DP0 IOID_25
189 #define BOARD_IOID_DP3 IOID_27
190 #define BOARD_IOID_DEVPK_ID IOID_30
191 #define BOARD_DEVPACK_CS (1 << BOARD_IOID_DEVPACK_CS)
192 /** @} */
193 /*---------------------------------------------------------------------------*/
194 /**
195  * \brief TMP Sensor
196  *
197  * Those values are not meant to be modified by the user
198  * @{
199  */
200 #define BOARD_IOID_TMP_RDY IOID_11
201 /** @} */
202 /*---------------------------------------------------------------------------*/
203 /**
204  * \brief Digital Microphone
205  *
206  * Those values are not meant to be modified by the user
207  * @{
208  */
209 #define BOARD_IOID_MIC_POWER IOID_13
210 #define BOARD_IOID_AUDIO_DI IOID_2
211 #define BOARD_IOID_AUDIO_CLK IOID_3
212 /** @} */
213 /*---------------------------------------------------------------------------*/
214 /**
215  * \name RF Front End configuration
216  *
217  * Those values are not meant to be modified by the user
218  * @{
219  */
220 #define RF_CORE_CONF_RADIO_SETUP_FRONT_END_MODE 0x01 /* Single-Ended, RFP */
221 #define RF_CORE_CONF_RADIO_SETUP_BIAS_MODE 0x01 /* External */
222 #define RF_CORE_CONF_PROP_FRONT_END_MODE 0x02 /* Single-Ended, RFN */
223 #define RF_CORE_CONF_PROP_BIAS_MODE 0x01 /* External */
224 /** @} */
225 /*---------------------------------------------------------------------------*/
226 /**
227  * \name Board-specific overrides
228  *
229  * Those values are not meant to be modified by the user
230  * @{
231  */
232 #define IEEE_MODE_CONF_BOARD_OVERRIDES ADI_HALFREG_OVERRIDE(0, 16, 0x7, 1),
233 #define RF_BLE_CONF_BOARD_OVERRIDES ADI_HALFREG_OVERRIDE(0, 16, 0x7, 1),
234 #define SMARTRF_SETTINGS_CONF_BOARD_OVERRIDES ADI_HALFREG_OVERRIDE(0, 16, 0x7, 2),
235 
236 #define SMARTRF_SETTINGS_CONF_RSSI_OFFSET_779_930 0x00F688A3
237 #define SMARTRF_SETTINGS_CONF_OVERRIDE_TRIM_OFFSET 0x00018883
238 /** @} */
239 /*---------------------------------------------------------------------------*/
240 /**
241  * \brief Board indices for the button HAL
242  *
243  * Those values are not meant to be modified by the user
244  * @{
245  */
246 #define BOARD_BUTTON_HAL_INDEX_KEY_LEFT 0x00
247 #define BOARD_BUTTON_HAL_INDEX_KEY_RIGHT 0x01
248 #define BOARD_BUTTON_HAL_INDEX_REED_RELAY 0xFF
249 /** @} */
250 /*---------------------------------------------------------------------------*/
251 /**
252  * \brief ROM bootloader configuration
253  *
254  * Sensortags do not support the bootloader
255  * @{
256  */
257 #define CCXXWARE_CONF_BL_PIN_NUMBER IOID_UNUSED
258 #define CCXXWARE_CONF_BL_LEVEL 0
259 /** @} */
260 /*---------------------------------------------------------------------------*/
261 /**
262  * \name Device string used on startup
263  * @{
264  */
265 #define BOARD_STRING "TI CC1350 SensorTag"
266 
267 /** @} */
268 /*---------------------------------------------------------------------------*/
269 /**
270  * \brief Board specific iniatialisation
271  * @{
272  */
273 void board_init(void);
274 /** @} */
275 /*---------------------------------------------------------------------------*/
276 #endif /* BOARD_H_ */
277 /*---------------------------------------------------------------------------*/
278 /**
279  * @}
280  * @}
281  */
Header file with declarations for the I/O Control module.
void board_init(void)
Board specific iniatialisation.
Definition: board.c:80