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_EXP430F5529_PLATFORM_H
33 #define BSP430_PLATFORM_EXP430F5529_PLATFORM_H
34 
60 #define BSP430_PLATFORM_EXP430F5529 1
61 
63 #define BSP430_CLOCK_NOMINAL_XT2CLK_HZ 4000000UL
64 
76 #ifndef configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK
77 #define configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK 0
78 #endif /* configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK */
79 
82 /* Enable if requested (ez430 serial needs it) */
83 #if (configBSP430_PLATFORM_SPIN_FOR_JUMPER - 0)
84 #define BSP430_PLATFORM_SPIN_FOR_JUMPER 1
85 #endif /* configBSP430_PLATFORM_SPIN_FOR_JUMPER */
86 
87 /* Available button definitions */
88 #define BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
89 #define BSP430_PLATFORM_BUTTON0_PORT_BIT BIT7
90 #define BSP430_PLATFORM_BUTTON1_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
91 #define BSP430_PLATFORM_BUTTON1_PORT_BIT BIT2
92 
93 /* Standard LED colors */
94 #define BSP430_LED_RED 0
95 #define BSP430_LED_ORANGE 1
96 #define BSP430_LED_GREEN 2
97 #define BSP430_LED_BLUE 3
98 #define BSP430_LED_BLUE1 4
99 #define BSP430_LED_BLUE2 5
100 #define BSP430_LED_BLUE3 6
101 #define BSP430_LED_BLUE4 7
102 
103 /* Select core voltage: MSP430F5529 8/12/20/25 */
104 #define BSP430_PMM_COREV_FOR_MCLK(mclk_) \
105  ((20000000UL < (mclk_)) ? PMMCOREV_3 : \
106  ((12000000UL < (mclk_)) ? PMMCOREV_2 : \
107  (((8000000UL < (mclk_)) ? PMMCOREV_1 : \
108  PMMCOREV_0))))
109 
110 /* How to use ACLK as a capture/compare input source. This board does
111  * a very poor job of making signals accessible. No timer has all of
112  * CLK, CC0, and CC1 on header pins.
113  *
114  * With CLK: Settings for TB0: T0B6 ccis=1 ; clk P7.7 ; cc0 P5.6 ; cc1 P5.7 -- CC0/CC1 PINS NOT ACCESSIBLE
115  *
116  * Without CLK: Settings for TA2: T2A2 ccis=1 ; clk P2.2 ; cc0 P2.3 ; cc1 P2.4 -- CLK PIN NOT ACCESSIBLE
117  */
118 
119 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIDX
120 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
121 #if (configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK - 0)
122 #define BSP430_TIMER_CCACLK_ACLK_CCIDX 6
123 #else /* configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK */
124 #define BSP430_TIMER_CCACLK_ACLK_CCIDX 2
125 #endif /* configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK */
126 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIDX */
127 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIS
128 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
129 #define BSP430_TIMER_CCACLK_ACLK_CCIS CCIS_1
130 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIS */
131 
132 #if (configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK - 0)
133 /* Option preferring CLK */
134 
135 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_BIT
136 /* NB: Check against BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID in bsp430_config.h */
137 #define BSP430_TIMER_CCACLK_CLK_PORT_BIT BIT7
138 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_BIT */
139 
140 #else /* configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK */
141 /* Option preferring CC0/CC1 */
142 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_BIT
143 /* NB: Check against BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID in bsp430_config.h */
144 #define BSP430_TIMER_CCACLK_CC0_PORT_BIT BIT3
145 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_BIT */
146 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_BIT
147 /* NB: Check against BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID in bsp430_config.h */
148 #define BSP430_TIMER_CCACLK_CC1_PORT_BIT BIT4
149 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_BIT */
150 
151 #endif /* configBSP430_PLATFORM_EXP430F5529_CCACLK_NEED_CLK */
152 
153 /* !BSP430! insert=rfem_platform platform=exp430f5529 mcu=msp430f5529 */
154 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [rfem_platform] */
155 #if (configBSP430_RFEM - 0)
156 #define BSP430_RFEM 1
157 #endif /* configBSP430_RFEM */
158 #if (BSP430_RFEM - 0)
159 #define BSP430_RFEM_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
160 #define BSP430_RFEM_RF1P3_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
161 #define BSP430_RFEM_RF1P3_PORT_BIT BIT1
162 #define BSP430_RFEM_RF1P3_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
163 #define BSP430_RFEM_RF1P3_TIMER_CCIDX 2
164 #define BSP430_RFEM_RF1P3_TIMER_CCIS CCIS_0
165 #define BSP430_RFEM_RF1P5_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
166 #define BSP430_RFEM_RF1P5_PORT_BIT BIT0
167 #define BSP430_RFEM_RF1P5_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
168 #define BSP430_RFEM_RF1P5_TIMER_CCIDX 1
169 #define BSP430_RFEM_RF1P5_TIMER_CCIS CCIS_0
170 #define BSP430_RFEM_RF1P6_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
171 #define BSP430_RFEM_RF1P6_PORT_BIT BIT0
172 #define BSP430_RFEM_RF1P7_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
173 #define BSP430_RFEM_RF1P7_PORT_BIT BIT0
174 #define BSP430_RFEM_RF1P8_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
175 #define BSP430_RFEM_RF1P8_PORT_BIT BIT6
176 #define BSP430_RFEM_RF1P9_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
177 #define BSP430_RFEM_RF1P9_PORT_BIT BIT6
178 #define BSP430_RFEM_RF1P10_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
179 #define BSP430_RFEM_RF1P10_PORT_BIT BIT3
180 #define BSP430_RFEM_RF1P10_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA2
181 #define BSP430_RFEM_RF1P10_TIMER_CCIDX 0
182 #define BSP430_RFEM_RF1P10_TIMER_CCIS CCIS_0
183 #define BSP430_RFEM_RF1P12_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
184 #define BSP430_RFEM_RF1P12_PORT_BIT BIT4
185 #define BSP430_RFEM_RF1P12_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA2
186 #define BSP430_RFEM_RF1P12_TIMER_CCIDX 1
187 #define BSP430_RFEM_RF1P12_TIMER_CCIS CCIS_0
188 #define BSP430_RFEM_RF1P14_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
189 #define BSP430_RFEM_RF1P14_PORT_BIT BIT6
190 #define BSP430_RFEM_RF1P16_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
191 #define BSP430_RFEM_RF1P16_PORT_BIT BIT2
192 #define BSP430_RFEM_RF1P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
193 #define BSP430_RFEM_RF1P18_PORT_BIT BIT0
194 #define BSP430_RFEM_RF1P20_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
195 #define BSP430_RFEM_RF1P20_PORT_BIT BIT1
196 #define BSP430_RFEM_RF2P13_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
197 #define BSP430_RFEM_RF2P13_PORT_BIT BIT0
198 #define BSP430_RFEM_RF2P15_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
199 #define BSP430_RFEM_RF2P15_PORT_BIT BIT0
200 #define BSP430_RFEM_RF2P15_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
201 #define BSP430_RFEM_RF2P15_TIMER_CCIDX 1
202 #define BSP430_RFEM_RF2P15_TIMER_CCIS CCIS_0
203 #define BSP430_RFEM_RF2P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
204 #define BSP430_RFEM_RF2P18_PORT_BIT BIT7
205 #define BSP430_RFEM_RF2P19_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT7
206 #define BSP430_RFEM_RF2P19_PORT_BIT BIT5
207 #define BSP430_RFEM_RF2P19_TIMER_PERIPH_HANDLE BSP430_PERIPH_TB0
208 #define BSP430_RFEM_RF2P19_TIMER_CCIDX 3
209 #define BSP430_RFEM_RF2P19_TIMER_CCIS CCIS_0
210 #define BSP430_RFEM_RF2P20_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT6
211 #define BSP430_RFEM_RF2P20_PORT_BIT BIT6
212 #define BSP430_RFEM_RF3P3_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
213 #define BSP430_RFEM_RF3P3_PORT_BIT BIT0
214 #define BSP430_RFEM_RF3P4_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
215 #define BSP430_RFEM_RF3P4_PORT_BIT BIT0
216 #define BSP430_RFEM_RF3P4_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
217 #define BSP430_RFEM_RF3P4_TIMER_CCIDX 1
218 #define BSP430_RFEM_RF3P4_TIMER_CCIS CCIS_0
219 #define BSP430_RFEM_RF3P5_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
220 #define BSP430_RFEM_RF3P5_PORT_BIT BIT4
221 #define BSP430_RFEM_RF3P6_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
222 #define BSP430_RFEM_RF3P6_PORT_BIT BIT0
223 #define BSP430_RFEM_RF3P7_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
224 #define BSP430_RFEM_RF3P7_PORT_BIT BIT5
225 #define BSP430_RFEM_RF3P8_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
226 #define BSP430_RFEM_RF3P8_PORT_BIT BIT6
227 #define BSP430_RFEM_RF3P9_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT4
228 #define BSP430_RFEM_RF3P9_PORT_BIT BIT7
229 #define BSP430_RFEM_RF3P10_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
230 #define BSP430_RFEM_RF3P10_PORT_BIT BIT4
231 #define BSP430_RFEM_RF3P10_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA2
232 #define BSP430_RFEM_RF3P10_TIMER_CCIDX 1
233 #define BSP430_RFEM_RF3P10_TIMER_CCIS CCIS_0
234 #define BSP430_RFEM_RF3P11_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT7
235 #define BSP430_RFEM_RF3P11_PORT_BIT BIT5
236 #define BSP430_RFEM_RF3P11_TIMER_PERIPH_HANDLE BSP430_PERIPH_TB0
237 #define BSP430_RFEM_RF3P11_TIMER_CCIDX 3
238 #define BSP430_RFEM_RF3P11_TIMER_CCIS CCIS_0
239 #define BSP430_RFEM_RF3P13_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
240 #define BSP430_RFEM_RF3P13_PORT_BIT BIT3
241 #define BSP430_RFEM_RF3P13_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA2
242 #define BSP430_RFEM_RF3P13_TIMER_CCIDX 0
243 #define BSP430_RFEM_RF3P13_TIMER_CCIS CCIS_0
244 #define BSP430_RFEM_RF3P14_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
245 #define BSP430_RFEM_RF3P14_PORT_BIT BIT1
246 #define BSP430_RFEM_RF3P14_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA1
247 #define BSP430_RFEM_RF3P14_TIMER_CCIDX 2
248 #define BSP430_RFEM_RF3P14_TIMER_CCIS CCIS_0
249 #define BSP430_RFEM_RF3P15_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
250 #define BSP430_RFEM_RF3P15_PORT_BIT BIT2
251 #define BSP430_RFEM_RF3P16_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
252 #define BSP430_RFEM_RF3P16_PORT_BIT BIT2
253 #define BSP430_RFEM_RF3P17_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
254 #define BSP430_RFEM_RF3P17_PORT_BIT BIT6
255 #define BSP430_RFEM_RF3P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
256 #define BSP430_RFEM_RF3P18_PORT_BIT BIT0
257 #endif /* BSP430_RFEM */
258 /* END AUTOMATICALLY GENERATED CODE [rfem_platform] */
259 /* !BSP430! end=rfem_platform */
260 
261 /* Enable U8GLIB if requested */
262 #define BSP430_UTILITY_U8GLIB (configBSP430_UTILITY_U8GLIB - 0)
263 
266 #ifndef configBSP430_PLATFORM_EXP430F5529_LCD
267 
279 #define configBSP430_PLATFORM_EXP430F5529_LCD 0
280 #endif /* configBSP430_PLATFORM_EXP430F5529_LCD */
281 
282 #if defined(BSP430_DOXYGEN) || (configBSP430_PLATFORM_EXP430F5529_LCD - 0)
283 
285 #define BSP430_PLATFORM_EXP430F5529_LCD_SPI_PERIPH_HANDLE BSP430_PERIPH_USCI5_B1
286 
290 #define BSP430_PLATFORM_EXP430F5529_LCD_RSTn_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT5
291 
295 #define BSP430_PLATFORM_EXP430F5529_LCD_RSTn_PORT_BIT BIT7
296 
300 #define BSP430_PLATFORM_EXP430F5529_LCD_CSn_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT7
301 
305 #define BSP430_PLATFORM_EXP430F5529_LCD_CSn_PORT_BIT BIT4
306 
310 #define BSP430_PLATFORM_EXP430F5529_LCD_A0_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT5
311 
315 #define BSP430_PLATFORM_EXP430F5529_LCD_A0_PORT_BIT BIT6
316 
318 #define BSP430_PLATFORM_EXP430F5529_LCD_COLUMNS 102
319 
321 #define BSP430_PLATFORM_EXP430F5529_LCD_PAGES 8
322 
324 #define BSP430_PLATFORM_EXP430F5529_LCD_ROWS_PER_PAGE 8
325 
326 #endif /* configBSP430_PLATFORM_EXP430F5529_LCD */
327 
328 /* Include generic file, in case this is being included directly */
329 #include <bsp430/platform.h>
330 
331 #endif /* BSP430_PLATFORM_EXP430F5529_H */
Entrypoint for platform-specific capabilities.