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