BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bsp430_config.h
Go to the documentation of this file.
1 /* Copyright 2012-2014, Peter A. Bigot
2  *
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 are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * * Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * * Neither the name of the software nor the names of its contributors may be
16  * used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
148 #ifndef BSP430_PLATFORM_BSP430_CONFIG_H
149 #define BSP430_PLATFORM_BSP430_CONFIG_H
150 
151 #include <msp430.h>
152 
153 /* UCS has no facility other than BSP430_UCS_TRIM_DCOCLKDIV to set the
154  * MCLK, so enable it by default. */
155 #if defined(__MSP430_HAS_UCS__) || defined(__MSP430_HAS_UCS_RF__)
156 #ifndef configBSP430_UCS_TRIM_DCOCLKDIV
157 #define configBSP430_UCS_TRIM_DCOCLKDIV 1
158 #ifndef configBSP430_TIMER_CCACLK
159 #define configBSP430_TIMER_CCACLK 1
160 #endif /* configBSP430_TIMER_CCACLK */
161 #endif /* configBSP430_UCS_TRIM_DCOCLKDIV */
162 #endif /* UCS */
163 
164 /* BC2 feature request also requires CCACLK be enabled */
165 #if (configBSP430_BC2_TRIM_TO_MCLK - 0)
166 #ifndef configBSP430_TIMER_CCACLK
167 #define configBSP430_TIMER_CCACLK 1
168 #endif /* configBSP430_TIMER_CCACLK */
169 #endif /* configBSP430_BC2_TRIM_TO_MCLK */
170 
171 /* !BSP430! instance=exp430f5438,exp430f5529,exp430f5529lp,exp430fr5739,exp430fr5969,exp430fr4133,exp430fg4618,exp430g2,em430,rf2500t,wolverine,trxeb,surf */
172 /* !BSP430! insert=platform_bsp430_config */
173 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [platform_bsp430_config] */
174 #if (BSP430_PLATFORM_EXP430F5438 - 0)
176 #endif /* BSP430_PLATFORM_EXP430F5438 */
177 
178 #if (BSP430_PLATFORM_EXP430F5529 - 0)
180 #endif /* BSP430_PLATFORM_EXP430F5529 */
181 
182 #if (BSP430_PLATFORM_EXP430F5529LP - 0)
184 #endif /* BSP430_PLATFORM_EXP430F5529LP */
185 
186 #if (BSP430_PLATFORM_EXP430FR5739 - 0)
188 #endif /* BSP430_PLATFORM_EXP430FR5739 */
189 
190 #if (BSP430_PLATFORM_EXP430FR5969 - 0)
192 #endif /* BSP430_PLATFORM_EXP430FR5969 */
193 
194 #if (BSP430_PLATFORM_EXP430FR4133 - 0)
196 #endif /* BSP430_PLATFORM_EXP430FR4133 */
197 
198 #if (BSP430_PLATFORM_EXP430FG4618 - 0)
200 #endif /* BSP430_PLATFORM_EXP430FG4618 */
201 
202 #if (BSP430_PLATFORM_EXP430G2 - 0)
204 #endif /* BSP430_PLATFORM_EXP430G2 */
205 
206 #if (BSP430_PLATFORM_EM430 - 0)
208 #endif /* BSP430_PLATFORM_EM430 */
209 
210 #if (BSP430_PLATFORM_RF2500T - 0)
212 #endif /* BSP430_PLATFORM_RF2500T */
213 
214 #if (BSP430_PLATFORM_WOLVERINE - 0)
216 #endif /* BSP430_PLATFORM_WOLVERINE */
217 
218 #if (BSP430_PLATFORM_TRXEB - 0)
220 #endif /* BSP430_PLATFORM_TRXEB */
221 
222 #if (BSP430_PLATFORM_SURF - 0)
224 #endif /* BSP430_PLATFORM_SURF */
225 
226 /* END AUTOMATICALLY GENERATED CODE [platform_bsp430_config] */
227 /* !BSP430! end=platform_bsp430_config */
228 
229 #if (BSP430_PLATFORM_CUSTOM - 0)
230 #include <bsp430/platform/custom/bsp430_config.h>
231 #endif /* BSP430_PLATFORM_CUSTOM */
232 
233 /* Propagate requests for functional resources. Note that because we
234  * need the feature resource identified in order to request it,
235  * default values for BSP430-supported features must be provided in
236  * the platform-specific bsp430_config.h not the platform.h file. */
237 
238 #if (configBSP430_UPTIME - 0)
239 /* Set a default resource if none encountered so far */
240 #ifndef BSP430_UPTIME_TIMER_PERIPH_CPPID
241 #define BSP430_UPTIME_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
242 #endif /* BSP430_UPTIME_TIMER_PERIPH_CPPID */
243 
244 /* Enable HPL and HAL and primary ISR. Control CC0 ISR only if
245  * explicitly requested. */
246 #define BSP430_WANT_PERIPH_CPPID BSP430_UPTIME_TIMER_PERIPH_CPPID
247 #define BSP430_WANT_CONFIG_HPL 1
248 #define BSP430_WANT_CONFIG_HAL 1
249 #define BSP430_WANT_CONFIG_HAL_ISR 1
250 #ifdef configBSP430_UPTIME_TIMER_HAL_CC0_ISR
251 #define BSP430_WANT_CONFIG_HAL_CC0_ISR (configBSP430_UPTIME_TIMER_HAL_CC0_ISR - 0)
252 #endif /* configBSP430_UPTIME_TIMER_HAL_CC0_ISR */
253 #include <bsp430/periph/want_.h>
254 #undef BSP430_WANT_CONFIG_HAL_CC0_ISR
255 #undef BSP430_WANT_CONFIG_HAL_ISR
256 #undef BSP430_WANT_CONFIG_HAL
257 #undef BSP430_WANT_CONFIG_HPL
258 #undef BSP430_WANT_PERIPH_CPPID
259 #endif /* configBSP430_UPTIME */
260 
261 #if (configBSP430_CONSOLE - 0)
262 /* Set a default resource if none encountered so far */
263 #ifndef BSP430_CONSOLE_SERIAL_PERIPH_CPPID
264 #define BSP430_CONSOLE_SERIAL_PERIPH_CPPID BSP430_PERIPH_CPPID_NONE
265 #endif /* BSP430_CONSOLE_SERIAL_PERIPH_CPPID */
266 
267 #if 0 /* DO NOT REMOVE THIS: it avoids a special initial case for what follows */
268 /* !BSP430! instance=@serial functional=console_serial subst=functional insert=periph_sethandle */
269 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [periph_sethandle] */
270 
271 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI_A0
272 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI_A0
273 
274 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI_A1
275 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI_A1
276 
277 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI_B0
278 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI_B0
279 
280 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI_B1
281 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI_B1
282 
283 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_A0
284 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_A0
285 
286 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_A1
287 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_A1
288 
289 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_A2
290 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_A2
291 
292 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_A3
293 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_A3
294 
295 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_B0
296 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
297 
298 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_B1
299 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_B1
300 
301 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_B2
302 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_B2
303 
304 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_USCI5_B3
305 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_B3
306 
307 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_EUSCI_A0
308 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_EUSCI_A0
309 
310 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_EUSCI_A1
311 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_EUSCI_A1
312 
313 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_EUSCI_A2
314 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_EUSCI_A2
315 
316 #elif BSP430_CONSOLE_SERIAL_PERIPH_CPPID == BSP430_PERIPH_CPPID_EUSCI_B0
317 #define BSP430_CONSOLE_SERIAL_PERIPH_HANDLE BSP430_PERIPH_EUSCI_B0
318 /* END AUTOMATICALLY GENERATED CODE [periph_sethandle] */
319 /* !BSP430! end=periph_sethandle */
320 #endif /* BSP430_CONSOLE_SERIAL_PERIPH_HANDLE */
321 
322 /* Enable HPL, HAL, and ISR. */
323 #define BSP430_WANT_PERIPH_CPPID BSP430_CONSOLE_SERIAL_PERIPH_CPPID
324 #define BSP430_WANT_CONFIG_HPL 1
325 #define BSP430_WANT_CONFIG_HAL 1
326 #define BSP430_WANT_CONFIG_HAL_ISR 1
327 #include <bsp430/periph/want_.h>
328 #undef BSP430_WANT_CONFIG_HAL_ISR
329 #undef BSP430_WANT_CONFIG_HAL
330 #undef BSP430_WANT_CONFIG_HPL
331 #undef BSP430_WANT_PERIPH_CPPID
332 #endif /* configBSP430_CONSOLE */
333 
334 #if (configBSP430_TIMER_CCACLK - 0)
335 
336 #ifndef BSP430_TIMER_CCACLK_PERIPH_CPPID
337 #define BSP430_TIMER_CCACLK_PERIPH_CPPID BSP430_PERIPH_CPPID_NONE
338 #endif /* BSP430_TIMER_CCACLK_PERIPH_CPPID */
339 
340 /* Enable HPL. Control HAL and ISRs only if explicitly requested. */
341 #define BSP430_WANT_PERIPH_CPPID BSP430_TIMER_CCACLK_PERIPH_CPPID
342 #define BSP430_WANT_CONFIG_HPL 1
343 #ifdef configBSP430_TIMER_CCACLK_HAL
344 #define BSP430_WANT_CONFIG_HAL (configBSP430_TIMER_CCACLK_HAL - 0)
345 #endif /* configBSP430_TIMER_CCACLK_HAL */
346 #ifdef configBSP430_TIMER_CCACLK_HAL_ISR
347 #define BSP430_WANT_CONFIG_HAL_ISR (configBSP430_TIMER_CCACLK_HAL_ISR - 0)
348 #endif /* configBSP430_TIMER_CCACLK_HAL_ISR */
349 #ifdef configBSP430_TIMER_CCACLK_HAL_CC0_ISR
350 #define BSP430_WANT_CONFIG_HAL_CC0_ISR (configBSP430_TIMER_CCACLK_HAL_CC0_ISR - 0)
351 #endif /* configBSP430_TIMER_CCACLK_HAL_CC0_ISR */
352 #include <bsp430/periph/want_.h>
353 #undef BSP430_WANT_CONFIG_HAL_CC0_ISR
354 #undef BSP430_WANT_CONFIG_HAL_ISR
355 #undef BSP430_WANT_CONFIG_HAL
356 #undef BSP430_WANT_CONFIG_HPL
357 #undef BSP430_WANT_PERIPH_CPPID
358 
359 #if (configBSP430_TIMER_CCACLK_CLK_PORT - 0)
360 
361 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID
362 #define BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_NONE
363 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID */
364 
365 /* Enable HPL. Control HAL only if requested. No control of ISRs. */
366 #define BSP430_WANT_PERIPH_CPPID BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID
367 #define BSP430_WANT_CONFIG_HPL 1
368 #ifdef configBSP430_TIMER_CCACLK_CLK_PORT_HAL
369 #define BSP430_WANT_CONFIG_HAL (configBSP430_TIMER_CCACLK_CLK_PORT_HAL - 0)
370 #endif /* configBSP430_TIMER_CCACL_CLK_PORT_HAL */
371 #include <bsp430/periph/want_.h>
372 #undef BSP430_WANT_CONFIG_HPL
373 #undef BSP430_WANT_CONFIG_HAL
374 #undef BSP430_WANT_PERIPH_CPPID
375 #endif /* configBSP430_TIMER_CCACLK_CLK_PORT */
376 
377 #if (configBSP430_TIMER_CCACLK_CC0_PORT - 0)
378 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID
379 #define BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_NONE
380 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID */
381 
382 /* Enable HPL. Control HAL only if requested. No control of ISRs. */
383 #define BSP430_WANT_PERIPH_CPPID BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID
384 #define BSP430_WANT_CONFIG_HPL 1
385 #ifdef configBSP430_TIMER_CCACLK_CC0_PORT_HAL
386 #define BSP430_WANT_CONFIG_HAL (configBSP430_TIMER_CCACLK_CC0_PORT_HAL - 0)
387 #endif /* configBSP430_TIMER_CCACLK_CC0_PORT_HAL */
388 #include <bsp430/periph/want_.h>
389 #undef BSP430_WANT_CONFIG_HPL
390 #undef BSP430_WANT_CONFIG_HAL
391 #undef BSP430_WANT_PERIPH_CPPID
392 #endif /* configBSP430_TIMER_CCACLK_CC0_PORT */
393 
394 #if (configBSP430_TIMER_CCACLK_CC1_PORT - 0)
395 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID
396 #define BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_NONE
397 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID */
398 
399 /* Enable HPL. Control HAL only if requested. No control of ISRs. */
400 #define BSP430_WANT_PERIPH_CPPID BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID
401 #define BSP430_WANT_CONFIG_HPL 1
402 #ifdef configBSP430_TIMER_CCACLK_CC1_PORT_HAL
403 #define BSP430_WANT_CONFIG_HAL (configBSP430_TIMER_CCACLK_CC1_PORT_HAL - 0)
404 #endif /* configBSP430_TIMER_CCACLK_CC1_PORT_HAL */
405 #include <bsp430/periph/want_.h>
406 #undef BSP430_WANT_CONFIG_HPL
407 #undef BSP430_WANT_CONFIG_HAL
408 #undef BSP430_WANT_PERIPH_CPPID
409 #endif /* configBSP430_TIMER_CCACLK_CC1_PORT */
410 
411 #endif /* configBSP430_TIMER_CCACLK */
412 
414 /* Explicitly disable RFEM if not previously explicitly configured */
415 #ifndef configBSP430_RFEM
416 #define configBSP430_RFEM (configBSP430_RFEM_CCEM - 0)
417 #endif /* configBSP430_RFEM */
418 /* @endcond */
419 
420 #if (configBSP430_RFEM - 0)
421 /* If using the RFEM feature, incorporate the header that maps RFEM
422  * constants to specific EMK functions. */
424 #endif /* configBSP430_RFEM */
425 
426 #endif /* BSP430_PLATFORM_BSP430_CONFIG_H */
Stripped header supporting Doxygen links.
Translate functional resource requests to core resource requests.
Platform-specific BSP430 configuration directives for MSP-EXP430F5438
Platform-specific BSP430 configuration directives for MSP-TRXEB
Platform-specific BSP430 configuration directives for MSP-EXP430FR4133
Platform-specific BSP430 configuration directives for MSP-EXP430G2 ("LaunchPad")
BSP430 RFEM to EMK configuration directive mapping.
Platform-specific BSP430 configuration directives for EM430
Platform-specific BSP430 configuration directives for MSP-EXP430F5529
Platform-specific BSP430 configuration directives for MSP-EXP430F5529 USB LaunchPad ...
Platform-specific BSP430 configuration directives for MSP-EXP430FR5969 ("Wolverine LaunchPad") ...
Platform-specific BSP430 configuration directives for EM430
Platform-specific BSP430 configuration directives for MSP-EXP430FR5739 ("Fraunchpad") ...
Platform-specific BSP430 configuration directives for MSP-EXP430FG4618
Platform-specific BSP430 configuration directives for Wolverine.
Platform-specific BSP430 configuration directives for EZ430-RF2500T