diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_NUCLEO64_F303RE/board.h')
-rw-r--r-- | lib/chibios/os/hal/boards/ST_NUCLEO64_F303RE/board.h | 1240 |
1 files changed, 1240 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_F303RE/board.h b/lib/chibios/os/hal/boards/ST_NUCLEO64_F303RE/board.h new file mode 100644 index 000000000..72f443b62 --- /dev/null +++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_F303RE/board.h | |||
@@ -0,0 +1,1240 @@ | |||
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-F303RE board. | ||
31 | */ | ||
32 | |||
33 | /* | ||
34 | * Board identifier. | ||
35 | */ | ||
36 | #define BOARD_ST_NUCLEO64_F303RE | ||
37 | #define BOARD_NAME "STMicroelectronics STM32 Nucleo64-F303RE" | ||
38 | |||
39 | /* | ||
40 | * Board oscillators-related settings. | ||
41 | * NOTE: LSE not fitted. | ||
42 | */ | ||
43 | #if !defined(STM32_LSECLK) | ||
44 | #define STM32_LSECLK 0U | ||
45 | #endif | ||
46 | |||
47 | #define STM32_LSEDRV (3U << 3U) | ||
48 | |||
49 | #if !defined(STM32_HSECLK) | ||
50 | #define STM32_HSECLK 8000000U | ||
51 | #endif | ||
52 | |||
53 | #define STM32_HSE_BYPASS | ||
54 | |||
55 | /* | ||
56 | * MCU type as defined in the ST header. | ||
57 | */ | ||
58 | #define STM32F303xE | ||
59 | |||
60 | /* | ||
61 | * IO pins assignments. | ||
62 | */ | ||
63 | #define GPIOA_ARD_A0 0U | ||
64 | #define GPIOA_ADC1_IN1 0U | ||
65 | #define GPIOA_ARD_A1 1U | ||
66 | #define GPIOA_ADC1_IN2 1U | ||
67 | #define GPIOA_ARD_D1 2U | ||
68 | #define GPIOA_USART2_TX 2U | ||
69 | #define GPIOA_ARD_D0 3U | ||
70 | #define GPIOA_USART2_RX 3U | ||
71 | #define GPIOA_ARD_A2 4U | ||
72 | #define GPIOA_ADC2_IN1 4U | ||
73 | #define GPIOA_LED_GREEN 5U | ||
74 | #define GPIOA_ARD_D13 5U | ||
75 | #define GPIOA_ARD_D12 6U | ||
76 | #define GPIOA_ARD_D11 7U | ||
77 | #define GPIOA_ARD_D7 8U | ||
78 | #define GPIOA_ARD_D8 9U | ||
79 | #define GPIOA_ARD_D2 10U | ||
80 | #define GPIOA_PIN11 11U | ||
81 | #define GPIOA_PIN12 12U | ||
82 | #define GPIOA_SWDIO 13U | ||
83 | #define GPIOA_SWCLK 14U | ||
84 | #define GPIOA_PIN15 15U | ||
85 | |||
86 | #define GPIOB_ARD_A3 0U | ||
87 | #define GPIOB_ADC3_IN12 0U | ||
88 | #define GPIOB_PIN1 1U | ||
89 | #define GPIOB_PIN2 2U | ||
90 | #define GPIOB_SWO 3U | ||
91 | #define GPIOB_ARD_D3 3U | ||
92 | #define GPIOB_ARD_D5 4U | ||
93 | #define GPIOB_ARD_D4 5U | ||
94 | #define GPIOB_ARD_D10 6U | ||
95 | #define GPIOB_PIN7 7U | ||
96 | #define GPIOB_ARD_D15 8U | ||
97 | #define GPIOB_ARD_D14 9U | ||
98 | #define GPIOB_ARD_D6 10U | ||
99 | #define GPIOB_PIN11 11U | ||
100 | #define GPIOB_PIN12 12U | ||
101 | #define GPIOB_PIN13 13U | ||
102 | #define GPIOB_PIN14 14U | ||
103 | #define GPIOB_PIN15 15U | ||
104 | |||
105 | #define GPIOC_ARD_A5 0U | ||
106 | #define GPIOC_ADC12_IN6 0U | ||
107 | #define GPIOC_ARD_A4 1U | ||
108 | #define GPIOC_ADC12_IN7 1U | ||
109 | #define GPIOC_PIN2 2U | ||
110 | #define GPIOC_PIN3 3U | ||
111 | #define GPIOC_PIN4 4U | ||
112 | #define GPIOC_PIN5 5U | ||
113 | #define GPIOC_PIN6 6U | ||
114 | #define GPIOC_ARD_D9 7U | ||
115 | #define GPIOC_PIN8 8U | ||
116 | #define GPIOC_PIN9 9U | ||
117 | #define GPIOC_PIN10 10U | ||
118 | #define GPIOC_PIN11 11U | ||
119 | #define GPIOC_PIN12 12U | ||
120 | #define GPIOC_BUTTON 13U | ||
121 | #define GPIOC_OSC32_IN 14U | ||
122 | #define GPIOC_OSC32_OUT 15U | ||
123 | |||
124 | #define GPIOD_PIN0 0U | ||
125 | #define GPIOD_PIN1 1U | ||
126 | #define GPIOD_PIN2 2U | ||
127 | #define GPIOD_PIN3 3U | ||
128 | #define GPIOD_PIN4 4U | ||
129 | #define GPIOD_PIN5 5U | ||
130 | #define GPIOD_PIN6 6U | ||
131 | #define GPIOD_PIN7 7U | ||
132 | #define GPIOD_PIN8 8U | ||
133 | #define GPIOD_PIN9 9U | ||
134 | #define GPIOD_PIN10 10U | ||
135 | #define GPIOD_PIN11 11U | ||
136 | #define GPIOD_PIN12 12U | ||
137 | #define GPIOD_PIN13 13U | ||
138 | #define GPIOD_PIN14 14U | ||
139 | #define GPIOD_PIN15 15U | ||
140 | |||
141 | #define GPIOE_PIN0 0U | ||
142 | #define GPIOE_PIN1 1U | ||
143 | #define GPIOE_PIN2 2U | ||
144 | #define GPIOE_PIN3 3U | ||
145 | #define GPIOE_PIN4 4U | ||
146 | #define GPIOE_PIN5 5U | ||
147 | #define GPIOE_PIN6 6U | ||
148 | #define GPIOE_PIN7 7U | ||
149 | #define GPIOE_PIN8 8U | ||
150 | #define GPIOE_PIN9 9U | ||
151 | #define GPIOE_PIN10 10U | ||
152 | #define GPIOE_PIN11 11U | ||
153 | #define GPIOE_PIN12 12U | ||
154 | #define GPIOE_PIN13 13U | ||
155 | #define GPIOE_PIN14 14U | ||
156 | #define GPIOE_PIN15 15U | ||
157 | |||
158 | #define GPIOF_OSC_IN 0U | ||
159 | #define GPIOF_OSC_OUT 1U | ||
160 | #define GPIOF_PIN2 2U | ||
161 | #define GPIOF_PIN3 3U | ||
162 | #define GPIOF_PIN4 4U | ||
163 | #define GPIOF_PIN5 5U | ||
164 | #define GPIOF_PIN6 6U | ||
165 | #define GPIOF_PIN7 7U | ||
166 | #define GPIOF_PIN8 8U | ||
167 | #define GPIOF_PIN9 9U | ||
168 | #define GPIOF_PIN10 10U | ||
169 | #define GPIOF_PIN11 11U | ||
170 | #define GPIOF_PIN12 12U | ||
171 | #define GPIOF_PIN13 13U | ||
172 | #define GPIOF_PIN14 14U | ||
173 | #define GPIOF_PIN15 15U | ||
174 | |||
175 | #define GPIOG_PIN0 0U | ||
176 | #define GPIOG_PIN1 1U | ||
177 | #define GPIOG_PIN2 2U | ||
178 | #define GPIOG_PIN3 3U | ||
179 | #define GPIOG_PIN4 4U | ||
180 | #define GPIOG_PIN5 5U | ||
181 | #define GPIOG_PIN6 6U | ||
182 | #define GPIOG_PIN7 7U | ||
183 | #define GPIOG_PIN8 8U | ||
184 | #define GPIOG_PIN9 9U | ||
185 | #define GPIOG_PIN10 10U | ||
186 | #define GPIOG_PIN11 11U | ||
187 | #define GPIOG_PIN12 12U | ||
188 | #define GPIOG_PIN13 13U | ||
189 | #define GPIOG_PIN14 14U | ||
190 | #define GPIOG_PIN15 15U | ||
191 | |||
192 | #define GPIOH_PIN0 0U | ||
193 | #define GPIOH_PIN1 1U | ||
194 | #define GPIOH_PIN2 2U | ||
195 | #define GPIOH_PIN3 3U | ||
196 | #define GPIOH_PIN4 4U | ||
197 | #define GPIOH_PIN5 5U | ||
198 | #define GPIOH_PIN6 6U | ||
199 | #define GPIOH_PIN7 7U | ||
200 | #define GPIOH_PIN8 8U | ||
201 | #define GPIOH_PIN9 9U | ||
202 | #define GPIOH_PIN10 10U | ||
203 | #define GPIOH_PIN11 11U | ||
204 | #define GPIOH_PIN12 12U | ||
205 | #define GPIOH_PIN13 13U | ||
206 | #define GPIOH_PIN14 14U | ||
207 | #define GPIOH_PIN15 15U | ||
208 | |||
209 | /* | ||
210 | * IO lines assignments. | ||
211 | */ | ||
212 | #define LINE_ARD_A0 PAL_LINE(GPIOA, 0U) | ||
213 | #define LINE_ADC1_IN1 PAL_LINE(GPIOA, 0U) | ||
214 | #define LINE_ARD_A1 PAL_LINE(GPIOA, 1U) | ||
215 | #define LINE_ADC1_IN2 PAL_LINE(GPIOA, 1U) | ||
216 | #define LINE_ARD_D1 PAL_LINE(GPIOA, 2U) | ||
217 | #define LINE_USART2_TX PAL_LINE(GPIOA, 2U) | ||
218 | #define LINE_ARD_D0 PAL_LINE(GPIOA, 3U) | ||
219 | #define LINE_USART2_RX PAL_LINE(GPIOA, 3U) | ||
220 | #define LINE_ARD_A2 PAL_LINE(GPIOA, 4U) | ||
221 | #define LINE_ADC2_IN1 PAL_LINE(GPIOA, 4U) | ||
222 | #define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) | ||
223 | #define LINE_ARD_D13 PAL_LINE(GPIOA, 5U) | ||
224 | #define LINE_ARD_D12 PAL_LINE(GPIOA, 6U) | ||
225 | #define LINE_ARD_D11 PAL_LINE(GPIOA, 7U) | ||
226 | #define LINE_ARD_D7 PAL_LINE(GPIOA, 8U) | ||
227 | #define LINE_ARD_D8 PAL_LINE(GPIOA, 9U) | ||
228 | #define LINE_ARD_D2 PAL_LINE(GPIOA, 10U) | ||
229 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
230 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
231 | #define LINE_ARD_A3 PAL_LINE(GPIOB, 0U) | ||
232 | #define LINE_ADC3_IN12 PAL_LINE(GPIOB, 0U) | ||
233 | #define LINE_SWO PAL_LINE(GPIOB, 3U) | ||
234 | #define LINE_ARD_D3 PAL_LINE(GPIOB, 3U) | ||
235 | #define LINE_ARD_D5 PAL_LINE(GPIOB, 4U) | ||
236 | #define LINE_ARD_D4 PAL_LINE(GPIOB, 5U) | ||
237 | #define LINE_ARD_D10 PAL_LINE(GPIOB, 6U) | ||
238 | #define LINE_ARD_D15 PAL_LINE(GPIOB, 8U) | ||
239 | #define LINE_ARD_D14 PAL_LINE(GPIOB, 9U) | ||
240 | #define LINE_ARD_D6 PAL_LINE(GPIOB, 10U) | ||
241 | #define LINE_ARD_A5 PAL_LINE(GPIOC, 0U) | ||
242 | #define LINE_ADC12_IN6 PAL_LINE(GPIOC, 0U) | ||
243 | #define LINE_ARD_A4 PAL_LINE(GPIOC, 1U) | ||
244 | #define LINE_ADC12_IN7 PAL_LINE(GPIOC, 1U) | ||
245 | #define LINE_ARD_D9 PAL_LINE(GPIOC, 7U) | ||
246 | #define LINE_BUTTON PAL_LINE(GPIOC, 13U) | ||
247 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
248 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
249 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
250 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
251 | |||
252 | /*===========================================================================*/ | ||
253 | /* Driver pre-compile time settings. */ | ||
254 | /*===========================================================================*/ | ||
255 | |||
256 | /*===========================================================================*/ | ||
257 | /* Derived constants and error checks. */ | ||
258 | /*===========================================================================*/ | ||
259 | |||
260 | /*===========================================================================*/ | ||
261 | /* Driver data structures and types. */ | ||
262 | /*===========================================================================*/ | ||
263 | |||
264 | /*===========================================================================*/ | ||
265 | /* Driver macros. */ | ||
266 | /*===========================================================================*/ | ||
267 | |||
268 | /* | ||
269 | * I/O ports initial setup, this configuration is established soon after reset | ||
270 | * in the initialization code. | ||
271 | * Please refer to the STM32 Reference Manual for details. | ||
272 | */ | ||
273 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
274 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
275 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
276 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
277 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
278 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
279 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
280 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
281 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
282 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
283 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
284 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
285 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
286 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
287 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
288 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
289 | |||
290 | /* | ||
291 | * GPIOA setup: | ||
292 | * | ||
293 | * PA0 - ARD_A0 ADC1_IN1 (input pullup). | ||
294 | * PA1 - ARD_A1 ADC1_IN2 (input pullup). | ||
295 | * PA2 - ARD_D1 USART2_TX (alternate 7). | ||
296 | * PA3 - ARD_D0 USART2_RX (alternate 7). | ||
297 | * PA4 - ARD_A2 ADC2_IN1 (input pullup). | ||
298 | * PA5 - LED_GREEN ARD_D13 (output pushpull high). | ||
299 | * PA6 - ARD_D12 (input pullup). | ||
300 | * PA7 - ARD_D11 (input pullup). | ||
301 | * PA8 - ARD_D7 (input pullup). | ||
302 | * PA9 - ARD_D8 (input pullup). | ||
303 | * PA10 - ARD_D2 (input pullup). | ||
304 | * PA11 - PIN11 (input pullup). | ||
305 | * PA12 - PIN12 (input pullup). | ||
306 | * PA13 - SWDIO (alternate 0). | ||
307 | * PA14 - SWCLK (alternate 0). | ||
308 | * PA15 - PIN15 (input pullup). | ||
309 | */ | ||
310 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_ARD_A0) | \ | ||
311 | PIN_MODE_INPUT(GPIOA_ARD_A1) | \ | ||
312 | PIN_MODE_ALTERNATE(GPIOA_ARD_D1) | \ | ||
313 | PIN_MODE_ALTERNATE(GPIOA_ARD_D0) | \ | ||
314 | PIN_MODE_INPUT(GPIOA_ARD_A2) | \ | ||
315 | PIN_MODE_OUTPUT(GPIOA_LED_GREEN) | \ | ||
316 | PIN_MODE_INPUT(GPIOA_ARD_D12) | \ | ||
317 | PIN_MODE_INPUT(GPIOA_ARD_D11) | \ | ||
318 | PIN_MODE_INPUT(GPIOA_ARD_D7) | \ | ||
319 | PIN_MODE_INPUT(GPIOA_ARD_D8) | \ | ||
320 | PIN_MODE_INPUT(GPIOA_ARD_D2) | \ | ||
321 | PIN_MODE_INPUT(GPIOA_PIN11) | \ | ||
322 | PIN_MODE_INPUT(GPIOA_PIN12) | \ | ||
323 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
324 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
325 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
326 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_ARD_A0) | \ | ||
327 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_A1) | \ | ||
328 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_D1) | \ | ||
329 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_D0) | \ | ||
330 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_A2) | \ | ||
331 | PIN_OTYPE_PUSHPULL(GPIOA_LED_GREEN) | \ | ||
332 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_D12) | \ | ||
333 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_D11) | \ | ||
334 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_D7) | \ | ||
335 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_D8) | \ | ||
336 | PIN_OTYPE_PUSHPULL(GPIOA_ARD_D2) | \ | ||
337 | PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ | ||
338 | PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ | ||
339 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
340 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
341 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
342 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_ARD_A0) | \ | ||
343 | PIN_OSPEED_HIGH(GPIOA_ARD_A1) | \ | ||
344 | PIN_OSPEED_LOW(GPIOA_ARD_D1) | \ | ||
345 | PIN_OSPEED_LOW(GPIOA_ARD_D0) | \ | ||
346 | PIN_OSPEED_HIGH(GPIOA_ARD_A2) | \ | ||
347 | PIN_OSPEED_LOW(GPIOA_LED_GREEN) | \ | ||
348 | PIN_OSPEED_HIGH(GPIOA_ARD_D12) | \ | ||
349 | PIN_OSPEED_HIGH(GPIOA_ARD_D11) | \ | ||
350 | PIN_OSPEED_HIGH(GPIOA_ARD_D7) | \ | ||
351 | PIN_OSPEED_HIGH(GPIOA_ARD_D8) | \ | ||
352 | PIN_OSPEED_HIGH(GPIOA_ARD_D2) | \ | ||
353 | PIN_OSPEED_HIGH(GPIOA_PIN11) | \ | ||
354 | PIN_OSPEED_HIGH(GPIOA_PIN12) | \ | ||
355 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
356 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
357 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
358 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_ARD_A0) | \ | ||
359 | PIN_PUPDR_PULLUP(GPIOA_ARD_A1) | \ | ||
360 | PIN_PUPDR_FLOATING(GPIOA_ARD_D1) | \ | ||
361 | PIN_PUPDR_FLOATING(GPIOA_ARD_D0) | \ | ||
362 | PIN_PUPDR_PULLUP(GPIOA_ARD_A2) | \ | ||
363 | PIN_PUPDR_FLOATING(GPIOA_LED_GREEN) | \ | ||
364 | PIN_PUPDR_PULLUP(GPIOA_ARD_D12) | \ | ||
365 | PIN_PUPDR_PULLUP(GPIOA_ARD_D11) | \ | ||
366 | PIN_PUPDR_PULLUP(GPIOA_ARD_D7) | \ | ||
367 | PIN_PUPDR_PULLUP(GPIOA_ARD_D8) | \ | ||
368 | PIN_PUPDR_PULLUP(GPIOA_ARD_D2) | \ | ||
369 | PIN_PUPDR_PULLUP(GPIOA_PIN11) | \ | ||
370 | PIN_PUPDR_PULLUP(GPIOA_PIN12) | \ | ||
371 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
372 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
373 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
374 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_ARD_A0) | \ | ||
375 | PIN_ODR_HIGH(GPIOA_ARD_A1) | \ | ||
376 | PIN_ODR_HIGH(GPIOA_ARD_D1) | \ | ||
377 | PIN_ODR_HIGH(GPIOA_ARD_D0) | \ | ||
378 | PIN_ODR_HIGH(GPIOA_ARD_A2) | \ | ||
379 | PIN_ODR_LOW(GPIOA_LED_GREEN) | \ | ||
380 | PIN_ODR_HIGH(GPIOA_ARD_D12) | \ | ||
381 | PIN_ODR_HIGH(GPIOA_ARD_D11) | \ | ||
382 | PIN_ODR_HIGH(GPIOA_ARD_D7) | \ | ||
383 | PIN_ODR_HIGH(GPIOA_ARD_D8) | \ | ||
384 | PIN_ODR_HIGH(GPIOA_ARD_D2) | \ | ||
385 | PIN_ODR_HIGH(GPIOA_PIN11) | \ | ||
386 | PIN_ODR_HIGH(GPIOA_PIN12) | \ | ||
387 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
388 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
389 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
390 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_ARD_A0, 0U) | \ | ||
391 | PIN_AFIO_AF(GPIOA_ARD_A1, 0U) | \ | ||
392 | PIN_AFIO_AF(GPIOA_ARD_D1, 7U) | \ | ||
393 | PIN_AFIO_AF(GPIOA_ARD_D0, 7U) | \ | ||
394 | PIN_AFIO_AF(GPIOA_ARD_A2, 0U) | \ | ||
395 | PIN_AFIO_AF(GPIOA_LED_GREEN, 0U) | \ | ||
396 | PIN_AFIO_AF(GPIOA_ARD_D12, 0U) | \ | ||
397 | PIN_AFIO_AF(GPIOA_ARD_D11, 0U)) | ||
398 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_ARD_D7, 0U) | \ | ||
399 | PIN_AFIO_AF(GPIOA_ARD_D8, 0U) | \ | ||
400 | PIN_AFIO_AF(GPIOA_ARD_D2, 0U) | \ | ||
401 | PIN_AFIO_AF(GPIOA_PIN11, 0U) | \ | ||
402 | PIN_AFIO_AF(GPIOA_PIN12, 0U) | \ | ||
403 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
404 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
405 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
406 | |||
407 | /* | ||
408 | * GPIOB setup: | ||
409 | * | ||
410 | * PB0 - ARD_A3 ADC3_IN12 (input pullup). | ||
411 | * PB1 - PIN1 (input pullup). | ||
412 | * PB2 - PIN2 (input pullup). | ||
413 | * PB3 - SWO ARD_D3 (alternate 0). | ||
414 | * PB4 - ARD_D5 (input pullup). | ||
415 | * PB5 - ARD_D4 (input pullup). | ||
416 | * PB6 - ARD_D10 (input pullup). | ||
417 | * PB7 - PIN7 (input pullup). | ||
418 | * PB8 - ARD_D15 (input pullup). | ||
419 | * PB9 - ARD_D14 (input pullup). | ||
420 | * PB10 - ARD_D6 (input pullup). | ||
421 | * PB11 - PIN11 (input pullup). | ||
422 | * PB12 - PIN12 (input pullup). | ||
423 | * PB13 - PIN13 (input pullup). | ||
424 | * PB14 - PIN14 (input pullup). | ||
425 | * PB15 - PIN15 (input pullup). | ||
426 | */ | ||
427 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_ARD_A3) | \ | ||
428 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
429 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
430 | PIN_MODE_ALTERNATE(GPIOB_SWO) | \ | ||
431 | PIN_MODE_INPUT(GPIOB_ARD_D5) | \ | ||
432 | PIN_MODE_INPUT(GPIOB_ARD_D4) | \ | ||
433 | PIN_MODE_INPUT(GPIOB_ARD_D10) | \ | ||
434 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
435 | PIN_MODE_INPUT(GPIOB_ARD_D15) | \ | ||
436 | PIN_MODE_INPUT(GPIOB_ARD_D14) | \ | ||
437 | PIN_MODE_INPUT(GPIOB_ARD_D6) | \ | ||
438 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
439 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
440 | PIN_MODE_INPUT(GPIOB_PIN13) | \ | ||
441 | PIN_MODE_INPUT(GPIOB_PIN14) | \ | ||
442 | PIN_MODE_INPUT(GPIOB_PIN15)) | ||
443 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_ARD_A3) | \ | ||
444 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
445 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
446 | PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \ | ||
447 | PIN_OTYPE_PUSHPULL(GPIOB_ARD_D5) | \ | ||
448 | PIN_OTYPE_PUSHPULL(GPIOB_ARD_D4) | \ | ||
449 | PIN_OTYPE_PUSHPULL(GPIOB_ARD_D10) | \ | ||
450 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
451 | PIN_OTYPE_PUSHPULL(GPIOB_ARD_D15) | \ | ||
452 | PIN_OTYPE_PUSHPULL(GPIOB_ARD_D14) | \ | ||
453 | PIN_OTYPE_PUSHPULL(GPIOB_ARD_D6) | \ | ||
454 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
455 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
456 | PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ | ||
457 | PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ | ||
458 | PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) | ||
459 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_ARD_A3) | \ | ||
460 | PIN_OSPEED_HIGH(GPIOB_PIN1) | \ | ||
461 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
462 | PIN_OSPEED_HIGH(GPIOB_SWO) | \ | ||
463 | PIN_OSPEED_HIGH(GPIOB_ARD_D5) | \ | ||
464 | PIN_OSPEED_HIGH(GPIOB_ARD_D4) | \ | ||
465 | PIN_OSPEED_HIGH(GPIOB_ARD_D10) | \ | ||
466 | PIN_OSPEED_HIGH(GPIOB_PIN7) | \ | ||
467 | PIN_OSPEED_HIGH(GPIOB_ARD_D15) | \ | ||
468 | PIN_OSPEED_HIGH(GPIOB_ARD_D14) | \ | ||
469 | PIN_OSPEED_HIGH(GPIOB_ARD_D6) | \ | ||
470 | PIN_OSPEED_HIGH(GPIOB_PIN11) | \ | ||
471 | PIN_OSPEED_HIGH(GPIOB_PIN12) | \ | ||
472 | PIN_OSPEED_HIGH(GPIOB_PIN13) | \ | ||
473 | PIN_OSPEED_HIGH(GPIOB_PIN14) | \ | ||
474 | PIN_OSPEED_HIGH(GPIOB_PIN15)) | ||
475 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_ARD_A3) | \ | ||
476 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
477 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
478 | PIN_PUPDR_PULLUP(GPIOB_SWO) | \ | ||
479 | PIN_PUPDR_PULLUP(GPIOB_ARD_D5) | \ | ||
480 | PIN_PUPDR_PULLUP(GPIOB_ARD_D4) | \ | ||
481 | PIN_PUPDR_PULLUP(GPIOB_ARD_D10) | \ | ||
482 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
483 | PIN_PUPDR_PULLUP(GPIOB_ARD_D15) | \ | ||
484 | PIN_PUPDR_PULLUP(GPIOB_ARD_D14) | \ | ||
485 | PIN_PUPDR_PULLUP(GPIOB_ARD_D6) | \ | ||
486 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
487 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
488 | PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ | ||
489 | PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ | ||
490 | PIN_PUPDR_PULLUP(GPIOB_PIN15)) | ||
491 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_ARD_A3) | \ | ||
492 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
493 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
494 | PIN_ODR_HIGH(GPIOB_SWO) | \ | ||
495 | PIN_ODR_HIGH(GPIOB_ARD_D5) | \ | ||
496 | PIN_ODR_HIGH(GPIOB_ARD_D4) | \ | ||
497 | PIN_ODR_HIGH(GPIOB_ARD_D10) | \ | ||
498 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
499 | PIN_ODR_HIGH(GPIOB_ARD_D15) | \ | ||
500 | PIN_ODR_HIGH(GPIOB_ARD_D14) | \ | ||
501 | PIN_ODR_HIGH(GPIOB_ARD_D6) | \ | ||
502 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
503 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
504 | PIN_ODR_HIGH(GPIOB_PIN13) | \ | ||
505 | PIN_ODR_HIGH(GPIOB_PIN14) | \ | ||
506 | PIN_ODR_HIGH(GPIOB_PIN15)) | ||
507 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_ARD_A3, 0U) | \ | ||
508 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
509 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
510 | PIN_AFIO_AF(GPIOB_SWO, 0U) | \ | ||
511 | PIN_AFIO_AF(GPIOB_ARD_D5, 0U) | \ | ||
512 | PIN_AFIO_AF(GPIOB_ARD_D4, 0U) | \ | ||
513 | PIN_AFIO_AF(GPIOB_ARD_D10, 0U) | \ | ||
514 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
515 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_ARD_D15, 0U) | \ | ||
516 | PIN_AFIO_AF(GPIOB_ARD_D14, 0U) | \ | ||
517 | PIN_AFIO_AF(GPIOB_ARD_D6, 0U) | \ | ||
518 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
519 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
520 | PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ | ||
521 | PIN_AFIO_AF(GPIOB_PIN14, 0U) | \ | ||
522 | PIN_AFIO_AF(GPIOB_PIN15, 0U)) | ||
523 | |||
524 | /* | ||
525 | * GPIOC setup: | ||
526 | * | ||
527 | * PC0 - ARD_A5 ADC12_IN6 (input pullup). | ||
528 | * PC1 - ARD_A4 ADC12_IN7 (input pullup). | ||
529 | * PC2 - PIN2 (input pullup). | ||
530 | * PC3 - PIN3 (input pullup). | ||
531 | * PC4 - PIN4 (input pullup). | ||
532 | * PC5 - PIN5 (input pullup). | ||
533 | * PC6 - PIN6 (input pullup). | ||
534 | * PC7 - ARD_D9 (input pullup). | ||
535 | * PC8 - PIN8 (input pullup). | ||
536 | * PC9 - PIN9 (input pullup). | ||
537 | * PC10 - PIN10 (input pullup). | ||
538 | * PC11 - PIN11 (input pullup). | ||
539 | * PC12 - PIN12 (input pullup). | ||
540 | * PC13 - BUTTON (input floating). | ||
541 | * PC14 - OSC32_IN (input floating). | ||
542 | * PC15 - OSC32_OUT (input floating). | ||
543 | */ | ||
544 | #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_ARD_A5) | \ | ||
545 | PIN_MODE_INPUT(GPIOC_ARD_A4) | \ | ||
546 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
547 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
548 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
549 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
550 | PIN_MODE_INPUT(GPIOC_PIN6) | \ | ||
551 | PIN_MODE_INPUT(GPIOC_ARD_D9) | \ | ||
552 | PIN_MODE_INPUT(GPIOC_PIN8) | \ | ||
553 | PIN_MODE_INPUT(GPIOC_PIN9) | \ | ||
554 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
555 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
556 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
557 | PIN_MODE_INPUT(GPIOC_BUTTON) | \ | ||
558 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
559 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
560 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_ARD_A5) | \ | ||
561 | PIN_OTYPE_PUSHPULL(GPIOC_ARD_A4) | \ | ||
562 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
563 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
564 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
565 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
566 | PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ | ||
567 | PIN_OTYPE_PUSHPULL(GPIOC_ARD_D9) | \ | ||
568 | PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ | ||
569 | PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ | ||
570 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
571 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
572 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
573 | PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ | ||
574 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
575 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
576 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_ARD_A5) | \ | ||
577 | PIN_OSPEED_HIGH(GPIOC_ARD_A4) | \ | ||
578 | PIN_OSPEED_HIGH(GPIOC_PIN2) | \ | ||
579 | PIN_OSPEED_HIGH(GPIOC_PIN3) | \ | ||
580 | PIN_OSPEED_HIGH(GPIOC_PIN4) | \ | ||
581 | PIN_OSPEED_HIGH(GPIOC_PIN5) | \ | ||
582 | PIN_OSPEED_HIGH(GPIOC_PIN6) | \ | ||
583 | PIN_OSPEED_HIGH(GPIOC_ARD_D9) | \ | ||
584 | PIN_OSPEED_HIGH(GPIOC_PIN8) | \ | ||
585 | PIN_OSPEED_HIGH(GPIOC_PIN9) | \ | ||
586 | PIN_OSPEED_HIGH(GPIOC_PIN10) | \ | ||
587 | PIN_OSPEED_HIGH(GPIOC_PIN11) | \ | ||
588 | PIN_OSPEED_HIGH(GPIOC_PIN12) | \ | ||
589 | PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ | ||
590 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
591 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
592 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_ARD_A5) | \ | ||
593 | PIN_PUPDR_PULLUP(GPIOC_ARD_A4) | \ | ||
594 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
595 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
596 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
597 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
598 | PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ | ||
599 | PIN_PUPDR_PULLUP(GPIOC_ARD_D9) | \ | ||
600 | PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ | ||
601 | PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ | ||
602 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
603 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
604 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
605 | PIN_PUPDR_FLOATING(GPIOC_BUTTON) | \ | ||
606 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
607 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
608 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_ARD_A5) | \ | ||
609 | PIN_ODR_HIGH(GPIOC_ARD_A4) | \ | ||
610 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
611 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
612 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
613 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
614 | PIN_ODR_HIGH(GPIOC_PIN6) | \ | ||
615 | PIN_ODR_HIGH(GPIOC_ARD_D9) | \ | ||
616 | PIN_ODR_HIGH(GPIOC_PIN8) | \ | ||
617 | PIN_ODR_HIGH(GPIOC_PIN9) | \ | ||
618 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
619 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
620 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
621 | PIN_ODR_HIGH(GPIOC_BUTTON) | \ | ||
622 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
623 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
624 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_ARD_A5, 0U) | \ | ||
625 | PIN_AFIO_AF(GPIOC_ARD_A4, 0U) | \ | ||
626 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
627 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
628 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
629 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
630 | PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ | ||
631 | PIN_AFIO_AF(GPIOC_ARD_D9, 0U)) | ||
632 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \ | ||
633 | PIN_AFIO_AF(GPIOC_PIN9, 0U) | \ | ||
634 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
635 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
636 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
637 | PIN_AFIO_AF(GPIOC_BUTTON, 0U) | \ | ||
638 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
639 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
640 | |||
641 | /* | ||
642 | * GPIOD setup: | ||
643 | * | ||
644 | * PD0 - PIN0 (input pullup). | ||
645 | * PD1 - PIN1 (input pullup). | ||
646 | * PD2 - PIN2 (input pullup). | ||
647 | * PD3 - PIN3 (input pullup). | ||
648 | * PD4 - PIN4 (input pullup). | ||
649 | * PD5 - PIN5 (input pullup). | ||
650 | * PD6 - PIN6 (input pullup). | ||
651 | * PD7 - PIN7 (input pullup). | ||
652 | * PD8 - PIN8 (input pullup). | ||
653 | * PD9 - PIN9 (input pullup). | ||
654 | * PD10 - PIN10 (input pullup). | ||
655 | * PD11 - PIN11 (input pullup). | ||
656 | * PD12 - PIN12 (input pullup). | ||
657 | * PD13 - PIN13 (input pullup). | ||
658 | * PD14 - PIN14 (input pullup). | ||
659 | * PD15 - PIN15 (input pullup). | ||
660 | */ | ||
661 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
662 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
663 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
664 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
665 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
666 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
667 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
668 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
669 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
670 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
671 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
672 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
673 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
674 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
675 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
676 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
677 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
678 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
679 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
680 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
681 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
682 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
683 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
684 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
685 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
686 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
687 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
688 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
689 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
690 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
691 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
692 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
693 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ | ||
694 | PIN_OSPEED_HIGH(GPIOD_PIN1) | \ | ||
695 | PIN_OSPEED_HIGH(GPIOD_PIN2) | \ | ||
696 | PIN_OSPEED_HIGH(GPIOD_PIN3) | \ | ||
697 | PIN_OSPEED_HIGH(GPIOD_PIN4) | \ | ||
698 | PIN_OSPEED_HIGH(GPIOD_PIN5) | \ | ||
699 | PIN_OSPEED_HIGH(GPIOD_PIN6) | \ | ||
700 | PIN_OSPEED_HIGH(GPIOD_PIN7) | \ | ||
701 | PIN_OSPEED_HIGH(GPIOD_PIN8) | \ | ||
702 | PIN_OSPEED_HIGH(GPIOD_PIN9) | \ | ||
703 | PIN_OSPEED_HIGH(GPIOD_PIN10) | \ | ||
704 | PIN_OSPEED_HIGH(GPIOD_PIN11) | \ | ||
705 | PIN_OSPEED_HIGH(GPIOD_PIN12) | \ | ||
706 | PIN_OSPEED_HIGH(GPIOD_PIN13) | \ | ||
707 | PIN_OSPEED_HIGH(GPIOD_PIN14) | \ | ||
708 | PIN_OSPEED_HIGH(GPIOD_PIN15)) | ||
709 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
710 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
711 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
712 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
713 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
714 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
715 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
716 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
717 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
718 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
719 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
720 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
721 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
722 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
723 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
724 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
725 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
726 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
727 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
728 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
729 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
730 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
731 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
732 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
733 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
734 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
735 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
736 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
737 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
738 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
739 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
740 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
741 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
742 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
743 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
744 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
745 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
746 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
747 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
748 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
749 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
750 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
751 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
752 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
753 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
754 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
755 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
756 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
757 | |||
758 | /* | ||
759 | * GPIOE setup: | ||
760 | * | ||
761 | * PE0 - PIN0 (input pullup). | ||
762 | * PE1 - PIN1 (input pullup). | ||
763 | * PE2 - PIN2 (input pullup). | ||
764 | * PE3 - PIN3 (input pullup). | ||
765 | * PE4 - PIN4 (input pullup). | ||
766 | * PE5 - PIN5 (input pullup). | ||
767 | * PE6 - PIN6 (input pullup). | ||
768 | * PE7 - PIN7 (input pullup). | ||
769 | * PE8 - PIN8 (input pullup). | ||
770 | * PE9 - PIN9 (input pullup). | ||
771 | * PE10 - PIN10 (input pullup). | ||
772 | * PE11 - PIN11 (input pullup). | ||
773 | * PE12 - PIN12 (input pullup). | ||
774 | * PE13 - PIN13 (input pullup). | ||
775 | * PE14 - PIN14 (input pullup). | ||
776 | * PE15 - PIN15 (input pullup). | ||
777 | */ | ||
778 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
779 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
780 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
781 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
782 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
783 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
784 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
785 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
786 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
787 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
788 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
789 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
790 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
791 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
792 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
793 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
794 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
795 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
796 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
797 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
798 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
799 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
800 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
801 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
802 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
803 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
804 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
805 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
806 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
807 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
808 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
809 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
810 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ | ||
811 | PIN_OSPEED_HIGH(GPIOE_PIN1) | \ | ||
812 | PIN_OSPEED_HIGH(GPIOE_PIN2) | \ | ||
813 | PIN_OSPEED_HIGH(GPIOE_PIN3) | \ | ||
814 | PIN_OSPEED_HIGH(GPIOE_PIN4) | \ | ||
815 | PIN_OSPEED_HIGH(GPIOE_PIN5) | \ | ||
816 | PIN_OSPEED_HIGH(GPIOE_PIN6) | \ | ||
817 | PIN_OSPEED_HIGH(GPIOE_PIN7) | \ | ||
818 | PIN_OSPEED_HIGH(GPIOE_PIN8) | \ | ||
819 | PIN_OSPEED_HIGH(GPIOE_PIN9) | \ | ||
820 | PIN_OSPEED_HIGH(GPIOE_PIN10) | \ | ||
821 | PIN_OSPEED_HIGH(GPIOE_PIN11) | \ | ||
822 | PIN_OSPEED_HIGH(GPIOE_PIN12) | \ | ||
823 | PIN_OSPEED_HIGH(GPIOE_PIN13) | \ | ||
824 | PIN_OSPEED_HIGH(GPIOE_PIN14) | \ | ||
825 | PIN_OSPEED_HIGH(GPIOE_PIN15)) | ||
826 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
827 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
828 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
829 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
830 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
831 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
832 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
833 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
834 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
835 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
836 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
837 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
838 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
839 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
840 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
841 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
842 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
843 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
844 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
845 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
846 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
847 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
848 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
849 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
850 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
851 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
852 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
853 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
854 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
855 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
856 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
857 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
858 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
859 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
860 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
861 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
862 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
863 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
864 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
865 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
866 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
867 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
868 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
869 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
870 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
871 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
872 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
873 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
874 | |||
875 | /* | ||
876 | * GPIOF setup: | ||
877 | * | ||
878 | * PF0 - OSC_IN (input floating). | ||
879 | * PF1 - OSC_OUT (input floating). | ||
880 | * PF2 - PIN2 (input pullup). | ||
881 | * PF3 - PIN3 (input pullup). | ||
882 | * PF4 - PIN4 (input pullup). | ||
883 | * PF5 - PIN5 (input pullup). | ||
884 | * PF6 - PIN6 (input pullup). | ||
885 | * PF7 - PIN7 (input pullup). | ||
886 | * PF8 - PIN8 (input pullup). | ||
887 | * PF9 - PIN9 (input pullup). | ||
888 | * PF10 - PIN10 (input pullup). | ||
889 | * PF11 - PIN11 (input pullup). | ||
890 | * PF12 - PIN12 (input pullup). | ||
891 | * PF13 - PIN13 (input pullup). | ||
892 | * PF14 - PIN14 (input pullup). | ||
893 | * PF15 - PIN15 (input pullup). | ||
894 | */ | ||
895 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
896 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
897 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
898 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
899 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
900 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
901 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
902 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
903 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
904 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
905 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
906 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
907 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
908 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
909 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
910 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
911 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
912 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
913 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
914 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
915 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
916 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
917 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
918 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
919 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
920 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
921 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
922 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
923 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
924 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
925 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
926 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
927 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_OSC_IN) | \ | ||
928 | PIN_OSPEED_HIGH(GPIOF_OSC_OUT) | \ | ||
929 | PIN_OSPEED_HIGH(GPIOF_PIN2) | \ | ||
930 | PIN_OSPEED_HIGH(GPIOF_PIN3) | \ | ||
931 | PIN_OSPEED_HIGH(GPIOF_PIN4) | \ | ||
932 | PIN_OSPEED_HIGH(GPIOF_PIN5) | \ | ||
933 | PIN_OSPEED_HIGH(GPIOF_PIN6) | \ | ||
934 | PIN_OSPEED_HIGH(GPIOF_PIN7) | \ | ||
935 | PIN_OSPEED_HIGH(GPIOF_PIN8) | \ | ||
936 | PIN_OSPEED_HIGH(GPIOF_PIN9) | \ | ||
937 | PIN_OSPEED_HIGH(GPIOF_PIN10) | \ | ||
938 | PIN_OSPEED_HIGH(GPIOF_PIN11) | \ | ||
939 | PIN_OSPEED_HIGH(GPIOF_PIN12) | \ | ||
940 | PIN_OSPEED_HIGH(GPIOF_PIN13) | \ | ||
941 | PIN_OSPEED_HIGH(GPIOF_PIN14) | \ | ||
942 | PIN_OSPEED_HIGH(GPIOF_PIN15)) | ||
943 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
944 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
945 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
946 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
947 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
948 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
949 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
950 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
951 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
952 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
953 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
954 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
955 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
956 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
957 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
958 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
959 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
960 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
961 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
962 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
963 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
964 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
965 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
966 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
967 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
968 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
969 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
970 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
971 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
972 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
973 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
974 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
975 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
976 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
977 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
978 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
979 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
980 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
981 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
982 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
983 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
984 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
985 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
986 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
987 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
988 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
989 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
990 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
991 | |||
992 | /* | ||
993 | * GPIOG setup: | ||
994 | * | ||
995 | * PG0 - PIN0 (input pullup). | ||
996 | * PG1 - PIN1 (input pullup). | ||
997 | * PG2 - PIN2 (input pullup). | ||
998 | * PG3 - PIN3 (input pullup). | ||
999 | * PG4 - PIN4 (input pullup). | ||
1000 | * PG5 - PIN5 (input pullup). | ||
1001 | * PG6 - PIN6 (input pullup). | ||
1002 | * PG7 - PIN7 (input pullup). | ||
1003 | * PG8 - PIN8 (input pullup). | ||
1004 | * PG9 - PIN9 (input pullup). | ||
1005 | * PG10 - PIN10 (input pullup). | ||
1006 | * PG11 - PIN11 (input pullup). | ||
1007 | * PG12 - PIN12 (input pullup). | ||
1008 | * PG13 - PIN13 (input pullup). | ||
1009 | * PG14 - PIN14 (input pullup). | ||
1010 | * PG15 - PIN15 (input pullup). | ||
1011 | */ | ||
1012 | #define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ | ||
1013 | PIN_MODE_INPUT(GPIOG_PIN1) | \ | ||
1014 | PIN_MODE_INPUT(GPIOG_PIN2) | \ | ||
1015 | PIN_MODE_INPUT(GPIOG_PIN3) | \ | ||
1016 | PIN_MODE_INPUT(GPIOG_PIN4) | \ | ||
1017 | PIN_MODE_INPUT(GPIOG_PIN5) | \ | ||
1018 | PIN_MODE_INPUT(GPIOG_PIN6) | \ | ||
1019 | PIN_MODE_INPUT(GPIOG_PIN7) | \ | ||
1020 | PIN_MODE_INPUT(GPIOG_PIN8) | \ | ||
1021 | PIN_MODE_INPUT(GPIOG_PIN9) | \ | ||
1022 | PIN_MODE_INPUT(GPIOG_PIN10) | \ | ||
1023 | PIN_MODE_INPUT(GPIOG_PIN11) | \ | ||
1024 | PIN_MODE_INPUT(GPIOG_PIN12) | \ | ||
1025 | PIN_MODE_INPUT(GPIOG_PIN13) | \ | ||
1026 | PIN_MODE_INPUT(GPIOG_PIN14) | \ | ||
1027 | PIN_MODE_INPUT(GPIOG_PIN15)) | ||
1028 | #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ | ||
1029 | PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ | ||
1030 | PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ | ||
1031 | PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ | ||
1032 | PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ | ||
1033 | PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ | ||
1034 | PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ | ||
1035 | PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ | ||
1036 | PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ | ||
1037 | PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ | ||
1038 | PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ | ||
1039 | PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ | ||
1040 | PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ | ||
1041 | PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ | ||
1042 | PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ | ||
1043 | PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) | ||
1044 | #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ | ||
1045 | PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ | ||
1046 | PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ | ||
1047 | PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ | ||
1048 | PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ | ||
1049 | PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ | ||
1050 | PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ | ||
1051 | PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ | ||
1052 | PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ | ||
1053 | PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ | ||
1054 | PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ | ||
1055 | PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ | ||
1056 | PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ | ||
1057 | PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ | ||
1058 | PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ | ||
1059 | PIN_OSPEED_VERYLOW(GPIOG_PIN15)) | ||
1060 | #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ | ||
1061 | PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ | ||
1062 | PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ | ||
1063 | PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ | ||
1064 | PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ | ||
1065 | PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ | ||
1066 | PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ | ||
1067 | PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ | ||
1068 | PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ | ||
1069 | PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ | ||
1070 | PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ | ||
1071 | PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ | ||
1072 | PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ | ||
1073 | PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ | ||
1074 | PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ | ||
1075 | PIN_PUPDR_PULLUP(GPIOG_PIN15)) | ||
1076 | #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ | ||
1077 | PIN_ODR_HIGH(GPIOG_PIN1) | \ | ||
1078 | PIN_ODR_HIGH(GPIOG_PIN2) | \ | ||
1079 | PIN_ODR_HIGH(GPIOG_PIN3) | \ | ||
1080 | PIN_ODR_HIGH(GPIOG_PIN4) | \ | ||
1081 | PIN_ODR_HIGH(GPIOG_PIN5) | \ | ||
1082 | PIN_ODR_HIGH(GPIOG_PIN6) | \ | ||
1083 | PIN_ODR_HIGH(GPIOG_PIN7) | \ | ||
1084 | PIN_ODR_HIGH(GPIOG_PIN8) | \ | ||
1085 | PIN_ODR_HIGH(GPIOG_PIN9) | \ | ||
1086 | PIN_ODR_HIGH(GPIOG_PIN10) | \ | ||
1087 | PIN_ODR_HIGH(GPIOG_PIN11) | \ | ||
1088 | PIN_ODR_HIGH(GPIOG_PIN12) | \ | ||
1089 | PIN_ODR_HIGH(GPIOG_PIN13) | \ | ||
1090 | PIN_ODR_HIGH(GPIOG_PIN14) | \ | ||
1091 | PIN_ODR_HIGH(GPIOG_PIN15)) | ||
1092 | #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \ | ||
1093 | PIN_AFIO_AF(GPIOG_PIN1, 0U) | \ | ||
1094 | PIN_AFIO_AF(GPIOG_PIN2, 0U) | \ | ||
1095 | PIN_AFIO_AF(GPIOG_PIN3, 0U) | \ | ||
1096 | PIN_AFIO_AF(GPIOG_PIN4, 0U) | \ | ||
1097 | PIN_AFIO_AF(GPIOG_PIN5, 0U) | \ | ||
1098 | PIN_AFIO_AF(GPIOG_PIN6, 0U) | \ | ||
1099 | PIN_AFIO_AF(GPIOG_PIN7, 0U)) | ||
1100 | #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \ | ||
1101 | PIN_AFIO_AF(GPIOG_PIN9, 0U) | \ | ||
1102 | PIN_AFIO_AF(GPIOG_PIN10, 0U) | \ | ||
1103 | PIN_AFIO_AF(GPIOG_PIN11, 0U) | \ | ||
1104 | PIN_AFIO_AF(GPIOG_PIN12, 0U) | \ | ||
1105 | PIN_AFIO_AF(GPIOG_PIN13, 0U) | \ | ||
1106 | PIN_AFIO_AF(GPIOG_PIN14, 0U) | \ | ||
1107 | PIN_AFIO_AF(GPIOG_PIN15, 0U)) | ||
1108 | |||
1109 | /* | ||
1110 | * GPIOH setup: | ||
1111 | * | ||
1112 | * PH0 - PIN0 (input pullup). | ||
1113 | * PH1 - PIN1 (input pullup). | ||
1114 | * PH2 - PIN2 (input pullup). | ||
1115 | * PH3 - PIN3 (input pullup). | ||
1116 | * PH4 - PIN4 (input pullup). | ||
1117 | * PH5 - PIN5 (input pullup). | ||
1118 | * PH6 - PIN6 (input pullup). | ||
1119 | * PH7 - PIN7 (input pullup). | ||
1120 | * PH8 - PIN8 (input pullup). | ||
1121 | * PH9 - PIN9 (input pullup). | ||
1122 | * PH10 - PIN10 (input pullup). | ||
1123 | * PH11 - PIN11 (input pullup). | ||
1124 | * PH12 - PIN12 (input pullup). | ||
1125 | * PH13 - PIN13 (input pullup). | ||
1126 | * PH14 - PIN14 (input pullup). | ||
1127 | * PH15 - PIN15 (input pullup). | ||
1128 | */ | ||
1129 | #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ | ||
1130 | PIN_MODE_INPUT(GPIOH_PIN1) | \ | ||
1131 | PIN_MODE_INPUT(GPIOH_PIN2) | \ | ||
1132 | PIN_MODE_INPUT(GPIOH_PIN3) | \ | ||
1133 | PIN_MODE_INPUT(GPIOH_PIN4) | \ | ||
1134 | PIN_MODE_INPUT(GPIOH_PIN5) | \ | ||
1135 | PIN_MODE_INPUT(GPIOH_PIN6) | \ | ||
1136 | PIN_MODE_INPUT(GPIOH_PIN7) | \ | ||
1137 | PIN_MODE_INPUT(GPIOH_PIN8) | \ | ||
1138 | PIN_MODE_INPUT(GPIOH_PIN9) | \ | ||
1139 | PIN_MODE_INPUT(GPIOH_PIN10) | \ | ||
1140 | PIN_MODE_INPUT(GPIOH_PIN11) | \ | ||
1141 | PIN_MODE_INPUT(GPIOH_PIN12) | \ | ||
1142 | PIN_MODE_INPUT(GPIOH_PIN13) | \ | ||
1143 | PIN_MODE_INPUT(GPIOH_PIN14) | \ | ||
1144 | PIN_MODE_INPUT(GPIOH_PIN15)) | ||
1145 | #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ | ||
1146 | PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ | ||
1147 | PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ | ||
1148 | PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ | ||
1149 | PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ | ||
1150 | PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ | ||
1151 | PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ | ||
1152 | PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ | ||
1153 | PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ | ||
1154 | PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ | ||
1155 | PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ | ||
1156 | PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ | ||
1157 | PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ | ||
1158 | PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ | ||
1159 | PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ | ||
1160 | PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) | ||
1161 | #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ | ||
1162 | PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ | ||
1163 | PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ | ||
1164 | PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ | ||
1165 | PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ | ||
1166 | PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ | ||
1167 | PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ | ||
1168 | PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ | ||
1169 | PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ | ||
1170 | PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ | ||
1171 | PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ | ||
1172 | PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ | ||
1173 | PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ | ||
1174 | PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ | ||
1175 | PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ | ||
1176 | PIN_OSPEED_VERYLOW(GPIOH_PIN15)) | ||
1177 | #define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ | ||
1178 | PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ | ||
1179 | PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ | ||
1180 | PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ | ||
1181 | PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ | ||
1182 | PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ | ||
1183 | PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ | ||
1184 | PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ | ||
1185 | PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ | ||
1186 | PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ | ||
1187 | PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ | ||
1188 | PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ | ||
1189 | PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ | ||
1190 | PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ | ||
1191 | PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ | ||
1192 | PIN_PUPDR_PULLUP(GPIOH_PIN15)) | ||
1193 | #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ | ||
1194 | PIN_ODR_HIGH(GPIOH_PIN1) | \ | ||
1195 | PIN_ODR_HIGH(GPIOH_PIN2) | \ | ||
1196 | PIN_ODR_HIGH(GPIOH_PIN3) | \ | ||
1197 | PIN_ODR_HIGH(GPIOH_PIN4) | \ | ||
1198 | PIN_ODR_HIGH(GPIOH_PIN5) | \ | ||
1199 | PIN_ODR_HIGH(GPIOH_PIN6) | \ | ||
1200 | PIN_ODR_HIGH(GPIOH_PIN7) | \ | ||
1201 | PIN_ODR_HIGH(GPIOH_PIN8) | \ | ||
1202 | PIN_ODR_HIGH(GPIOH_PIN9) | \ | ||
1203 | PIN_ODR_HIGH(GPIOH_PIN10) | \ | ||
1204 | PIN_ODR_HIGH(GPIOH_PIN11) | \ | ||
1205 | PIN_ODR_HIGH(GPIOH_PIN12) | \ | ||
1206 | PIN_ODR_HIGH(GPIOH_PIN13) | \ | ||
1207 | PIN_ODR_HIGH(GPIOH_PIN14) | \ | ||
1208 | PIN_ODR_HIGH(GPIOH_PIN15)) | ||
1209 | #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0U) | \ | ||
1210 | PIN_AFIO_AF(GPIOH_PIN1, 0U) | \ | ||
1211 | PIN_AFIO_AF(GPIOH_PIN2, 0U) | \ | ||
1212 | PIN_AFIO_AF(GPIOH_PIN3, 0U) | \ | ||
1213 | PIN_AFIO_AF(GPIOH_PIN4, 0U) | \ | ||
1214 | PIN_AFIO_AF(GPIOH_PIN5, 0U) | \ | ||
1215 | PIN_AFIO_AF(GPIOH_PIN6, 0U) | \ | ||
1216 | PIN_AFIO_AF(GPIOH_PIN7, 0U)) | ||
1217 | #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \ | ||
1218 | PIN_AFIO_AF(GPIOH_PIN9, 0U) | \ | ||
1219 | PIN_AFIO_AF(GPIOH_PIN10, 0U) | \ | ||
1220 | PIN_AFIO_AF(GPIOH_PIN11, 0U) | \ | ||
1221 | PIN_AFIO_AF(GPIOH_PIN12, 0U) | \ | ||
1222 | PIN_AFIO_AF(GPIOH_PIN13, 0U) | \ | ||
1223 | PIN_AFIO_AF(GPIOH_PIN14, 0U) | \ | ||
1224 | PIN_AFIO_AF(GPIOH_PIN15, 0U)) | ||
1225 | |||
1226 | /*===========================================================================*/ | ||
1227 | /* External declarations. */ | ||
1228 | /*===========================================================================*/ | ||
1229 | |||
1230 | #if !defined(_FROM_ASM_) | ||
1231 | #ifdef __cplusplus | ||
1232 | extern "C" { | ||
1233 | #endif | ||
1234 | void boardInit(void); | ||
1235 | #ifdef __cplusplus | ||
1236 | } | ||
1237 | #endif | ||
1238 | #endif /* _FROM_ASM_ */ | ||
1239 | |||
1240 | #endif /* BOARD_H */ | ||