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_SURF_PLATFORM_H
33 #define BSP430_PLATFORM_SURF_PLATFORM_H
34 
65 #ifndef BSP430_PLATFORM_SURF_REVISION
66 #define BSP430_PLATFORM_SURF_REVISION 2
67 #endif /* BSP430_PLATFORM_SURF_REVISION */
68 
71 #define BSP430_PLATFORM_SURF 1
72 
74 #define BSP430_CLOCK_NOMINAL_XT2CLK_HZ 26000000UL
75 
78 #if 2 == BSP430_PLATFORM_SURF_REVISION
79 
80 /* Available button definitions. */
81 #define BSP430_PLATFORM_BUTTON0_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
82 #define BSP430_PLATFORM_BUTTON0_PORT_BIT BIT0
83 #define BSP430_PLATFORM_BUTTON1_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
84 #define BSP430_PLATFORM_BUTTON1_PORT_BIT BIT1
85 #define BSP430_PLATFORM_BUTTON2_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
86 #define BSP430_PLATFORM_BUTTON2_PORT_BIT BIT6
87 #define BSP430_PLATFORM_BUTTON3_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT2
88 #define BSP430_PLATFORM_BUTTON3_PORT_BIT BIT7
89 
90 /* Standard LED colors */
91 #define BSP430_LED_GREEN 0
92 #define BSP430_LED_RED 1
93 #define BSP430_LED_ORANGE 2
94 #define BSP430_LED_WHITE 3
95 #define BSP430_LED_BLUE 4
96 
97 /* Select core voltage: CC430F5137 8=12/25 */
98 #define BSP430_PMM_COREV_FOR_MCLK(mclk_) \
99  ((12000000UL < (mclk_)) ? PMMCOREV_2 : \
100  PMMCOREV_0)
101 
102 /* DS1825 on P3.7 */
103 #define BSP430_PLATFORM_SURF_DS1825_PORT_HAL BSP430_HAL_PORT3
104 #define BSP430_PLATFORM_SURF_DS1825_PORT_BIT BIT7
105 
106 #else /* BSP430_PLATFORM_SURF_REVISION */
107 
108 #error BSP430_PLATFORM_SURF_REVISION not supported
109 
110 #endif /* BSP430_PLATFORM_SURF_REVISION */
111 
112 /* How to use ACLK as a capture/compare input source */
113 /* Settings for TA1: T1A2 ccis=1 ; clk P2.0 ; cc0 P2.1 ; cc1 P2.2 */
114 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIDX
115 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
116 #define BSP430_TIMER_CCACLK_ACLK_CCIDX 2
117 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIDX */
118 #ifndef BSP430_TIMER_CCACLK_ACLK_CCIS
119 /* NB: Check against BSP430_TIMER_CCACLK_PERIPH_CPPID in bsp430_config.h */
120 #define BSP430_TIMER_CCACLK_ACLK_CCIS CCIS_1
121 #endif /* BSP430_TIMER_CCACLK_ACLK_CCIS */
122 #ifndef BSP430_TIMER_CCACLK_CLK_PORT_BIT
123 /* NB: Check against BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID in bsp430_config.h */
124 #define BSP430_TIMER_CCACLK_CLK_PORT_BIT BIT0
125 #endif /* BSP430_TIMER_CCACLK_CLK_PORT_BIT */
126 #ifndef BSP430_TIMER_CCACLK_CC0_PORT_BIT
127 /* NB: Check against BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID in bsp430_config.h */
128 #define BSP430_TIMER_CCACLK_CC0_PORT_BIT BIT1
129 #endif /* BSP430_TIMER_CCACLK_CC0_PORT_BIT */
130 #ifndef BSP430_TIMER_CCACLK_CC1_PORT_BIT
131 /* NB: Check against BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID in bsp430_config.h */
132 #define BSP430_TIMER_CCACLK_CC1_PORT_BIT BIT2
133 #endif /* BSP430_TIMER_CCACLK_CC1_PORT_BIT */
134 
144 #ifndef configBSP430_PLATFORM_M25P
145 #define configBSP430_PLATFORM_M25P 0
146 #endif /* configBSP430_PLATFORM_M25P */
147 
148 #if (configBSP430_PLATFORM_M25P - 0)
149 
153 #define BSP430_PLATFORM_M25P_SPI_PERIPH_HANDLE BSP430_PERIPH_USCI5_B0
154 
158 #define BSP430_PLATFORM_M25P_CSn_PORT_PERIPH_HANDLE BSP430_PERIPH_PORT1
159 
163 #define BSP430_PLATFORM_M25P_CSn_PORT_BIT BIT7
164 
165 /* M25P10A does not support #BSP430_M25P_CMD_PE or
166  * #BSP430_M25P_CMD_PW, and does not support subsectors. */
167 
168 /* M25P10A has four 32 kiB sectors */
169 #define BSP430_PLATFORM_M25P_SECTOR_SIZE 0x8000L
170 
171 /* M25P10A has four 32 kiB sectors */
172 #define BSP430_PLATFORM_M25P_SECTOR_COUNT 4
173 
174 #endif /* configBSP430_PLATFORM_M25P */
175 
184 #ifndef configBSP430_PLATFORM_SURF_DS1825
185 #define configBSP430_PLATFORM_SURF_DS1825 0
186 #endif /* configBSP430_PLATFORM_SURF_DS1825 */
187 
188 #if defined(BSP430_DOXYGEN) || (configBSP430_PLATFORM_SURF_DS1825 - 0)
189 #include <bsp430/utility/onewire.h>
190 
196 #endif /* configBSP430_PLATFORM_SURF_DS1825 */
197 
198 /* Include generic file, in case this is being included directly */
199 #include <bsp430/platform.h>
200 
201 #endif /* BSP430_PLATFORM_SURF_H */
Basic support for 1-Wire(R) communications.
Definition: onewire.h:50
Entrypoint for platform-specific capabilities.
const sBSP430onewireBus xBSP430surfDS1825