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