diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/EXP430FR6989/board.h')
-rw-r--r-- | lib/chibios-contrib/os/hal/boards/EXP430FR6989/board.h | 205 |
1 files changed, 205 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/EXP430FR6989/board.h b/lib/chibios-contrib/os/hal/boards/EXP430FR6989/board.h new file mode 100644 index 000000000..4561feacc --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/EXP430FR6989/board.h | |||
@@ -0,0 +1,205 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2016 Andrew Wygle aka awygle | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #ifndef _BOARD_H_ | ||
18 | #define _BOARD_H_ | ||
19 | |||
20 | /* | ||
21 | * Setup for the EXP430FR6989 LaunchPad board | ||
22 | */ | ||
23 | |||
24 | /* NOTE: LCD segment pins configured as unused - controlled by LCD driver if | ||
25 | * present | ||
26 | */ | ||
27 | |||
28 | /* | ||
29 | * Board identifier. | ||
30 | */ | ||
31 | #define BOARD_EXP430FR6989 | ||
32 | #define BOARD_NAME "MSP430FR6989 LaunchPad" | ||
33 | |||
34 | /* | ||
35 | * IO lines assignments. | ||
36 | */ | ||
37 | #define LINE_LED_R PAL_LINE(IOPORT1, 0U) | ||
38 | #define LINE_LED_G PAL_LINE(IOPORT5, 7U) | ||
39 | #define LINE_SW_S1 PAL_LINE(IOPORT1, 1U) | ||
40 | #define LINE_SW_S2 PAL_LINE(IOPORT1, 2U) | ||
41 | |||
42 | /* | ||
43 | * I/O ports initial setup, this configuration is established soon after reset | ||
44 | * in the initialization code. | ||
45 | * Please refer to the MSP430X Family Users Guide for details. | ||
46 | */ | ||
47 | /* | ||
48 | * Port A setup: | ||
49 | * | ||
50 | * P1.0 - Red LED (output low) | ||
51 | * P1.1 - Switch S1 (input pullup falling-edge interrupt) | ||
52 | * P1.2 - Switch S2 (input pullup falling-edge interrupt) | ||
53 | * P1.3 - BoosterPack BP34 (input pullup) | ||
54 | * P1.4 - BoosterPack BP7 (input pullup) | ||
55 | * P1.5 - BoosterPack BP18 (input pullup) | ||
56 | * P1.6 - BoosterPack BP15 (input pullup) | ||
57 | * P1.7 - BoosterPack BP14 (input pullup) | ||
58 | * P2.0 - BoosterPack BP8 (input pullup) | ||
59 | * P2.1 - BoosterPack BP19 (input pullup) | ||
60 | * P2.2 - BoosterPack BP35 (input pullup) | ||
61 | * P2.3 - BoosterPack BP31 (input pullup) | ||
62 | * P2.4 - BoosterPack BP12 (input pullup) | ||
63 | * P2.5 - BoosterPack BP13 (input pullup) | ||
64 | * P2.6 - BoosterPack BP39 (input pullup) | ||
65 | * P2.7 - BoosterPack BP40 (input pullup) | ||
66 | */ | ||
67 | #define VAL_IOPORT1_OUT 0xFFFE | ||
68 | #define VAL_IOPORT1_DIR 0x0001 | ||
69 | #define VAL_IOPORT1_REN 0xFFFE | ||
70 | #define VAL_IOPORT1_SEL0 0x0000 | ||
71 | #define VAL_IOPORT1_SEL1 0x0000 | ||
72 | |||
73 | /* | ||
74 | * Port B setup: | ||
75 | * | ||
76 | * P3.0 - BoosterPack BP33 (input pullup) | ||
77 | * P3.1 - BoosterPack BP32 (input pullup) | ||
78 | * P3.2 - BoosterPack BP5 (input pullup) | ||
79 | * P3.3 - BoosterPack BP38 (input pullup) | ||
80 | * P3.4 - Application UART TX (alternate 1) | ||
81 | * P3.5 - Application UART RX (alternate 1) | ||
82 | * P3.6 - BoosterPack BP37 (input pullup) | ||
83 | * P3.7 - BoosterPack BP36 (input pullup) | ||
84 | * P4.0 - BoosterPack BP10 (input pullup) | ||
85 | * P4.1 - BoosterPack BP9 (input pullup) | ||
86 | * P4.2 - BoosterPack BP4 (input pullup) | ||
87 | * P4.3 - BoosterPack BP3 (input pullup) | ||
88 | * P4.4 - LCD S8 (input pullup) | ||
89 | * P4.5 - LCD S7 (input pullup) | ||
90 | * P4.6 - LCD S6 (input pullup) | ||
91 | * P4.7 - BoosterPack BP11 (input pullup) | ||
92 | */ | ||
93 | #define VAL_IOPORT2_OUT 0xFFCF | ||
94 | #define VAL_IOPORT2_DIR 0x0000 | ||
95 | #define VAL_IOPORT2_REN 0xFFCF | ||
96 | #define VAL_IOPORT2_SEL0 0x0030 | ||
97 | #define VAL_IOPORT2_SEL1 0x0000 | ||
98 | |||
99 | /* | ||
100 | * Port C setup: | ||
101 | * | ||
102 | * P5.0 - LCD S38 (input pullup) | ||
103 | * P5.1 - LCD S37 (input pullup) | ||
104 | * P5.2 - LCD S36 (input pullup) | ||
105 | * P5.3 - LCD S35 (input pullup) | ||
106 | * P5.4 - LCD S12 (input pullup) | ||
107 | * P5.5 - LCD S11 (input pullup) | ||
108 | * P5.6 - LCD S10 (input pullup) | ||
109 | * P5.7 - LCD S9 (input pullup) | ||
110 | * P6.0 - LCD R23 (input pullup) | ||
111 | * P6.1 - LCD R13 (input pullup) | ||
112 | * P6.2 - LCD R03 (input pullup) | ||
113 | * P6.3 - LCD COM0 (input pullup) | ||
114 | * P6.4 - LCD COM1 (input pullup) | ||
115 | * P6.5 - LCD COM2 (input pullup) | ||
116 | * P6.6 - LCD COM3 (input pullup) | ||
117 | * P6.7 - LCD S31 (input pullup) | ||
118 | */ | ||
119 | #define VAL_IOPORT3_OUT 0xFFFF | ||
120 | #define VAL_IOPORT3_DIR 0x0000 | ||
121 | #define VAL_IOPORT3_REN 0xFFFF | ||
122 | #define VAL_IOPORT3_SEL0 0x0000 | ||
123 | #define VAL_IOPORT3_SEL1 0x0000 | ||
124 | |||
125 | /* | ||
126 | * Port D setup: | ||
127 | * | ||
128 | * P7.0 - LCD S17 (input pullup) | ||
129 | * P7.1 - LCD S16 (input pullup) | ||
130 | * P7.2 - LCD S15 (input pullup) | ||
131 | * P7.3 - LCD S14 (input pullup) | ||
132 | * P7.4 - LCD S13 (input pullup) | ||
133 | * P7.5 - LCD S30 (input pullup) | ||
134 | * P7.6 - LCD S29 (input pullup) | ||
135 | * P7.7 - LCD S27 (input pullup) | ||
136 | * P8.0 - LCD S21 (input pullup) | ||
137 | * P8.1 - LCD S20 (input pullup) | ||
138 | * P8.2 - LCD S19 (input pullup) | ||
139 | * P8.3 - LCD S18 (input pullup) | ||
140 | * P8.4 - BoosterPack BP23 (input pullup) | ||
141 | * P8.5 - BoosterPack BP24 (input pullup) | ||
142 | * P8.6 - BoosterPack BP25 (input pullup) | ||
143 | * P8.7 - BoosterPack BP26 (input pullup) | ||
144 | */ | ||
145 | #define VAL_IOPORT4_OUT 0xFFFF | ||
146 | #define VAL_IOPORT4_DIR 0x0000 | ||
147 | #define VAL_IOPORT4_REN 0xFFFF | ||
148 | #define VAL_IOPORT4_SEL0 0x0000 | ||
149 | #define VAL_IOPORT4_SEL1 0x0000 | ||
150 | |||
151 | /* | ||
152 | * Port E setup: | ||
153 | * | ||
154 | * P9.0 - BoosterPack BP27 (input pullup) | ||
155 | * P9.1 - BoosterPack BP28 (input pullup) | ||
156 | * P9.2 - BoosterPack BP2 (input pullup) | ||
157 | * P9.3 - BoosterPack BP6 (input pullup) | ||
158 | * P9.4 - BoosterPack BP17 (input pullup) | ||
159 | * P9.5 - BoosterPack BP29 (input pullup) | ||
160 | * P9.6 - BoosterPack BP30 (input pullup) | ||
161 | * P9.7 - Green LED (output low) | ||
162 | * P10.0 - LCD S4 (input pullup) | ||
163 | * P10.1 - LCD S28 (input pullup) | ||
164 | * P10.2 - LCD S39 (input pullup) | ||
165 | * P10.3 - N/C Internally (input pullup) | ||
166 | * P10.4 - N/C Internally (input pullup) | ||
167 | * P10.5 - N/C Internally (input pullup) | ||
168 | * P10.6 - N/C Internally (input pullup) | ||
169 | * P10.7 - N/C Internally (input pullup) | ||
170 | */ | ||
171 | #define VAL_IOPORT5_OUT 0xFF7F | ||
172 | #define VAL_IOPORT5_DIR 0x0080 | ||
173 | #define VAL_IOPORT5_REN 0xFF7F | ||
174 | #define VAL_IOPORT5_SEL0 0x0000 | ||
175 | #define VAL_IOPORT5_SEL1 0x0000 | ||
176 | |||
177 | /* | ||
178 | * Port J setup: | ||
179 | * | ||
180 | * PJ.0 - TDO (input pullup) | ||
181 | * PJ.1 - TDI (input pullup) | ||
182 | * PJ.2 - TMS (input pullup) | ||
183 | * PJ.3 - TCK (input pullup) | ||
184 | * PJ.4 - LFXIN (alternate 1) | ||
185 | * PJ.5 - LFXOUT (alternate 1) | ||
186 | * PJ.6 - HFXIN (N/C) (input pullup) | ||
187 | * PJ.7 - HFXOUT (N/C) (input pullup) | ||
188 | */ | ||
189 | #define VAL_IOPORT0_OUT 0x00FF | ||
190 | #define VAL_IOPORT0_DIR 0x0000 | ||
191 | #define VAL_IOPORT0_REN 0x00CF | ||
192 | #define VAL_IOPORT0_SEL0 0x0030 | ||
193 | #define VAL_IOPORT0_SEL1 0x0000 | ||
194 | |||
195 | #if !defined(_FROM_ASM_) | ||
196 | #ifdef __cplusplus | ||
197 | extern "C" { | ||
198 | #endif | ||
199 | void boardInit(void); | ||
200 | #ifdef __cplusplus | ||
201 | } | ||
202 | #endif | ||
203 | #endif /* _FROM_ASM_ */ | ||
204 | |||
205 | #endif /* _BOARD_H_ */ | ||