diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_STM32L4R9I_DISCOVERY/board.h')
-rw-r--r-- | lib/chibios/os/hal/boards/ST_STM32L4R9I_DISCOVERY/board.h | 1655 |
1 files changed, 1655 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_STM32L4R9I_DISCOVERY/board.h b/lib/chibios/os/hal/boards/ST_STM32L4R9I_DISCOVERY/board.h new file mode 100644 index 000000000..cf75dc86b --- /dev/null +++ b/lib/chibios/os/hal/boards/ST_STM32L4R9I_DISCOVERY/board.h | |||
@@ -0,0 +1,1655 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
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 | /* | ||
18 | * This file has been automatically generated using ChibiStudio board | ||
19 | * generator plugin. Do not edit manually. | ||
20 | */ | ||
21 | |||
22 | #ifndef BOARD_H | ||
23 | #define BOARD_H | ||
24 | |||
25 | /*===========================================================================*/ | ||
26 | /* Driver constants. */ | ||
27 | /*===========================================================================*/ | ||
28 | |||
29 | /* | ||
30 | * Setup for STMicroelectronics STM32L4R9I-Discovery board. | ||
31 | */ | ||
32 | |||
33 | /* | ||
34 | * Board identifier. | ||
35 | */ | ||
36 | #define BOARD_ST_STM32L4R9I_DISCOVERY | ||
37 | #define BOARD_NAME "STMicroelectronics STM32L4R9I-Discovery" | ||
38 | |||
39 | /* | ||
40 | * Board oscillators-related settings. | ||
41 | */ | ||
42 | #if !defined(STM32_LSECLK) | ||
43 | #define STM32_LSECLK 32768U | ||
44 | #endif | ||
45 | |||
46 | #define STM32_LSEDRV (3U << 3U) | ||
47 | |||
48 | #if !defined(STM32_HSECLK) | ||
49 | #define STM32_HSECLK 16000000U | ||
50 | #endif | ||
51 | |||
52 | /* | ||
53 | * Board voltages. | ||
54 | * Required for performance limits calculation. | ||
55 | */ | ||
56 | #define STM32_VDD 300U | ||
57 | |||
58 | /* | ||
59 | * MCU type as defined in the ST header. | ||
60 | */ | ||
61 | #define STM32L4R9xx | ||
62 | |||
63 | /* | ||
64 | * IO pins assignments. | ||
65 | */ | ||
66 | #define GPIOA_PIN0 0U | ||
67 | #define GPIOA_PIN1 1U | ||
68 | #define GPIOA_STLINK_USART2_TX 2U | ||
69 | #define GPIOA_STLINK_USART2_RX 3U | ||
70 | #define GPIOA_PIN4 4U | ||
71 | #define GPIOA_PIN5 5U | ||
72 | #define GPIOA_PIN6 6U | ||
73 | #define GPIOA_PIN7 7U | ||
74 | #define GPIOA_PIN8 8U | ||
75 | #define GPIOA_USB_OTGFS_VBUS 9U | ||
76 | #define GPIOA_USB_OTGFS_ID 10U | ||
77 | #define GPIOA_USB_OTGFS_DM 11U | ||
78 | #define GPIOA_USB_OTGFS_DP 12U | ||
79 | #define GPIOA_SWDIO 13U | ||
80 | #define GPIOA_SWCLK 14U | ||
81 | #define GPIOA_PIN15 15U | ||
82 | |||
83 | #define GPIOB_PIN0 0U | ||
84 | #define GPIOB_PIN1 1U | ||
85 | #define GPIOB_PIN2 2U | ||
86 | #define GPIOB_SWO 3U | ||
87 | #define GPIOB_PIN4 4U | ||
88 | #define GPIOB_PIN5 5U | ||
89 | #define GPIOB_PIN6 6U | ||
90 | #define GPIOB_PIN7 7U | ||
91 | #define GPIOB_PIN8 8U | ||
92 | #define GPIOB_PIN9 9U | ||
93 | #define GPIOB_PIN10 10U | ||
94 | #define GPIOB_PIN11 11U | ||
95 | #define GPIOB_PIN12 12U | ||
96 | #define GPIOB_PIN13 13U | ||
97 | #define GPIOB_PIN14 14U | ||
98 | #define GPIOB_PIN15 15U | ||
99 | |||
100 | #define GPIOC_PIN0 0U | ||
101 | #define GPIOC_PIN1 1U | ||
102 | #define GPIOC_PIN2 2U | ||
103 | #define GPIOC_PIN3 3U | ||
104 | #define GPIOC_PIN4 4U | ||
105 | #define GPIOC_PIN5 5U | ||
106 | #define GPIOC_PIN6 6U | ||
107 | #define GPIOC_PIN7 7U | ||
108 | #define GPIOC_SDMMC_1_D0 8U | ||
109 | #define GPIOC_SDMMC_1_D1 9U | ||
110 | #define GPIOC_SDMMC_1_D2 10U | ||
111 | #define GPIOC_SDMMC_1_D3 11U | ||
112 | #define GPIOC_SDMMC_1_CK 12U | ||
113 | #define GPIOC_JOY_SEL 13U | ||
114 | #define GPIOC_BUTTON 13U | ||
115 | #define GPIOC_PIN14 14U | ||
116 | #define GPIOC_PIN15 15U | ||
117 | |||
118 | #define GPIOD_PIN0 0U | ||
119 | #define GPIOD_PIN1 1U | ||
120 | #define GPIOD_SDMMC_1_CMD 2U | ||
121 | #define GPIOD_PIN3 3U | ||
122 | #define GPIOD_PIN4 4U | ||
123 | #define GPIOD_PIN5 5U | ||
124 | #define GPIOD_PIN6 6U | ||
125 | #define GPIOD_PIN7 7U | ||
126 | #define GPIOD_PIN8 8U | ||
127 | #define GPIOD_PIN9 9U | ||
128 | #define GPIOD_PIN10 10U | ||
129 | #define GPIOD_PIN11 11U | ||
130 | #define GPIOD_PIN12 12U | ||
131 | #define GPIOD_PIN13 13U | ||
132 | #define GPIOD_PIN14 14U | ||
133 | #define GPIOD_PIN15 15U | ||
134 | |||
135 | #define GPIOE_PIN0 0U | ||
136 | #define GPIOE_PIN1 1U | ||
137 | #define GPIOE_PIN2 2U | ||
138 | #define GPIOE_PIN3 3U | ||
139 | #define GPIOE_PIN4 4U | ||
140 | #define GPIOE_PIN5 5U | ||
141 | #define GPIOE_PIN6 6U | ||
142 | #define GPIOE_PIN7 7U | ||
143 | #define GPIOE_PIN8 8U | ||
144 | #define GPIOE_PIN9 9U | ||
145 | #define GPIOE_PIN10 10U | ||
146 | #define GPIOE_PIN11 11U | ||
147 | #define GPIOE_PIN12 12U | ||
148 | #define GPIOE_PIN13 13U | ||
149 | #define GPIOE_PIN14 14U | ||
150 | #define GPIOE_PIN15 15U | ||
151 | |||
152 | #define GPIOF_PIN0 0U | ||
153 | #define GPIOF_PIN1 1U | ||
154 | #define GPIOF_PIN2 2U | ||
155 | #define GPIOF_PIN3 3U | ||
156 | #define GPIOF_PIN4 4U | ||
157 | #define GPIOF_PIN5 5U | ||
158 | #define GPIOF_PIN6 6U | ||
159 | #define GPIOF_PIN7 7U | ||
160 | #define GPIOF_PIN8 8U | ||
161 | #define GPIOF_PIN9 9U | ||
162 | #define GPIOF_PIN10 10U | ||
163 | #define GPIOF_PIN11 11U | ||
164 | #define GPIOF_PIN12 12U | ||
165 | #define GPIOF_PIN13 13U | ||
166 | #define GPIOF_PIN14 14U | ||
167 | #define GPIOF_PIN15 15U | ||
168 | |||
169 | #define GPIOG_PIN0 0U | ||
170 | #define GPIOG_PIN1 1U | ||
171 | #define GPIOG_PIN2 2U | ||
172 | #define GPIOG_PIN3 3U | ||
173 | #define GPIOG_PIN4 4U | ||
174 | #define GPIOG_PIN5 5U | ||
175 | #define GPIOG_PIN6 6U | ||
176 | #define GPIOG_PIN7 7U | ||
177 | #define GPIOG_PIN8 8U | ||
178 | #define GPIOG_OCTOSPIM_P2_IO6 9U | ||
179 | #define GPIOG_OCTOSPIM_P2_IO7 10U | ||
180 | #define GPIOG_PIN11 11U | ||
181 | #define GPIOG_OCTOSPIM_P2_NCS 12U | ||
182 | #define GPIOG_PIN13 13U | ||
183 | #define GPIOG_PIN14 14U | ||
184 | #define GPIOG_OCTOSPIM_P2_DQS 15U | ||
185 | |||
186 | #define GPIOH_OSC_IN 0U | ||
187 | #define GPIOH_OSC_OUT 1U | ||
188 | #define GPIOH_PIN2 2U | ||
189 | #define GPIOH_BOOT0 3U | ||
190 | #define GPIOH_LED 4U | ||
191 | #define GPIOH_LED_GREEN 4U | ||
192 | #define GPIOH_PIN5 5U | ||
193 | #define GPIOH_PIN6 6U | ||
194 | #define GPIOH_PIN7 7U | ||
195 | #define GPIOH_OCTOSPIM_P2_IO3 8U | ||
196 | #define GPIOH_OCTOSPIM_P2_IO4 9U | ||
197 | #define GPIOH_OCTOSPIM_P2_IO5 10U | ||
198 | #define GPIOH_PIN11 11U | ||
199 | #define GPIOH_PIN12 12U | ||
200 | #define GPIOH_PIN13 13U | ||
201 | #define GPIOH_PIN14 14U | ||
202 | #define GPIOH_PIN15 15U | ||
203 | |||
204 | #define GPIOI_PIN0 0U | ||
205 | #define GPIOI_PIN1 1U | ||
206 | #define GPIOI_PIN2 2U | ||
207 | #define GPIOI_PIN3 3U | ||
208 | #define GPIOI_PIN4 4U | ||
209 | #define GPIOI_PIN5 5U | ||
210 | #define GPIOI_OCTOSPIM_P2_CLK 6U | ||
211 | #define GPIOI_PIN7 7U | ||
212 | #define GPIOI_PIN8 8U | ||
213 | #define GPIOI_OCTOSPIM_P2_IO2 9U | ||
214 | #define GPIOI_OCTOSPIM_P2_IO1 10U | ||
215 | #define GPIOI_OCTOSPIM_P2_IO0 11U | ||
216 | #define GPIOI_PIN12 12U | ||
217 | #define GPIOI_PIN13 13U | ||
218 | #define GPIOI_PIN14 14U | ||
219 | #define GPIOI_PIN15 15U | ||
220 | |||
221 | /* | ||
222 | * IO lines assignments. | ||
223 | */ | ||
224 | #define LINE_STLINK_USART2_TX PAL_LINE(GPIOA, 2U) | ||
225 | #define LINE_STLINK_USART2_RX PAL_LINE(GPIOA, 3U) | ||
226 | #define LINE_USB_OTGFS_VBUS PAL_LINE(GPIOA, 9U) | ||
227 | #define LINE_USB_OTGFS_ID PAL_LINE(GPIOA, 10U) | ||
228 | #define LINE_USB_OTGFS_DM PAL_LINE(GPIOA, 11U) | ||
229 | #define LINE_USB_OTGFS_DP PAL_LINE(GPIOA, 12U) | ||
230 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
231 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
232 | #define LINE_SWO PAL_LINE(GPIOB, 3U) | ||
233 | #define LINE_SDMMC_1_D0 PAL_LINE(GPIOC, 8U) | ||
234 | #define LINE_SDMMC_1_D1 PAL_LINE(GPIOC, 9U) | ||
235 | #define LINE_SDMMC_1_D2 PAL_LINE(GPIOC, 10U) | ||
236 | #define LINE_SDMMC_1_D3 PAL_LINE(GPIOC, 11U) | ||
237 | #define LINE_SDMMC_1_CK PAL_LINE(GPIOC, 12U) | ||
238 | #define LINE_JOY_SEL PAL_LINE(GPIOC, 13U) | ||
239 | #define LINE_BUTTON PAL_LINE(GPIOC, 13U) | ||
240 | #define LINE_SDMMC_1_CMD PAL_LINE(GPIOD, 2U) | ||
241 | #define LINE_OCTOSPIM_P2_IO6 PAL_LINE(GPIOG, 9U) | ||
242 | #define LINE_OCTOSPIM_P2_IO7 PAL_LINE(GPIOG, 10U) | ||
243 | #define LINE_OCTOSPIM_P2_NCS PAL_LINE(GPIOG, 12U) | ||
244 | #define LINE_OCTOSPIM_P2_DQS PAL_LINE(GPIOG, 15U) | ||
245 | #define LINE_OSC_IN PAL_LINE(GPIOH, 0U) | ||
246 | #define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) | ||
247 | #define LINE_BOOT0 PAL_LINE(GPIOH, 3U) | ||
248 | #define LINE_LED PAL_LINE(GPIOH, 4U) | ||
249 | #define LINE_LED_GREEN PAL_LINE(GPIOH, 4U) | ||
250 | #define LINE_OCTOSPIM_P2_IO3 PAL_LINE(GPIOH, 8U) | ||
251 | #define LINE_OCTOSPIM_P2_IO4 PAL_LINE(GPIOH, 9U) | ||
252 | #define LINE_OCTOSPIM_P2_IO5 PAL_LINE(GPIOH, 10U) | ||
253 | #define LINE_OCTOSPIM_P2_CLK PAL_LINE(GPIOI, 6U) | ||
254 | #define LINE_OCTOSPIM_P2_IO2 PAL_LINE(GPIOI, 9U) | ||
255 | #define LINE_OCTOSPIM_P2_IO1 PAL_LINE(GPIOI, 10U) | ||
256 | #define LINE_OCTOSPIM_P2_IO0 PAL_LINE(GPIOI, 11U) | ||
257 | |||
258 | /*===========================================================================*/ | ||
259 | /* Driver pre-compile time settings. */ | ||
260 | /*===========================================================================*/ | ||
261 | |||
262 | /*===========================================================================*/ | ||
263 | /* Derived constants and error checks. */ | ||
264 | /*===========================================================================*/ | ||
265 | |||
266 | /*===========================================================================*/ | ||
267 | /* Driver data structures and types. */ | ||
268 | /*===========================================================================*/ | ||
269 | |||
270 | /*===========================================================================*/ | ||
271 | /* Driver macros. */ | ||
272 | /*===========================================================================*/ | ||
273 | |||
274 | /* | ||
275 | * I/O ports initial setup, this configuration is established soon after reset | ||
276 | * in the initialization code. | ||
277 | * Please refer to the STM32 Reference Manual for details. | ||
278 | */ | ||
279 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
280 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
281 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
282 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
283 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
284 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
285 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
286 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
287 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
288 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
289 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
290 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
291 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
292 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
293 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
294 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
295 | #define PIN_ASCR_DISABLED(n) (0U << (n)) | ||
296 | #define PIN_ASCR_ENABLED(n) (1U << (n)) | ||
297 | #define PIN_LOCKR_DISABLED(n) (0U << (n)) | ||
298 | #define PIN_LOCKR_ENABLED(n) (1U << (n)) | ||
299 | |||
300 | /* | ||
301 | * GPIOA setup: | ||
302 | * | ||
303 | * PA0 - PIN0 (analog). | ||
304 | * PA1 - PIN1 (analog). | ||
305 | * PA2 - STLINK_USART2_TX (alternate 7). | ||
306 | * PA3 - STLINK_USART2_RX (alternate 7). | ||
307 | * PA4 - PIN4 (analog). | ||
308 | * PA5 - PIN5 (analog). | ||
309 | * PA6 - PIN6 (analog). | ||
310 | * PA7 - PIN7 (analog). | ||
311 | * PA8 - PIN8 (analog). | ||
312 | * PA9 - USB_OTGFS_VBUS (input pullup). | ||
313 | * PA10 - USB_OTGFS_ID (alternate 10). | ||
314 | * PA11 - USB_OTGFS_DM (alternate 10). | ||
315 | * PA12 - USB_OTGFS_DP (alternate 10). | ||
316 | * PA13 - SWDIO (alternate 0). | ||
317 | * PA14 - SWCLK (alternate 0). | ||
318 | * PA15 - PIN15 (analog). | ||
319 | */ | ||
320 | #define VAL_GPIOA_MODER (PIN_MODE_ANALOG(GPIOA_PIN0) | \ | ||
321 | PIN_MODE_ANALOG(GPIOA_PIN1) | \ | ||
322 | PIN_MODE_ALTERNATE(GPIOA_STLINK_USART2_TX) |\ | ||
323 | PIN_MODE_ALTERNATE(GPIOA_STLINK_USART2_RX) |\ | ||
324 | PIN_MODE_ANALOG(GPIOA_PIN4) | \ | ||
325 | PIN_MODE_ANALOG(GPIOA_PIN5) | \ | ||
326 | PIN_MODE_ANALOG(GPIOA_PIN6) | \ | ||
327 | PIN_MODE_ANALOG(GPIOA_PIN7) | \ | ||
328 | PIN_MODE_ANALOG(GPIOA_PIN8) | \ | ||
329 | PIN_MODE_INPUT(GPIOA_USB_OTGFS_VBUS) | \ | ||
330 | PIN_MODE_ALTERNATE(GPIOA_USB_OTGFS_ID) |\ | ||
331 | PIN_MODE_ALTERNATE(GPIOA_USB_OTGFS_DM) |\ | ||
332 | PIN_MODE_ALTERNATE(GPIOA_USB_OTGFS_DP) |\ | ||
333 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
334 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
335 | PIN_MODE_ANALOG(GPIOA_PIN15)) | ||
336 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ | ||
337 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
338 | PIN_OTYPE_PUSHPULL(GPIOA_STLINK_USART2_TX) |\ | ||
339 | PIN_OTYPE_PUSHPULL(GPIOA_STLINK_USART2_RX) |\ | ||
340 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
341 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
342 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
343 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
344 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
345 | PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_VBUS) |\ | ||
346 | PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_ID) |\ | ||
347 | PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_DM) |\ | ||
348 | PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_DP) |\ | ||
349 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
350 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
351 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
352 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ | ||
353 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
354 | PIN_OSPEED_HIGH(GPIOA_STLINK_USART2_TX) |\ | ||
355 | PIN_OSPEED_HIGH(GPIOA_STLINK_USART2_RX) |\ | ||
356 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
357 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
358 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
359 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
360 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
361 | PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_VBUS) |\ | ||
362 | PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_ID) | \ | ||
363 | PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_DM) | \ | ||
364 | PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_DP) | \ | ||
365 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
366 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
367 | PIN_OSPEED_VERYLOW(GPIOA_PIN15)) | ||
368 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ | ||
369 | PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ | ||
370 | PIN_PUPDR_FLOATING(GPIOA_STLINK_USART2_TX) |\ | ||
371 | PIN_PUPDR_FLOATING(GPIOA_STLINK_USART2_RX) |\ | ||
372 | PIN_PUPDR_FLOATING(GPIOA_PIN4) | \ | ||
373 | PIN_PUPDR_FLOATING(GPIOA_PIN5) | \ | ||
374 | PIN_PUPDR_FLOATING(GPIOA_PIN6) | \ | ||
375 | PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ | ||
376 | PIN_PUPDR_FLOATING(GPIOA_PIN8) | \ | ||
377 | PIN_PUPDR_PULLUP(GPIOA_USB_OTGFS_VBUS) |\ | ||
378 | PIN_PUPDR_FLOATING(GPIOA_USB_OTGFS_ID) |\ | ||
379 | PIN_PUPDR_FLOATING(GPIOA_USB_OTGFS_DM) |\ | ||
380 | PIN_PUPDR_FLOATING(GPIOA_USB_OTGFS_DP) |\ | ||
381 | PIN_PUPDR_PULLDOWN(GPIOA_SWDIO) | \ | ||
382 | PIN_PUPDR_PULLUP(GPIOA_SWCLK) | \ | ||
383 | PIN_PUPDR_FLOATING(GPIOA_PIN15)) | ||
384 | #define VAL_GPIOA_ODR (PIN_ODR_LOW(GPIOA_PIN0) | \ | ||
385 | PIN_ODR_LOW(GPIOA_PIN1) | \ | ||
386 | PIN_ODR_LOW(GPIOA_STLINK_USART2_TX) | \ | ||
387 | PIN_ODR_LOW(GPIOA_STLINK_USART2_RX) | \ | ||
388 | PIN_ODR_LOW(GPIOA_PIN4) | \ | ||
389 | PIN_ODR_LOW(GPIOA_PIN5) | \ | ||
390 | PIN_ODR_LOW(GPIOA_PIN6) | \ | ||
391 | PIN_ODR_LOW(GPIOA_PIN7) | \ | ||
392 | PIN_ODR_LOW(GPIOA_PIN8) | \ | ||
393 | PIN_ODR_LOW(GPIOA_USB_OTGFS_VBUS) | \ | ||
394 | PIN_ODR_LOW(GPIOA_USB_OTGFS_ID) | \ | ||
395 | PIN_ODR_LOW(GPIOA_USB_OTGFS_DM) | \ | ||
396 | PIN_ODR_LOW(GPIOA_USB_OTGFS_DP) | \ | ||
397 | PIN_ODR_LOW(GPIOA_SWDIO) | \ | ||
398 | PIN_ODR_LOW(GPIOA_SWCLK) | \ | ||
399 | PIN_ODR_LOW(GPIOA_PIN15)) | ||
400 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \ | ||
401 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
402 | PIN_AFIO_AF(GPIOA_STLINK_USART2_TX, 7U) |\ | ||
403 | PIN_AFIO_AF(GPIOA_STLINK_USART2_RX, 7U) |\ | ||
404 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
405 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
406 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
407 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
408 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
409 | PIN_AFIO_AF(GPIOA_USB_OTGFS_VBUS, 0U) |\ | ||
410 | PIN_AFIO_AF(GPIOA_USB_OTGFS_ID, 10U) | \ | ||
411 | PIN_AFIO_AF(GPIOA_USB_OTGFS_DM, 10U) | \ | ||
412 | PIN_AFIO_AF(GPIOA_USB_OTGFS_DP, 10U) | \ | ||
413 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
414 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
415 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
416 | #define VAL_GPIOA_ASCR (PIN_ASCR_DISABLED(GPIOA_PIN0) | \ | ||
417 | PIN_ASCR_DISABLED(GPIOA_PIN1) | \ | ||
418 | PIN_ASCR_DISABLED(GPIOA_STLINK_USART2_TX) |\ | ||
419 | PIN_ASCR_DISABLED(GPIOA_STLINK_USART2_RX) |\ | ||
420 | PIN_ASCR_DISABLED(GPIOA_PIN4) | \ | ||
421 | PIN_ASCR_DISABLED(GPIOA_PIN5) | \ | ||
422 | PIN_ASCR_DISABLED(GPIOA_PIN6) | \ | ||
423 | PIN_ASCR_DISABLED(GPIOA_PIN7) | \ | ||
424 | PIN_ASCR_DISABLED(GPIOA_PIN8) | \ | ||
425 | PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_VBUS) |\ | ||
426 | PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_ID) |\ | ||
427 | PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_DM) |\ | ||
428 | PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_DP) |\ | ||
429 | PIN_ASCR_DISABLED(GPIOA_SWDIO) | \ | ||
430 | PIN_ASCR_DISABLED(GPIOA_SWCLK) | \ | ||
431 | PIN_ASCR_DISABLED(GPIOA_PIN15)) | ||
432 | #define VAL_GPIOA_LOCKR (PIN_LOCKR_DISABLED(GPIOA_PIN0) | \ | ||
433 | PIN_LOCKR_DISABLED(GPIOA_PIN1) | \ | ||
434 | PIN_LOCKR_DISABLED(GPIOA_STLINK_USART2_TX) |\ | ||
435 | PIN_LOCKR_DISABLED(GPIOA_STLINK_USART2_RX) |\ | ||
436 | PIN_LOCKR_DISABLED(GPIOA_PIN4) | \ | ||
437 | PIN_LOCKR_DISABLED(GPIOA_PIN5) | \ | ||
438 | PIN_LOCKR_DISABLED(GPIOA_PIN6) | \ | ||
439 | PIN_LOCKR_DISABLED(GPIOA_PIN7) | \ | ||
440 | PIN_LOCKR_DISABLED(GPIOA_PIN8) | \ | ||
441 | PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_VBUS) |\ | ||
442 | PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_ID) |\ | ||
443 | PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_DM) |\ | ||
444 | PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_DP) |\ | ||
445 | PIN_LOCKR_DISABLED(GPIOA_SWDIO) | \ | ||
446 | PIN_LOCKR_DISABLED(GPIOA_SWCLK) | \ | ||
447 | PIN_LOCKR_DISABLED(GPIOA_PIN15)) | ||
448 | |||
449 | /* | ||
450 | * GPIOB setup: | ||
451 | * | ||
452 | * PB0 - PIN0 (analog). | ||
453 | * PB1 - PIN1 (analog). | ||
454 | * PB2 - PIN2 (analog). | ||
455 | * PB3 - SWO (alternate 0). | ||
456 | * PB4 - PIN4 (analog). | ||
457 | * PB5 - PIN5 (analog). | ||
458 | * PB6 - PIN6 (analog). | ||
459 | * PB7 - PIN7 (analog). | ||
460 | * PB8 - PIN8 (analog). | ||
461 | * PB9 - PIN9 (analog). | ||
462 | * PB10 - PIN10 (analog). | ||
463 | * PB11 - PIN11 (analog). | ||
464 | * PB12 - PIN12 (analog). | ||
465 | * PB13 - PIN13 (analog). | ||
466 | * PB14 - PIN14 (analog). | ||
467 | * PB15 - PIN15 (analog). | ||
468 | */ | ||
469 | #define VAL_GPIOB_MODER (PIN_MODE_ANALOG(GPIOB_PIN0) | \ | ||
470 | PIN_MODE_ANALOG(GPIOB_PIN1) | \ | ||
471 | PIN_MODE_ANALOG(GPIOB_PIN2) | \ | ||
472 | PIN_MODE_ALTERNATE(GPIOB_SWO) | \ | ||
473 | PIN_MODE_ANALOG(GPIOB_PIN4) | \ | ||
474 | PIN_MODE_ANALOG(GPIOB_PIN5) | \ | ||
475 | PIN_MODE_ANALOG(GPIOB_PIN6) | \ | ||
476 | PIN_MODE_ANALOG(GPIOB_PIN7) | \ | ||
477 | PIN_MODE_ANALOG(GPIOB_PIN8) | \ | ||
478 | PIN_MODE_ANALOG(GPIOB_PIN9) | \ | ||
479 | PIN_MODE_ANALOG(GPIOB_PIN10) | \ | ||
480 | PIN_MODE_ANALOG(GPIOB_PIN11) | \ | ||
481 | PIN_MODE_ANALOG(GPIOB_PIN12) | \ | ||
482 | PIN_MODE_ANALOG(GPIOB_PIN13) | \ | ||
483 | PIN_MODE_ANALOG(GPIOB_PIN14) | \ | ||
484 | PIN_MODE_ANALOG(GPIOB_PIN15)) | ||
485 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
486 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
487 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
488 | PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \ | ||
489 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
490 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
491 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
492 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
493 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
494 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
495 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
496 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
497 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
498 | PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ | ||
499 | PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ | ||
500 | PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) | ||
501 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
502 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
503 | PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ | ||
504 | PIN_OSPEED_HIGH(GPIOB_SWO) | \ | ||
505 | PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ | ||
506 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
507 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
508 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
509 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
510 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
511 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
512 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
513 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
514 | PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ | ||
515 | PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ | ||
516 | PIN_OSPEED_VERYLOW(GPIOB_PIN15)) | ||
517 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_PIN0) | \ | ||
518 | PIN_PUPDR_FLOATING(GPIOB_PIN1) | \ | ||
519 | PIN_PUPDR_FLOATING(GPIOB_PIN2) | \ | ||
520 | PIN_PUPDR_FLOATING(GPIOB_SWO) | \ | ||
521 | PIN_PUPDR_FLOATING(GPIOB_PIN4) | \ | ||
522 | PIN_PUPDR_FLOATING(GPIOB_PIN5) | \ | ||
523 | PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ | ||
524 | PIN_PUPDR_FLOATING(GPIOB_PIN7) | \ | ||
525 | PIN_PUPDR_FLOATING(GPIOB_PIN8) | \ | ||
526 | PIN_PUPDR_FLOATING(GPIOB_PIN9) | \ | ||
527 | PIN_PUPDR_FLOATING(GPIOB_PIN10) | \ | ||
528 | PIN_PUPDR_FLOATING(GPIOB_PIN11) | \ | ||
529 | PIN_PUPDR_FLOATING(GPIOB_PIN12) | \ | ||
530 | PIN_PUPDR_FLOATING(GPIOB_PIN13) | \ | ||
531 | PIN_PUPDR_FLOATING(GPIOB_PIN14) | \ | ||
532 | PIN_PUPDR_FLOATING(GPIOB_PIN15)) | ||
533 | #define VAL_GPIOB_ODR (PIN_ODR_LOW(GPIOB_PIN0) | \ | ||
534 | PIN_ODR_LOW(GPIOB_PIN1) | \ | ||
535 | PIN_ODR_LOW(GPIOB_PIN2) | \ | ||
536 | PIN_ODR_LOW(GPIOB_SWO) | \ | ||
537 | PIN_ODR_LOW(GPIOB_PIN4) | \ | ||
538 | PIN_ODR_LOW(GPIOB_PIN5) | \ | ||
539 | PIN_ODR_LOW(GPIOB_PIN6) | \ | ||
540 | PIN_ODR_LOW(GPIOB_PIN7) | \ | ||
541 | PIN_ODR_LOW(GPIOB_PIN8) | \ | ||
542 | PIN_ODR_LOW(GPIOB_PIN9) | \ | ||
543 | PIN_ODR_LOW(GPIOB_PIN10) | \ | ||
544 | PIN_ODR_LOW(GPIOB_PIN11) | \ | ||
545 | PIN_ODR_LOW(GPIOB_PIN12) | \ | ||
546 | PIN_ODR_LOW(GPIOB_PIN13) | \ | ||
547 | PIN_ODR_LOW(GPIOB_PIN14) | \ | ||
548 | PIN_ODR_LOW(GPIOB_PIN15)) | ||
549 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
550 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
551 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
552 | PIN_AFIO_AF(GPIOB_SWO, 0U) | \ | ||
553 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
554 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
555 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
556 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
557 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
558 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
559 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
560 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
561 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
562 | PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ | ||
563 | PIN_AFIO_AF(GPIOB_PIN14, 0U) | \ | ||
564 | PIN_AFIO_AF(GPIOB_PIN15, 0U)) | ||
565 | #define VAL_GPIOB_ASCR (PIN_ASCR_DISABLED(GPIOB_PIN0) | \ | ||
566 | PIN_ASCR_DISABLED(GPIOB_PIN1) | \ | ||
567 | PIN_ASCR_DISABLED(GPIOB_PIN2) | \ | ||
568 | PIN_ASCR_DISABLED(GPIOB_SWO) | \ | ||
569 | PIN_ASCR_DISABLED(GPIOB_PIN4) | \ | ||
570 | PIN_ASCR_DISABLED(GPIOB_PIN5) | \ | ||
571 | PIN_ASCR_DISABLED(GPIOB_PIN6) | \ | ||
572 | PIN_ASCR_DISABLED(GPIOB_PIN7) | \ | ||
573 | PIN_ASCR_DISABLED(GPIOB_PIN8) | \ | ||
574 | PIN_ASCR_DISABLED(GPIOB_PIN9) | \ | ||
575 | PIN_ASCR_DISABLED(GPIOB_PIN10) | \ | ||
576 | PIN_ASCR_DISABLED(GPIOB_PIN11) | \ | ||
577 | PIN_ASCR_DISABLED(GPIOB_PIN12) | \ | ||
578 | PIN_ASCR_DISABLED(GPIOB_PIN13) | \ | ||
579 | PIN_ASCR_DISABLED(GPIOB_PIN14) | \ | ||
580 | PIN_ASCR_DISABLED(GPIOB_PIN15)) | ||
581 | #define VAL_GPIOB_LOCKR (PIN_LOCKR_DISABLED(GPIOB_PIN0) | \ | ||
582 | PIN_LOCKR_DISABLED(GPIOB_PIN1) | \ | ||
583 | PIN_LOCKR_DISABLED(GPIOB_PIN2) | \ | ||
584 | PIN_LOCKR_DISABLED(GPIOB_SWO) | \ | ||
585 | PIN_LOCKR_DISABLED(GPIOB_PIN4) | \ | ||
586 | PIN_LOCKR_DISABLED(GPIOB_PIN5) | \ | ||
587 | PIN_LOCKR_DISABLED(GPIOB_PIN6) | \ | ||
588 | PIN_LOCKR_DISABLED(GPIOB_PIN7) | \ | ||
589 | PIN_LOCKR_DISABLED(GPIOB_PIN8) | \ | ||
590 | PIN_LOCKR_DISABLED(GPIOB_PIN9) | \ | ||
591 | PIN_LOCKR_DISABLED(GPIOB_PIN10) | \ | ||
592 | PIN_LOCKR_DISABLED(GPIOB_PIN11) | \ | ||
593 | PIN_LOCKR_DISABLED(GPIOB_PIN12) | \ | ||
594 | PIN_LOCKR_DISABLED(GPIOB_PIN13) | \ | ||
595 | PIN_LOCKR_DISABLED(GPIOB_PIN14) | \ | ||
596 | PIN_LOCKR_DISABLED(GPIOB_PIN15)) | ||
597 | |||
598 | /* | ||
599 | * GPIOC setup: | ||
600 | * | ||
601 | * PC0 - PIN0 (analog). | ||
602 | * PC1 - PIN1 (analog). | ||
603 | * PC2 - PIN2 (analog). | ||
604 | * PC3 - PIN3 (analog). | ||
605 | * PC4 - PIN4 (analog). | ||
606 | * PC5 - PIN5 (analog). | ||
607 | * PC6 - PIN6 (analog). | ||
608 | * PC7 - PIN7 (analog). | ||
609 | * PC8 - SDMMC_1_D0 (alternate 12). | ||
610 | * PC9 - SDMMC_1_D1 (alternate 12). | ||
611 | * PC10 - SDMMC_1_D2 (alternate 12). | ||
612 | * PC11 - SDMMC_1_D3 (alternate 12). | ||
613 | * PC12 - SDMMC_1_CK (alternate 12). | ||
614 | * PC13 - JOY_SEL BUTTON (input pulldown). | ||
615 | * PC14 - PIN14 (analog). | ||
616 | * PC15 - PIN15 (analog). | ||
617 | */ | ||
618 | #define VAL_GPIOC_MODER (PIN_MODE_ANALOG(GPIOC_PIN0) | \ | ||
619 | PIN_MODE_ANALOG(GPIOC_PIN1) | \ | ||
620 | PIN_MODE_ANALOG(GPIOC_PIN2) | \ | ||
621 | PIN_MODE_ANALOG(GPIOC_PIN3) | \ | ||
622 | PIN_MODE_ANALOG(GPIOC_PIN4) | \ | ||
623 | PIN_MODE_ANALOG(GPIOC_PIN5) | \ | ||
624 | PIN_MODE_ANALOG(GPIOC_PIN6) | \ | ||
625 | PIN_MODE_ANALOG(GPIOC_PIN7) | \ | ||
626 | PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D0) | \ | ||
627 | PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D1) | \ | ||
628 | PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D2) | \ | ||
629 | PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D3) | \ | ||
630 | PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_CK) | \ | ||
631 | PIN_MODE_INPUT(GPIOC_JOY_SEL) | \ | ||
632 | PIN_MODE_ANALOG(GPIOC_PIN14) | \ | ||
633 | PIN_MODE_ANALOG(GPIOC_PIN15)) | ||
634 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ | ||
635 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
636 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
637 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
638 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
639 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
640 | PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ | ||
641 | PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ | ||
642 | PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D0) | \ | ||
643 | PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D1) | \ | ||
644 | PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D2) | \ | ||
645 | PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D3) | \ | ||
646 | PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_CK) | \ | ||
647 | PIN_OTYPE_PUSHPULL(GPIOC_JOY_SEL) | \ | ||
648 | PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ | ||
649 | PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) | ||
650 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ | ||
651 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
652 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
653 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
654 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
655 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
656 | PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ | ||
657 | PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ | ||
658 | PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D0) | \ | ||
659 | PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D1) | \ | ||
660 | PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D2) | \ | ||
661 | PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D3) | \ | ||
662 | PIN_OSPEED_HIGH(GPIOC_SDMMC_1_CK) | \ | ||
663 | PIN_OSPEED_VERYLOW(GPIOC_JOY_SEL) | \ | ||
664 | PIN_OSPEED_VERYLOW(GPIOC_PIN14) | \ | ||
665 | PIN_OSPEED_VERYLOW(GPIOC_PIN15)) | ||
666 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_PIN0) | \ | ||
667 | PIN_PUPDR_FLOATING(GPIOC_PIN1) | \ | ||
668 | PIN_PUPDR_FLOATING(GPIOC_PIN2) | \ | ||
669 | PIN_PUPDR_FLOATING(GPIOC_PIN3) | \ | ||
670 | PIN_PUPDR_FLOATING(GPIOC_PIN4) | \ | ||
671 | PIN_PUPDR_FLOATING(GPIOC_PIN5) | \ | ||
672 | PIN_PUPDR_FLOATING(GPIOC_PIN6) | \ | ||
673 | PIN_PUPDR_FLOATING(GPIOC_PIN7) | \ | ||
674 | PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D0) | \ | ||
675 | PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D1) | \ | ||
676 | PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D2) | \ | ||
677 | PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D3) | \ | ||
678 | PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_CK) | \ | ||
679 | PIN_PUPDR_PULLDOWN(GPIOC_JOY_SEL) | \ | ||
680 | PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ | ||
681 | PIN_PUPDR_FLOATING(GPIOC_PIN15)) | ||
682 | #define VAL_GPIOC_ODR (PIN_ODR_LOW(GPIOC_PIN0) | \ | ||
683 | PIN_ODR_LOW(GPIOC_PIN1) | \ | ||
684 | PIN_ODR_LOW(GPIOC_PIN2) | \ | ||
685 | PIN_ODR_LOW(GPIOC_PIN3) | \ | ||
686 | PIN_ODR_LOW(GPIOC_PIN4) | \ | ||
687 | PIN_ODR_LOW(GPIOC_PIN5) | \ | ||
688 | PIN_ODR_LOW(GPIOC_PIN6) | \ | ||
689 | PIN_ODR_LOW(GPIOC_PIN7) | \ | ||
690 | PIN_ODR_LOW(GPIOC_SDMMC_1_D0) | \ | ||
691 | PIN_ODR_LOW(GPIOC_SDMMC_1_D1) | \ | ||
692 | PIN_ODR_LOW(GPIOC_SDMMC_1_D2) | \ | ||
693 | PIN_ODR_LOW(GPIOC_SDMMC_1_D3) | \ | ||
694 | PIN_ODR_LOW(GPIOC_SDMMC_1_CK) | \ | ||
695 | PIN_ODR_LOW(GPIOC_JOY_SEL) | \ | ||
696 | PIN_ODR_LOW(GPIOC_PIN14) | \ | ||
697 | PIN_ODR_LOW(GPIOC_PIN15)) | ||
698 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \ | ||
699 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
700 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
701 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
702 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
703 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
704 | PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ | ||
705 | PIN_AFIO_AF(GPIOC_PIN7, 0U)) | ||
706 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_SDMMC_1_D0, 12U) | \ | ||
707 | PIN_AFIO_AF(GPIOC_SDMMC_1_D1, 12U) | \ | ||
708 | PIN_AFIO_AF(GPIOC_SDMMC_1_D2, 12U) | \ | ||
709 | PIN_AFIO_AF(GPIOC_SDMMC_1_D3, 12U) | \ | ||
710 | PIN_AFIO_AF(GPIOC_SDMMC_1_CK, 12U) | \ | ||
711 | PIN_AFIO_AF(GPIOC_JOY_SEL, 0U) | \ | ||
712 | PIN_AFIO_AF(GPIOC_PIN14, 0U) | \ | ||
713 | PIN_AFIO_AF(GPIOC_PIN15, 0U)) | ||
714 | #define VAL_GPIOC_ASCR (PIN_ASCR_DISABLED(GPIOC_PIN0) | \ | ||
715 | PIN_ASCR_DISABLED(GPIOC_PIN1) | \ | ||
716 | PIN_ASCR_DISABLED(GPIOC_PIN2) | \ | ||
717 | PIN_ASCR_DISABLED(GPIOC_PIN3) | \ | ||
718 | PIN_ASCR_DISABLED(GPIOC_PIN4) | \ | ||
719 | PIN_ASCR_DISABLED(GPIOC_PIN5) | \ | ||
720 | PIN_ASCR_DISABLED(GPIOC_PIN6) | \ | ||
721 | PIN_ASCR_DISABLED(GPIOC_PIN7) | \ | ||
722 | PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D0) | \ | ||
723 | PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D1) | \ | ||
724 | PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D2) | \ | ||
725 | PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D3) | \ | ||
726 | PIN_ASCR_DISABLED(GPIOC_SDMMC_1_CK) | \ | ||
727 | PIN_ASCR_DISABLED(GPIOC_JOY_SEL) | \ | ||
728 | PIN_ASCR_DISABLED(GPIOC_PIN14) | \ | ||
729 | PIN_ASCR_DISABLED(GPIOC_PIN15)) | ||
730 | #define VAL_GPIOC_LOCKR (PIN_LOCKR_DISABLED(GPIOC_PIN0) | \ | ||
731 | PIN_LOCKR_DISABLED(GPIOC_PIN1) | \ | ||
732 | PIN_LOCKR_DISABLED(GPIOC_PIN2) | \ | ||
733 | PIN_LOCKR_DISABLED(GPIOC_PIN3) | \ | ||
734 | PIN_LOCKR_DISABLED(GPIOC_PIN4) | \ | ||
735 | PIN_LOCKR_DISABLED(GPIOC_PIN5) | \ | ||
736 | PIN_LOCKR_DISABLED(GPIOC_PIN6) | \ | ||
737 | PIN_LOCKR_DISABLED(GPIOC_PIN7) | \ | ||
738 | PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D0) | \ | ||
739 | PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D1) | \ | ||
740 | PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D2) | \ | ||
741 | PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D3) | \ | ||
742 | PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_CK) | \ | ||
743 | PIN_LOCKR_DISABLED(GPIOC_JOY_SEL) | \ | ||
744 | PIN_LOCKR_DISABLED(GPIOC_PIN14) | \ | ||
745 | PIN_LOCKR_DISABLED(GPIOC_PIN15)) | ||
746 | |||
747 | /* | ||
748 | * GPIOD setup: | ||
749 | * | ||
750 | * PD0 - PIN0 (analog). | ||
751 | * PD1 - PIN1 (analog). | ||
752 | * PD2 - SDMMC_1_CMD (alternate 12). | ||
753 | * PD3 - PIN3 (analog). | ||
754 | * PD4 - PIN4 (analog). | ||
755 | * PD5 - PIN5 (analog). | ||
756 | * PD6 - PIN6 (analog). | ||
757 | * PD7 - PIN7 (analog). | ||
758 | * PD8 - PIN8 (analog). | ||
759 | * PD9 - PIN9 (analog). | ||
760 | * PD10 - PIN10 (analog). | ||
761 | * PD11 - PIN11 (analog). | ||
762 | * PD12 - PIN12 (analog). | ||
763 | * PD13 - PIN13 (analog). | ||
764 | * PD14 - PIN14 (analog). | ||
765 | * PD15 - PIN15 (analog). | ||
766 | */ | ||
767 | #define VAL_GPIOD_MODER (PIN_MODE_ANALOG(GPIOD_PIN0) | \ | ||
768 | PIN_MODE_ANALOG(GPIOD_PIN1) | \ | ||
769 | PIN_MODE_ALTERNATE(GPIOD_SDMMC_1_CMD) |\ | ||
770 | PIN_MODE_ANALOG(GPIOD_PIN3) | \ | ||
771 | PIN_MODE_ANALOG(GPIOD_PIN4) | \ | ||
772 | PIN_MODE_ANALOG(GPIOD_PIN5) | \ | ||
773 | PIN_MODE_ANALOG(GPIOD_PIN6) | \ | ||
774 | PIN_MODE_ANALOG(GPIOD_PIN7) | \ | ||
775 | PIN_MODE_ANALOG(GPIOD_PIN8) | \ | ||
776 | PIN_MODE_ANALOG(GPIOD_PIN9) | \ | ||
777 | PIN_MODE_ANALOG(GPIOD_PIN10) | \ | ||
778 | PIN_MODE_ANALOG(GPIOD_PIN11) | \ | ||
779 | PIN_MODE_ANALOG(GPIOD_PIN12) | \ | ||
780 | PIN_MODE_ANALOG(GPIOD_PIN13) | \ | ||
781 | PIN_MODE_ANALOG(GPIOD_PIN14) | \ | ||
782 | PIN_MODE_ANALOG(GPIOD_PIN15)) | ||
783 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
784 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
785 | PIN_OTYPE_PUSHPULL(GPIOD_SDMMC_1_CMD) |\ | ||
786 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
787 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
788 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
789 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
790 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
791 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
792 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
793 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
794 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
795 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
796 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
797 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
798 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
799 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
800 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
801 | PIN_OSPEED_HIGH(GPIOD_SDMMC_1_CMD) | \ | ||
802 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
803 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
804 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
805 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
806 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
807 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
808 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
809 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
810 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
811 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
812 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
813 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
814 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
815 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \ | ||
816 | PIN_PUPDR_FLOATING(GPIOD_PIN1) | \ | ||
817 | PIN_PUPDR_FLOATING(GPIOD_SDMMC_1_CMD) |\ | ||
818 | PIN_PUPDR_FLOATING(GPIOD_PIN3) | \ | ||
819 | PIN_PUPDR_FLOATING(GPIOD_PIN4) | \ | ||
820 | PIN_PUPDR_FLOATING(GPIOD_PIN5) | \ | ||
821 | PIN_PUPDR_FLOATING(GPIOD_PIN6) | \ | ||
822 | PIN_PUPDR_FLOATING(GPIOD_PIN7) | \ | ||
823 | PIN_PUPDR_FLOATING(GPIOD_PIN8) | \ | ||
824 | PIN_PUPDR_FLOATING(GPIOD_PIN9) | \ | ||
825 | PIN_PUPDR_FLOATING(GPIOD_PIN10) | \ | ||
826 | PIN_PUPDR_FLOATING(GPIOD_PIN11) | \ | ||
827 | PIN_PUPDR_FLOATING(GPIOD_PIN12) | \ | ||
828 | PIN_PUPDR_FLOATING(GPIOD_PIN13) | \ | ||
829 | PIN_PUPDR_FLOATING(GPIOD_PIN14) | \ | ||
830 | PIN_PUPDR_FLOATING(GPIOD_PIN15)) | ||
831 | #define VAL_GPIOD_ODR (PIN_ODR_LOW(GPIOD_PIN0) | \ | ||
832 | PIN_ODR_LOW(GPIOD_PIN1) | \ | ||
833 | PIN_ODR_LOW(GPIOD_SDMMC_1_CMD) | \ | ||
834 | PIN_ODR_LOW(GPIOD_PIN3) | \ | ||
835 | PIN_ODR_LOW(GPIOD_PIN4) | \ | ||
836 | PIN_ODR_LOW(GPIOD_PIN5) | \ | ||
837 | PIN_ODR_LOW(GPIOD_PIN6) | \ | ||
838 | PIN_ODR_LOW(GPIOD_PIN7) | \ | ||
839 | PIN_ODR_LOW(GPIOD_PIN8) | \ | ||
840 | PIN_ODR_LOW(GPIOD_PIN9) | \ | ||
841 | PIN_ODR_LOW(GPIOD_PIN10) | \ | ||
842 | PIN_ODR_LOW(GPIOD_PIN11) | \ | ||
843 | PIN_ODR_LOW(GPIOD_PIN12) | \ | ||
844 | PIN_ODR_LOW(GPIOD_PIN13) | \ | ||
845 | PIN_ODR_LOW(GPIOD_PIN14) | \ | ||
846 | PIN_ODR_LOW(GPIOD_PIN15)) | ||
847 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
848 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
849 | PIN_AFIO_AF(GPIOD_SDMMC_1_CMD, 12U) | \ | ||
850 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
851 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
852 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
853 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
854 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
855 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
856 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
857 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
858 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
859 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
860 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
861 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
862 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
863 | #define VAL_GPIOD_ASCR (PIN_ASCR_DISABLED(GPIOD_PIN0) | \ | ||
864 | PIN_ASCR_DISABLED(GPIOD_PIN1) | \ | ||
865 | PIN_ASCR_DISABLED(GPIOD_SDMMC_1_CMD) | \ | ||
866 | PIN_ASCR_DISABLED(GPIOD_PIN3) | \ | ||
867 | PIN_ASCR_DISABLED(GPIOD_PIN4) | \ | ||
868 | PIN_ASCR_DISABLED(GPIOD_PIN5) | \ | ||
869 | PIN_ASCR_DISABLED(GPIOD_PIN6) | \ | ||
870 | PIN_ASCR_DISABLED(GPIOD_PIN7) | \ | ||
871 | PIN_ASCR_DISABLED(GPIOD_PIN8) | \ | ||
872 | PIN_ASCR_DISABLED(GPIOD_PIN9) | \ | ||
873 | PIN_ASCR_DISABLED(GPIOD_PIN10) | \ | ||
874 | PIN_ASCR_DISABLED(GPIOD_PIN11) | \ | ||
875 | PIN_ASCR_DISABLED(GPIOD_PIN12) | \ | ||
876 | PIN_ASCR_DISABLED(GPIOD_PIN13) | \ | ||
877 | PIN_ASCR_DISABLED(GPIOD_PIN14) | \ | ||
878 | PIN_ASCR_DISABLED(GPIOD_PIN15)) | ||
879 | #define VAL_GPIOD_LOCKR (PIN_LOCKR_DISABLED(GPIOD_PIN0) | \ | ||
880 | PIN_LOCKR_DISABLED(GPIOD_PIN1) | \ | ||
881 | PIN_LOCKR_DISABLED(GPIOD_SDMMC_1_CMD) |\ | ||
882 | PIN_LOCKR_DISABLED(GPIOD_PIN3) | \ | ||
883 | PIN_LOCKR_DISABLED(GPIOD_PIN4) | \ | ||
884 | PIN_LOCKR_DISABLED(GPIOD_PIN5) | \ | ||
885 | PIN_LOCKR_DISABLED(GPIOD_PIN6) | \ | ||
886 | PIN_LOCKR_DISABLED(GPIOD_PIN7) | \ | ||
887 | PIN_LOCKR_DISABLED(GPIOD_PIN8) | \ | ||
888 | PIN_LOCKR_DISABLED(GPIOD_PIN9) | \ | ||
889 | PIN_LOCKR_DISABLED(GPIOD_PIN10) | \ | ||
890 | PIN_LOCKR_DISABLED(GPIOD_PIN11) | \ | ||
891 | PIN_LOCKR_DISABLED(GPIOD_PIN12) | \ | ||
892 | PIN_LOCKR_DISABLED(GPIOD_PIN13) | \ | ||
893 | PIN_LOCKR_DISABLED(GPIOD_PIN14) | \ | ||
894 | PIN_LOCKR_DISABLED(GPIOD_PIN15)) | ||
895 | |||
896 | /* | ||
897 | * GPIOE setup: | ||
898 | * | ||
899 | * PE0 - PIN0 (analog). | ||
900 | * PE1 - PIN1 (analog). | ||
901 | * PE2 - PIN2 (analog). | ||
902 | * PE3 - PIN3 (analog). | ||
903 | * PE4 - PIN4 (analog). | ||
904 | * PE5 - PIN5 (analog). | ||
905 | * PE6 - PIN6 (analog). | ||
906 | * PE7 - PIN7 (analog). | ||
907 | * PE8 - PIN8 (analog). | ||
908 | * PE9 - PIN9 (analog). | ||
909 | * PE10 - PIN10 (analog). | ||
910 | * PE11 - PIN11 (analog). | ||
911 | * PE12 - PIN12 (analog). | ||
912 | * PE13 - PIN13 (analog). | ||
913 | * PE14 - PIN14 (analog). | ||
914 | * PE15 - PIN15 (analog). | ||
915 | */ | ||
916 | #define VAL_GPIOE_MODER (PIN_MODE_ANALOG(GPIOE_PIN0) | \ | ||
917 | PIN_MODE_ANALOG(GPIOE_PIN1) | \ | ||
918 | PIN_MODE_ANALOG(GPIOE_PIN2) | \ | ||
919 | PIN_MODE_ANALOG(GPIOE_PIN3) | \ | ||
920 | PIN_MODE_ANALOG(GPIOE_PIN4) | \ | ||
921 | PIN_MODE_ANALOG(GPIOE_PIN5) | \ | ||
922 | PIN_MODE_ANALOG(GPIOE_PIN6) | \ | ||
923 | PIN_MODE_ANALOG(GPIOE_PIN7) | \ | ||
924 | PIN_MODE_ANALOG(GPIOE_PIN8) | \ | ||
925 | PIN_MODE_ANALOG(GPIOE_PIN9) | \ | ||
926 | PIN_MODE_ANALOG(GPIOE_PIN10) | \ | ||
927 | PIN_MODE_ANALOG(GPIOE_PIN11) | \ | ||
928 | PIN_MODE_ANALOG(GPIOE_PIN12) | \ | ||
929 | PIN_MODE_ANALOG(GPIOE_PIN13) | \ | ||
930 | PIN_MODE_ANALOG(GPIOE_PIN14) | \ | ||
931 | PIN_MODE_ANALOG(GPIOE_PIN15)) | ||
932 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
933 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
934 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
935 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
936 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
937 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
938 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
939 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
940 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
941 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
942 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
943 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
944 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
945 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
946 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
947 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
948 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
949 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
950 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
951 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
952 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
953 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
954 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
955 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
956 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
957 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
958 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
959 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
960 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
961 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
962 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
963 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
964 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \ | ||
965 | PIN_PUPDR_FLOATING(GPIOE_PIN1) | \ | ||
966 | PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ | ||
967 | PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ | ||
968 | PIN_PUPDR_FLOATING(GPIOE_PIN4) | \ | ||
969 | PIN_PUPDR_FLOATING(GPIOE_PIN5) | \ | ||
970 | PIN_PUPDR_FLOATING(GPIOE_PIN6) | \ | ||
971 | PIN_PUPDR_FLOATING(GPIOE_PIN7) | \ | ||
972 | PIN_PUPDR_FLOATING(GPIOE_PIN8) | \ | ||
973 | PIN_PUPDR_FLOATING(GPIOE_PIN9) | \ | ||
974 | PIN_PUPDR_FLOATING(GPIOE_PIN10) | \ | ||
975 | PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ | ||
976 | PIN_PUPDR_FLOATING(GPIOE_PIN12) | \ | ||
977 | PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ | ||
978 | PIN_PUPDR_FLOATING(GPIOE_PIN14) | \ | ||
979 | PIN_PUPDR_FLOATING(GPIOE_PIN15)) | ||
980 | #define VAL_GPIOE_ODR (PIN_ODR_LOW(GPIOE_PIN0) | \ | ||
981 | PIN_ODR_LOW(GPIOE_PIN1) | \ | ||
982 | PIN_ODR_LOW(GPIOE_PIN2) | \ | ||
983 | PIN_ODR_LOW(GPIOE_PIN3) | \ | ||
984 | PIN_ODR_LOW(GPIOE_PIN4) | \ | ||
985 | PIN_ODR_LOW(GPIOE_PIN5) | \ | ||
986 | PIN_ODR_LOW(GPIOE_PIN6) | \ | ||
987 | PIN_ODR_LOW(GPIOE_PIN7) | \ | ||
988 | PIN_ODR_LOW(GPIOE_PIN8) | \ | ||
989 | PIN_ODR_LOW(GPIOE_PIN9) | \ | ||
990 | PIN_ODR_LOW(GPIOE_PIN10) | \ | ||
991 | PIN_ODR_LOW(GPIOE_PIN11) | \ | ||
992 | PIN_ODR_LOW(GPIOE_PIN12) | \ | ||
993 | PIN_ODR_LOW(GPIOE_PIN13) | \ | ||
994 | PIN_ODR_LOW(GPIOE_PIN14) | \ | ||
995 | PIN_ODR_LOW(GPIOE_PIN15)) | ||
996 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
997 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
998 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
999 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
1000 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
1001 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
1002 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
1003 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
1004 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
1005 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
1006 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
1007 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
1008 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
1009 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
1010 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
1011 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
1012 | #define VAL_GPIOE_ASCR (PIN_ASCR_DISABLED(GPIOE_PIN0) | \ | ||
1013 | PIN_ASCR_DISABLED(GPIOE_PIN1) | \ | ||
1014 | PIN_ASCR_DISABLED(GPIOE_PIN2) | \ | ||
1015 | PIN_ASCR_DISABLED(GPIOE_PIN3) | \ | ||
1016 | PIN_ASCR_DISABLED(GPIOE_PIN4) | \ | ||
1017 | PIN_ASCR_DISABLED(GPIOE_PIN5) | \ | ||
1018 | PIN_ASCR_DISABLED(GPIOE_PIN6) | \ | ||
1019 | PIN_ASCR_DISABLED(GPIOE_PIN7) | \ | ||
1020 | PIN_ASCR_DISABLED(GPIOE_PIN8) | \ | ||
1021 | PIN_ASCR_DISABLED(GPIOE_PIN9) | \ | ||
1022 | PIN_ASCR_DISABLED(GPIOE_PIN10) | \ | ||
1023 | PIN_ASCR_DISABLED(GPIOE_PIN11) | \ | ||
1024 | PIN_ASCR_DISABLED(GPIOE_PIN12) | \ | ||
1025 | PIN_ASCR_DISABLED(GPIOE_PIN13) | \ | ||
1026 | PIN_ASCR_DISABLED(GPIOE_PIN14) | \ | ||
1027 | PIN_ASCR_DISABLED(GPIOE_PIN15)) | ||
1028 | #define VAL_GPIOE_LOCKR (PIN_LOCKR_DISABLED(GPIOE_PIN0) | \ | ||
1029 | PIN_LOCKR_DISABLED(GPIOE_PIN1) | \ | ||
1030 | PIN_LOCKR_DISABLED(GPIOE_PIN2) | \ | ||
1031 | PIN_LOCKR_DISABLED(GPIOE_PIN3) | \ | ||
1032 | PIN_LOCKR_DISABLED(GPIOE_PIN4) | \ | ||
1033 | PIN_LOCKR_DISABLED(GPIOE_PIN5) | \ | ||
1034 | PIN_LOCKR_DISABLED(GPIOE_PIN6) | \ | ||
1035 | PIN_LOCKR_DISABLED(GPIOE_PIN7) | \ | ||
1036 | PIN_LOCKR_DISABLED(GPIOE_PIN8) | \ | ||
1037 | PIN_LOCKR_DISABLED(GPIOE_PIN9) | \ | ||
1038 | PIN_LOCKR_DISABLED(GPIOE_PIN10) | \ | ||
1039 | PIN_LOCKR_DISABLED(GPIOE_PIN11) | \ | ||
1040 | PIN_LOCKR_DISABLED(GPIOE_PIN12) | \ | ||
1041 | PIN_LOCKR_DISABLED(GPIOE_PIN13) | \ | ||
1042 | PIN_LOCKR_DISABLED(GPIOE_PIN14) | \ | ||
1043 | PIN_LOCKR_DISABLED(GPIOE_PIN15)) | ||
1044 | |||
1045 | /* | ||
1046 | * GPIOF setup: | ||
1047 | * | ||
1048 | * PF0 - PIN0 (analog). | ||
1049 | * PF1 - PIN1 (analog). | ||
1050 | * PF2 - PIN2 (analog). | ||
1051 | * PF3 - PIN3 (analog). | ||
1052 | * PF4 - PIN4 (analog). | ||
1053 | * PF5 - PIN5 (analog). | ||
1054 | * PF6 - PIN6 (analog). | ||
1055 | * PF7 - PIN7 (analog). | ||
1056 | * PF8 - PIN8 (analog). | ||
1057 | * PF9 - PIN9 (analog). | ||
1058 | * PF10 - PIN10 (analog). | ||
1059 | * PF11 - PIN11 (analog). | ||
1060 | * PF12 - PIN12 (analog). | ||
1061 | * PF13 - PIN13 (analog). | ||
1062 | * PF14 - PIN14 (analog). | ||
1063 | * PF15 - PIN15 (analog). | ||
1064 | */ | ||
1065 | #define VAL_GPIOF_MODER (PIN_MODE_ANALOG(GPIOF_PIN0) | \ | ||
1066 | PIN_MODE_ANALOG(GPIOF_PIN1) | \ | ||
1067 | PIN_MODE_ANALOG(GPIOF_PIN2) | \ | ||
1068 | PIN_MODE_ANALOG(GPIOF_PIN3) | \ | ||
1069 | PIN_MODE_ANALOG(GPIOF_PIN4) | \ | ||
1070 | PIN_MODE_ANALOG(GPIOF_PIN5) | \ | ||
1071 | PIN_MODE_ANALOG(GPIOF_PIN6) | \ | ||
1072 | PIN_MODE_ANALOG(GPIOF_PIN7) | \ | ||
1073 | PIN_MODE_ANALOG(GPIOF_PIN8) | \ | ||
1074 | PIN_MODE_ANALOG(GPIOF_PIN9) | \ | ||
1075 | PIN_MODE_ANALOG(GPIOF_PIN10) | \ | ||
1076 | PIN_MODE_ANALOG(GPIOF_PIN11) | \ | ||
1077 | PIN_MODE_ANALOG(GPIOF_PIN12) | \ | ||
1078 | PIN_MODE_ANALOG(GPIOF_PIN13) | \ | ||
1079 | PIN_MODE_ANALOG(GPIOF_PIN14) | \ | ||
1080 | PIN_MODE_ANALOG(GPIOF_PIN15)) | ||
1081 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ | ||
1082 | PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ | ||
1083 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
1084 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
1085 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
1086 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
1087 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
1088 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
1089 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
1090 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
1091 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
1092 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
1093 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
1094 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
1095 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
1096 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
1097 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_PIN0) | \ | ||
1098 | PIN_OSPEED_VERYLOW(GPIOF_PIN1) | \ | ||
1099 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
1100 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
1101 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
1102 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
1103 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
1104 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
1105 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
1106 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
1107 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
1108 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
1109 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
1110 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
1111 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
1112 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
1113 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \ | ||
1114 | PIN_PUPDR_FLOATING(GPIOF_PIN1) | \ | ||
1115 | PIN_PUPDR_FLOATING(GPIOF_PIN2) | \ | ||
1116 | PIN_PUPDR_FLOATING(GPIOF_PIN3) | \ | ||
1117 | PIN_PUPDR_FLOATING(GPIOF_PIN4) | \ | ||
1118 | PIN_PUPDR_FLOATING(GPIOF_PIN5) | \ | ||
1119 | PIN_PUPDR_FLOATING(GPIOF_PIN6) | \ | ||
1120 | PIN_PUPDR_FLOATING(GPIOF_PIN7) | \ | ||
1121 | PIN_PUPDR_FLOATING(GPIOF_PIN8) | \ | ||
1122 | PIN_PUPDR_FLOATING(GPIOF_PIN9) | \ | ||
1123 | PIN_PUPDR_FLOATING(GPIOF_PIN10) | \ | ||
1124 | PIN_PUPDR_FLOATING(GPIOF_PIN11) | \ | ||
1125 | PIN_PUPDR_FLOATING(GPIOF_PIN12) | \ | ||
1126 | PIN_PUPDR_FLOATING(GPIOF_PIN13) | \ | ||
1127 | PIN_PUPDR_FLOATING(GPIOF_PIN14) | \ | ||
1128 | PIN_PUPDR_FLOATING(GPIOF_PIN15)) | ||
1129 | #define VAL_GPIOF_ODR (PIN_ODR_LOW(GPIOF_PIN0) | \ | ||
1130 | PIN_ODR_LOW(GPIOF_PIN1) | \ | ||
1131 | PIN_ODR_LOW(GPIOF_PIN2) | \ | ||
1132 | PIN_ODR_LOW(GPIOF_PIN3) | \ | ||
1133 | PIN_ODR_LOW(GPIOF_PIN4) | \ | ||
1134 | PIN_ODR_LOW(GPIOF_PIN5) | \ | ||
1135 | PIN_ODR_LOW(GPIOF_PIN6) | \ | ||
1136 | PIN_ODR_LOW(GPIOF_PIN7) | \ | ||
1137 | PIN_ODR_LOW(GPIOF_PIN8) | \ | ||
1138 | PIN_ODR_LOW(GPIOF_PIN9) | \ | ||
1139 | PIN_ODR_LOW(GPIOF_PIN10) | \ | ||
1140 | PIN_ODR_LOW(GPIOF_PIN11) | \ | ||
1141 | PIN_ODR_LOW(GPIOF_PIN12) | \ | ||
1142 | PIN_ODR_LOW(GPIOF_PIN13) | \ | ||
1143 | PIN_ODR_LOW(GPIOF_PIN14) | \ | ||
1144 | PIN_ODR_LOW(GPIOF_PIN15)) | ||
1145 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \ | ||
1146 | PIN_AFIO_AF(GPIOF_PIN1, 0U) | \ | ||
1147 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
1148 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
1149 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
1150 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
1151 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
1152 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
1153 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
1154 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
1155 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
1156 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
1157 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
1158 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
1159 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
1160 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
1161 | #define VAL_GPIOF_ASCR (PIN_ASCR_DISABLED(GPIOF_PIN0) | \ | ||
1162 | PIN_ASCR_DISABLED(GPIOF_PIN1) | \ | ||
1163 | PIN_ASCR_DISABLED(GPIOF_PIN2) | \ | ||
1164 | PIN_ASCR_DISABLED(GPIOF_PIN3) | \ | ||
1165 | PIN_ASCR_DISABLED(GPIOF_PIN4) | \ | ||
1166 | PIN_ASCR_DISABLED(GPIOF_PIN5) | \ | ||
1167 | PIN_ASCR_DISABLED(GPIOF_PIN6) | \ | ||
1168 | PIN_ASCR_DISABLED(GPIOF_PIN7) | \ | ||
1169 | PIN_ASCR_DISABLED(GPIOF_PIN8) | \ | ||
1170 | PIN_ASCR_DISABLED(GPIOF_PIN9) | \ | ||
1171 | PIN_ASCR_DISABLED(GPIOF_PIN10) | \ | ||
1172 | PIN_ASCR_DISABLED(GPIOF_PIN11) | \ | ||
1173 | PIN_ASCR_DISABLED(GPIOF_PIN12) | \ | ||
1174 | PIN_ASCR_DISABLED(GPIOF_PIN13) | \ | ||
1175 | PIN_ASCR_DISABLED(GPIOF_PIN14) | \ | ||
1176 | PIN_ASCR_DISABLED(GPIOF_PIN15)) | ||
1177 | #define VAL_GPIOF_LOCKR (PIN_LOCKR_DISABLED(GPIOF_PIN0) | \ | ||
1178 | PIN_LOCKR_DISABLED(GPIOF_PIN1) | \ | ||
1179 | PIN_LOCKR_DISABLED(GPIOF_PIN2) | \ | ||
1180 | PIN_LOCKR_DISABLED(GPIOF_PIN3) | \ | ||
1181 | PIN_LOCKR_DISABLED(GPIOF_PIN4) | \ | ||
1182 | PIN_LOCKR_DISABLED(GPIOF_PIN5) | \ | ||
1183 | PIN_LOCKR_DISABLED(GPIOF_PIN6) | \ | ||
1184 | PIN_LOCKR_DISABLED(GPIOF_PIN7) | \ | ||
1185 | PIN_LOCKR_DISABLED(GPIOF_PIN8) | \ | ||
1186 | PIN_LOCKR_DISABLED(GPIOF_PIN9) | \ | ||
1187 | PIN_LOCKR_DISABLED(GPIOF_PIN10) | \ | ||
1188 | PIN_LOCKR_DISABLED(GPIOF_PIN11) | \ | ||
1189 | PIN_LOCKR_DISABLED(GPIOF_PIN12) | \ | ||
1190 | PIN_LOCKR_DISABLED(GPIOF_PIN13) | \ | ||
1191 | PIN_LOCKR_DISABLED(GPIOF_PIN14) | \ | ||
1192 | PIN_LOCKR_DISABLED(GPIOF_PIN15)) | ||
1193 | |||
1194 | /* | ||
1195 | * GPIOG setup: | ||
1196 | * | ||
1197 | * PG0 - PIN0 (analog). | ||
1198 | * PG1 - PIN1 (analog). | ||
1199 | * PG2 - PIN2 (analog). | ||
1200 | * PG3 - PIN3 (analog). | ||
1201 | * PG4 - PIN4 (analog). | ||
1202 | * PG5 - PIN5 (analog). | ||
1203 | * PG6 - PIN6 (analog). | ||
1204 | * PG7 - PIN7 (analog). | ||
1205 | * PG8 - PIN8 (analog). | ||
1206 | * PG9 - OCTOSPIM_P2_IO6 (alternate 5). | ||
1207 | * PG10 - OCTOSPIM_P2_IO7 (alternate 5). | ||
1208 | * PG11 - PIN11 (analog). | ||
1209 | * PG12 - OCTOSPIM_P2_NCS (alternate 5). | ||
1210 | * PG13 - PIN13 (analog). | ||
1211 | * PG14 - PIN14 (analog). | ||
1212 | * PG15 - OCTOSPIM_P2_DQS (alternate 5). | ||
1213 | */ | ||
1214 | #define VAL_GPIOG_MODER (PIN_MODE_ANALOG(GPIOG_PIN0) | \ | ||
1215 | PIN_MODE_ANALOG(GPIOG_PIN1) | \ | ||
1216 | PIN_MODE_ANALOG(GPIOG_PIN2) | \ | ||
1217 | PIN_MODE_ANALOG(GPIOG_PIN3) | \ | ||
1218 | PIN_MODE_ANALOG(GPIOG_PIN4) | \ | ||
1219 | PIN_MODE_ANALOG(GPIOG_PIN5) | \ | ||
1220 | PIN_MODE_ANALOG(GPIOG_PIN6) | \ | ||
1221 | PIN_MODE_ANALOG(GPIOG_PIN7) | \ | ||
1222 | PIN_MODE_ANALOG(GPIOG_PIN8) | \ | ||
1223 | PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_IO6) |\ | ||
1224 | PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_IO7) |\ | ||
1225 | PIN_MODE_ANALOG(GPIOG_PIN11) | \ | ||
1226 | PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_NCS) |\ | ||
1227 | PIN_MODE_ANALOG(GPIOG_PIN13) | \ | ||
1228 | PIN_MODE_ANALOG(GPIOG_PIN14) | \ | ||
1229 | PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_DQS)) | ||
1230 | #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ | ||
1231 | PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ | ||
1232 | PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ | ||
1233 | PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ | ||
1234 | PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ | ||
1235 | PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ | ||
1236 | PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ | ||
1237 | PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ | ||
1238 | PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ | ||
1239 | PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_IO6) |\ | ||
1240 | PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_IO7) |\ | ||
1241 | PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ | ||
1242 | PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_NCS) |\ | ||
1243 | PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ | ||
1244 | PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ | ||
1245 | PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_DQS)) | ||
1246 | #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ | ||
1247 | PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ | ||
1248 | PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ | ||
1249 | PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ | ||
1250 | PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ | ||
1251 | PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ | ||
1252 | PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ | ||
1253 | PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ | ||
1254 | PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ | ||
1255 | PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_IO6) |\ | ||
1256 | PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_IO7) |\ | ||
1257 | PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ | ||
1258 | PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_NCS) |\ | ||
1259 | PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ | ||
1260 | PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ | ||
1261 | PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_DQS)) | ||
1262 | #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \ | ||
1263 | PIN_PUPDR_FLOATING(GPIOG_PIN1) | \ | ||
1264 | PIN_PUPDR_FLOATING(GPIOG_PIN2) | \ | ||
1265 | PIN_PUPDR_FLOATING(GPIOG_PIN3) | \ | ||
1266 | PIN_PUPDR_FLOATING(GPIOG_PIN4) | \ | ||
1267 | PIN_PUPDR_FLOATING(GPIOG_PIN5) | \ | ||
1268 | PIN_PUPDR_FLOATING(GPIOG_PIN6) | \ | ||
1269 | PIN_PUPDR_FLOATING(GPIOG_PIN7) | \ | ||
1270 | PIN_PUPDR_FLOATING(GPIOG_PIN8) | \ | ||
1271 | PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_IO6) |\ | ||
1272 | PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_IO7) |\ | ||
1273 | PIN_PUPDR_FLOATING(GPIOG_PIN11) | \ | ||
1274 | PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_NCS) |\ | ||
1275 | PIN_PUPDR_FLOATING(GPIOG_PIN13) | \ | ||
1276 | PIN_PUPDR_FLOATING(GPIOG_PIN14) | \ | ||
1277 | PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_DQS)) | ||
1278 | #define VAL_GPIOG_ODR (PIN_ODR_LOW(GPIOG_PIN0) | \ | ||
1279 | PIN_ODR_LOW(GPIOG_PIN1) | \ | ||
1280 | PIN_ODR_LOW(GPIOG_PIN2) | \ | ||
1281 | PIN_ODR_LOW(GPIOG_PIN3) | \ | ||
1282 | PIN_ODR_LOW(GPIOG_PIN4) | \ | ||
1283 | PIN_ODR_LOW(GPIOG_PIN5) | \ | ||
1284 | PIN_ODR_LOW(GPIOG_PIN6) | \ | ||
1285 | PIN_ODR_LOW(GPIOG_PIN7) | \ | ||
1286 | PIN_ODR_LOW(GPIOG_PIN8) | \ | ||
1287 | PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_IO6) | \ | ||
1288 | PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_IO7) | \ | ||
1289 | PIN_ODR_LOW(GPIOG_PIN11) | \ | ||
1290 | PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_NCS) | \ | ||
1291 | PIN_ODR_LOW(GPIOG_PIN13) | \ | ||
1292 | PIN_ODR_LOW(GPIOG_PIN14) | \ | ||
1293 | PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_DQS)) | ||
1294 | #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \ | ||
1295 | PIN_AFIO_AF(GPIOG_PIN1, 0U) | \ | ||
1296 | PIN_AFIO_AF(GPIOG_PIN2, 0U) | \ | ||
1297 | PIN_AFIO_AF(GPIOG_PIN3, 0U) | \ | ||
1298 | PIN_AFIO_AF(GPIOG_PIN4, 0U) | \ | ||
1299 | PIN_AFIO_AF(GPIOG_PIN5, 0U) | \ | ||
1300 | PIN_AFIO_AF(GPIOG_PIN6, 0U) | \ | ||
1301 | PIN_AFIO_AF(GPIOG_PIN7, 8U)) | ||
1302 | #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 8U) | \ | ||
1303 | PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_IO6, 5U) |\ | ||
1304 | PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_IO7, 5U) |\ | ||
1305 | PIN_AFIO_AF(GPIOG_PIN11, 0U) | \ | ||
1306 | PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_NCS, 5U) |\ | ||
1307 | PIN_AFIO_AF(GPIOG_PIN13, 0U) | \ | ||
1308 | PIN_AFIO_AF(GPIOG_PIN14, 0U) | \ | ||
1309 | PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_DQS, 5U)) | ||
1310 | #define VAL_GPIOG_ASCR (PIN_ASCR_DISABLED(GPIOG_PIN0) | \ | ||
1311 | PIN_ASCR_DISABLED(GPIOG_PIN1) | \ | ||
1312 | PIN_ASCR_DISABLED(GPIOG_PIN2) | \ | ||
1313 | PIN_ASCR_DISABLED(GPIOG_PIN3) | \ | ||
1314 | PIN_ASCR_DISABLED(GPIOG_PIN4) | \ | ||
1315 | PIN_ASCR_DISABLED(GPIOG_PIN5) | \ | ||
1316 | PIN_ASCR_DISABLED(GPIOG_PIN6) | \ | ||
1317 | PIN_ASCR_DISABLED(GPIOG_PIN7) | \ | ||
1318 | PIN_ASCR_DISABLED(GPIOG_PIN8) | \ | ||
1319 | PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_IO6) |\ | ||
1320 | PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_IO7) |\ | ||
1321 | PIN_ASCR_DISABLED(GPIOG_PIN11) | \ | ||
1322 | PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_NCS) |\ | ||
1323 | PIN_ASCR_DISABLED(GPIOG_PIN13) | \ | ||
1324 | PIN_ASCR_DISABLED(GPIOG_PIN14) | \ | ||
1325 | PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_DQS)) | ||
1326 | #define VAL_GPIOG_LOCKR (PIN_LOCKR_DISABLED(GPIOG_PIN0) | \ | ||
1327 | PIN_LOCKR_DISABLED(GPIOG_PIN1) | \ | ||
1328 | PIN_LOCKR_DISABLED(GPIOG_PIN2) | \ | ||
1329 | PIN_LOCKR_DISABLED(GPIOG_PIN3) | \ | ||
1330 | PIN_LOCKR_DISABLED(GPIOG_PIN4) | \ | ||
1331 | PIN_LOCKR_DISABLED(GPIOG_PIN5) | \ | ||
1332 | PIN_LOCKR_DISABLED(GPIOG_PIN6) | \ | ||
1333 | PIN_LOCKR_DISABLED(GPIOG_PIN7) | \ | ||
1334 | PIN_LOCKR_DISABLED(GPIOG_PIN8) | \ | ||
1335 | PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_IO6) |\ | ||
1336 | PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_IO7) |\ | ||
1337 | PIN_LOCKR_DISABLED(GPIOG_PIN11) | \ | ||
1338 | PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_NCS) |\ | ||
1339 | PIN_LOCKR_DISABLED(GPIOG_PIN13) | \ | ||
1340 | PIN_LOCKR_DISABLED(GPIOG_PIN14) | \ | ||
1341 | PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_DQS)) | ||
1342 | |||
1343 | /* | ||
1344 | * GPIOH setup: | ||
1345 | * | ||
1346 | * PH0 - OSC_IN (analog). | ||
1347 | * PH1 - OSC_OUT (analog). | ||
1348 | * PH2 - PIN2 (analog). | ||
1349 | * PH3 - BOOT0 (input floating). | ||
1350 | * PH4 - LED LED_GREEN (output pushpull maximum). | ||
1351 | * PH5 - PIN5 (analog). | ||
1352 | * PH6 - PIN6 (analog). | ||
1353 | * PH7 - PIN7 (analog). | ||
1354 | * PH8 - OCTOSPIM_P2_IO3 (alternate 5). | ||
1355 | * PH9 - OCTOSPIM_P2_IO4 (alternate 5). | ||
1356 | * PH10 - OCTOSPIM_P2_IO5 (alternate 5). | ||
1357 | * PH11 - PIN11 (analog). | ||
1358 | * PH12 - PIN12 (analog). | ||
1359 | * PH13 - PIN13 (analog). | ||
1360 | * PH14 - PIN14 (analog). | ||
1361 | * PH15 - PIN15 (analog). | ||
1362 | */ | ||
1363 | #define VAL_GPIOH_MODER (PIN_MODE_ANALOG(GPIOH_OSC_IN) | \ | ||
1364 | PIN_MODE_ANALOG(GPIOH_OSC_OUT) | \ | ||
1365 | PIN_MODE_ANALOG(GPIOH_PIN2) | \ | ||
1366 | PIN_MODE_INPUT(GPIOH_BOOT0) | \ | ||
1367 | PIN_MODE_OUTPUT(GPIOH_LED) | \ | ||
1368 | PIN_MODE_ANALOG(GPIOH_PIN5) | \ | ||
1369 | PIN_MODE_ANALOG(GPIOH_PIN6) | \ | ||
1370 | PIN_MODE_ANALOG(GPIOH_PIN7) | \ | ||
1371 | PIN_MODE_ALTERNATE(GPIOH_OCTOSPIM_P2_IO3) |\ | ||
1372 | PIN_MODE_ALTERNATE(GPIOH_OCTOSPIM_P2_IO4) |\ | ||
1373 | PIN_MODE_ALTERNATE(GPIOH_OCTOSPIM_P2_IO5) |\ | ||
1374 | PIN_MODE_ANALOG(GPIOH_PIN11) | \ | ||
1375 | PIN_MODE_ANALOG(GPIOH_PIN12) | \ | ||
1376 | PIN_MODE_ANALOG(GPIOH_PIN13) | \ | ||
1377 | PIN_MODE_ANALOG(GPIOH_PIN14) | \ | ||
1378 | PIN_MODE_ANALOG(GPIOH_PIN15)) | ||
1379 | #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \ | ||
1380 | PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \ | ||
1381 | PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ | ||
1382 | PIN_OTYPE_PUSHPULL(GPIOH_BOOT0) | \ | ||
1383 | PIN_OTYPE_PUSHPULL(GPIOH_LED) | \ | ||
1384 | PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ | ||
1385 | PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ | ||
1386 | PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ | ||
1387 | PIN_OTYPE_PUSHPULL(GPIOH_OCTOSPIM_P2_IO3) |\ | ||
1388 | PIN_OTYPE_PUSHPULL(GPIOH_OCTOSPIM_P2_IO4) |\ | ||
1389 | PIN_OTYPE_PUSHPULL(GPIOH_OCTOSPIM_P2_IO5) |\ | ||
1390 | PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ | ||
1391 | PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ | ||
1392 | PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ | ||
1393 | PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ | ||
1394 | PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) | ||
1395 | #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_OSC_IN) | \ | ||
1396 | PIN_OSPEED_VERYLOW(GPIOH_OSC_OUT) | \ | ||
1397 | PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ | ||
1398 | PIN_OSPEED_VERYLOW(GPIOH_BOOT0) | \ | ||
1399 | PIN_OSPEED_HIGH(GPIOH_LED) | \ | ||
1400 | PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ | ||
1401 | PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ | ||
1402 | PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ | ||
1403 | PIN_OSPEED_HIGH(GPIOH_OCTOSPIM_P2_IO3) |\ | ||
1404 | PIN_OSPEED_HIGH(GPIOH_OCTOSPIM_P2_IO4) |\ | ||
1405 | PIN_OSPEED_HIGH(GPIOH_OCTOSPIM_P2_IO5) |\ | ||
1406 | PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ | ||
1407 | PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ | ||
1408 | PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ | ||
1409 | PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ | ||
1410 | PIN_OSPEED_VERYLOW(GPIOH_PIN15)) | ||
1411 | #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ | ||
1412 | PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ | ||
1413 | PIN_PUPDR_FLOATING(GPIOH_PIN2) | \ | ||
1414 | PIN_PUPDR_FLOATING(GPIOH_BOOT0) | \ | ||
1415 | PIN_PUPDR_FLOATING(GPIOH_LED) | \ | ||
1416 | PIN_PUPDR_FLOATING(GPIOH_PIN5) | \ | ||
1417 | PIN_PUPDR_FLOATING(GPIOH_PIN6) | \ | ||
1418 | PIN_PUPDR_FLOATING(GPIOH_PIN7) | \ | ||
1419 | PIN_PUPDR_FLOATING(GPIOH_OCTOSPIM_P2_IO3) |\ | ||
1420 | PIN_PUPDR_FLOATING(GPIOH_OCTOSPIM_P2_IO4) |\ | ||
1421 | PIN_PUPDR_FLOATING(GPIOH_OCTOSPIM_P2_IO5) |\ | ||
1422 | PIN_PUPDR_FLOATING(GPIOH_PIN11) | \ | ||
1423 | PIN_PUPDR_FLOATING(GPIOH_PIN12) | \ | ||
1424 | PIN_PUPDR_FLOATING(GPIOH_PIN13) | \ | ||
1425 | PIN_PUPDR_FLOATING(GPIOH_PIN14) | \ | ||
1426 | PIN_PUPDR_FLOATING(GPIOH_PIN15)) | ||
1427 | #define VAL_GPIOH_ODR (PIN_ODR_LOW(GPIOH_OSC_IN) | \ | ||
1428 | PIN_ODR_LOW(GPIOH_OSC_OUT) | \ | ||
1429 | PIN_ODR_LOW(GPIOH_PIN2) | \ | ||
1430 | PIN_ODR_LOW(GPIOH_BOOT0) | \ | ||
1431 | PIN_ODR_HIGH(GPIOH_LED) | \ | ||
1432 | PIN_ODR_LOW(GPIOH_PIN5) | \ | ||
1433 | PIN_ODR_LOW(GPIOH_PIN6) | \ | ||
1434 | PIN_ODR_LOW(GPIOH_PIN7) | \ | ||
1435 | PIN_ODR_LOW(GPIOH_OCTOSPIM_P2_IO3) | \ | ||
1436 | PIN_ODR_LOW(GPIOH_OCTOSPIM_P2_IO4) | \ | ||
1437 | PIN_ODR_LOW(GPIOH_OCTOSPIM_P2_IO5) | \ | ||
1438 | PIN_ODR_LOW(GPIOH_PIN11) | \ | ||
1439 | PIN_ODR_LOW(GPIOH_PIN12) | \ | ||
1440 | PIN_ODR_LOW(GPIOH_PIN13) | \ | ||
1441 | PIN_ODR_LOW(GPIOH_PIN14) | \ | ||
1442 | PIN_ODR_LOW(GPIOH_PIN15)) | ||
1443 | #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \ | ||
1444 | PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \ | ||
1445 | PIN_AFIO_AF(GPIOH_PIN2, 0U) | \ | ||
1446 | PIN_AFIO_AF(GPIOH_BOOT0, 0U) | \ | ||
1447 | PIN_AFIO_AF(GPIOH_LED, 0U) | \ | ||
1448 | PIN_AFIO_AF(GPIOH_PIN5, 0U) | \ | ||
1449 | PIN_AFIO_AF(GPIOH_PIN6, 0U) | \ | ||
1450 | PIN_AFIO_AF(GPIOH_PIN7, 0U)) | ||
1451 | #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_OCTOSPIM_P2_IO3, 5U) |\ | ||
1452 | PIN_AFIO_AF(GPIOH_OCTOSPIM_P2_IO4, 5U) |\ | ||
1453 | PIN_AFIO_AF(GPIOH_OCTOSPIM_P2_IO5, 5U) |\ | ||
1454 | PIN_AFIO_AF(GPIOH_PIN11, 0U) | \ | ||
1455 | PIN_AFIO_AF(GPIOH_PIN12, 0U) | \ | ||
1456 | PIN_AFIO_AF(GPIOH_PIN13, 0U) | \ | ||
1457 | PIN_AFIO_AF(GPIOH_PIN14, 0U) | \ | ||
1458 | PIN_AFIO_AF(GPIOH_PIN15, 0U)) | ||
1459 | #define VAL_GPIOH_ASCR (PIN_ASCR_DISABLED(GPIOH_OSC_IN) | \ | ||
1460 | PIN_ASCR_DISABLED(GPIOH_OSC_OUT) | \ | ||
1461 | PIN_ASCR_DISABLED(GPIOH_PIN2) | \ | ||
1462 | PIN_ASCR_DISABLED(GPIOH_BOOT0) | \ | ||
1463 | PIN_ASCR_DISABLED(GPIOH_LED) | \ | ||
1464 | PIN_ASCR_DISABLED(GPIOH_PIN5) | \ | ||
1465 | PIN_ASCR_DISABLED(GPIOH_PIN6) | \ | ||
1466 | PIN_ASCR_DISABLED(GPIOH_PIN7) | \ | ||
1467 | PIN_ASCR_DISABLED(GPIOH_OCTOSPIM_P2_IO3) |\ | ||
1468 | PIN_ASCR_DISABLED(GPIOH_OCTOSPIM_P2_IO4) |\ | ||
1469 | PIN_ASCR_DISABLED(GPIOH_OCTOSPIM_P2_IO5) |\ | ||
1470 | PIN_ASCR_DISABLED(GPIOH_PIN11) | \ | ||
1471 | PIN_ASCR_DISABLED(GPIOH_PIN12) | \ | ||
1472 | PIN_ASCR_DISABLED(GPIOH_PIN13) | \ | ||
1473 | PIN_ASCR_DISABLED(GPIOH_PIN14) | \ | ||
1474 | PIN_ASCR_DISABLED(GPIOH_PIN15)) | ||
1475 | #define VAL_GPIOH_LOCKR (PIN_LOCKR_DISABLED(GPIOH_OSC_IN) | \ | ||
1476 | PIN_LOCKR_DISABLED(GPIOH_OSC_OUT) | \ | ||
1477 | PIN_LOCKR_DISABLED(GPIOH_PIN2) | \ | ||
1478 | PIN_LOCKR_DISABLED(GPIOH_BOOT0) | \ | ||
1479 | PIN_LOCKR_DISABLED(GPIOH_LED) | \ | ||
1480 | PIN_LOCKR_DISABLED(GPIOH_PIN5) | \ | ||
1481 | PIN_LOCKR_DISABLED(GPIOH_PIN6) | \ | ||
1482 | PIN_LOCKR_DISABLED(GPIOH_PIN7) | \ | ||
1483 | PIN_LOCKR_DISABLED(GPIOH_OCTOSPIM_P2_IO3) |\ | ||
1484 | PIN_LOCKR_DISABLED(GPIOH_OCTOSPIM_P2_IO4) |\ | ||
1485 | PIN_LOCKR_DISABLED(GPIOH_OCTOSPIM_P2_IO5) |\ | ||
1486 | PIN_LOCKR_DISABLED(GPIOH_PIN11) | \ | ||
1487 | PIN_LOCKR_DISABLED(GPIOH_PIN12) | \ | ||
1488 | PIN_LOCKR_DISABLED(GPIOH_PIN13) | \ | ||
1489 | PIN_LOCKR_DISABLED(GPIOH_PIN14) | \ | ||
1490 | PIN_LOCKR_DISABLED(GPIOH_PIN15)) | ||
1491 | |||
1492 | /* | ||
1493 | * GPIOI setup: | ||
1494 | * | ||
1495 | * PI0 - PIN0 (analog). | ||
1496 | * PI1 - PIN1 (analog). | ||
1497 | * PI2 - PIN2 (analog). | ||
1498 | * PI3 - PIN3 (analog). | ||
1499 | * PI4 - PIN4 (analog). | ||
1500 | * PI5 - PIN5 (analog). | ||
1501 | * PI6 - OCTOSPIM_P2_CLK (alternate 5). | ||
1502 | * PI7 - PIN7 (analog). | ||
1503 | * PI8 - PIN8 (analog). | ||
1504 | * PI9 - OCTOSPIM_P2_IO2 (alternate 5). | ||
1505 | * PI10 - OCTOSPIM_P2_IO1 (alternate 5). | ||
1506 | * PI11 - OCTOSPIM_P2_IO0 (alternate 5). | ||
1507 | * PI12 - PIN12 (analog). | ||
1508 | * PI13 - PIN13 (analog). | ||
1509 | * PI14 - PIN14 (analog). | ||
1510 | * PI15 - PIN15 (analog). | ||
1511 | */ | ||
1512 | #define VAL_GPIOI_MODER (PIN_MODE_ANALOG(GPIOI_PIN0) | \ | ||
1513 | PIN_MODE_ANALOG(GPIOI_PIN1) | \ | ||
1514 | PIN_MODE_ANALOG(GPIOI_PIN2) | \ | ||
1515 | PIN_MODE_ANALOG(GPIOI_PIN3) | \ | ||
1516 | PIN_MODE_ANALOG(GPIOI_PIN4) | \ | ||
1517 | PIN_MODE_ANALOG(GPIOI_PIN5) | \ | ||
1518 | PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_CLK) |\ | ||
1519 | PIN_MODE_ANALOG(GPIOI_PIN7) | \ | ||
1520 | PIN_MODE_ANALOG(GPIOI_PIN8) | \ | ||
1521 | PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_IO2) |\ | ||
1522 | PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_IO1) |\ | ||
1523 | PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_IO0) |\ | ||
1524 | PIN_MODE_ANALOG(GPIOI_PIN12) | \ | ||
1525 | PIN_MODE_ANALOG(GPIOI_PIN13) | \ | ||
1526 | PIN_MODE_ANALOG(GPIOI_PIN14) | \ | ||
1527 | PIN_MODE_ANALOG(GPIOI_PIN15)) | ||
1528 | #define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \ | ||
1529 | PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \ | ||
1530 | PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \ | ||
1531 | PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \ | ||
1532 | PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \ | ||
1533 | PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \ | ||
1534 | PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_CLK) |\ | ||
1535 | PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \ | ||
1536 | PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \ | ||
1537 | PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_IO2) |\ | ||
1538 | PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_IO1) |\ | ||
1539 | PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_IO0) |\ | ||
1540 | PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \ | ||
1541 | PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ | ||
1542 | PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ | ||
1543 | PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) | ||
1544 | #define VAL_GPIOI_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOI_PIN0) | \ | ||
1545 | PIN_OSPEED_VERYLOW(GPIOI_PIN1) | \ | ||
1546 | PIN_OSPEED_VERYLOW(GPIOI_PIN2) | \ | ||
1547 | PIN_OSPEED_VERYLOW(GPIOI_PIN3) | \ | ||
1548 | PIN_OSPEED_VERYLOW(GPIOI_PIN4) | \ | ||
1549 | PIN_OSPEED_VERYLOW(GPIOI_PIN5) | \ | ||
1550 | PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_CLK) |\ | ||
1551 | PIN_OSPEED_VERYLOW(GPIOI_PIN7) | \ | ||
1552 | PIN_OSPEED_VERYLOW(GPIOI_PIN8) | \ | ||
1553 | PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_IO2) |\ | ||
1554 | PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_IO1) |\ | ||
1555 | PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_IO0) |\ | ||
1556 | PIN_OSPEED_VERYLOW(GPIOI_PIN12) | \ | ||
1557 | PIN_OSPEED_VERYLOW(GPIOI_PIN13) | \ | ||
1558 | PIN_OSPEED_VERYLOW(GPIOI_PIN14) | \ | ||
1559 | PIN_OSPEED_VERYLOW(GPIOI_PIN15)) | ||
1560 | #define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \ | ||
1561 | PIN_PUPDR_FLOATING(GPIOI_PIN1) | \ | ||
1562 | PIN_PUPDR_FLOATING(GPIOI_PIN2) | \ | ||
1563 | PIN_PUPDR_FLOATING(GPIOI_PIN3) | \ | ||
1564 | PIN_PUPDR_FLOATING(GPIOI_PIN4) | \ | ||
1565 | PIN_PUPDR_FLOATING(GPIOI_PIN5) | \ | ||
1566 | PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_CLK) |\ | ||
1567 | PIN_PUPDR_FLOATING(GPIOI_PIN7) | \ | ||
1568 | PIN_PUPDR_FLOATING(GPIOI_PIN8) | \ | ||
1569 | PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_IO2) |\ | ||
1570 | PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_IO1) |\ | ||
1571 | PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_IO0) |\ | ||
1572 | PIN_PUPDR_FLOATING(GPIOI_PIN12) | \ | ||
1573 | PIN_PUPDR_FLOATING(GPIOI_PIN13) | \ | ||
1574 | PIN_PUPDR_FLOATING(GPIOI_PIN14) | \ | ||
1575 | PIN_PUPDR_FLOATING(GPIOI_PIN15)) | ||
1576 | #define VAL_GPIOI_ODR (PIN_ODR_LOW(GPIOI_PIN0) | \ | ||
1577 | PIN_ODR_LOW(GPIOI_PIN1) | \ | ||
1578 | PIN_ODR_LOW(GPIOI_PIN2) | \ | ||
1579 | PIN_ODR_LOW(GPIOI_PIN3) | \ | ||
1580 | PIN_ODR_LOW(GPIOI_PIN4) | \ | ||
1581 | PIN_ODR_LOW(GPIOI_PIN5) | \ | ||
1582 | PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_CLK) | \ | ||
1583 | PIN_ODR_LOW(GPIOI_PIN7) | \ | ||
1584 | PIN_ODR_LOW(GPIOI_PIN8) | \ | ||
1585 | PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_IO2) | \ | ||
1586 | PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_IO1) | \ | ||
1587 | PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_IO0) | \ | ||
1588 | PIN_ODR_LOW(GPIOI_PIN12) | \ | ||
1589 | PIN_ODR_LOW(GPIOI_PIN13) | \ | ||
1590 | PIN_ODR_LOW(GPIOI_PIN14) | \ | ||
1591 | PIN_ODR_LOW(GPIOI_PIN15)) | ||
1592 | #define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0U) | \ | ||
1593 | PIN_AFIO_AF(GPIOI_PIN1, 0U) | \ | ||
1594 | PIN_AFIO_AF(GPIOI_PIN2, 0U) | \ | ||
1595 | PIN_AFIO_AF(GPIOI_PIN3, 0U) | \ | ||
1596 | PIN_AFIO_AF(GPIOI_PIN4, 0U) | \ | ||
1597 | PIN_AFIO_AF(GPIOI_PIN5, 0U) | \ | ||
1598 | PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_CLK, 5U) |\ | ||
1599 | PIN_AFIO_AF(GPIOI_PIN7, 0U)) | ||
1600 | #define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0U) | \ | ||
1601 | PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_IO2, 5U) |\ | ||
1602 | PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_IO1, 5U) |\ | ||
1603 | PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_IO0, 5U) |\ | ||
1604 | PIN_AFIO_AF(GPIOI_PIN12, 0U) | \ | ||
1605 | PIN_AFIO_AF(GPIOI_PIN13, 0U) | \ | ||
1606 | PIN_AFIO_AF(GPIOI_PIN14, 0U) | \ | ||
1607 | PIN_AFIO_AF(GPIOI_PIN15, 0U)) | ||
1608 | #define VAL_GPIOI_ASCR (PIN_ASCR_DISABLED(GPIOI_PIN0) | \ | ||
1609 | PIN_ASCR_DISABLED(GPIOI_PIN1) | \ | ||
1610 | PIN_ASCR_DISABLED(GPIOI_PIN2) | \ | ||
1611 | PIN_ASCR_DISABLED(GPIOI_PIN3) | \ | ||
1612 | PIN_ASCR_DISABLED(GPIOI_PIN4) | \ | ||
1613 | PIN_ASCR_DISABLED(GPIOI_PIN5) | \ | ||
1614 | PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_CLK) |\ | ||
1615 | PIN_ASCR_DISABLED(GPIOI_PIN7) | \ | ||
1616 | PIN_ASCR_DISABLED(GPIOI_PIN8) | \ | ||
1617 | PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_IO2) |\ | ||
1618 | PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_IO1) |\ | ||
1619 | PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_IO0) |\ | ||
1620 | PIN_ASCR_DISABLED(GPIOI_PIN12) | \ | ||
1621 | PIN_ASCR_DISABLED(GPIOI_PIN13) | \ | ||
1622 | PIN_ASCR_DISABLED(GPIOI_PIN14) | \ | ||
1623 | PIN_ASCR_DISABLED(GPIOI_PIN15)) | ||
1624 | #define VAL_GPIOI_LOCKR (PIN_LOCKR_DISABLED(GPIOI_PIN0) | \ | ||
1625 | PIN_LOCKR_DISABLED(GPIOI_PIN1) | \ | ||
1626 | PIN_LOCKR_DISABLED(GPIOI_PIN2) | \ | ||
1627 | PIN_LOCKR_DISABLED(GPIOI_PIN3) | \ | ||
1628 | PIN_LOCKR_DISABLED(GPIOI_PIN4) | \ | ||
1629 | PIN_LOCKR_DISABLED(GPIOI_PIN5) | \ | ||
1630 | PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_CLK) |\ | ||
1631 | PIN_LOCKR_DISABLED(GPIOI_PIN7) | \ | ||
1632 | PIN_LOCKR_DISABLED(GPIOI_PIN8) | \ | ||
1633 | PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_IO2) |\ | ||
1634 | PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_IO1) |\ | ||
1635 | PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_IO0) |\ | ||
1636 | PIN_LOCKR_DISABLED(GPIOI_PIN12) | \ | ||
1637 | PIN_LOCKR_DISABLED(GPIOI_PIN13) | \ | ||
1638 | PIN_LOCKR_DISABLED(GPIOI_PIN14) | \ | ||
1639 | PIN_LOCKR_DISABLED(GPIOI_PIN15)) | ||
1640 | |||
1641 | /*===========================================================================*/ | ||
1642 | /* External declarations. */ | ||
1643 | /*===========================================================================*/ | ||
1644 | |||
1645 | #if !defined(_FROM_ASM_) | ||
1646 | #ifdef __cplusplus | ||
1647 | extern "C" { | ||
1648 | #endif | ||
1649 | void boardInit(void); | ||
1650 | #ifdef __cplusplus | ||
1651 | } | ||
1652 | #endif | ||
1653 | #endif /* _FROM_ASM_ */ | ||
1654 | |||
1655 | #endif /* BOARD_H */ | ||