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_EM430_BSP430_CONFIG_H
40 #define BSP430_PLATFORM_EM430_BSP430_CONFIG_H
41 
43 #ifndef configBSP430_PERIPH_XT2
44 #define configBSP430_PERIPH_XT2 1
45 #endif /* configBSP430_PERIPH_XT2 */
46 
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_PORT1)
57 #define configBSP430_HAL_PORT1 1
58 #else /* configBSP430_HAL_PORT1 */
59 #if (configBSP430_PLATFORM_BUTTON0 - 0) && ! defined(configBSP430_HPL_PORT1)
60 #define configBSP430_HPL_PORT1 1
61 #endif /* BUTTON0 */
62 #endif /* configBSP430_HAL_PORT1 */
63 #endif /* configBSP430_PLATFORM_BUTTON[01] */
64 
65 /* What to use as a console */
66 #if (configBSP430_CONSOLE - 0)
67 #ifndef BSP430_CONSOLE_SERIAL_PERIPH_CPPID
68 #define BSP430_CONSOLE_SERIAL_PERIPH_CPPID BSP430_PERIPH_CPPID_USCI5_A0
69 #endif /* BSP430_CONSOLE_SERIAL_PERIPH_CPPID */
70 #endif /* configBSP430_CONSOLE */
71 
72 /* How to use ACLK as a capture/compare input source */
73 /* Settings for TA1: T1A2 ccis=1 ; clk P2.0 ; cc0 P2.1 ; cc1 P2.2 */
74 #if (configBSP430_TIMER_CCACLK - 0)
75 #ifndef BSP430_TIMER_CCACLK_PERIPH_CPPID
76 #define BSP430_TIMER_CCACLK_PERIPH_CPPID BSP430_PERIPH_CPPID_TA1
77 #endif /* BSP430_TIMER_CCACLK_PERIPH_CPPID */
78 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID
79 #define BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT2
80 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID */
81 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID
82 #define BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT2
83 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID */
84 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID
85 #define BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID BSP430_PERIPH_CPPID_PORT2
86 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID */
87 #endif /* configBSP430_TIMER_CCACLK */
88 
89 #if (configBSP430_PLATFORM_M25P - 0)
90 /* Flash is on USCI_B0 */
91 #define configBSP430_SERIAL_ENABLE_SPI 1
92 #define configBSP430_HAL_USCI5_B0 1
93 /* P1.7 is FLASH_CSn */
94 #ifndef configBSP430_HPL_PORT1
95 #define configBSP430_HPL_PORT1 1
96 #endif /* configBSP430_HPL_PORT1 */
97 #endif /* configBSP430_PLATFORM_M25P */
98 
99 /* Use platform-provided EUI64 unless told not to. SuRF does not use
100  * the generic implementation for its platform default. */
101 #ifndef configBSP430_EUI64_USE_PLATFORM
102 #define configBSP430_EUI64_USE_PLATFORM 1
103 #define configBSP430_EUI64_USE_GENERIC 0
104 #endif /* configBSP430_EUI64_USE_PLATFORM */
105 
106 #if (configBSP430_EUI64_USE_PLATFORM - 0)
107 /* Platform-specific EUI-64 requires DS1825 access */
108 #define configBSP430_PLATFORM_SURF_DS1825 1
109 #endif /* configBSP430_PLATFORM_SURF_DS1825 */
110 
111 #if (configBSP430_PLATFORM_SURF_DS1825 - 0)
112 /* DS1825 is on P3.7 */
113 #define configBSP430_HAL_PORT3 1
114 #endif /* configBSP430_PLATFORM_SURF_DS1825 */
115 
118 #endif /* BSP430_PLATFORM_EM430_BSP430_CONFIG_H */