BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bsp430_config.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 
39 #ifndef BSP430_PLATFORM_TRXEB_BSP430_CONFIG_H
40 #define BSP430_PLATFORM_TRXEB_BSP430_CONFIG_H
41 
44 /* Platform has custom LED implementation */
45 #ifndef configBSP430_LED_USE_COMMON
46 #define configBSP430_LED_USE_COMMON 0
47 #endif /* configBSP430_LED_USE_COMMON */
48 
49 /* Use native USCI5 for genericized serial port unless told not to */
50 #ifndef configBSP430_SERIAL_USE_USCI5
51 #define configBSP430_SERIAL_USE_USCI5 1
52 #endif /* configBSP430_SERIAL_USE_USCI5 */
53 
54 /* Enable buttons as requested */
55 #if (configBSP430_PLATFORM_BUTTON0 - 0) || (configBSP430_PLATFORM_BUTTON1 - 0)
56 #if !defined(configBSP430_HAL_PORT2)
57 #define configBSP430_HAL_PORT2 1
58 #else /* configBSP430_HAL_PORT2 */
59 #if (configBSP430_PLATFORM_BUTTON0 - 0) && ! defined(configBSP430_HPL_PORT2)
60 #define configBSP430_HPL_PORT2 1
61 #endif /* BUTTON0 */
62 #if (configBSP430_PLATFORM_BUTTON1 - 0) && ! defined(configBSP430_HPL_PORT2)
63 #define configBSP430_HPL_PORT2 1
64 #endif /* BUTTON1 */
65 #endif /* configBSP430_HAL_PORT2 */
66 #endif /* configBSP430_PLATFORM_BUTTON[01] */
67 
68 /* What to use as a console */
69 #if (configBSP430_CONSOLE - 0)
70 #ifndef BSP430_CONSOLE_SERIAL_PERIPH_CPPID
71 #define BSP430_CONSOLE_SERIAL_PERIPH_CPPID BSP430_PERIPH_CPPID_USCI5_A1
72 #endif /* BSP430_CONSOLE_SERIAL_PERIPH_CPPID */
73 #endif /* configBSP430_CONSOLE */
74 
75 /* How to use ACLK as a capture/compare input source */
76 /* Settings for TB0: T0B6 ccis=1 ; clk P4.7 ; cc0 P4.0 ; cc1 P4.1 */
77 #if (configBSP430_TIMER_CCACLK - 0)
78 #ifndef BSP430_TIMER_CCACLK_PERIPH_CPPID
79 #define BSP430_TIMER_CCACLK_PERIPH_CPPID BSP430_PERIPH_CPPID_TB0
80 #endif /* BSP430_TIMER_CCACLK_PERIPH_CPPID */
81 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID
82 #define BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT4
83 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID */
84 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID
85 #define BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT4
86 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID */
87 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID
88 #define BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT4
89 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID */
90 #endif /* configBSP430_TIMER_CCACLK */
91 
92 /* !BSP430! insert=rfem_config platform=trxeb mcu=msp430f5438a */
93 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [rfem_config] */
94 #if (configBSP430_RFEM - 0)
95 #define BSP430_RFEM_SERIAL_PERIPH_CPPID BSP430_PERIPH_CPPID_USCI5_B0
96 #define configBSP430_SERIAL_ENABLE_SPI 1
97 #define configBSP430_HAL_USCI5_B0 1
98 #define BSP430_RFEM_RF1P3_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT1
99 #define BSP430_RFEM_RF1P3_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
100 #define BSP430_RFEM_RF1P4_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT1
101 #define BSP430_RFEM_RF1P4_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
102 #define BSP430_RFEM_RF1P5_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT8
103 #define BSP430_RFEM_RF1P5_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
104 #define BSP430_RFEM_RF1P6_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT1
105 #define BSP430_RFEM_RF1P6_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
106 #define BSP430_RFEM_RF1P7_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT3
107 #define BSP430_RFEM_RF1P9_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT3
108 #define BSP430_RFEM_RF1P10_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT1
109 #define BSP430_RFEM_RF1P11_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT8
110 #define BSP430_RFEM_RF1P11_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
111 #define BSP430_RFEM_RF1P12_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT1
112 #define BSP430_RFEM_RF1P12_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
113 #define BSP430_RFEM_RF1P14_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT3
114 #define BSP430_RFEM_RF1P15_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT8
115 #define BSP430_RFEM_RF1P15_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
116 #define BSP430_RFEM_RF1P16_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT3
117 #define BSP430_RFEM_RF1P17_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT8
118 #define BSP430_RFEM_RF1P17_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA1
119 #define BSP430_RFEM_RF1P18_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT3
120 #define BSP430_RFEM_RF1P20_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT3
121 #define BSP430_RFEM_RF2P15_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT8
122 #define BSP430_RFEM_RF2P15_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
123 #define BSP430_RFEM_RF2P17_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT8
124 #define BSP430_RFEM_RF2P17_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
125 #define BSP430_RFEM_RF2P18_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT1
126 #define BSP430_RFEM_RF2P18_TIMER_PERIPH_CPPID BSP430_PERIPH_CPPID_TA0
127 #define BSP430_RFEM_RF2P19_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT1
128 #endif /* configBSP430_RFEM */
129 /* END AUTOMATICALLY GENERATED CODE [rfem_config] */
130 /* !BSP430! end=rfem_config */
131 
132 #if (configBSP430_PLATFORM_TRXEB_ALS - 0)
133 #ifndef configBSP430_HPL_PORT6
134 #define configBSP430_HPL_PORT6 1
135 #endif /* configBSP430_HPL_PORT6 */
136 #endif /* configBSP430_PLATFORM_TRXEB_ALS */
137 
138 #if (configBSP430_PLATFORM_TRXEB_ACCEL - 0)
139 /* Accelerometer is on IO_SPI1 */
140 #define configBSP430_PLATFORM_TRXEB_IO_SPI1 1
141 /* P6.1 is accelerometer power */
142 #ifndef configBSP430_HPL_PORT6
143 #define configBSP430_HPL_PORT6 1
144 #endif /* configBSP430_HPL_PORT6 */
145 /* P8.7 is accelerometer CSn */
146 #ifndef configBSP430_HPL_PORT8
147 #define configBSP430_HPL_PORT8 1
148 #endif /* configBSP430_HPL_PORT8 */
149 /* Accelerometer IRQ is P2.0 */
150 #if (configBSP430_PLATFORM_TRXEB_ACCEL_IRQ - 0)
151 #ifndef configBSP430_HAL_PORT2
152 #define configBSP430_HAL_PORT2 1
153 #endif /* configBSP430_HAL_PORT2 */
154 #endif /* configBSP430_PLATFORM_TRXEB_ACCEL_IRQ */
155 #endif /* configBSP430_PLATFORM_TRXEB_ACCEL */
156 
157 #if (configBSP430_PLATFORM_M25P - 0)
158 /* Flash is on IO_SPI0 */
159 #define configBSP430_PLATFORM_TRXEB_IO_SPI0 1
160 /* P7.6 is FLASH_PWR */
161 #ifndef configBSP430_HPL_PORT7
162 #define configBSP430_HPL_PORT7 1
163 #endif /* configBSP430_HPL_PORT7 */
164 /* P8.6 is FLASH_CSn */
165 #ifndef configBSP430_HPL_PORT8
166 #define configBSP430_HPL_PORT8 1
167 #endif /* configBSP430_HPL_PORT8 */
168 #endif /* configBSP430_PLATFORM_M25P */
169 
170 #if (configBSP430_UTILITY_U8GLIB - 0) && (! defined(configBSP430_PLATFORM_TRXEB_LCD))
171 #define configBSP430_PLATFORM_TRXEB_LCD 1
172 #endif /* U8GLIB */
173 
174 #if (configBSP430_PLATFORM_TRXEB_LCD - 0)
175 /* LCD is on IO_SPI0 */
176 #define configBSP430_PLATFORM_TRXEB_IO_SPI0 1
177 /* PWR (P7.7) and RSTn (P7.3) */
178 #ifndef configBSP430_HPL_PORT7
179 #define configBSP430_HPL_PORT7 1
180 #endif /* configBSP430_HPL_PORT7 */
181 /* CSn (P9.6) and A0 (P9.7) */
182 #ifndef configBSP430_HPL_PORT9
183 #define configBSP430_HPL_PORT9 1
184 #endif /* configBSP430_HPL_PORT9 */
185 #endif /* configBSP430_PLATFORM_TRXEB_LCD */
186 
187 #if (configBSP430_PLATFORM_TRXEB_IO_SPI0 - 0)
188 #define configBSP430_SERIAL_ENABLE_SPI 1
189 #define configBSP430_HAL_USCI5_B2 1
190 #endif /* configBSP430_PLATFORM_TRXEB_IO_SPI0 */
191 
192 #if (configBSP430_PLATFORM_TRXEB_IO_SPI1 - 0)
193 #define configBSP430_SERIAL_ENABLE_SPI 1
194 #define configBSP430_HAL_USCI5_A2 1
195 #endif /* configBSP430_PLATFORM_TRXEB_IO_SPI1 */
196 
199 #endif /* BSP430_PLATFORM_TRXEB_BSP430_CONFIG_H */