BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
platform.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 
62 #ifndef BSP430_PLATFORM_H
63 #define BSP430_PLATFORM_H
64 
65 #include <msp430.h>
66 #include <bsp430/periph.h>
67 
73 
104 void vBSP430platformInitialize_ni (void);
105 
135 int iBSP430platformConfigurePeripheralPins_ni (tBSP430periphHandle periph, int periph_config, int enablep);
136 
148 #ifndef configBSP430_PLATFORM_SPIN_FOR_JUMPER
149 #define configBSP430_PLATFORM_SPIN_FOR_JUMPER 0
150 #endif /* configBSP430_PLATFORM_SPIN_FOR_JUMPER */
151 
171 #if defined(BSP430_DOXYGEN) || (configBSP430_PLATFORM_SPIN_FOR_JUMPER - 0)
173 #endif /* configBSP430_PLATFORM_SPIN_FOR_JUMPER */
174 
181 #ifndef configBSP430_PLATFORM_PERIPHERAL_HELP
182 #define configBSP430_PLATFORM_PERIPHERAL_HELP 0
183 #endif /* configBSP430_PLATFORM_PERIPHERAL_HELP */
184 
208 const char * xBSP430platformPeripheralHelp (tBSP430periphHandle periph, int periph_config);
209 
210 #ifndef configBSP430_PLATFORM_RF
211 
224 #define configBSP430_PLATFORM_RF 0
225 #endif /* configBSP430_PLATFORM_RF */
226 
237 #ifndef configBSP430_PLATFORM_BUTTON0
238 #define configBSP430_PLATFORM_BUTTON0 0
239 #endif /* configBSP430_PLATFORM_BUTTON0 */
240 
255 #if defined(BSP430_DOXYGEN)
256 #define BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE include <bsp430/platform.h>
257 #endif /* BSP430_DOXYGEN */
258 
273 #if defined(BSP430_DOXYGEN)
274 #define BSP430_PLATFORM_BUTTON0_PORT_BIT include <bsp430/platform.h>
275 #endif /* BSP430_DOXYGEN */
276 
288 #if defined(BSP430_DOXYGEN)
289 #define BSP430_PLATFORM_BUTTON0 include <bsp430/platform.h>
290 #endif /* configBSP430_PLATFORM_BUTTON0 */
291 
292 
293 /* !BSP430! tool=msp subst=tool instance=exp430f5438,exp430f5529,exp430f5529lp,exp430fr5739,exp430fr5969,exp430fr4133,exp430fg4618,exp430g2 */
294 /* !BSP430! insert=platform_decl */
295 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [platform_decl] */
310 #ifndef BSP430_PLATFORM_EXP430F5438
311 #define BSP430_PLATFORM_EXP430F5438 0
312 #endif /* BSP430_PLATFORM_EXP430F5438 */
313 
314 #if (BSP430_PLATFORM_EXP430F5438 - 0)
316 #endif /* BSP430_PLATFORM_EXP430F5438 */
317 
332 #ifndef BSP430_PLATFORM_EXP430F5529
333 #define BSP430_PLATFORM_EXP430F5529 0
334 #endif /* BSP430_PLATFORM_EXP430F5529 */
335 
336 #if (BSP430_PLATFORM_EXP430F5529 - 0)
338 #endif /* BSP430_PLATFORM_EXP430F5529 */
339 
354 #ifndef BSP430_PLATFORM_EXP430F5529LP
355 #define BSP430_PLATFORM_EXP430F5529LP 0
356 #endif /* BSP430_PLATFORM_EXP430F5529LP */
357 
358 #if (BSP430_PLATFORM_EXP430F5529LP - 0)
360 #endif /* BSP430_PLATFORM_EXP430F5529LP */
361 
376 #ifndef BSP430_PLATFORM_EXP430FR5739
377 #define BSP430_PLATFORM_EXP430FR5739 0
378 #endif /* BSP430_PLATFORM_EXP430FR5739 */
379 
380 #if (BSP430_PLATFORM_EXP430FR5739 - 0)
382 #endif /* BSP430_PLATFORM_EXP430FR5739 */
383 
398 #ifndef BSP430_PLATFORM_EXP430FR5969
399 #define BSP430_PLATFORM_EXP430FR5969 0
400 #endif /* BSP430_PLATFORM_EXP430FR5969 */
401 
402 #if (BSP430_PLATFORM_EXP430FR5969 - 0)
404 #endif /* BSP430_PLATFORM_EXP430FR5969 */
405 
420 #ifndef BSP430_PLATFORM_EXP430FR4133
421 #define BSP430_PLATFORM_EXP430FR4133 0
422 #endif /* BSP430_PLATFORM_EXP430FR4133 */
423 
424 #if (BSP430_PLATFORM_EXP430FR4133 - 0)
426 #endif /* BSP430_PLATFORM_EXP430FR4133 */
427 
442 #ifndef BSP430_PLATFORM_EXP430FG4618
443 #define BSP430_PLATFORM_EXP430FG4618 0
444 #endif /* BSP430_PLATFORM_EXP430FG4618 */
445 
446 #if (BSP430_PLATFORM_EXP430FG4618 - 0)
448 #endif /* BSP430_PLATFORM_EXP430FG4618 */
449 
464 #ifndef BSP430_PLATFORM_EXP430G2
465 #define BSP430_PLATFORM_EXP430G2 0
466 #endif /* BSP430_PLATFORM_EXP430G2 */
467 
468 #if (BSP430_PLATFORM_EXP430G2 - 0)
470 #endif /* BSP430_PLATFORM_EXP430G2 */
471 
472 /* END AUTOMATICALLY GENERATED CODE [platform_decl] */
473 /* !BSP430! end=platform_decl */
474 /* !BSP430! tool=ez430 subst=tool instance=rf2500t */
475 /* !BSP430! insert=platform_decl */
476 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [platform_decl] */
491 #ifndef BSP430_PLATFORM_RF2500T
492 #define BSP430_PLATFORM_RF2500T 0
493 #endif /* BSP430_PLATFORM_RF2500T */
494 
495 #if (BSP430_PLATFORM_RF2500T - 0)
497 #endif /* BSP430_PLATFORM_RF2500T */
498 
499 /* END AUTOMATICALLY GENERATED CODE [platform_decl] */
500 /* !BSP430! end=platform_decl */
501 /* !BSP430! url=http://www.ti.com/tool/em430f5137rf900 subst=url instance=em430 */
502 /* !BSP430! insert=platform_decl_url */
503 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [platform_decl_url] */
518 #ifndef BSP430_PLATFORM_EM430
519 #define BSP430_PLATFORM_EM430 0
520 #endif /* BSP430_PLATFORM_EM430 */
521 
522 #if (BSP430_PLATFORM_EM430 - 0)
524 #endif /* BSP430_PLATFORM_EM430 */
525 
526 /* END AUTOMATICALLY GENERATED CODE [platform_decl_url] */
527 /* !BSP430! end=platform_decl_url */
528 /* !BSP430! url=http://en.wikipedia.org/wiki/HTTP_404 subst=url instance=surf */
529 /* !BSP430! insert=platform_decl_url */
530 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [platform_decl_url] */
545 #ifndef BSP430_PLATFORM_SURF
546 #define BSP430_PLATFORM_SURF 0
547 #endif /* BSP430_PLATFORM_SURF */
548 
549 #if (BSP430_PLATFORM_SURF - 0)
551 #endif /* BSP430_PLATFORM_SURF */
552 
553 /* END AUTOMATICALLY GENERATED CODE [platform_decl_url] */
554 /* !BSP430! end=platform_decl_url */
555 /* !BSP430! url=http://www.ti.com/tool/cc1125dk subst=url instance=trxeb */
556 /* !BSP430! insert=platform_decl_url */
557 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [platform_decl_url] */
572 #ifndef BSP430_PLATFORM_TRXEB
573 #define BSP430_PLATFORM_TRXEB 0
574 #endif /* BSP430_PLATFORM_TRXEB */
575 
576 #if (BSP430_PLATFORM_TRXEB - 0)
578 #endif /* BSP430_PLATFORM_TRXEB */
579 
580 /* END AUTOMATICALLY GENERATED CODE [platform_decl_url] */
581 /* !BSP430! end=platform_decl_url */
582 /* !BSP430! url=http://www.ti.com/tool/msp-fet430u48c subst=url instance=wolverine */
583 /* !BSP430! insert=platform_decl_url */
584 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [platform_decl_url] */
599 #ifndef BSP430_PLATFORM_WOLVERINE
600 #define BSP430_PLATFORM_WOLVERINE 0
601 #endif /* BSP430_PLATFORM_WOLVERINE */
602 
603 #if (BSP430_PLATFORM_WOLVERINE - 0)
605 #endif /* BSP430_PLATFORM_WOLVERINE */
606 
607 /* END AUTOMATICALLY GENERATED CODE [platform_decl_url] */
608 /* !BSP430! end=platform_decl_url */
609 
633 #ifndef BSP430_PLATFORM_CUSTOM
634 #define BSP430_PLATFORM_CUSTOM 0
635 #endif /* BSP430_PLATFORM_CUSTOM */
636 
637 #if (BSP430_PLATFORM_CUSTOM - 0)
638 #include <bsp430/platform/custom/platform.h>
639 #endif /* BSP430_PLATFORM_CUSTOM */
640 
641 /* If configBSP430_TIMER_CCACLK was requested, then mark the feature as
642  * available or not based on whether the platform provided a serial
643  * peripheral for the console's use. */
644 #if (configBSP430_TIMER_CCACLK - 0)
645 #if BSP430_PERIPH_CPPID_NONE != BSP430_TIMER_CCACLK_PERIPH_CPPID
646 #define BSP430_TIMER_CCACLK 1
647 #else /* BSP430_TIMER_CCACLK_PERIPH_CPPID */
648 #define BSP430_TIMER_CCACLK 0
649 #endif /* BSP430_TIMER_CCACLK_PERIPH_CPPID */
650 #endif /* configBSP430_TIMER_CCACLK */
651 
652 /* If configBSP430_UCS_TRIM_DCOCLKDIV was requested and the platform
653  * supports BSP430_TIMER_CCACLK, then mark the feature as
654  * available. */
655 #if (configBSP430_UCS_TRIM_DCOCLKDIV - 0)
656 #if (BSP430_TIMER_CCACLK - 0)
657 #define BSP430_UCS_TRIM_DCOCLKDIV 1
658 #else /* BSP430_TIMER_CCACLK */
659 #define BSP430_UCS_TRIM_DCOCLKDIV 0
660 #endif /* BSP430_TIMER_CCACLK */
661 #endif /* configBSP430_UCS_TRIM_DCOCLKDIV */
662 
663 /* If configBSP430_BC2_TRIM_TO_MCLK was requested and the platform
664  * supports BSP430_TIMER_CCACLK, then mark the feature as
665  * available. */
666 #if (configBSP430_BC2_TRIM_TO_MCLK - 0)
667 #if (BSP430_TIMER_CCACLK - 0)
668 #define BSP430_BC2_TRIM_TO_MCLK 1
669 #else /* BSP430_TIMER_CCACLK */
670 #define BSP430_BC2_TRIM_TO_MCLK 0
671 #endif /* BSP430_TIMER_CCACLK */
672 #endif /* configBSP430_BC2_TRIM_TO_MCLK */
673 
674 /* If configBSP430_CONSOLE was requested, then mark the feature as
675  * available or not based on whether the platform provided a serial
676  * peripheral for the console's use. */
677 #if (configBSP430_CONSOLE - 0)
678 #if BSP430_PERIPH_CPPID_NONE != BSP430_CONSOLE_SERIAL_PERIPH_CPPID
679 #define BSP430_CONSOLE 1
680 #else /* BSP430_CONSOLE_SERIAL_PERIPH_CPPID */
681 #define BSP430_CONSOLE 0
682 #endif /* BSP430_CONSOLE_SERIAL_PERIPH_CPPID */
683 #endif /* configBSP430_CONSOLE */
684 
685 /* If configBSP430_UPTIME was requested, then mark the feature as
686  * available or not based on whether the platform provided a timer for
687  * its use. */
688 #if (configBSP430_UPTIME - 0) && !defined(BSP430_UPTIME)
689 #if BSP430_PERIPH_CPPID_NONE != BSP430_UPTIME_TIMER_PERIPH_CPPID
690 #define BSP430_UPTIME 1
691 #else /* BSP430_UPTIME_TIMER_PERIPH_CPPID */
692 #define BSP430_UPTIME 0
693 #endif /* BSP430_UPTIME_TIMER_PERIPH_CPPID */
694 #endif /* configBSP430_UPTIME */
695 
696 /* If configBSP430_PLATFORM_BUTTON0 was requested, then mark the
697  * feature as available or not based on whether the platform provided
698  * a peripheral handle for the button's use.
699  *
700  * NOTE: This file is responsible only for processing button 0.
701  * Additional buttons must be handled in the platform-specific
702  * header. */
703 #if (configBSP430_PLATFORM_BUTTON0 - 0)
704 #ifdef BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE
705 #define BSP430_PLATFORM_BUTTON0 1
706 #else /* BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE */
707 #define BSP430_PLATFORM_BUTTON0 0
708 #endif /* BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE */
709 #endif /* configBSP430_PLATFORM_BUTTON0 */
710 
711 /* If configBSP430_PLATFORM_M25P was requested, then mark the feature
712  * as available or not based on whether the platform provided a
713  * peripheral handle to use to access the device. */
714 #if (configBSP430_PLATFORM_M25P - 0)
715 #ifdef BSP430_PLATFORM_M25P_SPI_PERIPH_HANDLE
716 #define BSP430_PLATFORM_M25P 1
717 #else /* BSP430_PLATFORM_M25P_SPI_PERIPH_HANDLE */
718 #define BSP430_PLATFORM_M25P 0
719 #endif /* BSP430_PLATFORM_M25P_SPI_PERIPH_HANDLE */
720 #endif /* configBSP430_PLATFORM_M25P */
721 
722 /* Set other M25P defaults */
723 #if (BSP430_PLATFORM_M25P - 0)
724 #endif /* BSP430_PLATFORM_M25P */
725 
726 /* If configBSP430_PLATFORM_BOOSTERPACK_SHARP96 was requested, then
727  * mark the feature as available or not based on whether the platform
728  * provided a peripheral handle to use to access the device. Default
729  * the screen size to the boosterpack, but accept existing
730  * overrides. */
731 #if (configBSP430_PLATFORM_BOOSTERPACK_SHARP96 - 0)
732 #ifdef BSP430_PLATFORM_SHARPLCD_SPI_PERIPH_HANDLE
733 #define BSP430_PLATFORM_BOOSTERPACK_SHARP96 1
734 #define BSP430_PLATFORM_SHARPLCD 1
735 #ifndef BSP430_PLATFORM_SHARPLCD_ROWS
736 #define BSP430_PLATFORM_SHARPLCD_ROWS 96
737 #endif /* BSP430_PLATFORM_SHARPLCD_ROWS */
738 #ifndef BSP430_PLATFORM_SHARPLCD_COLUMNS
739 #define BSP430_PLATFORM_SHARPLCD_COLUMNS 96
740 #endif /* BSP430_PLATFORM_SHARPLCD_COLUMNS */
741 #else /* BSP430_PLATFORM_SHARPLCD_SPI_PERIPH_HANDLE */
742 #define BSP430_PLATFORM_SHARPLCD 0
743 #endif /* BSP430_PLATFORM_SHARPLCD_SPI_PERIPH_HANDLE */
744 #endif /* configBSP430_PLATFORM_BOOSTERPACK_SHARP96 */
745 
746 #if (BSP430_PLATFORM_SHARPLCD - 0)
747 #ifndef BSP430_UTILITY_U8GLIB
748 /* Enable U8GLIB if requested */
749 #define BSP430_UTILITY_U8GLIB (configBSP430_UTILITY_U8GLIB - 0)
750 #endif /* BSP430_UTILITY_U8GLIB */
751 #endif /* BSP430_PLATFORM_SHARPLCD */
752 
760 #if defined(BSP430_DOXYGEN) || defined(configBSP430_PLATFORM_SPIN_FOR_JUMPER)
761 #ifndef BSP430_PLATFORM_SPIN_FOR_JUMPER
762 #define BSP430_PLATFORM_SPIN_FOR_JUMPER 0 /* False unless platform explicitly enabled it */
763 #endif /* BSP430_PLATFORM_SPIN_FOR_JUMPER */
764 #endif /* BSP430_DOXYGEN */
765 
774 #if defined(BSP430_DOXYGEN) || defined(configBSP430_PLATFORM_PERIPHERAL_HELP)
775 #ifndef BSP430_PLATFORM_PERIPHERAL_HELP
776 #define BSP430_PLATFORM_PERIPHERAL_HELP 1 /* True unless platform explicitly disabled it */
777 #endif /* BSP430_PLATFORM_PERIPHERAL_HELP */
778 #endif /* BSP430_DOXYGEN */
779 
794 #ifndef BSP430_PLATFORM_BOOT_DISABLE_WATCHDOG
795 #define BSP430_PLATFORM_BOOT_DISABLE_WATCHDOG (! (configBSP430_CORE_SUPPORT_WATCHDOG - 0))
796 #endif /* BSP430_PLATFORM_BOOT_DISABLE_WATCHDOG */
797 
806 #ifndef BSP430_PLATFORM_BOOT_CONFIGURE_LEDS
807 #if defined(BSP430_PLATFORM_BOOT_CONFIGURE_LED)
808 #warning BSP430_PLATFORM_BOOT_CONFIGURE_LEDS is not spelled BSP430_PLATFORM_BOOT_CONFIGURE_LED
809 #endif /* BSP430_PLATFORM_BOOT_CONFIGURE_LED */
810 #define BSP430_PLATFORM_BOOT_CONFIGURE_LEDS 1
811 #endif /* BSP430_PLATFORM_BOOT_CONFIGURE_LEDS */
812 
823 #ifndef BSP430_PLATFORM_BOOT_CONFIGURE_CLOCKS
824 #define BSP430_PLATFORM_BOOT_CONFIGURE_CLOCKS 1
825 #endif /* BSP430_PLATFORM_BOOT_CONFIGURE_CLOCKS */
826 
855 #ifndef BSP430_PLATFORM_BOOT_CONFIGURE_LFXT1
856 #define BSP430_PLATFORM_BOOT_CONFIGURE_LFXT1 0
857 #endif /* BSP430_PLATFORM_BOOT_CONFIGURE_LFXT1 */
858 
868 #ifndef BSP430_PLATFORM_BOOT_CONFIGURE_XT2
869 #define BSP430_PLATFORM_BOOT_CONFIGURE_XT2 0
870 #endif /* BSP430_PLATFORM_BOOT_CONFIGURE_XT2 */
871 
882 #ifndef BSP430_PLATFORM_BOOT_LFXT1_DELAY_SEC
883 #define BSP430_PLATFORM_BOOT_LFXT1_DELAY_SEC 1
884 #endif /* BSP430_PLATFORM_BOOT_LFXT1_DELAY_SEC */
885 
905 #ifndef BSP430_PLATFORM_BOOT_ACLK_SOURCE
906 #define BSP430_PLATFORM_BOOT_ACLK_SOURCE eBSP430clockSRC_XT1CLK_FALLBACK
907 #endif /* BSP430_PLATFORM_BOOT_ACLK_SOURCE */
908 
921 #ifndef BSP430_PLATFORM_BOOT_ACLK_DIVIDING_SHIFT
922 #define BSP430_PLATFORM_BOOT_ACLK_DIVIDING_SHIFT 0
923 #endif /* BSP430_PLATFORM_BOOT_ACLK_DIVIDING_SHIFT */
924 
934 #ifndef BSP430_PLATFORM_BOOT_SMCLK_SOURCE
935 #define BSP430_PLATFORM_BOOT_SMCLK_SOURCE eBSP430clockSRC_SMCLK_PU_DEFAULT
936 #endif /* BSP430_PLATFORM_BOOT_SMCLK_SOURCE */
937 
950 #ifndef BSP430_PLATFORM_BOOT_SMCLK_DIVIDING_SHIFT
951 #define BSP430_PLATFORM_BOOT_SMCLK_DIVIDING_SHIFT 0
952 #endif /* BSP430_PLATFORM_BOOT_SMCLK_DIVIDING_SHIFT */
953 
954 #if (BSP430_RFEM - 0)
955 /* If using the RFEM feature, incorporate the header that maps RFEM
956  * constants to specific EMK functions. */
957 #include <bsp430/rf/emk_platform.h>
958 #endif /* BSP430_RFEM */
959 
960 #endif /* BSP430_PLATFORM_H */
Stripped header supporting Doxygen links.
void vBSP430platformSpinForJumper_ni(void)
Platform-specific include for SuRF board.
Platform-specific BSP430 configuration directives for MSP-EXP430F5529 USB LaunchPad ...
Entrypoint for platform-specific capabilities.
Platform-specific include for MSP-EXP430F5438
const char * xBSP430platformPeripheralHelp(tBSP430periphHandle periph, int periph_config)
Platform-specific include for MSP430FR5969 in a TS430RGZ48C carrier.
Platform-specific include for MSP-EXP430FR4133
void vBSP430platformInitialize_ni(void)
Platform-specific include for MSP-EXP430FR5969 ("Wolverine LaunchPad")
Platform-specific include for MSP-EXP430F5529
Generic peripheral support for MSP430 MCUs.
Platform-specific include for EZ430-RF2500T
Platform-specific include for MSP-EXP430FR5739 ("Fraunchpad")
Platform-specific include for EM430
Platform-specific include for MSP-TRXEB
Platform-specific include for MSP-EXP430FG4618
int tBSP430periphHandle
Definition: periph.h:106
int iBSP430platformConfigurePeripheralPins_ni(tBSP430periphHandle periph, int periph_config, int enablep)
Platform-specific include for MSP-EXP430G2 ("LaunchPad")