diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.h')
-rw-r--r-- | lib/chibios-contrib/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.h | 1150 |
1 files changed, 1150 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.h b/lib/chibios-contrib/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.h new file mode 100644 index 000000000..0788eb7fe --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.h | |||
@@ -0,0 +1,1150 @@ | |||
1 | /* | ||
2 | ChibiOS/RT - Copyright (C) 2014 Uladzimir Pylinsky aka barthess | ||
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 STMicroelectronics STM32F4-Discovery board. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * Board identifier. | ||
26 | */ | ||
27 | #define BOARD_NAME "NAND and SRAM test board (codename Buod)" | ||
28 | |||
29 | /* | ||
30 | * Board oscillators-related settings. | ||
31 | */ | ||
32 | #if !defined(STM32_LSECLK) | ||
33 | #define STM32_LSECLK 32768 | ||
34 | #endif | ||
35 | |||
36 | #if !defined(STM32_HSECLK) | ||
37 | #define STM32_HSECLK 12000000 | ||
38 | #endif | ||
39 | |||
40 | /* | ||
41 | * Board voltages. | ||
42 | * Required for performance limits calculation. | ||
43 | */ | ||
44 | #define STM32_VDD 300 | ||
45 | |||
46 | /* | ||
47 | * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. | ||
48 | */ | ||
49 | #define STM32F407xx | ||
50 | |||
51 | /* | ||
52 | * IO pins assignments. | ||
53 | */ | ||
54 | #define GPIOA_PIN0 0 | ||
55 | #define GPIOA_PIN1 1 | ||
56 | #define GPIOA_PIN2 2 | ||
57 | #define GPIOA_PIN3 3 | ||
58 | #define GPIOA_SPI1_NSS 4 | ||
59 | #define GPIOA_PIN5 5 | ||
60 | #define GPIOA_PIN6 6 | ||
61 | #define GPIOA_PIN7 7 | ||
62 | #define GPIOA_PIN8 8 | ||
63 | #define GPIOA_USB_PRESENT 9 | ||
64 | #define GPIOA_PIN10 10 | ||
65 | #define GPIOA_OTG_FS_DM 11 | ||
66 | #define GPIOA_OTG_FS_DP 12 | ||
67 | #define GPIOA_JTMS 13 | ||
68 | #define GPIOA_JTCK 14 | ||
69 | #define GPIOA_JTDI 15 | ||
70 | |||
71 | |||
72 | |||
73 | #define GPIOA_USB_PRESENT 9 | ||
74 | #define GPIOA_PIN10 10 | ||
75 | #define GPIOA_OTG_FS_DM 11 | ||
76 | #define GPIOA_OTG_FS_DP 12 | ||
77 | |||
78 | |||
79 | #define GPIOB_PIN0 0 | ||
80 | #define GPIOB_NAND_WP 1 | ||
81 | #define GPIOB_PIN2 2 | ||
82 | #define GPIOB_JTDO 3 | ||
83 | #define GPIOB_JTRST 4 | ||
84 | #define GPIOB_NVRAM_PWR 5 | ||
85 | #define GPIOB_PIN6 6 | ||
86 | #define GPIOB_PIN7 7 | ||
87 | #define GPIOB_PIN8 8 | ||
88 | #define GPIOB_PIN9 9 | ||
89 | #define GPIOB_PIN10 10 | ||
90 | #define GPIOB_PIN11 11 | ||
91 | #define GPIOB_PIN12 12 | ||
92 | #define GPIOB_PIN13 13 | ||
93 | #define GPIOB_PIN14 14 | ||
94 | #define GPIOB_PIN15 15 | ||
95 | |||
96 | #define GPIOC_PIN0 0 | ||
97 | #define GPIOC_PIN1 1 | ||
98 | #define GPIOC_PIN2 2 | ||
99 | #define GPIOC_PIN3 3 | ||
100 | #define GPIOC_PIN4 4 | ||
101 | #define GPIOC_PIN5 5 | ||
102 | #define GPIOC_PIN6 6 | ||
103 | #define GPIOC_PIN7 7 | ||
104 | #define GPIOC_PIN8 8 | ||
105 | #define GPIOC_PIN9 9 | ||
106 | #define GPIOC_PIN10 10 | ||
107 | #define GPIOC_PIN11 11 | ||
108 | #define GPIOC_PIN12 12 | ||
109 | #define GPIOC_PIN13 13 | ||
110 | #define GPIOC_PIN14 14 | ||
111 | #define GPIOC_PIN15 15 | ||
112 | |||
113 | #define GPIOD_MEM_D2 0 | ||
114 | #define GPIOD_MEM_D3 1 | ||
115 | #define GPIOD_PIN2 2 | ||
116 | #define GPIOD_PIN3 3 | ||
117 | #define GPIOD_MEM_OE 4 | ||
118 | #define GPIOD_MEM_WE 5 | ||
119 | #define GPIOD_NAND_RB_NWAIT 6 | ||
120 | #define GPIOD_NAND_CE1 7 | ||
121 | #define GPIOD_MEM_D13 8 | ||
122 | #define GPIOD_MEM_D14 9 | ||
123 | #define GPIOD_MEM_D15 10 | ||
124 | #define GPIOD_MEM_A16 11 | ||
125 | #define GPIOD_MEM_A17 12 | ||
126 | #define GPIOD_PIN13 13 | ||
127 | #define GPIOD_MEM_D0 14 | ||
128 | #define GPIOD_MEM_D1 15 | ||
129 | |||
130 | #define GPIOE_SRAM_LB 0 | ||
131 | #define GPIOE_SRAM_UB 1 | ||
132 | #define GPIOE_PIN2 2 | ||
133 | #define GPIOE_PIN3 3 | ||
134 | #define GPIOE_PIN4 4 | ||
135 | #define GPIOE_PIN5 5 | ||
136 | #define GPIOE_PIN6 6 | ||
137 | #define GPIOE_MEM_D4 7 | ||
138 | #define GPIOE_MEM_D5 8 | ||
139 | #define GPIOE_MEM_D6 9 | ||
140 | #define GPIOE_MEM_D7 10 | ||
141 | #define GPIOE_MEM_D8 11 | ||
142 | #define GPIOE_MEM_D9 12 | ||
143 | #define GPIOE_MEM_D10 13 | ||
144 | #define GPIOE_MEM_D11 14 | ||
145 | #define GPIOE_MEM_D12 15 | ||
146 | |||
147 | #define GPIOF_MEM_A0 0 | ||
148 | #define GPIOF_MEM_A1 1 | ||
149 | #define GPIOF_MEM_A2 2 | ||
150 | #define GPIOF_MEM_A3 3 | ||
151 | #define GPIOF_MEM_A4 4 | ||
152 | #define GPIOF_MEM_A5 5 | ||
153 | #define GPIOF_PIN6 6 | ||
154 | #define GPIOF_PIN7 7 | ||
155 | #define GPIOF_PIN8 8 | ||
156 | #define GPIOF_PIN9 9 | ||
157 | #define GPIOF_PIN10 10 | ||
158 | #define GPIOF_PIN11 11 | ||
159 | #define GPIOF_MEM_A6 12 | ||
160 | #define GPIOF_MEM_A7 13 | ||
161 | #define GPIOF_MEM_A8 14 | ||
162 | #define GPIOF_MEM_A9 15 | ||
163 | |||
164 | #define GPIOG_MEM_A10 0 | ||
165 | #define GPIOG_MEM_A11 1 | ||
166 | #define GPIOG_MEM_A12 2 | ||
167 | #define GPIOG_MEM_A13 3 | ||
168 | #define GPIOG_MEM_A14 4 | ||
169 | #define GPIOG_MEM_A15 5 | ||
170 | #define GPIOG_NAND_RB1 6 | ||
171 | #define GPIOG_NAND_RB2 7 | ||
172 | #define GPIOG_PIN8 8 | ||
173 | #define GPIOG_NAND_CE2 9 | ||
174 | #define GPIOG_PIN10 10 | ||
175 | #define GPIOG_PIN11 11 | ||
176 | #define GPIOG_SRAM_CS1 12 | ||
177 | #define GPIOG_PIN13 13 | ||
178 | #define GPIOG_PIN14 14 | ||
179 | #define GPIOG_PIN15 15 | ||
180 | |||
181 | #define GPIOH_OSC_IN 0 | ||
182 | #define GPIOH_OSC_OUT 1 | ||
183 | #define GPIOH_PIN2 2 | ||
184 | #define GPIOH_PIN3 3 | ||
185 | #define GPIOH_PIN4 4 | ||
186 | #define GPIOH_PIN5 5 | ||
187 | #define GPIOH_PIN6 6 | ||
188 | #define GPIOH_I2C3_SCL 7 | ||
189 | #define GPIOH_I2C3_SDA 8 | ||
190 | #define GPIOH_PIN9 9 | ||
191 | #define GPIOH_PIN10 10 | ||
192 | #define GPIOH_PIN11 11 | ||
193 | #define GPIOH_PIN12 12 | ||
194 | #define GPIOH_PIN13 13 | ||
195 | #define GPIOH_PIN14 14 | ||
196 | #define GPIOH_PIN15 15 | ||
197 | |||
198 | #define GPIOI_PIN0 0 | ||
199 | #define GPIOI_PIN1 1 | ||
200 | #define GPIOI_PIN2 2 | ||
201 | #define GPIOI_PIN3 3 | ||
202 | #define GPIOI_PIN4 4 | ||
203 | #define GPIOI_PIN5 5 | ||
204 | #define GPIOI_PIN6 6 | ||
205 | #define GPIOI_PIN7 7 | ||
206 | #define GPIOI_PIN8 8 | ||
207 | #define GPIOI_PIN9 9 | ||
208 | #define GPIOI_LED_R 10 | ||
209 | #define GPIOI_LED_G 11 | ||
210 | #define GPIOI_PIN12 12 | ||
211 | #define GPIOI_PIN13 13 | ||
212 | #define GPIOI_PIN14 14 | ||
213 | #define GPIOI_PIN15 15 | ||
214 | |||
215 | /* | ||
216 | * I/O ports initial setup, this configuration is established soon after reset | ||
217 | * in the initialization code. | ||
218 | * Please refer to the STM32 Reference Manual for details. | ||
219 | */ | ||
220 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2)) | ||
221 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2)) | ||
222 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2)) | ||
223 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2)) | ||
224 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
225 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
226 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
227 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
228 | #define PIN_OSPEED_2M(n) (0U << ((n) * 2)) | ||
229 | #define PIN_OSPEED_25M(n) (1U << ((n) * 2)) | ||
230 | #define PIN_OSPEED_50M(n) (2U << ((n) * 2)) | ||
231 | #define PIN_OSPEED_100M(n) (3U << ((n) * 2)) | ||
232 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2)) | ||
233 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2)) | ||
234 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2)) | ||
235 | #define PIN_AFIO_AF(n, v) ((v##U) << ((n % 8) * 4)) | ||
236 | |||
237 | /* | ||
238 | * GPIOA setup: | ||
239 | */ | ||
240 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ | ||
241 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
242 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
243 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
244 | PIN_MODE_ALTERNATE(GPIOA_SPI1_NSS) | \ | ||
245 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
246 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
247 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
248 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
249 | PIN_MODE_INPUT(GPIOA_USB_PRESENT) | \ | ||
250 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
251 | PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DM) | \ | ||
252 | PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DP) | \ | ||
253 | PIN_MODE_ALTERNATE(GPIOA_JTMS) | \ | ||
254 | PIN_MODE_ALTERNATE(GPIOA_JTCK) | \ | ||
255 | PIN_MODE_ALTERNATE(GPIOA_JTDI)) | ||
256 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ | ||
257 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
258 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
259 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
260 | PIN_OTYPE_PUSHPULL(GPIOA_SPI1_NSS) | \ | ||
261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
265 | PIN_OTYPE_PUSHPULL(GPIOA_USB_PRESENT) |\ | ||
266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
267 | PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DM) | \ | ||
268 | PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DP) | \ | ||
269 | PIN_OTYPE_PUSHPULL(GPIOA_JTMS) | \ | ||
270 | PIN_OTYPE_PUSHPULL(GPIOA_JTCK) | \ | ||
271 | PIN_OTYPE_PUSHPULL(GPIOA_JTDI)) | ||
272 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_PIN0) | \ | ||
273 | PIN_OSPEED_100M(GPIOA_PIN1) | \ | ||
274 | PIN_OSPEED_100M(GPIOA_PIN2) | \ | ||
275 | PIN_OSPEED_100M(GPIOA_PIN3) | \ | ||
276 | PIN_OSPEED_100M(GPIOA_SPI1_NSS) | \ | ||
277 | PIN_OSPEED_100M(GPIOA_PIN5) | \ | ||
278 | PIN_OSPEED_100M(GPIOA_PIN6) | \ | ||
279 | PIN_OSPEED_100M(GPIOA_PIN7) | \ | ||
280 | PIN_OSPEED_100M(GPIOA_PIN8) | \ | ||
281 | PIN_OSPEED_100M(GPIOA_USB_PRESENT) | \ | ||
282 | PIN_OSPEED_100M(GPIOA_PIN10) | \ | ||
283 | PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ | ||
284 | PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ | ||
285 | PIN_OSPEED_100M(GPIOA_JTMS) | \ | ||
286 | PIN_OSPEED_100M(GPIOA_JTCK) | \ | ||
287 | PIN_OSPEED_100M(GPIOA_JTDI)) | ||
288 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ | ||
289 | PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ | ||
290 | PIN_PUPDR_FLOATING(GPIOA_PIN2) | \ | ||
291 | PIN_PUPDR_FLOATING(GPIOA_PIN3) | \ | ||
292 | PIN_PUPDR_FLOATING(GPIOA_SPI1_NSS) | \ | ||
293 | PIN_PUPDR_FLOATING(GPIOA_PIN5) | \ | ||
294 | PIN_PUPDR_FLOATING(GPIOA_PIN6) | \ | ||
295 | PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ | ||
296 | PIN_PUPDR_FLOATING(GPIOA_PIN8) | \ | ||
297 | PIN_PUPDR_FLOATING(GPIOA_USB_PRESENT) |\ | ||
298 | PIN_PUPDR_FLOATING(GPIOA_PIN10) | \ | ||
299 | PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DM) | \ | ||
300 | PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DP) | \ | ||
301 | PIN_PUPDR_FLOATING(GPIOA_JTMS) | \ | ||
302 | PIN_PUPDR_FLOATING(GPIOA_JTCK) | \ | ||
303 | PIN_PUPDR_FLOATING(GPIOA_JTDI)) | ||
304 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ | ||
305 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
306 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
307 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
308 | PIN_ODR_HIGH(GPIOA_SPI1_NSS) | \ | ||
309 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
310 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
311 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
312 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
313 | PIN_ODR_HIGH(GPIOA_USB_PRESENT) | \ | ||
314 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
315 | PIN_ODR_HIGH(GPIOA_OTG_FS_DM) | \ | ||
316 | PIN_ODR_HIGH(GPIOA_OTG_FS_DP) | \ | ||
317 | PIN_ODR_HIGH(GPIOA_JTMS) | \ | ||
318 | PIN_ODR_HIGH(GPIOA_JTCK) | \ | ||
319 | PIN_ODR_HIGH(GPIOA_JTDI)) | ||
320 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ | ||
321 | PIN_AFIO_AF(GPIOA_PIN1, 0) | \ | ||
322 | PIN_AFIO_AF(GPIOA_PIN2, 0) | \ | ||
323 | PIN_AFIO_AF(GPIOA_PIN3, 0) | \ | ||
324 | PIN_AFIO_AF(GPIOA_SPI1_NSS, 5) | \ | ||
325 | PIN_AFIO_AF(GPIOA_PIN5, 0) | \ | ||
326 | PIN_AFIO_AF(GPIOA_PIN6, 0) | \ | ||
327 | PIN_AFIO_AF(GPIOA_PIN7, 0)) | ||
328 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ | ||
329 | PIN_AFIO_AF(GPIOA_USB_PRESENT, 0) | \ | ||
330 | PIN_AFIO_AF(GPIOA_PIN10, 0) | \ | ||
331 | PIN_AFIO_AF(GPIOA_OTG_FS_DM, 10) | \ | ||
332 | PIN_AFIO_AF(GPIOA_OTG_FS_DP, 10) | \ | ||
333 | PIN_AFIO_AF(GPIOA_JTMS, 0) | \ | ||
334 | PIN_AFIO_AF(GPIOA_JTCK, 0) | \ | ||
335 | PIN_AFIO_AF(GPIOA_JTDI, 0)) | ||
336 | |||
337 | /* | ||
338 | * GPIOB setup: | ||
339 | */ | ||
340 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
341 | PIN_MODE_OUTPUT(GPIOB_NAND_WP) | \ | ||
342 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
343 | PIN_MODE_ALTERNATE(GPIOB_JTDO) | \ | ||
344 | PIN_MODE_ALTERNATE(GPIOB_JTRST) | \ | ||
345 | PIN_MODE_OUTPUT(GPIOB_NVRAM_PWR) | \ | ||
346 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
347 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
348 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
349 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
350 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
351 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
352 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
353 | PIN_MODE_INPUT(GPIOB_PIN13) | \ | ||
354 | PIN_MODE_INPUT(GPIOB_PIN14) | \ | ||
355 | PIN_MODE_INPUT(GPIOB_PIN15)) | ||
356 | |||
357 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
358 | PIN_OTYPE_PUSHPULL(GPIOB_NAND_WP) | \ | ||
359 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
360 | PIN_OTYPE_PUSHPULL(GPIOB_JTDO) | \ | ||
361 | PIN_OTYPE_PUSHPULL(GPIOB_JTRST) | \ | ||
362 | PIN_OTYPE_OPENDRAIN(GPIOB_NVRAM_PWR) | \ | ||
363 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
364 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
365 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
366 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
367 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
368 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
369 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
370 | PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ | ||
371 | PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ | ||
372 | PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) | ||
373 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ | ||
374 | PIN_OSPEED_100M(GPIOB_NAND_WP) | \ | ||
375 | PIN_OSPEED_100M(GPIOB_PIN2) | \ | ||
376 | PIN_OSPEED_100M(GPIOB_JTDO) | \ | ||
377 | PIN_OSPEED_100M(GPIOB_JTRST) | \ | ||
378 | PIN_OSPEED_2M(GPIOB_NVRAM_PWR) | \ | ||
379 | PIN_OSPEED_100M(GPIOB_PIN6) | \ | ||
380 | PIN_OSPEED_100M(GPIOB_PIN7) | \ | ||
381 | PIN_OSPEED_100M(GPIOB_PIN8) | \ | ||
382 | PIN_OSPEED_100M(GPIOB_PIN9) | \ | ||
383 | PIN_OSPEED_100M(GPIOB_PIN10) | \ | ||
384 | PIN_OSPEED_100M(GPIOB_PIN11) | \ | ||
385 | PIN_OSPEED_100M(GPIOB_PIN12) | \ | ||
386 | PIN_OSPEED_100M(GPIOB_PIN13) | \ | ||
387 | PIN_OSPEED_100M(GPIOB_PIN14) | \ | ||
388 | PIN_OSPEED_100M(GPIOB_PIN15)) | ||
389 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_PIN0) | \ | ||
390 | PIN_PUPDR_PULLDOWN(GPIOB_NAND_WP) | \ | ||
391 | PIN_PUPDR_FLOATING(GPIOB_PIN2) | \ | ||
392 | PIN_PUPDR_FLOATING(GPIOB_JTDO) | \ | ||
393 | PIN_PUPDR_FLOATING(GPIOB_JTRST) | \ | ||
394 | PIN_PUPDR_FLOATING(GPIOB_NVRAM_PWR) | \ | ||
395 | PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ | ||
396 | PIN_PUPDR_FLOATING(GPIOB_PIN7) | \ | ||
397 | PIN_PUPDR_FLOATING(GPIOB_PIN8) | \ | ||
398 | PIN_PUPDR_FLOATING(GPIOB_PIN9) | \ | ||
399 | PIN_PUPDR_FLOATING(GPIOB_PIN10) | \ | ||
400 | PIN_PUPDR_FLOATING(GPIOB_PIN11) | \ | ||
401 | PIN_PUPDR_FLOATING(GPIOB_PIN12) | \ | ||
402 | PIN_PUPDR_FLOATING(GPIOB_PIN13) | \ | ||
403 | PIN_PUPDR_FLOATING(GPIOB_PIN14) | \ | ||
404 | PIN_PUPDR_FLOATING(GPIOB_PIN15)) | ||
405 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
406 | PIN_ODR_LOW(GPIOB_NAND_WP) | \ | ||
407 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
408 | PIN_ODR_HIGH(GPIOB_JTDO) | \ | ||
409 | PIN_ODR_HIGH(GPIOB_JTRST) | \ | ||
410 | PIN_ODR_LOW(GPIOB_NVRAM_PWR) | \ | ||
411 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
412 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
413 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
414 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
415 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
416 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
417 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
418 | PIN_ODR_HIGH(GPIOB_PIN13) | \ | ||
419 | PIN_ODR_HIGH(GPIOB_PIN14) | \ | ||
420 | PIN_ODR_HIGH(GPIOB_PIN15)) | ||
421 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ | ||
422 | PIN_AFIO_AF(GPIOB_NAND_WP, 0) | \ | ||
423 | PIN_AFIO_AF(GPIOB_PIN2, 0) | \ | ||
424 | PIN_AFIO_AF(GPIOB_JTDO, 0) | \ | ||
425 | PIN_AFIO_AF(GPIOB_JTRST, 0) | \ | ||
426 | PIN_AFIO_AF(GPIOB_NVRAM_PWR, 0) | \ | ||
427 | PIN_AFIO_AF(GPIOB_PIN6, 0) | \ | ||
428 | PIN_AFIO_AF(GPIOB_PIN7, 0)) | ||
429 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ | ||
430 | PIN_AFIO_AF(GPIOB_PIN9, 0) | \ | ||
431 | PIN_AFIO_AF(GPIOB_PIN10, 0) | \ | ||
432 | PIN_AFIO_AF(GPIOB_PIN11, 0) | \ | ||
433 | PIN_AFIO_AF(GPIOB_PIN12, 0) | \ | ||
434 | PIN_AFIO_AF(GPIOB_PIN13, 0) | \ | ||
435 | PIN_AFIO_AF(GPIOB_PIN14, 0) | \ | ||
436 | PIN_AFIO_AF(GPIOB_PIN15, 0)) | ||
437 | |||
438 | /* | ||
439 | * GPIOC setup: | ||
440 | */ | ||
441 | #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ | ||
442 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
443 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
444 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
445 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
446 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
447 | PIN_MODE_INPUT(GPIOC_PIN6) | \ | ||
448 | PIN_MODE_INPUT(GPIOC_PIN7) | \ | ||
449 | PIN_MODE_INPUT(GPIOC_PIN8) | \ | ||
450 | PIN_MODE_INPUT(GPIOC_PIN9) | \ | ||
451 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
452 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
453 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
454 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
455 | PIN_MODE_INPUT(GPIOC_PIN14) | \ | ||
456 | PIN_MODE_INPUT(GPIOC_PIN15)) | ||
457 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ | ||
458 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
459 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
460 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
461 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
462 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
463 | PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ | ||
464 | PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ | ||
465 | PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ | ||
466 | PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ | ||
467 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
468 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
469 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
470 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
471 | PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ | ||
472 | PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) | ||
473 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) |\ | ||
474 | PIN_OSPEED_100M(GPIOC_PIN1) | \ | ||
475 | PIN_OSPEED_100M(GPIOC_PIN2) | \ | ||
476 | PIN_OSPEED_100M(GPIOC_PIN3) | \ | ||
477 | PIN_OSPEED_100M(GPIOC_PIN4) | \ | ||
478 | PIN_OSPEED_100M(GPIOC_PIN5) | \ | ||
479 | PIN_OSPEED_100M(GPIOC_PIN6) | \ | ||
480 | PIN_OSPEED_100M(GPIOC_PIN7) | \ | ||
481 | PIN_OSPEED_100M(GPIOC_PIN8) | \ | ||
482 | PIN_OSPEED_100M(GPIOC_PIN9) | \ | ||
483 | PIN_OSPEED_100M(GPIOC_PIN10) | \ | ||
484 | PIN_OSPEED_100M(GPIOC_PIN11) | \ | ||
485 | PIN_OSPEED_100M(GPIOC_PIN12) | \ | ||
486 | PIN_OSPEED_100M(GPIOC_PIN13) | \ | ||
487 | PIN_OSPEED_100M(GPIOC_PIN14) | \ | ||
488 | PIN_OSPEED_100M(GPIOC_PIN15)) | ||
489 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_PIN0) | \ | ||
490 | PIN_PUPDR_FLOATING(GPIOC_PIN1) | \ | ||
491 | PIN_PUPDR_FLOATING(GPIOC_PIN2) | \ | ||
492 | PIN_PUPDR_FLOATING(GPIOC_PIN3) | \ | ||
493 | PIN_PUPDR_FLOATING(GPIOC_PIN4) | \ | ||
494 | PIN_PUPDR_FLOATING(GPIOC_PIN5) | \ | ||
495 | PIN_PUPDR_FLOATING(GPIOC_PIN6) | \ | ||
496 | PIN_PUPDR_FLOATING(GPIOC_PIN7) | \ | ||
497 | PIN_PUPDR_FLOATING(GPIOC_PIN8) | \ | ||
498 | PIN_PUPDR_FLOATING(GPIOC_PIN9) | \ | ||
499 | PIN_PUPDR_FLOATING(GPIOC_PIN10) | \ | ||
500 | PIN_PUPDR_FLOATING(GPIOC_PIN11) | \ | ||
501 | PIN_PUPDR_FLOATING(GPIOC_PIN12) | \ | ||
502 | PIN_PUPDR_FLOATING(GPIOC_PIN13) | \ | ||
503 | PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ | ||
504 | PIN_PUPDR_FLOATING(GPIOC_PIN15)) | ||
505 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ | ||
506 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
507 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
508 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
509 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
510 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
511 | PIN_ODR_HIGH(GPIOC_PIN6) | \ | ||
512 | PIN_ODR_HIGH(GPIOC_PIN7) | \ | ||
513 | PIN_ODR_HIGH(GPIOC_PIN8) | \ | ||
514 | PIN_ODR_HIGH(GPIOC_PIN9) | \ | ||
515 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
516 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
517 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
518 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
519 | PIN_ODR_HIGH(GPIOC_PIN14) | \ | ||
520 | PIN_ODR_HIGH(GPIOC_PIN15)) | ||
521 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ | ||
522 | PIN_AFIO_AF(GPIOC_PIN1, 0) | \ | ||
523 | PIN_AFIO_AF(GPIOC_PIN2, 0) | \ | ||
524 | PIN_AFIO_AF(GPIOC_PIN3, 0) | \ | ||
525 | PIN_AFIO_AF(GPIOC_PIN4, 0) | \ | ||
526 | PIN_AFIO_AF(GPIOC_PIN5, 0) | \ | ||
527 | PIN_AFIO_AF(GPIOC_PIN6, 0) | \ | ||
528 | PIN_AFIO_AF(GPIOC_PIN7, 0)) | ||
529 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ | ||
530 | PIN_AFIO_AF(GPIOC_PIN9, 0) | \ | ||
531 | PIN_AFIO_AF(GPIOC_PIN10, 0) | \ | ||
532 | PIN_AFIO_AF(GPIOC_PIN11, 0) | \ | ||
533 | PIN_AFIO_AF(GPIOC_PIN12, 0) | \ | ||
534 | PIN_AFIO_AF(GPIOC_PIN13, 0) | \ | ||
535 | PIN_AFIO_AF(GPIOC_PIN14, 0) | \ | ||
536 | PIN_AFIO_AF(GPIOC_PIN15, 0)) | ||
537 | |||
538 | /* | ||
539 | * GPIOD setup: | ||
540 | */ | ||
541 | #define VAL_GPIOD_MODER (PIN_MODE_ALTERNATE(GPIOD_MEM_D2) | \ | ||
542 | PIN_MODE_ALTERNATE(GPIOD_MEM_D3) | \ | ||
543 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
544 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
545 | PIN_MODE_ALTERNATE(GPIOD_MEM_OE) | \ | ||
546 | PIN_MODE_ALTERNATE(GPIOD_MEM_WE) | \ | ||
547 | PIN_MODE_INPUT(GPIOD_NAND_RB_NWAIT) | \ | ||
548 | PIN_MODE_ALTERNATE(GPIOD_NAND_CE1) | \ | ||
549 | PIN_MODE_ALTERNATE(GPIOD_MEM_D13) | \ | ||
550 | PIN_MODE_ALTERNATE(GPIOD_MEM_D14) | \ | ||
551 | PIN_MODE_ALTERNATE(GPIOD_MEM_D15) | \ | ||
552 | PIN_MODE_ALTERNATE(GPIOD_MEM_A16) | \ | ||
553 | PIN_MODE_ALTERNATE(GPIOD_MEM_A17) | \ | ||
554 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
555 | PIN_MODE_ALTERNATE(GPIOD_MEM_D0) | \ | ||
556 | PIN_MODE_ALTERNATE(GPIOD_MEM_D1)) | ||
557 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_MEM_D2) | \ | ||
558 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_D3) | \ | ||
559 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
560 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
561 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_OE) | \ | ||
562 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_WE) | \ | ||
563 | PIN_OTYPE_PUSHPULL(GPIOD_NAND_RB_NWAIT) |\ | ||
564 | PIN_OTYPE_PUSHPULL(GPIOD_NAND_CE1) | \ | ||
565 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_D13) | \ | ||
566 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_D14) | \ | ||
567 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_D15) | \ | ||
568 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_A16) | \ | ||
569 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_A17) | \ | ||
570 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
571 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_D0) | \ | ||
572 | PIN_OTYPE_PUSHPULL(GPIOD_MEM_D1)) | ||
573 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_MEM_D2) | \ | ||
574 | PIN_OSPEED_100M(GPIOD_MEM_D3) | \ | ||
575 | PIN_OSPEED_100M(GPIOD_PIN2) | \ | ||
576 | PIN_OSPEED_100M(GPIOD_PIN3) | \ | ||
577 | PIN_OSPEED_100M(GPIOD_MEM_OE) | \ | ||
578 | PIN_OSPEED_100M(GPIOD_MEM_WE) | \ | ||
579 | PIN_OSPEED_100M(GPIOD_NAND_RB_NWAIT) | \ | ||
580 | PIN_OSPEED_100M(GPIOD_NAND_CE1) | \ | ||
581 | PIN_OSPEED_100M(GPIOD_MEM_D13) | \ | ||
582 | PIN_OSPEED_100M(GPIOD_MEM_D14) | \ | ||
583 | PIN_OSPEED_100M(GPIOD_MEM_D15) | \ | ||
584 | PIN_OSPEED_100M(GPIOD_MEM_A16) | \ | ||
585 | PIN_OSPEED_100M(GPIOD_MEM_A17) | \ | ||
586 | PIN_OSPEED_100M(GPIOD_PIN13) | \ | ||
587 | PIN_OSPEED_100M(GPIOD_MEM_D0) | \ | ||
588 | PIN_OSPEED_100M(GPIOD_MEM_D1)) | ||
589 | |||
590 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_MEM_D2) | \ | ||
591 | PIN_PUPDR_FLOATING(GPIOD_MEM_D3) | \ | ||
592 | PIN_PUPDR_FLOATING(GPIOD_PIN2) | \ | ||
593 | PIN_PUPDR_FLOATING(GPIOD_PIN3) | \ | ||
594 | PIN_PUPDR_FLOATING(GPIOD_MEM_OE) | \ | ||
595 | PIN_PUPDR_FLOATING(GPIOD_MEM_WE) | \ | ||
596 | PIN_PUPDR_FLOATING(GPIOD_NAND_RB_NWAIT) |\ | ||
597 | PIN_PUPDR_PULLUP(GPIOD_NAND_CE1) | \ | ||
598 | PIN_PUPDR_FLOATING(GPIOD_MEM_D13) | \ | ||
599 | PIN_PUPDR_FLOATING(GPIOD_MEM_D14) | \ | ||
600 | PIN_PUPDR_FLOATING(GPIOD_MEM_D15) | \ | ||
601 | PIN_PUPDR_FLOATING(GPIOD_MEM_A16) | \ | ||
602 | PIN_PUPDR_FLOATING(GPIOD_MEM_A17) | \ | ||
603 | PIN_PUPDR_FLOATING(GPIOD_PIN13) | \ | ||
604 | PIN_PUPDR_FLOATING(GPIOD_MEM_D0) | \ | ||
605 | PIN_PUPDR_FLOATING(GPIOD_MEM_D1)) | ||
606 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_MEM_D2) | \ | ||
607 | PIN_ODR_HIGH(GPIOD_MEM_D3) | \ | ||
608 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
609 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
610 | PIN_ODR_HIGH(GPIOD_MEM_OE) | \ | ||
611 | PIN_ODR_HIGH(GPIOD_MEM_WE) | \ | ||
612 | PIN_ODR_HIGH(GPIOD_NAND_RB_NWAIT) | \ | ||
613 | PIN_ODR_HIGH(GPIOD_NAND_CE1) | \ | ||
614 | PIN_ODR_HIGH(GPIOD_MEM_D13) | \ | ||
615 | PIN_ODR_HIGH(GPIOD_MEM_D14) | \ | ||
616 | PIN_ODR_HIGH(GPIOD_MEM_D15) | \ | ||
617 | PIN_ODR_HIGH(GPIOD_MEM_A16) | \ | ||
618 | PIN_ODR_HIGH(GPIOD_MEM_A17) | \ | ||
619 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
620 | PIN_ODR_HIGH(GPIOD_MEM_D0) | \ | ||
621 | PIN_ODR_HIGH(GPIOD_MEM_D1)) | ||
622 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_MEM_D2, 12) | \ | ||
623 | PIN_AFIO_AF(GPIOD_MEM_D3, 12) | \ | ||
624 | PIN_AFIO_AF(GPIOD_PIN2, 0) | \ | ||
625 | PIN_AFIO_AF(GPIOD_PIN3, 0) | \ | ||
626 | PIN_AFIO_AF(GPIOD_MEM_OE, 12) | \ | ||
627 | PIN_AFIO_AF(GPIOD_MEM_WE, 12) | \ | ||
628 | PIN_AFIO_AF(GPIOD_NAND_RB_NWAIT, 0) | \ | ||
629 | PIN_AFIO_AF(GPIOD_NAND_CE1, 12)) | ||
630 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_MEM_D13, 12) | \ | ||
631 | PIN_AFIO_AF(GPIOD_MEM_D14, 12) | \ | ||
632 | PIN_AFIO_AF(GPIOD_MEM_D15, 12) | \ | ||
633 | PIN_AFIO_AF(GPIOD_MEM_A16, 12) | \ | ||
634 | PIN_AFIO_AF(GPIOD_MEM_A17, 12) | \ | ||
635 | PIN_AFIO_AF(GPIOD_PIN13, 0) | \ | ||
636 | PIN_AFIO_AF(GPIOD_MEM_D0, 12) | \ | ||
637 | PIN_AFIO_AF(GPIOD_MEM_D1, 12)) | ||
638 | |||
639 | /* | ||
640 | * GPIOE setup: | ||
641 | */ | ||
642 | #define VAL_GPIOE_MODER (PIN_MODE_ALTERNATE(GPIOE_SRAM_LB) | \ | ||
643 | PIN_MODE_ALTERNATE(GPIOE_SRAM_UB) | \ | ||
644 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
645 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
646 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
647 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
648 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
649 | PIN_MODE_ALTERNATE(GPIOE_MEM_D4) | \ | ||
650 | PIN_MODE_ALTERNATE(GPIOE_MEM_D5) | \ | ||
651 | PIN_MODE_ALTERNATE(GPIOE_MEM_D6) | \ | ||
652 | PIN_MODE_ALTERNATE(GPIOE_MEM_D7) | \ | ||
653 | PIN_MODE_ALTERNATE(GPIOE_MEM_D8) | \ | ||
654 | PIN_MODE_ALTERNATE(GPIOE_MEM_D9) | \ | ||
655 | PIN_MODE_ALTERNATE(GPIOE_MEM_D10) | \ | ||
656 | PIN_MODE_ALTERNATE(GPIOE_MEM_D11) | \ | ||
657 | PIN_MODE_ALTERNATE(GPIOE_MEM_D12)) | ||
658 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_SRAM_LB) | \ | ||
659 | PIN_OTYPE_PUSHPULL(GPIOE_SRAM_UB) | \ | ||
660 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
661 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
662 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
663 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
664 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
665 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D4) | \ | ||
666 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D5) | \ | ||
667 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D6) | \ | ||
668 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D7) | \ | ||
669 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D8) | \ | ||
670 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D9) | \ | ||
671 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D10) | \ | ||
672 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D11) | \ | ||
673 | PIN_OTYPE_PUSHPULL(GPIOE_MEM_D12)) | ||
674 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_SRAM_LB) | \ | ||
675 | PIN_OSPEED_100M(GPIOE_SRAM_UB) | \ | ||
676 | PIN_OSPEED_100M(GPIOE_PIN2) | \ | ||
677 | PIN_OSPEED_100M(GPIOE_PIN3) | \ | ||
678 | PIN_OSPEED_100M(GPIOE_PIN4) | \ | ||
679 | PIN_OSPEED_100M(GPIOE_PIN5) | \ | ||
680 | PIN_OSPEED_100M(GPIOE_PIN6) | \ | ||
681 | PIN_OSPEED_100M(GPIOE_MEM_D4) | \ | ||
682 | PIN_OSPEED_100M(GPIOE_MEM_D5) | \ | ||
683 | PIN_OSPEED_100M(GPIOE_MEM_D6) | \ | ||
684 | PIN_OSPEED_100M(GPIOE_MEM_D7) | \ | ||
685 | PIN_OSPEED_100M(GPIOE_MEM_D8) | \ | ||
686 | PIN_OSPEED_100M(GPIOE_MEM_D9) | \ | ||
687 | PIN_OSPEED_100M(GPIOE_MEM_D10) | \ | ||
688 | PIN_OSPEED_100M(GPIOE_MEM_D11) | \ | ||
689 | PIN_OSPEED_100M(GPIOE_MEM_D12)) | ||
690 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_SRAM_LB) | \ | ||
691 | PIN_PUPDR_FLOATING(GPIOE_SRAM_UB) | \ | ||
692 | PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ | ||
693 | PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ | ||
694 | PIN_PUPDR_FLOATING(GPIOE_PIN4) | \ | ||
695 | PIN_PUPDR_FLOATING(GPIOE_PIN5) | \ | ||
696 | PIN_PUPDR_FLOATING(GPIOE_PIN6) | \ | ||
697 | PIN_PUPDR_FLOATING(GPIOE_MEM_D4) | \ | ||
698 | PIN_PUPDR_FLOATING(GPIOE_MEM_D5) | \ | ||
699 | PIN_PUPDR_FLOATING(GPIOE_MEM_D6) | \ | ||
700 | PIN_PUPDR_FLOATING(GPIOE_MEM_D7) | \ | ||
701 | PIN_PUPDR_FLOATING(GPIOE_MEM_D8) | \ | ||
702 | PIN_PUPDR_FLOATING(GPIOE_MEM_D9) | \ | ||
703 | PIN_PUPDR_FLOATING(GPIOE_MEM_D10) | \ | ||
704 | PIN_PUPDR_FLOATING(GPIOE_MEM_D11) | \ | ||
705 | PIN_PUPDR_FLOATING(GPIOE_MEM_D12)) | ||
706 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_SRAM_LB) | \ | ||
707 | PIN_ODR_HIGH(GPIOE_SRAM_UB) | \ | ||
708 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
709 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
710 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
711 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
712 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
713 | PIN_ODR_HIGH(GPIOE_MEM_D4) | \ | ||
714 | PIN_ODR_HIGH(GPIOE_MEM_D5) | \ | ||
715 | PIN_ODR_HIGH(GPIOE_MEM_D6) | \ | ||
716 | PIN_ODR_HIGH(GPIOE_MEM_D7) | \ | ||
717 | PIN_ODR_HIGH(GPIOE_MEM_D8) | \ | ||
718 | PIN_ODR_HIGH(GPIOE_MEM_D9) | \ | ||
719 | PIN_ODR_HIGH(GPIOE_MEM_D10) | \ | ||
720 | PIN_ODR_HIGH(GPIOE_MEM_D11) | \ | ||
721 | PIN_ODR_HIGH(GPIOE_MEM_D12)) | ||
722 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_SRAM_LB, 12) | \ | ||
723 | PIN_AFIO_AF(GPIOE_SRAM_UB, 12) | \ | ||
724 | PIN_AFIO_AF(GPIOE_PIN2, 0) | \ | ||
725 | PIN_AFIO_AF(GPIOE_PIN3, 0) | \ | ||
726 | PIN_AFIO_AF(GPIOE_PIN4, 0) | \ | ||
727 | PIN_AFIO_AF(GPIOE_PIN5, 0) | \ | ||
728 | PIN_AFIO_AF(GPIOE_PIN6, 0) | \ | ||
729 | PIN_AFIO_AF(GPIOE_MEM_D4, 12)) | ||
730 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_MEM_D5, 12) | \ | ||
731 | PIN_AFIO_AF(GPIOE_MEM_D6, 12) | \ | ||
732 | PIN_AFIO_AF(GPIOE_MEM_D7, 12) | \ | ||
733 | PIN_AFIO_AF(GPIOE_MEM_D8, 12) | \ | ||
734 | PIN_AFIO_AF(GPIOE_MEM_D9, 12) | \ | ||
735 | PIN_AFIO_AF(GPIOE_MEM_D10, 12) | \ | ||
736 | PIN_AFIO_AF(GPIOE_MEM_D11, 12) | \ | ||
737 | PIN_AFIO_AF(GPIOE_MEM_D12, 12)) | ||
738 | |||
739 | /* | ||
740 | * GPIOF setup: | ||
741 | */ | ||
742 | #define VAL_GPIOF_MODER (PIN_MODE_ALTERNATE(GPIOF_MEM_A0) | \ | ||
743 | PIN_MODE_ALTERNATE(GPIOF_MEM_A1) | \ | ||
744 | PIN_MODE_ALTERNATE(GPIOF_MEM_A2) | \ | ||
745 | PIN_MODE_ALTERNATE(GPIOF_MEM_A3) | \ | ||
746 | PIN_MODE_ALTERNATE(GPIOF_MEM_A4) | \ | ||
747 | PIN_MODE_ALTERNATE(GPIOF_MEM_A5) | \ | ||
748 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
749 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
750 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
751 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
752 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
753 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
754 | PIN_MODE_ALTERNATE(GPIOF_MEM_A6) | \ | ||
755 | PIN_MODE_ALTERNATE(GPIOF_MEM_A7) | \ | ||
756 | PIN_MODE_ALTERNATE(GPIOF_MEM_A8) | \ | ||
757 | PIN_MODE_ALTERNATE(GPIOF_MEM_A9)) | ||
758 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_MEM_A0) | \ | ||
759 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A1) | \ | ||
760 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A2) | \ | ||
761 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A3) | \ | ||
762 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A4) | \ | ||
763 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A5) | \ | ||
764 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
765 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
766 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
767 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
768 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
769 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
770 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A6) | \ | ||
771 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A7) | \ | ||
772 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A8) | \ | ||
773 | PIN_OTYPE_PUSHPULL(GPIOF_MEM_A9)) | ||
774 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_MEM_A0) | \ | ||
775 | PIN_OSPEED_100M(GPIOF_MEM_A1) | \ | ||
776 | PIN_OSPEED_100M(GPIOF_MEM_A2) | \ | ||
777 | PIN_OSPEED_100M(GPIOF_MEM_A3) | \ | ||
778 | PIN_OSPEED_100M(GPIOF_MEM_A4) | \ | ||
779 | PIN_OSPEED_100M(GPIOF_MEM_A5) | \ | ||
780 | PIN_OSPEED_100M(GPIOF_PIN6) | \ | ||
781 | PIN_OSPEED_100M(GPIOF_PIN7) | \ | ||
782 | PIN_OSPEED_100M(GPIOF_PIN8) | \ | ||
783 | PIN_OSPEED_100M(GPIOF_PIN9) | \ | ||
784 | PIN_OSPEED_100M(GPIOF_PIN10) | \ | ||
785 | PIN_OSPEED_100M(GPIOF_PIN11) | \ | ||
786 | PIN_OSPEED_100M(GPIOF_MEM_A6) | \ | ||
787 | PIN_OSPEED_100M(GPIOF_MEM_A7) | \ | ||
788 | PIN_OSPEED_100M(GPIOF_MEM_A8) | \ | ||
789 | PIN_OSPEED_100M(GPIOF_MEM_A9)) | ||
790 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_MEM_A0) | \ | ||
791 | PIN_PUPDR_FLOATING(GPIOF_MEM_A1) | \ | ||
792 | PIN_PUPDR_FLOATING(GPIOF_MEM_A2) | \ | ||
793 | PIN_PUPDR_FLOATING(GPIOF_MEM_A3) | \ | ||
794 | PIN_PUPDR_FLOATING(GPIOF_MEM_A4) | \ | ||
795 | PIN_PUPDR_FLOATING(GPIOF_MEM_A5) | \ | ||
796 | PIN_PUPDR_FLOATING(GPIOF_PIN6) | \ | ||
797 | PIN_PUPDR_FLOATING(GPIOF_PIN7) | \ | ||
798 | PIN_PUPDR_FLOATING(GPIOF_PIN8) | \ | ||
799 | PIN_PUPDR_FLOATING(GPIOF_PIN9) | \ | ||
800 | PIN_PUPDR_FLOATING(GPIOF_PIN10) | \ | ||
801 | PIN_PUPDR_FLOATING(GPIOF_PIN11) | \ | ||
802 | PIN_PUPDR_FLOATING(GPIOF_MEM_A6) | \ | ||
803 | PIN_PUPDR_FLOATING(GPIOF_MEM_A7) | \ | ||
804 | PIN_PUPDR_FLOATING(GPIOF_MEM_A8) | \ | ||
805 | PIN_PUPDR_FLOATING(GPIOF_MEM_A9)) | ||
806 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_MEM_A0) | \ | ||
807 | PIN_ODR_HIGH(GPIOF_MEM_A1) | \ | ||
808 | PIN_ODR_HIGH(GPIOF_MEM_A2) | \ | ||
809 | PIN_ODR_HIGH(GPIOF_MEM_A3) | \ | ||
810 | PIN_ODR_HIGH(GPIOF_MEM_A4) | \ | ||
811 | PIN_ODR_HIGH(GPIOF_MEM_A5) | \ | ||
812 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
813 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
814 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
815 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
816 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
817 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
818 | PIN_ODR_HIGH(GPIOF_MEM_A6) | \ | ||
819 | PIN_ODR_HIGH(GPIOF_MEM_A7) | \ | ||
820 | PIN_ODR_HIGH(GPIOF_MEM_A8) | \ | ||
821 | PIN_ODR_HIGH(GPIOF_MEM_A9)) | ||
822 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_MEM_A0, 12) | \ | ||
823 | PIN_AFIO_AF(GPIOF_MEM_A1, 12) | \ | ||
824 | PIN_AFIO_AF(GPIOF_MEM_A2, 12) | \ | ||
825 | PIN_AFIO_AF(GPIOF_MEM_A3, 12) | \ | ||
826 | PIN_AFIO_AF(GPIOF_MEM_A4, 12) | \ | ||
827 | PIN_AFIO_AF(GPIOF_MEM_A5, 12) | \ | ||
828 | PIN_AFIO_AF(GPIOF_PIN6, 0) | \ | ||
829 | PIN_AFIO_AF(GPIOF_PIN7, 0)) | ||
830 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ | ||
831 | PIN_AFIO_AF(GPIOF_PIN9, 0) | \ | ||
832 | PIN_AFIO_AF(GPIOF_PIN10, 0) | \ | ||
833 | PIN_AFIO_AF(GPIOF_PIN11, 0) | \ | ||
834 | PIN_AFIO_AF(GPIOF_MEM_A6, 12) | \ | ||
835 | PIN_AFIO_AF(GPIOF_MEM_A7, 12) | \ | ||
836 | PIN_AFIO_AF(GPIOF_MEM_A8, 12) | \ | ||
837 | PIN_AFIO_AF(GPIOF_MEM_A9, 12)) | ||
838 | |||
839 | /* | ||
840 | * GPIOG setup: | ||
841 | */ | ||
842 | #define VAL_GPIOG_MODER (PIN_MODE_ALTERNATE(GPIOG_MEM_A10) | \ | ||
843 | PIN_MODE_ALTERNATE(GPIOG_MEM_A11) | \ | ||
844 | PIN_MODE_ALTERNATE(GPIOG_MEM_A12) | \ | ||
845 | PIN_MODE_ALTERNATE(GPIOG_MEM_A13) | \ | ||
846 | PIN_MODE_ALTERNATE(GPIOG_MEM_A14) | \ | ||
847 | PIN_MODE_ALTERNATE(GPIOG_MEM_A15) | \ | ||
848 | PIN_MODE_ALTERNATE(GPIOG_NAND_RB1) | \ | ||
849 | PIN_MODE_ALTERNATE(GPIOG_NAND_RB2) | \ | ||
850 | PIN_MODE_INPUT(GPIOG_PIN8) | \ | ||
851 | PIN_MODE_ALTERNATE(GPIOG_NAND_CE2) | \ | ||
852 | PIN_MODE_INPUT(GPIOG_PIN10) | \ | ||
853 | PIN_MODE_INPUT(GPIOG_PIN11) | \ | ||
854 | PIN_MODE_ALTERNATE(GPIOG_SRAM_CS1) | \ | ||
855 | PIN_MODE_INPUT(GPIOG_PIN13) | \ | ||
856 | PIN_MODE_INPUT(GPIOG_PIN14) | \ | ||
857 | PIN_MODE_INPUT(GPIOG_PIN15)) | ||
858 | #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_MEM_A10) | \ | ||
859 | PIN_OTYPE_PUSHPULL(GPIOG_MEM_A11) | \ | ||
860 | PIN_OTYPE_PUSHPULL(GPIOG_MEM_A12) | \ | ||
861 | PIN_OTYPE_PUSHPULL(GPIOG_MEM_A13) | \ | ||
862 | PIN_OTYPE_PUSHPULL(GPIOG_MEM_A14) | \ | ||
863 | PIN_OTYPE_PUSHPULL(GPIOG_MEM_A15) | \ | ||
864 | PIN_OTYPE_PUSHPULL(GPIOG_NAND_RB1) | \ | ||
865 | PIN_OTYPE_PUSHPULL(GPIOG_NAND_RB2) | \ | ||
866 | PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ | ||
867 | PIN_OTYPE_PUSHPULL(GPIOG_NAND_CE2) | \ | ||
868 | PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ | ||
869 | PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ | ||
870 | PIN_OTYPE_PUSHPULL(GPIOG_SRAM_CS1) | \ | ||
871 | PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ | ||
872 | PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ | ||
873 | PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) | ||
874 | #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_MEM_A10) | \ | ||
875 | PIN_OSPEED_100M(GPIOG_MEM_A11) | \ | ||
876 | PIN_OSPEED_100M(GPIOG_MEM_A12) | \ | ||
877 | PIN_OSPEED_100M(GPIOG_MEM_A13) | \ | ||
878 | PIN_OSPEED_100M(GPIOG_MEM_A14) | \ | ||
879 | PIN_OSPEED_100M(GPIOG_MEM_A15) | \ | ||
880 | PIN_OSPEED_100M(GPIOG_NAND_RB1) | \ | ||
881 | PIN_OSPEED_100M(GPIOG_NAND_RB2) | \ | ||
882 | PIN_OSPEED_100M(GPIOG_PIN8) | \ | ||
883 | PIN_OSPEED_100M(GPIOG_NAND_CE2) | \ | ||
884 | PIN_OSPEED_100M(GPIOG_PIN10) | \ | ||
885 | PIN_OSPEED_100M(GPIOG_PIN11) | \ | ||
886 | PIN_OSPEED_100M(GPIOG_SRAM_CS1) | \ | ||
887 | PIN_OSPEED_100M(GPIOG_PIN13) | \ | ||
888 | PIN_OSPEED_100M(GPIOG_PIN14) | \ | ||
889 | PIN_OSPEED_100M(GPIOG_PIN15)) | ||
890 | |||
891 | #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_MEM_A10) | \ | ||
892 | PIN_PUPDR_FLOATING(GPIOG_MEM_A11) | \ | ||
893 | PIN_PUPDR_FLOATING(GPIOG_MEM_A12) | \ | ||
894 | PIN_PUPDR_FLOATING(GPIOG_MEM_A13) | \ | ||
895 | PIN_PUPDR_FLOATING(GPIOG_MEM_A14) | \ | ||
896 | PIN_PUPDR_FLOATING(GPIOG_MEM_A15) | \ | ||
897 | PIN_PUPDR_PULLUP(GPIOG_NAND_RB1) | \ | ||
898 | PIN_PUPDR_FLOATING(GPIOG_NAND_RB2) | \ | ||
899 | PIN_PUPDR_FLOATING(GPIOG_PIN8) | \ | ||
900 | PIN_PUPDR_PULLUP(GPIOG_NAND_CE2) | \ | ||
901 | PIN_PUPDR_FLOATING(GPIOG_PIN10) | \ | ||
902 | PIN_PUPDR_FLOATING(GPIOG_PIN11) | \ | ||
903 | PIN_PUPDR_FLOATING(GPIOG_SRAM_CS1) | \ | ||
904 | PIN_PUPDR_FLOATING(GPIOG_PIN13) | \ | ||
905 | PIN_PUPDR_FLOATING(GPIOG_PIN14) | \ | ||
906 | PIN_PUPDR_FLOATING(GPIOG_PIN15)) | ||
907 | #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_MEM_A10) | \ | ||
908 | PIN_ODR_HIGH(GPIOG_MEM_A11) | \ | ||
909 | PIN_ODR_HIGH(GPIOG_MEM_A12) | \ | ||
910 | PIN_ODR_HIGH(GPIOG_MEM_A13) | \ | ||
911 | PIN_ODR_HIGH(GPIOG_MEM_A14) | \ | ||
912 | PIN_ODR_HIGH(GPIOG_MEM_A15) | \ | ||
913 | PIN_ODR_HIGH(GPIOG_NAND_RB1) | \ | ||
914 | PIN_ODR_HIGH(GPIOG_NAND_RB2) | \ | ||
915 | PIN_ODR_HIGH(GPIOG_PIN8) | \ | ||
916 | PIN_ODR_HIGH(GPIOG_NAND_CE2) | \ | ||
917 | PIN_ODR_HIGH(GPIOG_PIN10) | \ | ||
918 | PIN_ODR_HIGH(GPIOG_PIN11) | \ | ||
919 | PIN_ODR_HIGH(GPIOG_SRAM_CS1) | \ | ||
920 | PIN_ODR_HIGH(GPIOG_PIN13) | \ | ||
921 | PIN_ODR_HIGH(GPIOG_PIN14) | \ | ||
922 | PIN_ODR_HIGH(GPIOG_PIN15)) | ||
923 | #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_MEM_A10, 12) | \ | ||
924 | PIN_AFIO_AF(GPIOG_MEM_A11, 12) | \ | ||
925 | PIN_AFIO_AF(GPIOG_MEM_A12, 12) | \ | ||
926 | PIN_AFIO_AF(GPIOG_MEM_A13, 12) | \ | ||
927 | PIN_AFIO_AF(GPIOG_MEM_A14, 12) | \ | ||
928 | PIN_AFIO_AF(GPIOG_MEM_A15, 12) | \ | ||
929 | PIN_AFIO_AF(GPIOG_NAND_RB1, 12) | \ | ||
930 | PIN_AFIO_AF(GPIOG_NAND_RB2, 12)) | ||
931 | #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ | ||
932 | PIN_AFIO_AF(GPIOG_NAND_CE2, 12) | \ | ||
933 | PIN_AFIO_AF(GPIOG_PIN10, 0) | \ | ||
934 | PIN_AFIO_AF(GPIOG_PIN11, 0) | \ | ||
935 | PIN_AFIO_AF(GPIOG_SRAM_CS1, 12) | \ | ||
936 | PIN_AFIO_AF(GPIOG_PIN13, 0) | \ | ||
937 | PIN_AFIO_AF(GPIOG_PIN14, 0) | \ | ||
938 | PIN_AFIO_AF(GPIOG_PIN15, 0)) | ||
939 | |||
940 | /* | ||
941 | * GPIOH setup: | ||
942 | */ | ||
943 | #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \ | ||
944 | PIN_MODE_INPUT(GPIOH_OSC_OUT) | \ | ||
945 | PIN_MODE_INPUT(GPIOH_PIN2) | \ | ||
946 | PIN_MODE_INPUT(GPIOH_PIN3) | \ | ||
947 | PIN_MODE_INPUT(GPIOH_PIN4) | \ | ||
948 | PIN_MODE_INPUT(GPIOH_PIN5) | \ | ||
949 | PIN_MODE_INPUT(GPIOH_PIN6) | \ | ||
950 | PIN_MODE_ALTERNATE(GPIOH_I2C3_SCL) | \ | ||
951 | PIN_MODE_ALTERNATE(GPIOH_I2C3_SDA) | \ | ||
952 | PIN_MODE_INPUT(GPIOH_PIN9) | \ | ||
953 | PIN_MODE_INPUT(GPIOH_PIN10) | \ | ||
954 | PIN_MODE_INPUT(GPIOH_PIN11) | \ | ||
955 | PIN_MODE_INPUT(GPIOH_PIN12) | \ | ||
956 | PIN_MODE_INPUT(GPIOH_PIN13) | \ | ||
957 | PIN_MODE_INPUT(GPIOH_PIN14) | \ | ||
958 | PIN_MODE_INPUT(GPIOH_PIN15)) | ||
959 | #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \ | ||
960 | PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \ | ||
961 | PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ | ||
962 | PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ | ||
963 | PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ | ||
964 | PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ | ||
965 | PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ | ||
966 | PIN_OTYPE_OPENDRAIN(GPIOH_I2C3_SCL) | \ | ||
967 | PIN_OTYPE_OPENDRAIN(GPIOH_I2C3_SDA) | \ | ||
968 | PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ | ||
969 | PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ | ||
970 | PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ | ||
971 | PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ | ||
972 | PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ | ||
973 | PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ | ||
974 | PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) | ||
975 | #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ | ||
976 | PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ | ||
977 | PIN_OSPEED_100M(GPIOH_PIN2) | \ | ||
978 | PIN_OSPEED_100M(GPIOH_PIN3) | \ | ||
979 | PIN_OSPEED_100M(GPIOH_PIN4) | \ | ||
980 | PIN_OSPEED_100M(GPIOH_PIN5) | \ | ||
981 | PIN_OSPEED_100M(GPIOH_PIN6) | \ | ||
982 | PIN_OSPEED_2M(GPIOH_I2C3_SCL) | \ | ||
983 | PIN_OSPEED_2M(GPIOH_I2C3_SDA) | \ | ||
984 | PIN_OSPEED_100M(GPIOH_PIN9) | \ | ||
985 | PIN_OSPEED_100M(GPIOH_PIN10) | \ | ||
986 | PIN_OSPEED_100M(GPIOH_PIN11) | \ | ||
987 | PIN_OSPEED_100M(GPIOH_PIN12) | \ | ||
988 | PIN_OSPEED_100M(GPIOH_PIN13) | \ | ||
989 | PIN_OSPEED_100M(GPIOH_PIN14) | \ | ||
990 | PIN_OSPEED_100M(GPIOH_PIN15)) | ||
991 | #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ | ||
992 | PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ | ||
993 | PIN_PUPDR_FLOATING(GPIOH_PIN2) | \ | ||
994 | PIN_PUPDR_FLOATING(GPIOH_PIN3) | \ | ||
995 | PIN_PUPDR_FLOATING(GPIOH_PIN4) | \ | ||
996 | PIN_PUPDR_FLOATING(GPIOH_PIN5) | \ | ||
997 | PIN_PUPDR_FLOATING(GPIOH_PIN6) | \ | ||
998 | PIN_PUPDR_FLOATING(GPIOH_I2C3_SCL) | \ | ||
999 | PIN_PUPDR_FLOATING(GPIOH_I2C3_SDA) | \ | ||
1000 | PIN_PUPDR_FLOATING(GPIOH_PIN9) | \ | ||
1001 | PIN_PUPDR_FLOATING(GPIOH_PIN10) | \ | ||
1002 | PIN_PUPDR_FLOATING(GPIOH_PIN11) | \ | ||
1003 | PIN_PUPDR_FLOATING(GPIOH_PIN12) | \ | ||
1004 | PIN_PUPDR_FLOATING(GPIOH_PIN13) | \ | ||
1005 | PIN_PUPDR_FLOATING(GPIOH_PIN14) | \ | ||
1006 | PIN_PUPDR_FLOATING(GPIOH_PIN15)) | ||
1007 | #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \ | ||
1008 | PIN_ODR_HIGH(GPIOH_OSC_OUT) | \ | ||
1009 | PIN_ODR_HIGH(GPIOH_PIN2) | \ | ||
1010 | PIN_ODR_HIGH(GPIOH_PIN3) | \ | ||
1011 | PIN_ODR_HIGH(GPIOH_PIN4) | \ | ||
1012 | PIN_ODR_HIGH(GPIOH_PIN5) | \ | ||
1013 | PIN_ODR_HIGH(GPIOH_PIN6) | \ | ||
1014 | PIN_ODR_HIGH(GPIOH_I2C3_SCL) | \ | ||
1015 | PIN_ODR_HIGH(GPIOH_I2C3_SDA) | \ | ||
1016 | PIN_ODR_HIGH(GPIOH_PIN9) | \ | ||
1017 | PIN_ODR_HIGH(GPIOH_PIN10) | \ | ||
1018 | PIN_ODR_HIGH(GPIOH_PIN11) | \ | ||
1019 | PIN_ODR_HIGH(GPIOH_PIN12) | \ | ||
1020 | PIN_ODR_HIGH(GPIOH_PIN13) | \ | ||
1021 | PIN_ODR_HIGH(GPIOH_PIN14) | \ | ||
1022 | PIN_ODR_HIGH(GPIOH_PIN15)) | ||
1023 | #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0) | \ | ||
1024 | PIN_AFIO_AF(GPIOH_OSC_OUT, 0) | \ | ||
1025 | PIN_AFIO_AF(GPIOH_PIN2, 0) | \ | ||
1026 | PIN_AFIO_AF(GPIOH_PIN3, 0) | \ | ||
1027 | PIN_AFIO_AF(GPIOH_PIN4, 0) | \ | ||
1028 | PIN_AFIO_AF(GPIOH_PIN5, 0) | \ | ||
1029 | PIN_AFIO_AF(GPIOH_PIN6, 0) | \ | ||
1030 | PIN_AFIO_AF(GPIOH_I2C3_SCL, 4)) | ||
1031 | #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_I2C3_SDA, 4) | \ | ||
1032 | PIN_AFIO_AF(GPIOH_PIN9, 0) | \ | ||
1033 | PIN_AFIO_AF(GPIOH_PIN10, 0) | \ | ||
1034 | PIN_AFIO_AF(GPIOH_PIN11, 0) | \ | ||
1035 | PIN_AFIO_AF(GPIOH_PIN12, 0) | \ | ||
1036 | PIN_AFIO_AF(GPIOH_PIN13, 0) | \ | ||
1037 | PIN_AFIO_AF(GPIOH_PIN14, 0) | \ | ||
1038 | PIN_AFIO_AF(GPIOH_PIN15, 0)) | ||
1039 | |||
1040 | /* | ||
1041 | * GPIOI setup: | ||
1042 | */ | ||
1043 | #define VAL_GPIOI_MODER (PIN_MODE_INPUT(GPIOI_PIN0) | \ | ||
1044 | PIN_MODE_INPUT(GPIOI_PIN1) | \ | ||
1045 | PIN_MODE_INPUT(GPIOI_PIN2) | \ | ||
1046 | PIN_MODE_INPUT(GPIOI_PIN3) | \ | ||
1047 | PIN_MODE_INPUT(GPIOI_PIN4) | \ | ||
1048 | PIN_MODE_INPUT(GPIOI_PIN5) | \ | ||
1049 | PIN_MODE_INPUT(GPIOI_PIN6) | \ | ||
1050 | PIN_MODE_INPUT(GPIOI_PIN7) | \ | ||
1051 | PIN_MODE_INPUT(GPIOI_PIN8) | \ | ||
1052 | PIN_MODE_INPUT(GPIOI_PIN9) | \ | ||
1053 | PIN_MODE_OUTPUT(GPIOI_LED_R) | \ | ||
1054 | PIN_MODE_OUTPUT(GPIOI_LED_G) | \ | ||
1055 | PIN_MODE_INPUT(GPIOI_PIN12) | \ | ||
1056 | PIN_MODE_INPUT(GPIOI_PIN13) | \ | ||
1057 | PIN_MODE_INPUT(GPIOI_PIN14) | \ | ||
1058 | PIN_MODE_INPUT(GPIOI_PIN15)) | ||
1059 | #define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \ | ||
1060 | PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \ | ||
1061 | PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \ | ||
1062 | PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \ | ||
1063 | PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \ | ||
1064 | PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \ | ||
1065 | PIN_OTYPE_PUSHPULL(GPIOI_PIN6) | \ | ||
1066 | PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \ | ||
1067 | PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \ | ||
1068 | PIN_OTYPE_PUSHPULL(GPIOI_PIN9) | \ | ||
1069 | PIN_OTYPE_PUSHPULL(GPIOI_LED_R) | \ | ||
1070 | PIN_OTYPE_PUSHPULL(GPIOI_LED_G) | \ | ||
1071 | PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \ | ||
1072 | PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ | ||
1073 | PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ | ||
1074 | PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) | ||
1075 | #define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ | ||
1076 | PIN_OSPEED_100M(GPIOI_PIN1) | \ | ||
1077 | PIN_OSPEED_100M(GPIOI_PIN2) | \ | ||
1078 | PIN_OSPEED_100M(GPIOI_PIN3) | \ | ||
1079 | PIN_OSPEED_100M(GPIOI_PIN4) | \ | ||
1080 | PIN_OSPEED_100M(GPIOI_PIN5) | \ | ||
1081 | PIN_OSPEED_100M(GPIOI_PIN6) | \ | ||
1082 | PIN_OSPEED_100M(GPIOI_PIN7) | \ | ||
1083 | PIN_OSPEED_100M(GPIOI_PIN8) | \ | ||
1084 | PIN_OSPEED_100M(GPIOI_PIN9) | \ | ||
1085 | PIN_OSPEED_100M(GPIOI_LED_R) | \ | ||
1086 | PIN_OSPEED_100M(GPIOI_LED_G) | \ | ||
1087 | PIN_OSPEED_100M(GPIOI_PIN12) | \ | ||
1088 | PIN_OSPEED_100M(GPIOI_PIN13) | \ | ||
1089 | PIN_OSPEED_100M(GPIOI_PIN14) | \ | ||
1090 | PIN_OSPEED_100M(GPIOI_PIN15)) | ||
1091 | #define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \ | ||
1092 | PIN_PUPDR_FLOATING(GPIOI_PIN1) | \ | ||
1093 | PIN_PUPDR_FLOATING(GPIOI_PIN2) | \ | ||
1094 | PIN_PUPDR_FLOATING(GPIOI_PIN3) | \ | ||
1095 | PIN_PUPDR_FLOATING(GPIOI_PIN4) | \ | ||
1096 | PIN_PUPDR_FLOATING(GPIOI_PIN5) | \ | ||
1097 | PIN_PUPDR_FLOATING(GPIOI_PIN6) | \ | ||
1098 | PIN_PUPDR_FLOATING(GPIOI_PIN7) | \ | ||
1099 | PIN_PUPDR_FLOATING(GPIOI_PIN8) | \ | ||
1100 | PIN_PUPDR_FLOATING(GPIOI_PIN9) | \ | ||
1101 | PIN_PUPDR_FLOATING(GPIOI_LED_R) | \ | ||
1102 | PIN_PUPDR_FLOATING(GPIOI_LED_G) | \ | ||
1103 | PIN_PUPDR_FLOATING(GPIOI_PIN12) | \ | ||
1104 | PIN_PUPDR_FLOATING(GPIOI_PIN13) | \ | ||
1105 | PIN_PUPDR_FLOATING(GPIOI_PIN14) | \ | ||
1106 | PIN_PUPDR_FLOATING(GPIOI_PIN15)) | ||
1107 | #define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_PIN0) | \ | ||
1108 | PIN_ODR_HIGH(GPIOI_PIN1) | \ | ||
1109 | PIN_ODR_HIGH(GPIOI_PIN2) | \ | ||
1110 | PIN_ODR_HIGH(GPIOI_PIN3) | \ | ||
1111 | PIN_ODR_HIGH(GPIOI_PIN4) | \ | ||
1112 | PIN_ODR_HIGH(GPIOI_PIN5) | \ | ||
1113 | PIN_ODR_HIGH(GPIOI_PIN6) | \ | ||
1114 | PIN_ODR_HIGH(GPIOI_PIN7) | \ | ||
1115 | PIN_ODR_HIGH(GPIOI_PIN8) | \ | ||
1116 | PIN_ODR_HIGH(GPIOI_PIN9) | \ | ||
1117 | PIN_ODR_LOW(GPIOI_LED_R) | \ | ||
1118 | PIN_ODR_LOW(GPIOI_LED_G) | \ | ||
1119 | PIN_ODR_HIGH(GPIOI_PIN12) | \ | ||
1120 | PIN_ODR_HIGH(GPIOI_PIN13) | \ | ||
1121 | PIN_ODR_HIGH(GPIOI_PIN14) | \ | ||
1122 | PIN_ODR_HIGH(GPIOI_PIN15)) | ||
1123 | #define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0) | \ | ||
1124 | PIN_AFIO_AF(GPIOI_PIN1, 0) | \ | ||
1125 | PIN_AFIO_AF(GPIOI_PIN2, 0) | \ | ||
1126 | PIN_AFIO_AF(GPIOI_PIN3, 0) | \ | ||
1127 | PIN_AFIO_AF(GPIOI_PIN4, 0) | \ | ||
1128 | PIN_AFIO_AF(GPIOI_PIN5, 0) | \ | ||
1129 | PIN_AFIO_AF(GPIOI_PIN6, 0) | \ | ||
1130 | PIN_AFIO_AF(GPIOI_PIN7, 0)) | ||
1131 | #define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0) | \ | ||
1132 | PIN_AFIO_AF(GPIOI_PIN9, 0) | \ | ||
1133 | PIN_AFIO_AF(GPIOI_LED_R, 0) | \ | ||
1134 | PIN_AFIO_AF(GPIOI_LED_G, 0) | \ | ||
1135 | PIN_AFIO_AF(GPIOI_PIN12, 0) | \ | ||
1136 | PIN_AFIO_AF(GPIOI_PIN13, 0) | \ | ||
1137 | PIN_AFIO_AF(GPIOI_PIN14, 0) | \ | ||
1138 | PIN_AFIO_AF(GPIOI_PIN15, 0)) | ||
1139 | |||
1140 | #if !defined(_FROM_ASM_) | ||
1141 | #ifdef __cplusplus | ||
1142 | extern "C" { | ||
1143 | #endif | ||
1144 | void boardInit(void); | ||
1145 | #ifdef __cplusplus | ||
1146 | } | ||
1147 | #endif | ||
1148 | #endif /* _FROM_ASM_ */ | ||
1149 | |||
1150 | #endif /* _BOARD_H_ */ | ||