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