diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_NUCLEO64_G071RB/board.h')
-rw-r--r-- | lib/chibios/os/hal/boards/ST_NUCLEO64_G071RB/board.h | 796 |
1 files changed, 796 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_G071RB/board.h b/lib/chibios/os/hal/boards/ST_NUCLEO64_G071RB/board.h new file mode 100644 index 000000000..edcf25a91 --- /dev/null +++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_G071RB/board.h | |||
@@ -0,0 +1,796 @@ | |||
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 Nucleo64-G071RB board. | ||
31 | */ | ||
32 | |||
33 | /* | ||
34 | * Board identifier. | ||
35 | */ | ||
36 | #define BOARD_ST_NUCLEO64_G071RB | ||
37 | #define BOARD_NAME "STMicroelectronics STM32 Nucleo64-G071RB" | ||
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 << 11U) | ||
47 | |||
48 | #if !defined(STM32_HSECLK) | ||
49 | #define STM32_HSECLK 8000000U | ||
50 | #endif | ||
51 | |||
52 | /* | ||
53 | * MCU type as defined in the ST header. | ||
54 | */ | ||
55 | #define STM32G071xx | ||
56 | |||
57 | /* | ||
58 | * IO pins assignments. | ||
59 | */ | ||
60 | #define GPIOA_PIN0 0U | ||
61 | #define GPIOA_PIN1 1U | ||
62 | #define GPIOA_STLK_RX 2U | ||
63 | #define GPIOA_STLK_TX 3U | ||
64 | #define GPIOA_PIN4 4U | ||
65 | #define GPIOA_LED_GREEN 5U | ||
66 | #define GPIOA_PIN6 6U | ||
67 | #define GPIOA_PIN7 7U | ||
68 | #define GPIOA_PIN8 8U | ||
69 | #define GPIOA_PIN9 9U | ||
70 | #define GPIOA_PIN10 10U | ||
71 | #define GPIOA_PIN11 11U | ||
72 | #define GPIOA_PIN12 12U | ||
73 | #define GPIOA_SWDIO 13U | ||
74 | #define GPIOA_SWCLK 14U | ||
75 | #define GPIOA_PIN15 15U | ||
76 | |||
77 | #define GPIOB_PIN0 0U | ||
78 | #define GPIOB_PIN1 1U | ||
79 | #define GPIOB_PIN2 2U | ||
80 | #define GPIOB_PIN3 3U | ||
81 | #define GPIOB_PIN4 4U | ||
82 | #define GPIOB_PIN5 5U | ||
83 | #define GPIOB_PIN6 6U | ||
84 | #define GPIOB_PIN7 7U | ||
85 | #define GPIOB_PIN8 8U | ||
86 | #define GPIOB_PIN9 9U | ||
87 | #define GPIOB_PIN10 10U | ||
88 | #define GPIOB_PIN11 11U | ||
89 | #define GPIOB_PIN12 12U | ||
90 | #define GPIOB_PIN13 13U | ||
91 | #define GPIOB_PIN14 14U | ||
92 | #define GPIOB_PIN15 15U | ||
93 | |||
94 | #define GPIOC_PIN0 0U | ||
95 | #define GPIOC_PIN1 1U | ||
96 | #define GPIOC_PIN2 2U | ||
97 | #define GPIOC_PIN3 3U | ||
98 | #define GPIOC_PIN4 4U | ||
99 | #define GPIOC_PIN5 5U | ||
100 | #define GPIOC_PIN6 6U | ||
101 | #define GPIOC_PIN7 7U | ||
102 | #define GPIOC_PIN8 8U | ||
103 | #define GPIOC_PIN9 9U | ||
104 | #define GPIOC_PIN10 10U | ||
105 | #define GPIOC_PIN11 11U | ||
106 | #define GPIOC_PIN12 12U | ||
107 | #define GPIOC_BUTTON 13U | ||
108 | #define GPIOC_OSC32_IN 14U | ||
109 | #define GPIOC_OSC32_OUT 15U | ||
110 | |||
111 | #define GPIOD_PIN0 0U | ||
112 | #define GPIOD_PIN1 1U | ||
113 | #define GPIOD_PIN2 2U | ||
114 | #define GPIOD_PIN3 3U | ||
115 | #define GPIOD_PIN4 4U | ||
116 | #define GPIOD_PIN5 5U | ||
117 | #define GPIOD_PIN6 6U | ||
118 | #define GPIOD_PIN7 7U | ||
119 | #define GPIOD_PIN8 8U | ||
120 | #define GPIOD_PIN9 9U | ||
121 | #define GPIOD_PIN10 10U | ||
122 | #define GPIOD_PIN11 11U | ||
123 | #define GPIOD_PIN12 12U | ||
124 | #define GPIOD_PIN13 13U | ||
125 | #define GPIOD_PIN14 14U | ||
126 | #define GPIOD_PIN15 15U | ||
127 | |||
128 | #define GPIOF_OSC_IN 0U | ||
129 | #define GPIOF_OSC_OUT 1U | ||
130 | #define GPIOF_PIN2 2U | ||
131 | #define GPIOF_PIN3 3U | ||
132 | #define GPIOF_PIN4 4U | ||
133 | #define GPIOF_PIN5 5U | ||
134 | #define GPIOF_PIN6 6U | ||
135 | #define GPIOF_PIN7 7U | ||
136 | #define GPIOF_PIN8 8U | ||
137 | #define GPIOF_PIN9 9U | ||
138 | #define GPIOF_PIN10 10U | ||
139 | #define GPIOF_PIN11 11U | ||
140 | #define GPIOF_PIN12 12U | ||
141 | #define GPIOF_PIN13 13U | ||
142 | #define GPIOF_PIN14 14U | ||
143 | #define GPIOF_PIN15 15U | ||
144 | |||
145 | /* | ||
146 | * IO lines assignments. | ||
147 | */ | ||
148 | #define LINE_STLK_RX PAL_LINE(GPIOA, 2U) | ||
149 | #define LINE_STLK_TX PAL_LINE(GPIOA, 3U) | ||
150 | #define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) | ||
151 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
152 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
153 | #define LINE_BUTTON PAL_LINE(GPIOC, 13U) | ||
154 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
155 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
156 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
157 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
158 | |||
159 | /*===========================================================================*/ | ||
160 | /* Driver pre-compile time settings. */ | ||
161 | /*===========================================================================*/ | ||
162 | |||
163 | /*===========================================================================*/ | ||
164 | /* Derived constants and error checks. */ | ||
165 | /*===========================================================================*/ | ||
166 | |||
167 | /*===========================================================================*/ | ||
168 | /* Driver data structures and types. */ | ||
169 | /*===========================================================================*/ | ||
170 | |||
171 | /*===========================================================================*/ | ||
172 | /* Driver macros. */ | ||
173 | /*===========================================================================*/ | ||
174 | |||
175 | /* | ||
176 | * I/O ports initial setup, this configuration is established soon after reset | ||
177 | * in the initialization code. | ||
178 | * Please refer to the STM32 Reference Manual for details. | ||
179 | */ | ||
180 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
181 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
182 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
183 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
184 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
185 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
186 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
187 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
188 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
189 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
190 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
191 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
192 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
193 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
194 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
195 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
196 | |||
197 | /* | ||
198 | * GPIOA setup: | ||
199 | * | ||
200 | * PA0 - PIN0 (input pullup). | ||
201 | * PA1 - PIN1 (input pullup). | ||
202 | * PA2 - STLK_RX (alternate 1). | ||
203 | * PA3 - STLK_TX (alternate 1). | ||
204 | * PA4 - PIN4 (input pullup). | ||
205 | * PA5 - LED_GREEN (output pushpull maximum). | ||
206 | * PA6 - PIN6 (input pullup). | ||
207 | * PA7 - PIN7 (input pullup). | ||
208 | * PA8 - PIN8 (input pullup). | ||
209 | * PA9 - PIN9 (input pullup). | ||
210 | * PA10 - PIN10 (input pullup). | ||
211 | * PA11 - PIN11 (input pullup). | ||
212 | * PA12 - PIN12 (input pullup). | ||
213 | * PA13 - SWDIO (alternate 0). | ||
214 | * PA14 - SWCLK (alternate 0). | ||
215 | * PA15 - PIN15 (input pullup). | ||
216 | */ | ||
217 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ | ||
218 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
219 | PIN_MODE_ALTERNATE(GPIOA_STLK_RX) | \ | ||
220 | PIN_MODE_ALTERNATE(GPIOA_STLK_TX) | \ | ||
221 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
222 | PIN_MODE_OUTPUT(GPIOA_LED_GREEN) | \ | ||
223 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
224 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
225 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
226 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
227 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
228 | PIN_MODE_INPUT(GPIOA_PIN11) | \ | ||
229 | PIN_MODE_INPUT(GPIOA_PIN12) | \ | ||
230 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
231 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
232 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
233 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ | ||
234 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
235 | PIN_OTYPE_PUSHPULL(GPIOA_STLK_RX) | \ | ||
236 | PIN_OTYPE_PUSHPULL(GPIOA_STLK_TX) | \ | ||
237 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
238 | PIN_OTYPE_PUSHPULL(GPIOA_LED_GREEN) | \ | ||
239 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
240 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
241 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
242 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
243 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
244 | PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ | ||
245 | PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ | ||
246 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
247 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
248 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
249 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ | ||
250 | PIN_OSPEED_HIGH(GPIOA_PIN1) | \ | ||
251 | PIN_OSPEED_MEDIUM(GPIOA_STLK_RX) | \ | ||
252 | PIN_OSPEED_MEDIUM(GPIOA_STLK_TX) | \ | ||
253 | PIN_OSPEED_HIGH(GPIOA_PIN4) | \ | ||
254 | PIN_OSPEED_HIGH(GPIOA_LED_GREEN) | \ | ||
255 | PIN_OSPEED_HIGH(GPIOA_PIN6) | \ | ||
256 | PIN_OSPEED_HIGH(GPIOA_PIN7) | \ | ||
257 | PIN_OSPEED_HIGH(GPIOA_PIN8) | \ | ||
258 | PIN_OSPEED_HIGH(GPIOA_PIN9) | \ | ||
259 | PIN_OSPEED_HIGH(GPIOA_PIN10) | \ | ||
260 | PIN_OSPEED_HIGH(GPIOA_PIN11) | \ | ||
261 | PIN_OSPEED_HIGH(GPIOA_PIN12) | \ | ||
262 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
263 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
264 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
265 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ | ||
266 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
267 | PIN_PUPDR_FLOATING(GPIOA_STLK_RX) | \ | ||
268 | PIN_PUPDR_FLOATING(GPIOA_STLK_TX) | \ | ||
269 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
270 | PIN_PUPDR_FLOATING(GPIOA_LED_GREEN) | \ | ||
271 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
272 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
273 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
274 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
275 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
276 | PIN_PUPDR_PULLUP(GPIOA_PIN11) | \ | ||
277 | PIN_PUPDR_PULLUP(GPIOA_PIN12) | \ | ||
278 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
279 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
280 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
281 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ | ||
282 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
283 | PIN_ODR_HIGH(GPIOA_STLK_RX) | \ | ||
284 | PIN_ODR_HIGH(GPIOA_STLK_TX) | \ | ||
285 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
286 | PIN_ODR_LOW(GPIOA_LED_GREEN) | \ | ||
287 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
288 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
289 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
290 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
291 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
292 | PIN_ODR_HIGH(GPIOA_PIN11) | \ | ||
293 | PIN_ODR_HIGH(GPIOA_PIN12) | \ | ||
294 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
295 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
296 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
297 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \ | ||
298 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
299 | PIN_AFIO_AF(GPIOA_STLK_RX, 1U) | \ | ||
300 | PIN_AFIO_AF(GPIOA_STLK_TX, 1U) | \ | ||
301 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
302 | PIN_AFIO_AF(GPIOA_LED_GREEN, 0U) | \ | ||
303 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
304 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
305 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
306 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
307 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
308 | PIN_AFIO_AF(GPIOA_PIN11, 0U) | \ | ||
309 | PIN_AFIO_AF(GPIOA_PIN12, 0U) | \ | ||
310 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
311 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
312 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
313 | |||
314 | /* | ||
315 | * GPIOB setup: | ||
316 | * | ||
317 | * PB0 - PIN0 (input pullup). | ||
318 | * PB1 - PIN1 (input pullup). | ||
319 | * PB2 - PIN2 (input pullup). | ||
320 | * PB3 - PIN3 (input pullup). | ||
321 | * PB4 - PIN4 (input pullup). | ||
322 | * PB5 - PIN5 (input pullup). | ||
323 | * PB6 - PIN6 (input pullup). | ||
324 | * PB7 - PIN7 (input pullup). | ||
325 | * PB8 - PIN8 (input pullup). | ||
326 | * PB9 - PIN9 (input pullup). | ||
327 | * PB10 - PIN10 (input pullup). | ||
328 | * PB11 - PIN11 (input pullup). | ||
329 | * PB12 - PIN12 (input pullup). | ||
330 | * PB13 - PIN13 (input pullup). | ||
331 | * PB14 - PIN14 (input pullup). | ||
332 | * PB15 - PIN15 (input pullup). | ||
333 | */ | ||
334 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
335 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
336 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
337 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
338 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
339 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
340 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
341 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
342 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
343 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
344 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
345 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
346 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
347 | PIN_MODE_INPUT(GPIOB_PIN13) | \ | ||
348 | PIN_MODE_INPUT(GPIOB_PIN14) | \ | ||
349 | PIN_MODE_INPUT(GPIOB_PIN15)) | ||
350 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
351 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
352 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
353 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
354 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
355 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
356 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
357 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
358 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
359 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
360 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
361 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
362 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
363 | PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ | ||
364 | PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ | ||
365 | PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) | ||
366 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ | ||
367 | PIN_OSPEED_HIGH(GPIOB_PIN1) | \ | ||
368 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
369 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
370 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
371 | PIN_OSPEED_HIGH(GPIOB_PIN5) | \ | ||
372 | PIN_OSPEED_HIGH(GPIOB_PIN6) | \ | ||
373 | PIN_OSPEED_HIGH(GPIOB_PIN7) | \ | ||
374 | PIN_OSPEED_HIGH(GPIOB_PIN8) | \ | ||
375 | PIN_OSPEED_HIGH(GPIOB_PIN9) | \ | ||
376 | PIN_OSPEED_HIGH(GPIOB_PIN10) | \ | ||
377 | PIN_OSPEED_HIGH(GPIOB_PIN11) | \ | ||
378 | PIN_OSPEED_HIGH(GPIOB_PIN12) | \ | ||
379 | PIN_OSPEED_HIGH(GPIOB_PIN13) | \ | ||
380 | PIN_OSPEED_HIGH(GPIOB_PIN14) | \ | ||
381 | PIN_OSPEED_HIGH(GPIOB_PIN15)) | ||
382 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
383 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
384 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
385 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
386 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
387 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
388 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
389 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
390 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
391 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
392 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
393 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
394 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
395 | PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ | ||
396 | PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ | ||
397 | PIN_PUPDR_PULLUP(GPIOB_PIN15)) | ||
398 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
399 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
400 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
401 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
402 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
403 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
404 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
405 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
406 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
407 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
408 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
409 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
410 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
411 | PIN_ODR_HIGH(GPIOB_PIN13) | \ | ||
412 | PIN_ODR_HIGH(GPIOB_PIN14) | \ | ||
413 | PIN_ODR_HIGH(GPIOB_PIN15)) | ||
414 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
415 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
416 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
417 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
418 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
419 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
420 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
421 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
422 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
423 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
424 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
425 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
426 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
427 | PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ | ||
428 | PIN_AFIO_AF(GPIOB_PIN14, 0U) | \ | ||
429 | PIN_AFIO_AF(GPIOB_PIN15, 0U)) | ||
430 | |||
431 | /* | ||
432 | * GPIOC setup: | ||
433 | * | ||
434 | * PC0 - PIN0 (input pullup). | ||
435 | * PC1 - PIN1 (input pullup). | ||
436 | * PC2 - PIN2 (input pullup). | ||
437 | * PC3 - PIN3 (input pullup). | ||
438 | * PC4 - PIN4 (input pullup). | ||
439 | * PC5 - PIN5 (input pullup). | ||
440 | * PC6 - PIN6 (input pullup). | ||
441 | * PC7 - PIN7 (input pullup). | ||
442 | * PC8 - PIN8 (input pullup). | ||
443 | * PC9 - PIN9 (input pullup). | ||
444 | * PC10 - PIN10 (input pullup). | ||
445 | * PC11 - PIN11 (input pullup). | ||
446 | * PC12 - PIN12 (input pullup). | ||
447 | * PC13 - BUTTON (input floating). | ||
448 | * PC14 - OSC32_IN (input floating). | ||
449 | * PC15 - OSC32_OUT (input floating). | ||
450 | */ | ||
451 | #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ | ||
452 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
453 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
454 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
455 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
456 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
457 | PIN_MODE_INPUT(GPIOC_PIN6) | \ | ||
458 | PIN_MODE_INPUT(GPIOC_PIN7) | \ | ||
459 | PIN_MODE_INPUT(GPIOC_PIN8) | \ | ||
460 | PIN_MODE_INPUT(GPIOC_PIN9) | \ | ||
461 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
462 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
463 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
464 | PIN_MODE_INPUT(GPIOC_BUTTON) | \ | ||
465 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
466 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
467 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ | ||
468 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
469 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
470 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
471 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
472 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
473 | PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ | ||
474 | PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ | ||
475 | PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ | ||
476 | PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ | ||
477 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
478 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
479 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
480 | PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ | ||
481 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
482 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
483 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ | ||
484 | PIN_OSPEED_HIGH(GPIOC_PIN1) | \ | ||
485 | PIN_OSPEED_HIGH(GPIOC_PIN2) | \ | ||
486 | PIN_OSPEED_HIGH(GPIOC_PIN3) | \ | ||
487 | PIN_OSPEED_HIGH(GPIOC_PIN4) | \ | ||
488 | PIN_OSPEED_HIGH(GPIOC_PIN5) | \ | ||
489 | PIN_OSPEED_HIGH(GPIOC_PIN6) | \ | ||
490 | PIN_OSPEED_HIGH(GPIOC_PIN7) | \ | ||
491 | PIN_OSPEED_HIGH(GPIOC_PIN8) | \ | ||
492 | PIN_OSPEED_HIGH(GPIOC_PIN9) | \ | ||
493 | PIN_OSPEED_HIGH(GPIOC_PIN10) | \ | ||
494 | PIN_OSPEED_HIGH(GPIOC_PIN11) | \ | ||
495 | PIN_OSPEED_HIGH(GPIOC_PIN12) | \ | ||
496 | PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ | ||
497 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
498 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
499 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ | ||
500 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
501 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
502 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
503 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
504 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
505 | PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ | ||
506 | PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ | ||
507 | PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ | ||
508 | PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ | ||
509 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
510 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
511 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
512 | PIN_PUPDR_FLOATING(GPIOC_BUTTON) | \ | ||
513 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
514 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
515 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ | ||
516 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
517 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
518 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
519 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
520 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
521 | PIN_ODR_HIGH(GPIOC_PIN6) | \ | ||
522 | PIN_ODR_HIGH(GPIOC_PIN7) | \ | ||
523 | PIN_ODR_HIGH(GPIOC_PIN8) | \ | ||
524 | PIN_ODR_HIGH(GPIOC_PIN9) | \ | ||
525 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
526 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
527 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
528 | PIN_ODR_HIGH(GPIOC_BUTTON) | \ | ||
529 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
530 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
531 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \ | ||
532 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
533 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
534 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
535 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
536 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
537 | PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ | ||
538 | PIN_AFIO_AF(GPIOC_PIN7, 0U)) | ||
539 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \ | ||
540 | PIN_AFIO_AF(GPIOC_PIN9, 0U) | \ | ||
541 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
542 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
543 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
544 | PIN_AFIO_AF(GPIOC_BUTTON, 0U) | \ | ||
545 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
546 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
547 | |||
548 | /* | ||
549 | * GPIOD setup: | ||
550 | * | ||
551 | * PD0 - PIN0 (input pullup). | ||
552 | * PD1 - PIN1 (input pullup). | ||
553 | * PD2 - PIN2 (input pullup). | ||
554 | * PD3 - PIN3 (input pullup). | ||
555 | * PD4 - PIN4 (input pullup). | ||
556 | * PD5 - PIN5 (input pullup). | ||
557 | * PD6 - PIN6 (input pullup). | ||
558 | * PD7 - PIN7 (input pullup). | ||
559 | * PD8 - PIN8 (input pullup). | ||
560 | * PD9 - PIN9 (input pullup). | ||
561 | * PD10 - PIN10 (input pullup). | ||
562 | * PD11 - PIN11 (input pullup). | ||
563 | * PD12 - PIN12 (input pullup). | ||
564 | * PD13 - PIN13 (input pullup). | ||
565 | * PD14 - PIN14 (input pullup). | ||
566 | * PD15 - PIN15 (input pullup). | ||
567 | */ | ||
568 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
569 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
570 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
571 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
572 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
573 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
574 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
575 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
576 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
577 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
578 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
579 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
580 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
581 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
582 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
583 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
584 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
585 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
586 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
587 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
588 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
589 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
590 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
591 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
592 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
593 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
594 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
595 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
596 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
597 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
598 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
599 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
600 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ | ||
601 | PIN_OSPEED_HIGH(GPIOD_PIN1) | \ | ||
602 | PIN_OSPEED_HIGH(GPIOD_PIN2) | \ | ||
603 | PIN_OSPEED_HIGH(GPIOD_PIN3) | \ | ||
604 | PIN_OSPEED_HIGH(GPIOD_PIN4) | \ | ||
605 | PIN_OSPEED_HIGH(GPIOD_PIN5) | \ | ||
606 | PIN_OSPEED_HIGH(GPIOD_PIN6) | \ | ||
607 | PIN_OSPEED_HIGH(GPIOD_PIN7) | \ | ||
608 | PIN_OSPEED_HIGH(GPIOD_PIN8) | \ | ||
609 | PIN_OSPEED_HIGH(GPIOD_PIN9) | \ | ||
610 | PIN_OSPEED_HIGH(GPIOD_PIN10) | \ | ||
611 | PIN_OSPEED_HIGH(GPIOD_PIN11) | \ | ||
612 | PIN_OSPEED_HIGH(GPIOD_PIN12) | \ | ||
613 | PIN_OSPEED_HIGH(GPIOD_PIN13) | \ | ||
614 | PIN_OSPEED_HIGH(GPIOD_PIN14) | \ | ||
615 | PIN_OSPEED_HIGH(GPIOD_PIN15)) | ||
616 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
617 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
618 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
619 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
620 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
621 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
622 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
623 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
624 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
625 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
626 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
627 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
628 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
629 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
630 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
631 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
632 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
633 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
634 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
635 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
636 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
637 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
638 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
639 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
640 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
641 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
642 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
643 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
644 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
645 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
646 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
647 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
648 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
649 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
650 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
651 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
652 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
653 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
654 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
655 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
656 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
657 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
658 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
659 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
660 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
661 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
662 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
663 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
664 | |||
665 | /* | ||
666 | * GPIOF setup: | ||
667 | * | ||
668 | * PF0 - OSC_IN (input floating). | ||
669 | * PF1 - OSC_OUT (input floating). | ||
670 | * PF2 - PIN2 (input pullup). | ||
671 | * PF3 - PIN3 (input pullup). | ||
672 | * PF4 - PIN4 (input pullup). | ||
673 | * PF5 - PIN5 (input pullup). | ||
674 | * PF6 - PIN6 (input pullup). | ||
675 | * PF7 - PIN7 (input pullup). | ||
676 | * PF8 - PIN8 (input pullup). | ||
677 | * PF9 - PIN9 (input pullup). | ||
678 | * PF10 - PIN10 (input pullup). | ||
679 | * PF11 - PIN11 (input pullup). | ||
680 | * PF12 - PIN12 (input pullup). | ||
681 | * PF13 - PIN13 (input pullup). | ||
682 | * PF14 - PIN14 (input pullup). | ||
683 | * PF15 - PIN15 (input pullup). | ||
684 | */ | ||
685 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
686 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
687 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
688 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
689 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
690 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
691 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
692 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
693 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
694 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
695 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
696 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
697 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
698 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
699 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
700 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
701 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
702 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
703 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
704 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
705 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
706 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
707 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
708 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
709 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
710 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
711 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
712 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
713 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
714 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
715 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
716 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
717 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_OSC_IN) | \ | ||
718 | PIN_OSPEED_HIGH(GPIOF_OSC_OUT) | \ | ||
719 | PIN_OSPEED_HIGH(GPIOF_PIN2) | \ | ||
720 | PIN_OSPEED_HIGH(GPIOF_PIN3) | \ | ||
721 | PIN_OSPEED_HIGH(GPIOF_PIN4) | \ | ||
722 | PIN_OSPEED_HIGH(GPIOF_PIN5) | \ | ||
723 | PIN_OSPEED_HIGH(GPIOF_PIN6) | \ | ||
724 | PIN_OSPEED_HIGH(GPIOF_PIN7) | \ | ||
725 | PIN_OSPEED_HIGH(GPIOF_PIN8) | \ | ||
726 | PIN_OSPEED_HIGH(GPIOF_PIN9) | \ | ||
727 | PIN_OSPEED_HIGH(GPIOF_PIN10) | \ | ||
728 | PIN_OSPEED_HIGH(GPIOF_PIN11) | \ | ||
729 | PIN_OSPEED_HIGH(GPIOF_PIN12) | \ | ||
730 | PIN_OSPEED_HIGH(GPIOF_PIN13) | \ | ||
731 | PIN_OSPEED_HIGH(GPIOF_PIN14) | \ | ||
732 | PIN_OSPEED_HIGH(GPIOF_PIN15)) | ||
733 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
734 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
735 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
736 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
737 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
738 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
739 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
740 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
741 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
742 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
743 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
744 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
745 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
746 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
747 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
748 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
749 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
750 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
751 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
752 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
753 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
754 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
755 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
756 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
757 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
758 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
759 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
760 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
761 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
762 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
763 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
764 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
765 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
766 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
767 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
768 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
769 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
770 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
771 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
772 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
773 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
774 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
775 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
776 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
777 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
778 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
779 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
780 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
781 | |||
782 | /*===========================================================================*/ | ||
783 | /* External declarations. */ | ||
784 | /*===========================================================================*/ | ||
785 | |||
786 | #if !defined(_FROM_ASM_) | ||
787 | #ifdef __cplusplus | ||
788 | extern "C" { | ||
789 | #endif | ||
790 | void boardInit(void); | ||
791 | #ifdef __cplusplus | ||
792 | } | ||
793 | #endif | ||
794 | #endif /* _FROM_ASM_ */ | ||
795 | |||
796 | #endif /* BOARD_H */ | ||