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_EXP430F5529LP_PLATFORM_H
33 #define BSP430_PLATFORM_EXP430F5529LP_PLATFORM_H
34 
60 #define BSP430_PLATFORM_EXP430F5529LP 1
61 
63 #define BSP430_CLOCK_NOMINAL_XT2CLK_HZ 4000000UL
64 
67 /* Available button definitions */
68 #define BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
69 #define BSP430_PLATFORM_BUTTON0_PORT_BIT BIT1
70 #define BSP430_PLATFORM_BUTTON1_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
71 #define BSP430_PLATFORM_BUTTON1_PORT_BIT BIT1
72 
73 /* Standard LED colors */
74 #define BSP430_LED_RED 0
75 #define BSP430_LED_GREEN 1
76 
77 /* Select core voltage: MSP430F5529 8/12/20/25 */
78 #define BSP430_PMM_COREV_FOR_MCLK(mclk_) \
79  ((20000000UL < (mclk_)) ? PMMCOREV_3 : \
80  ((12000000UL < (mclk_)) ? PMMCOREV_2 : \
81  (((8000000UL < (mclk_)) ? PMMCOREV_1 : \
82  PMMCOREV_0))))
83 
84 /* How to use ACLK as a capture/compare input source */
85 /* Settings for TA2: T2A2 ccis=1 ; clk P2.2 ; cc0 P2.3 ; cc1 P2.4 */
86 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIDX
87 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
88 #define BSP430_TIMER_CCACLK_ACLK_CCIDX 2
89 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIDX */
90 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIS
91 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
92 #define BSP430_TIMER_CCACLK_ACLK_CCIS CCIS_1
93 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIS */
94 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_BIT
95 /* NB: Check against BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID in bsp430_config.h */
96 #define BSP430_TIMER_CCACLK_CLK_PORT_BIT BIT2
97 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_BIT */
98 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_BIT
99 /* NB: Check against BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID in bsp430_config.h */
100 #define BSP430_TIMER_CCACLK_CC0_PORT_BIT BIT3
101 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_BIT */
102 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_BIT
103 /* NB: Check against BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID in bsp430_config.h */
104 #define BSP430_TIMER_CCACLK_CC1_PORT_BIT BIT4
105 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_BIT */
106 
107 /* !BSP430! insert=emk_platform boosterpack=cc3000boost platform=exp430f5529lp mcu=msp430f5529 spi=UCB0SOMI tag=cc3000 hal=CSn gpio=IRQn */
108 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [emk_platform] */
109 #if (configBSP430_RF_CC3000BOOST - 0)
110 #define BSP430_RF_CC3000 1
111 #define BSP430_RF_CC3000_SPI_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
112 #define BSP430_RF_CC3000_PWR_EN_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT6
113 #define BSP430_RF_CC3000_PWR_EN_PORT_BIT BIT5
114 #define BSP430_RF_CC3000_SCLK_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
115 #define BSP430_RF_CC3000_SCLK_PORT_BIT BIT2
116 #define BSP430_RF_CC3000_IRQn_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
117 #define BSP430_RF_CC3000_IRQn_PORT_BIT BIT0
118 #define BSP430_RF_CC3000_IRQn_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
119 #define BSP430_RF_CC3000_IRQn_TIMER_CCIDX 1
120 #define BSP430_RF_CC3000_IRQn_TIMER_CCIS CCIS_0
121 #define BSP430_RF_CC3000_CSn_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
122 #define BSP430_RF_CC3000_CSn_PORT_BIT BIT2
123 #define BSP430_RF_CC3000_MOSI_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
124 #define BSP430_RF_CC3000_MOSI_PORT_BIT BIT0
125 #define BSP430_RF_CC3000_MISO_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
126 #define BSP430_RF_CC3000_MISO_PORT_BIT BIT1
127 #endif /* configBSP430_RF_CC3000BOOST */
128 /* END AUTOMATICALLY GENERATED CODE [emk_platform] */
129 /* !BSP430! end=emk_platform */
130 
131 /* !BSP430! insert=emk_platform boosterpack=anaren_cc110l platform=exp430f5529lp mcu=msp430f5529 spi=UCB0SOMI tag=cc110x hal=CSn gpio=GDO0,GDO1,GDO2 */
132 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [emk_platform] */
133 #if (configBSP430_RF_ANAREN_CC110L - 0)
134 #define BSP430_RF_CC110X 1
135 #define BSP430_RF_CC110X_SPI_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
136 #define BSP430_RF_CC110X_GDO2_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT6
137 #define BSP430_RF_CC110X_GDO2_PORT_BIT BIT5
138 #define BSP430_RF_CC110X_GDO0_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
139 #define BSP430_RF_CC110X_GDO0_PORT_BIT BIT0
140 #define BSP430_RF_CC110X_GDO0_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
141 #define BSP430_RF_CC110X_GDO0_TIMER_CCIDX 1
142 #define BSP430_RF_CC110X_GDO0_TIMER_CCIS CCIS_0
143 #define BSP430_RF_CC110X_CSn_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
144 #define BSP430_RF_CC110X_CSn_PORT_BIT BIT2
145 #define BSP430_RF_CC110X_GDO1_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
146 #define BSP430_RF_CC110X_GDO1_PORT_BIT BIT1
147 #endif /* configBSP430_RF_ANAREN_CC110L */
148 /* END AUTOMATICALLY GENERATED CODE [emk_platform] */
149 /* !BSP430! end=emk_platform */
150 
151 /* !BSP430! insert=rfem_platform boosterpack=ccem platform=exp430f5529lp mcu=msp430f5529 */
152 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [rfem_platform] */
153 #if (configBSP430_RFEM_CCEM - 0)
154 #define BSP430_RFEM_CCEM 1
155 #define BSP430_RFEM 1
156 #endif /* configBSP430_RFEM_CCEM */
157 #if (BSP430_RFEM_CCEM - 0)
158 #define BSP430_RFEM_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
159 #define BSP430_RFEM_RF1P3_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
160 #define BSP430_RFEM_RF1P3_PORT_BIT BIT3
161 #define BSP430_RFEM_RF1P3_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA2
162 #define BSP430_RFEM_RF1P3_TIMER_CCIDX 0
163 #define BSP430_RFEM_RF1P3_TIMER_CCIS CCIS_0
164 #define BSP430_RFEM_RF1P7_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
165 #define BSP430_RFEM_RF1P7_PORT_BIT BIT3
166 #define BSP430_RFEM_RF1P9_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
167 #define BSP430_RFEM_RF1P9_PORT_BIT BIT4
168 #define BSP430_RFEM_RF1P10_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
169 #define BSP430_RFEM_RF1P10_PORT_BIT BIT0
170 #define BSP430_RFEM_RF1P10_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
171 #define BSP430_RFEM_RF1P10_TIMER_CCIDX 1
172 #define BSP430_RFEM_RF1P10_TIMER_CCIS CCIS_0
173 #define BSP430_RFEM_RF1P12_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT6
174 #define BSP430_RFEM_RF1P12_PORT_BIT BIT5
175 #define BSP430_RFEM_RF1P14_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
176 #define BSP430_RFEM_RF1P14_PORT_BIT BIT2
177 #define BSP430_RFEM_RF1P16_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
178 #define BSP430_RFEM_RF1P16_PORT_BIT BIT2
179 #define BSP430_RFEM_RF1P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
180 #define BSP430_RFEM_RF1P18_PORT_BIT BIT0
181 #define BSP430_RFEM_RF1P20_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
182 #define BSP430_RFEM_RF1P20_PORT_BIT BIT1
183 #define BSP430_RFEM_RF2P15_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
184 #define BSP430_RFEM_RF2P15_PORT_BIT BIT6
185 #define BSP430_RFEM_RF2P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT8
186 #define BSP430_RFEM_RF2P18_PORT_BIT BIT1
187 #define BSP430_RFEM_RF2P19_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
188 #define BSP430_RFEM_RF2P19_PORT_BIT BIT1
189 #endif /* BSP430_RFEM_CCEM */
190 /* END AUTOMATICALLY GENERATED CODE [rfem_platform] */
191 /* !BSP430! end=rfem_platform */
192 
193 #if (configBSP430_PLATFORM_BOOSTERPACK_SHARP96 - 0)
194 /* CS on P6.6, LCD_EN on P1.6, PWR_en on P6.5, SPI on USCI5_B0 */
195 #define BSP430_PLATFORM_SHARPLCD_CS_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT6
196 #define BSP430_PLATFORM_SHARPLCD_CS_PORT_BIT BIT6
197 #define BSP430_PLATFORM_SHARPLCD_LCD_EN_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
198 #define BSP430_PLATFORM_SHARPLCD_LCD_EN_PORT_BIT BIT6
199 #define BSP430_PLATFORM_SHARPLCD_PWR_EN_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT6
200 #define BSP430_PLATFORM_SHARPLCD_PWR_EN_PORT_BIT BIT5
201 #define BSP430_PLATFORM_SHARPLCD_SPI_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
202 #endif /* configBSP430_PLATFORM_BOOSTERPACK_SHARP96 */
203 
206 /* Include generic file, in case this is being included directly */
207 #include <bsp430/platform.h>
208 
209 #endif /* BSP430_PLATFORM_EXP430F5529LP_H */
Entrypoint for platform-specific capabilities.