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_EXP430F5438_PLATFORM_H
33 #define BSP430_PLATFORM_EXP430F5438_PLATFORM_H
34 
56 #define BSP430_PLATFORM_EXP430F5438 1
57 
60 /* Available button definitions */
61 #define BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
62 #define BSP430_PLATFORM_BUTTON0_PORT_BIT BIT6
63 #define BSP430_PLATFORM_BUTTON1_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
64 #define BSP430_PLATFORM_BUTTON1_PORT_BIT BIT7
65 
66 /* Standard LED colors. In the absense of a green LED, the orange
67  * will substitute. */
68 #define BSP430_LED_RED 0
69 #define BSP430_LED_ORANGE 1
70 #define BSP430_LED_GREEN BSP430_LED_ORANGE
71 
72 /* Select core voltage: MSP430F5438A 8/12/20/25 */
73 #define BSP430_PMM_COREV_FOR_MCLK(mclk_) \
74  ((20000000UL < (mclk_)) ? PMMCOREV_3 : \
75  ((12000000UL < (mclk_)) ? PMMCOREV_2 : \
76  (((8000000UL < (mclk_)) ? PMMCOREV_1 : \
77  PMMCOREV_0))))
78 
79 /* How to use ACLK as a capture/compare input source */
80 /* Settings for TB0: T0B6 ccis=1 ; clk P4.7 ; cc0 P4.0 ; cc1 P4.1 */
81 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIDX
82 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
83 #define BSP430_TIMER_CCACLK_ACLK_CCIDX 6
84 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIDX */
85 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIS
86 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
87 #define BSP430_TIMER_CCACLK_ACLK_CCIS CCIS_1
88 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIS */
89 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_BIT
90 /* NB: Check against BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID in bsp430_config.h */
91 #define BSP430_TIMER_CCACLK_CLK_PORT_BIT BIT7
92 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_BIT */
93 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_BIT
94 /* NB: Check against BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID in bsp430_config.h */
95 #define BSP430_TIMER_CCACLK_CC0_PORT_BIT BIT0
96 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_BIT */
97 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_BIT
98 /* NB: Check against BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID in bsp430_config.h */
99 #define BSP430_TIMER_CCACLK_CC1_PORT_BIT BIT1
100 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_BIT */
101 
102 /* !BSP430! insert=rfem_platform platform=exp430f5438 mcu=msp430f5438a */
103 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [rfem_platform] */
104 #if (configBSP430_RFEM - 0)
105 #define BSP430_RFEM 1
106 #endif /* configBSP430_RFEM */
107 #if (BSP430_RFEM - 0)
108 #define BSP430_RFEM_SERIAL_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
109 #define BSP430_RFEM_RF1P3_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
110 #define BSP430_RFEM_RF1P3_PORT_BIT BIT4
111 #define BSP430_RFEM_RF1P3_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
112 #define BSP430_RFEM_RF1P3_TIMER_CCIDX 3
113 #define BSP430_RFEM_RF1P3_TIMER_CCIS CCIS_0
114 #define BSP430_RFEM_RF1P5_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
115 #define BSP430_RFEM_RF1P5_PORT_BIT BIT2
116 #define BSP430_RFEM_RF1P5_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
117 #define BSP430_RFEM_RF1P5_TIMER_CCIDX 1
118 #define BSP430_RFEM_RF1P5_TIMER_CCIS CCIS_0
119 #define BSP430_RFEM_RF1P6_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
120 #define BSP430_RFEM_RF1P6_PORT_BIT BIT5
121 #define BSP430_RFEM_RF1P6_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
122 #define BSP430_RFEM_RF1P6_TIMER_CCIDX 4
123 #define BSP430_RFEM_RF1P6_TIMER_CCIS CCIS_0
124 #define BSP430_RFEM_RF1P7_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
125 #define BSP430_RFEM_RF1P7_PORT_BIT BIT5
126 #define BSP430_RFEM_RF1P7_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
127 #define BSP430_RFEM_RF1P7_TIMER_CCIDX 4
128 #define BSP430_RFEM_RF1P7_TIMER_CCIS CCIS_0
129 #define BSP430_RFEM_RF1P8_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
130 #define BSP430_RFEM_RF1P8_PORT_BIT BIT6
131 #define BSP430_RFEM_RF1P9_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
132 #define BSP430_RFEM_RF1P9_PORT_BIT BIT6
133 #define BSP430_RFEM_RF1P10_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
134 #define BSP430_RFEM_RF1P10_PORT_BIT BIT7
135 #define BSP430_RFEM_RF1P12_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
136 #define BSP430_RFEM_RF1P12_PORT_BIT BIT3
137 #define BSP430_RFEM_RF1P12_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
138 #define BSP430_RFEM_RF1P12_TIMER_CCIDX 2
139 #define BSP430_RFEM_RF1P12_TIMER_CCIS CCIS_0
140 #define BSP430_RFEM_RF1P14_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
141 #define BSP430_RFEM_RF1P14_PORT_BIT BIT0
142 #define BSP430_RFEM_RF1P16_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
143 #define BSP430_RFEM_RF1P16_PORT_BIT BIT3
144 #define BSP430_RFEM_RF1P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
145 #define BSP430_RFEM_RF1P18_PORT_BIT BIT1
146 #define BSP430_RFEM_RF1P20_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
147 #define BSP430_RFEM_RF1P20_PORT_BIT BIT2
148 #define BSP430_RFEM_RF2P15_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
149 #define BSP430_RFEM_RF2P15_PORT_BIT BIT2
150 #define BSP430_RFEM_RF2P15_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
151 #define BSP430_RFEM_RF2P15_TIMER_CCIDX 1
152 #define BSP430_RFEM_RF2P15_TIMER_CCIS CCIS_0
153 #define BSP430_RFEM_RF2P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT8
154 #define BSP430_RFEM_RF2P18_PORT_BIT BIT1
155 #define BSP430_RFEM_RF2P18_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
156 #define BSP430_RFEM_RF2P18_TIMER_CCIDX 1
157 #define BSP430_RFEM_RF2P18_TIMER_CCIS CCIS_1
158 #define BSP430_RFEM_RF2P19_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT8
159 #define BSP430_RFEM_RF2P19_PORT_BIT BIT2
160 #define BSP430_RFEM_RF2P19_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
161 #define BSP430_RFEM_RF2P19_TIMER_CCIDX 2
162 #define BSP430_RFEM_RF2P19_TIMER_CCIS CCIS_1
163 #define BSP430_RFEM_RF3P3_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT11
164 #define BSP430_RFEM_RF3P3_PORT_BIT BIT0
165 #define BSP430_RFEM_RF3P4_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
166 #define BSP430_RFEM_RF3P4_PORT_BIT BIT4
167 #define BSP430_RFEM_RF3P4_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
168 #define BSP430_RFEM_RF3P4_TIMER_CCIDX 3
169 #define BSP430_RFEM_RF3P4_TIMER_CCIS CCIS_0
170 #define BSP430_RFEM_RF3P5_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT9
171 #define BSP430_RFEM_RF3P5_PORT_BIT BIT4
172 #define BSP430_RFEM_RF3P6_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
173 #define BSP430_RFEM_RF3P6_PORT_BIT BIT2
174 #define BSP430_RFEM_RF3P6_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
175 #define BSP430_RFEM_RF3P6_TIMER_CCIDX 1
176 #define BSP430_RFEM_RF3P6_TIMER_CCIS CCIS_0
177 #define BSP430_RFEM_RF3P7_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT9
178 #define BSP430_RFEM_RF3P7_PORT_BIT BIT5
179 #define BSP430_RFEM_RF3P8_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
180 #define BSP430_RFEM_RF3P8_PORT_BIT BIT5
181 #define BSP430_RFEM_RF3P8_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
182 #define BSP430_RFEM_RF3P8_TIMER_CCIDX 4
183 #define BSP430_RFEM_RF3P8_TIMER_CCIS CCIS_0
184 #define BSP430_RFEM_RF3P9_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT8
185 #define BSP430_RFEM_RF3P9_PORT_BIT BIT2
186 #define BSP430_RFEM_RF3P9_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
187 #define BSP430_RFEM_RF3P9_TIMER_CCIDX 2
188 #define BSP430_RFEM_RF3P9_TIMER_CCIS CCIS_1
189 #define BSP430_RFEM_RF3P10_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
190 #define BSP430_RFEM_RF3P10_PORT_BIT BIT6
191 #define BSP430_RFEM_RF3P11_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT8
192 #define BSP430_RFEM_RF3P11_PORT_BIT BIT1
193 #define BSP430_RFEM_RF3P11_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
194 #define BSP430_RFEM_RF3P11_TIMER_CCIDX 1
195 #define BSP430_RFEM_RF3P11_TIMER_CCIS CCIS_1
196 #define BSP430_RFEM_RF3P13_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
197 #define BSP430_RFEM_RF3P13_PORT_BIT BIT7
198 #define BSP430_RFEM_RF3P14_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
199 #define BSP430_RFEM_RF3P14_PORT_BIT BIT3
200 #define BSP430_RFEM_RF3P14_TIMER_PERIPH_HANDLE BSP430_PERIPH_TA0
201 #define BSP430_RFEM_RF3P14_TIMER_CCIDX 2
202 #define BSP430_RFEM_RF3P14_TIMER_CCIS CCIS_0
203 #define BSP430_RFEM_RF3P15_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
204 #define BSP430_RFEM_RF3P15_PORT_BIT BIT2
205 #define BSP430_RFEM_RF3P16_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
206 #define BSP430_RFEM_RF3P16_PORT_BIT BIT3
207 #define BSP430_RFEM_RF3P17_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
208 #define BSP430_RFEM_RF3P17_PORT_BIT BIT0
209 #define BSP430_RFEM_RF3P18_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT3
210 #define BSP430_RFEM_RF3P18_PORT_BIT BIT1
211 #endif /* BSP430_RFEM */
212 /* END AUTOMATICALLY GENERATED CODE [rfem_platform] */
213 /* !BSP430! end=rfem_platform */
214 
215 /* Enable U8GLIB if requested */
216 #define BSP430_UTILITY_U8GLIB (configBSP430_UTILITY_U8GLIB - 0)
217 
220 #ifndef configBSP430_PLATFORM_EXP430F5438_LCD
221 
233 #define configBSP430_PLATFORM_EXP430F5438_LCD 0
234 #endif /* configBSP430_PLATFORM_EXP430F5438_LCD */
235 
236 #if defined(BSP430_DOXYGEN) || (configBSP430_PLATFORM_EXP430F5438_LCD - 0)
237 
239 #define BSP430_PLATFORM_EXP430F5438_LCD_SPI_PERIPH_HANDLE BSP430_PERIPH_USCI5_B2
240 
244 #define BSP430_PLATFORM_EXP430F5438_LCD_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT9
245 
249 #define BSP430_PLATFORM_EXP430F5438_LCD_RSTn_PORT_BIT BIT7
250 
254 #define BSP430_PLATFORM_EXP430F5438_LCD_CSn_PORT_BIT BIT6
255 
259 #define BSP430_PLATFORM_EXP430F5438_LCD_COLUMNS 138
260 
263 #define BSP430_PLATFORM_EXP430F5438_LCD_ROWS 110
264 
268 #define BSP430_PLATFORM_EXP430F5438_LCD_BL_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT8
269 
278 #define BSP430_PLATFORM_EXP430F5438_LCD_BL_PORT_BIT BIT3
279 
280 #endif /* configBSP430_PLATFORM_EXP430F5438_LCD */
281 
282 /* Include generic file, in case this is being included directly */
283 #include <bsp430/platform.h>
284 
285 #endif /* BSP430_PLATFORM_EXP430F5438_H */
Entrypoint for platform-specific capabilities.