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 
32 #ifndef BSP430_PLATFORM_EM430_PLATFORM_H
33 #define BSP430_PLATFORM_EM430_PLATFORM_H
34 
57 #define BSP430_PLATFORM_EM430 1
58 
60 #define BSP430_CLOCK_NOMINAL_XT2CLK_HZ 26000000UL
61 
64 /* Available button definitions. SW2 is available and is on P1.7 */
65 #define BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
66 #define BSP430_PLATFORM_BUTTON0_PORT_BIT BIT7
67 
68 /* Standard LED colors */
69 #define BSP430_LED_GREEN 0
70 #define BSP430_LED_RED 1
71 
72 /* Select core voltage: CC430F5137 8=12/25 */
73 #define BSP430_PMM_COREV_FOR_MCLK(mclk_) \
74  ((12000000UL < (mclk_)) ? PMMCOREV_2 : \
75  PMMCOREV_0)
76 
77 /* How to use ACLK as a capture/compare input source */
78 /* Settings for TA1: T1A2 ccis=1 ; clk P2.0 ; cc0 P2.1 ; cc1 P2.2 */
79 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIDX
80 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
81 #define BSP430_TIMER_CCACLK_ACLK_CCIDX 2
82 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIDX */
83 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIS
84 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
85 #define BSP430_TIMER_CCACLK_ACLK_CCIS CCIS_1
86 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIS */
87 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_BIT
88 /* NB: Check against BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID in bsp430_config.h */
89 #define BSP430_TIMER_CCACLK_CLK_PORT_BIT BIT0
90 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_BIT */
91 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_BIT
92 /* NB: Check against BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID in bsp430_config.h */
93 #define BSP430_TIMER_CCACLK_CC0_PORT_BIT BIT1
94 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_BIT */
95 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_BIT
96 /* NB: Check against BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID in bsp430_config.h */
97 #define BSP430_TIMER_CCACLK_CC1_PORT_BIT BIT2
98 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_BIT */
99 
102 /* Include generic file, in case this is being included directly */
103 #include <bsp430/platform.h>
104 
105 #endif /* BSP430_PLATFORM_EM430_H */
Entrypoint for platform-specific capabilities.