MAV'RIC
|
00001 /* 00002 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio 00003 00004 Licensed under the Apache License, Version 2.0 (the "License"); 00005 you may not use this file except in compliance with the License. 00006 You may obtain a copy of the License at 00007 00008 http://www.apache.org/licenses/LICENSE-2.0 00009 00010 Unless required by applicable law or agreed to in writing, software 00011 distributed under the License is distributed on an "AS IS" BASIS, 00012 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 See the License for the specific language governing permissions and 00014 limitations under the License. 00015 */ 00016 00017 /* 00018 * This file has been automatically generated using ChibiStudio board 00019 * generator plugin. Do not edit manually. 00020 */ 00021 00022 #ifndef BOARD_H 00023 #define BOARD_H 00024 00025 /* 00026 * Setup for STMicroelectronics STM32F4-Discovery board. 00027 */ 00028 00029 /* 00030 * Board identifier. 00031 */ 00032 #define BOARD_SPARKY_V2 00033 #define BOARD_ST_STM32F4_DISCOVERY 00034 #define BOARD_NAME "Sparky V2" 00035 00036 /* 00037 * Board oscillators-related settings. 00038 * NOTE: LSE not fitted. 00039 */ 00040 #if !defined(STM32_LSECLK) 00041 #define STM32_LSECLK 0U 00042 #endif 00043 00044 #if !defined(STM32_HSECLK) 00045 #define STM32_HSECLK 8000000U 00046 #endif 00047 00048 /* 00049 * Board voltages. 00050 * Required for performance limits calculation. 00051 */ 00052 #define STM32_VDD 300U 00053 00054 /* 00055 * MCU type as defined in the ST header. 00056 */ 00057 #define STM32F405xx 00058 00059 /* 00060 * Indicate that USB VBUS is not connected on this board 00061 */ 00062 #define BOARD_OTG_NOVBUSSENS 00063 00064 /* 00065 * IO pins assignments. 00066 */ 00067 #define GPIOA_PIN0_PWM5 0U 00068 #define GPIOA_PIN1_PWM4 1U 00069 #define GPIOA_PIN2_PWM3 2U 00070 #define GPIOA_PIN3_PWM2 3U 00071 #define GPIOA_LRCK 4U 00072 #define GPIOA_SPC 5U 00073 #define GPIOA_SDO 6U 00074 #define GPIOA_SDI 7U 00075 #define GPIOA_PIN8 8U 00076 #define GPIOA_PIN9_UART1_TX 9U 00077 #define GPIOA_PIN10_UART1_RX 10U 00078 #define GPIOA_OTG_FS_DM 11U 00079 #define GPIOA_OTG_FS_DP 12U 00080 #define GPIOA_SWDIO 13U 00081 #define GPIOA_SWCLK 14U 00082 #define GPIOA_PIN15 15U 00083 00084 #define GPIOB_PIN0_PWM0 0U 00085 #define GPIOB_PIN1_PWM1 1U 00086 #define GPIOB_PIN2 2U 00087 #define GPIOB_SWO 3U 00088 #define GPIOB_PIN4 4U 00089 #define GPIOB_PIN5 5U 00090 #define GPIOB_PIN6 6U 00091 #define GPIOB_PIN7 7U 00092 #define GPIOB_PIN8_SCL 8U 00093 #define GPIOB_PIN9_SDA 9U 00094 #define GPIOB_CLK_IN 10U 00095 #define GPIOB_PIN11 11U 00096 #define GPIOB_PIN12 12U 00097 #define GPIOB_PIN13 13U 00098 #define GPIOB_PIN14_PWM9 14U 00099 #define GPIOB_PIN15_PWM8 15U 00100 00101 #define GPIOC_OTG_FS_POWER_ON 0U 00102 #define GPIOC_PIN1 1U 00103 #define GPIOC_PIN2 2U 00104 #define GPIOC_PDM_OUT 3U 00105 #define GPIOC_PIN4 4U 00106 #define GPIOC_PIN5 5U 00107 #define GPIOC_PIN6 6U 00108 #define GPIOC_MCLK 7U 00109 #define GPIOC_PIN8_PWM7 8U 00110 #define GPIOC_PIN9_PWM6 9U 00111 #define GPIOC_PIN10_SPI3_SCLK 10U 00112 #define GPIOC_PIN11_SPI3_MISO 11U 00113 #define GPIOC_PIN12_SPI3_MOSI 12U 00114 #define GPIOC_PIN13 13U 00115 #define GPIOC_PIN14 14U 00116 #define GPIOC_PIN15 15U 00117 00118 #define GPIOD_PIN0 0U 00119 #define GPIOD_PIN1 1U 00120 #define GPIOD_PIN2 2U 00121 #define GPIOD_PIN3 3U 00122 #define GPIOD_RESET 4U 00123 #define GPIOD_OVER_CURRENT 5U 00124 #define GPIOD_PIN6 6U 00125 #define GPIOD_PIN7 7U 00126 #define GPIOD_PIN8 8U 00127 #define GPIOD_PIN9 9U 00128 #define GPIOD_PIN10 10U 00129 #define GPIOD_PIN11 11U 00130 #define GPIOD_PIN12_LED4 12U 00131 #define GPIOD_PIN13_LED3 13U 00132 #define GPIOD_PIN14_LED5 14U 00133 #define GPIOD_PIN15_LED6 15U 00134 00135 #define GPIOE_INT1 0U 00136 #define GPIOE_INT2 1U 00137 #define GPIOE_PIN2 2U 00138 #define GPIOE_CS_SPI 3U 00139 #define GPIOE_PIN4 4U 00140 #define GPIOE_PIN5 5U 00141 #define GPIOE_PIN6 6U 00142 #define GPIOE_PIN7 7U 00143 #define GPIOE_PIN8 8U 00144 #define GPIOE_PIN9 9U 00145 #define GPIOE_PIN10 10U 00146 #define GPIOE_PIN11 11U 00147 #define GPIOE_PIN12 12U 00148 #define GPIOE_PIN13 13U 00149 #define GPIOE_PIN14 14U 00150 #define GPIOE_PIN15 15U 00151 00152 #define GPIOF_PIN0 0U 00153 #define GPIOF_PIN1 1U 00154 #define GPIOF_PIN2 2U 00155 #define GPIOF_PIN3 3U 00156 #define GPIOF_PIN4 4U 00157 #define GPIOF_PIN5 5U 00158 #define GPIOF_PIN6 6U 00159 #define GPIOF_PIN7 7U 00160 #define GPIOF_PIN8 8U 00161 #define GPIOF_PIN9 9U 00162 #define GPIOF_PIN10 10U 00163 #define GPIOF_PIN11 11U 00164 #define GPIOF_PIN12 12U 00165 #define GPIOF_PIN13 13U 00166 #define GPIOF_PIN14 14U 00167 #define GPIOF_PIN15 15U 00168 00169 #define GPIOG_PIN0 0U 00170 #define GPIOG_PIN1 1U 00171 #define GPIOG_PIN2 2U 00172 #define GPIOG_PIN3 3U 00173 #define GPIOG_PIN4 4U 00174 #define GPIOG_PIN5 5U 00175 #define GPIOG_PIN6 6U 00176 #define GPIOG_PIN7 7U 00177 #define GPIOG_PIN8 8U 00178 #define GPIOG_PIN9 9U 00179 #define GPIOG_PIN10 10U 00180 #define GPIOG_PIN11 11U 00181 #define GPIOG_PIN12 12U 00182 #define GPIOG_PIN13 13U 00183 #define GPIOG_PIN14 14U 00184 #define GPIOG_PIN15 15U 00185 00186 #define GPIOH_OSC_IN 0U 00187 #define GPIOH_OSC_OUT 1U 00188 #define GPIOH_PIN2 2U 00189 #define GPIOH_PIN3 3U 00190 #define GPIOH_PIN4 4U 00191 #define GPIOH_PIN5 5U 00192 #define GPIOH_PIN6 6U 00193 #define GPIOH_PIN7 7U 00194 #define GPIOH_PIN8 8U 00195 #define GPIOH_PIN9 9U 00196 #define GPIOH_PIN10 10U 00197 #define GPIOH_PIN11 11U 00198 #define GPIOH_PIN12 12U 00199 #define GPIOH_PIN13 13U 00200 #define GPIOH_PIN14 14U 00201 #define GPIOH_PIN15 15U 00202 00203 #define GPIOI_PIN0 0U 00204 #define GPIOI_PIN1 1U 00205 #define GPIOI_PIN2 2U 00206 #define GPIOI_PIN3 3U 00207 #define GPIOI_PIN4 4U 00208 #define GPIOI_PIN5 5U 00209 #define GPIOI_PIN6 6U 00210 #define GPIOI_PIN7 7U 00211 #define GPIOI_PIN8 8U 00212 #define GPIOI_PIN9 9U 00213 #define GPIOI_PIN10 10U 00214 #define GPIOI_PIN11 11U 00215 #define GPIOI_PIN12 12U 00216 #define GPIOI_PIN13 13U 00217 #define GPIOI_PIN14 14U 00218 #define GPIOI_PIN15 15U 00219 00220 /* 00221 * IO lines assignments. 00222 */ 00223 #define LINE_BUTTON PAL_LINE(GPIOA, 0U) 00224 #define LINE_LRCK PAL_LINE(GPIOA, 4U) 00225 #define LINE_SPC PAL_LINE(GPIOA, 5U) 00226 #define LINE_SDO PAL_LINE(GPIOA, 6U) 00227 #define LINE_SDI PAL_LINE(GPIOA, 7U) 00228 #define LINE_VBUS_FS PAL_LINE(GPIOA, 9U) 00229 #define LINE_OTG_FS_ID PAL_LINE(GPIOA, 10U) 00230 #define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) 00231 #define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) 00232 #define LINE_SWDIO PAL_LINE(GPIOA, 13U) 00233 #define LINE_SWCLK PAL_LINE(GPIOA, 14U) 00234 00235 #define LINE_SWO PAL_LINE(GPIOB, 3U) 00236 #define LINE_SCL PAL_LINE(GPIOB, 6U) 00237 #define LINE_SDA PAL_LINE(GPIOB, 9U) 00238 #define LINE_CLK_IN PAL_LINE(GPIOB, 10U) 00239 00240 #define LINE_OTG_FS_POWER_ON PAL_LINE(GPIOC, 0U) 00241 #define LINE_PDM_OUT PAL_LINE(GPIOC, 3U) 00242 #define LINE_MCLK PAL_LINE(GPIOC, 7U) 00243 #define LINE_SCLK PAL_LINE(GPIOC, 10U) 00244 #define LINE_SDIN PAL_LINE(GPIOC, 12U) 00245 00246 #define LINE_RESET PAL_LINE(GPIOD, 4U) 00247 #define LINE_OVER_CURRENT PAL_LINE(GPIOD, 5U) 00248 #define LINE_LED4 PAL_LINE(GPIOD, 12U) 00249 #define LINE_LED3 PAL_LINE(GPIOD, 13U) 00250 #define LINE_LED5 PAL_LINE(GPIOD, 14U) 00251 #define LINE_LED6 PAL_LINE(GPIOD, 15U) 00252 00253 #define LINE_INT1 PAL_LINE(GPIOE, 0U) 00254 #define LINE_INT2 PAL_LINE(GPIOE, 1U) 00255 #define LINE_CS_SPI PAL_LINE(GPIOE, 3U) 00256 00257 00258 00259 #define LINE_OSC_IN PAL_LINE(GPIOH, 0U) 00260 #define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) 00261 00262 00263 /* 00264 * I/O ports initial setup, this configuration is established soon after reset 00265 * in the initialization code. 00266 * Please refer to the STM32 Reference Manual for details. 00267 */ 00268 #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) 00269 #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) 00270 #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) 00271 #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) 00272 #define PIN_ODR_LOW(n) (0U << (n)) 00273 #define PIN_ODR_HIGH(n) (1U << (n)) 00274 #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) 00275 #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) 00276 #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) 00277 #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) 00278 #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) 00279 #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) 00280 #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) 00281 #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) 00282 #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) 00283 #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) 00284 00285 /* 00286 * GPIOA setup: 00287 * 00288 * PA0 - BUTTON (input floating). 00289 * PA1 - PIN1 (input pullup). 00290 * PA2 - PIN2 (input pullup). 00291 * PA3 - PIN3 (input pullup). 00292 * PA4 - LRCK (alternate 6). 00293 * PA5 - SPC (alternate 5). 00294 * PA6 - SDO (alternate 5). 00295 * PA7 - SDI (alternate 5). 00296 * PA8 - PIN8 (input pullup). 00297 * PA9 - VBUS_FS (input floating). 00298 * PA10 - OTG_FS_ID (alternate 10). 00299 * PA11 - OTG_FS_DM (alternate 10). 00300 * PA12 - OTG_FS_DP (alternate 10). 00301 * PA13 - SWDIO (alternate 0). 00302 * PA14 - SWCLK (alternate 0). 00303 * PA15 - PIN15 (input pullup). 00304 */ 00305 #define VAL_GPIOA_MODER (PIN_MODE_ALTERNATE(GPIOA_PIN0_PWM5) | \ 00306 PIN_MODE_ALTERNATE(GPIOA_PIN1_PWM4) | \ 00307 PIN_MODE_ALTERNATE(GPIOA_PIN2_PWM3) | \ 00308 PIN_MODE_ALTERNATE(GPIOA_PIN3_PWM2) | \ 00309 PIN_MODE_ALTERNATE(GPIOA_LRCK) | \ 00310 PIN_MODE_ALTERNATE(GPIOA_SPC) | \ 00311 PIN_MODE_ALTERNATE(GPIOA_SDO) | \ 00312 PIN_MODE_ALTERNATE(GPIOA_SDI) | \ 00313 PIN_MODE_ALTERNATE(GPIOA_PIN8) | \ 00314 PIN_MODE_ALTERNATE(GPIOA_PIN9_UART1_TX) | \ 00315 PIN_MODE_ALTERNATE(GPIOA_PIN10_UART1_RX) | \ 00316 PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DM) | \ 00317 PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DP) | \ 00318 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ 00319 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ 00320 PIN_MODE_INPUT(GPIOA_PIN15)) 00321 #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0_PWM5) | \ 00322 PIN_OTYPE_PUSHPULL(GPIOA_PIN1_PWM4) | \ 00323 PIN_OTYPE_PUSHPULL(GPIOA_PIN2_PWM3) | \ 00324 PIN_OTYPE_PUSHPULL(GPIOA_PIN3_PWM2) | \ 00325 PIN_OTYPE_PUSHPULL(GPIOA_LRCK) | \ 00326 PIN_OTYPE_PUSHPULL(GPIOA_SPC) | \ 00327 PIN_OTYPE_PUSHPULL(GPIOA_SDO) | \ 00328 PIN_OTYPE_PUSHPULL(GPIOA_SDI) | \ 00329 PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ 00330 PIN_OTYPE_PUSHPULL(GPIOA_PIN9_UART1_TX) | \ 00331 PIN_OTYPE_PUSHPULL(GPIOA_PIN10_UART1_RX) | \ 00332 PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DM) | \ 00333 PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DP) | \ 00334 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ 00335 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ 00336 PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) 00337 #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0_PWM5) | \ 00338 PIN_OSPEED_HIGH(GPIOA_PIN1_PWM4) | \ 00339 PIN_OSPEED_HIGH(GPIOA_PIN2_PWM3) | \ 00340 PIN_OSPEED_HIGH(GPIOA_PIN3_PWM2) | \ 00341 PIN_OSPEED_HIGH(GPIOA_LRCK) | \ 00342 PIN_OSPEED_MEDIUM(GPIOA_SPC) | \ 00343 PIN_OSPEED_MEDIUM(GPIOA_SDO) | \ 00344 PIN_OSPEED_MEDIUM(GPIOA_SDI) | \ 00345 PIN_OSPEED_HIGH(GPIOA_PIN8) | \ 00346 PIN_OSPEED_HIGH(GPIOA_PIN9_UART1_TX) | \ 00347 PIN_OSPEED_HIGH(GPIOA_PIN10_UART1_RX) | \ 00348 PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \ 00349 PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \ 00350 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ 00351 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ 00352 PIN_OSPEED_HIGH(GPIOA_PIN15)) 00353 #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0_PWM5) | \ 00354 PIN_PUPDR_FLOATING(GPIOA_PIN1_PWM4) | \ 00355 PIN_PUPDR_FLOATING(GPIOA_PIN2_PWM3) | \ 00356 PIN_PUPDR_FLOATING(GPIOA_PIN3_PWM2) | \ 00357 PIN_PUPDR_FLOATING(GPIOA_LRCK) | \ 00358 PIN_PUPDR_FLOATING(GPIOA_SPC) | \ 00359 PIN_PUPDR_FLOATING(GPIOA_SDO) | \ 00360 PIN_PUPDR_FLOATING(GPIOA_SDI) | \ 00361 PIN_PUPDR_FLOATING(GPIOA_PIN8) | \ 00362 PIN_PUPDR_FLOATING(GPIOA_PIN9_UART1_TX) | \ 00363 PIN_PUPDR_FLOATING(GPIOA_PIN10_UART1_RX) | \ 00364 PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DM) | \ 00365 PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DP) | \ 00366 PIN_PUPDR_FLOATING(GPIOA_SWDIO) | \ 00367 PIN_PUPDR_FLOATING(GPIOA_SWCLK) | \ 00368 PIN_PUPDR_PULLUP(GPIOA_PIN15)) 00369 #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0_PWM5) | \ 00370 PIN_ODR_HIGH(GPIOA_PIN1_PWM4) | \ 00371 PIN_ODR_HIGH(GPIOA_PIN2_PWM3) | \ 00372 PIN_ODR_HIGH(GPIOA_PIN3_PWM2) | \ 00373 PIN_ODR_HIGH(GPIOA_LRCK) | \ 00374 PIN_ODR_HIGH(GPIOA_SPC) | \ 00375 PIN_ODR_HIGH(GPIOA_SDO) | \ 00376 PIN_ODR_HIGH(GPIOA_SDI) | \ 00377 PIN_ODR_HIGH(GPIOA_PIN8) | \ 00378 PIN_ODR_HIGH(GPIOA_PIN9_UART1_TX) | \ 00379 PIN_ODR_HIGH(GPIOA_PIN10_UART1_RX) | \ 00380 PIN_ODR_HIGH(GPIOA_OTG_FS_DM) | \ 00381 PIN_ODR_HIGH(GPIOA_OTG_FS_DP) | \ 00382 PIN_ODR_HIGH(GPIOA_SWDIO) | \ 00383 PIN_ODR_HIGH(GPIOA_SWCLK) | \ 00384 PIN_ODR_HIGH(GPIOA_PIN15)) 00385 #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0_PWM5, 2U) | \ 00386 PIN_AFIO_AF(GPIOA_PIN1_PWM4, 2U) | \ 00387 PIN_AFIO_AF(GPIOA_PIN2_PWM3, 3U) | \ 00388 PIN_AFIO_AF(GPIOA_PIN3_PWM2, 3U) | \ 00389 PIN_AFIO_AF(GPIOA_LRCK, 6U) | \ 00390 PIN_AFIO_AF(GPIOA_SPC, 5U) | \ 00391 PIN_AFIO_AF(GPIOA_SDO, 5U) | \ 00392 PIN_AFIO_AF(GPIOA_SDI, 5U)) 00393 #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 1U) | \ 00394 PIN_AFIO_AF(GPIOA_PIN9_UART1_TX, 7U) | \ 00395 PIN_AFIO_AF(GPIOA_PIN10_UART1_RX, 7U) | \ 00396 PIN_AFIO_AF(GPIOA_OTG_FS_DM, 10U) | \ 00397 PIN_AFIO_AF(GPIOA_OTG_FS_DP, 10U) | \ 00398 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ 00399 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ 00400 PIN_AFIO_AF(GPIOA_PIN15, 0U)) 00401 00402 /* 00403 * GPIOB setup: 00404 * 00405 * PB0 - PIN0 (input pullup). 00406 * PB1 - PIN1 (input pullup). 00407 * PB2 - PIN2 (input pullup). 00408 * PB3 - SWO (alternate 0). 00409 * PB4 - PIN4 (input pullup). 00410 * PB5 - PIN5 (input pullup). 00411 * PB6 - SCL (alternate 4). 00412 * PB7 - PIN7 (input pullup). 00413 * PB8 - PIN8 (input pullup). 00414 * PB9 - SDA (alternate 4). 00415 * PB10 - CLK_IN (input pullup). 00416 * PB11 - PIN11 (input pullup). 00417 * PB12 - PIN12 (input pullup). 00418 * PB13 - PIN13 (input pullup). 00419 * PB14 - PIN14 (input pullup). 00420 * PB15 - PIN15 (input pullup). 00421 */ 00422 #define VAL_GPIOB_MODER (PIN_MODE_ALTERNATE(GPIOB_PIN0_PWM0) | \ 00423 PIN_MODE_ALTERNATE(GPIOB_PIN1_PWM1) | \ 00424 PIN_MODE_INPUT(GPIOB_PIN2) | \ 00425 PIN_MODE_ALTERNATE(GPIOB_SWO) | \ 00426 PIN_MODE_OUTPUT(GPIOB_PIN4) | \ 00427 PIN_MODE_OUTPUT(GPIOB_PIN5) | \ 00428 PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ 00429 PIN_MODE_ALTERNATE(GPIOB_PIN7) | \ 00430 PIN_MODE_ALTERNATE(GPIOB_PIN8_SCL) | \ 00431 PIN_MODE_ALTERNATE(GPIOB_PIN9_SDA) | \ 00432 PIN_MODE_INPUT(GPIOB_CLK_IN) | \ 00433 PIN_MODE_INPUT(GPIOB_PIN11) | \ 00434 PIN_MODE_INPUT(GPIOB_PIN12) | \ 00435 PIN_MODE_INPUT(GPIOB_PIN13) | \ 00436 PIN_MODE_OUTPUT(GPIOB_PIN14_PWM9) | \ 00437 PIN_MODE_OUTPUT(GPIOB_PIN15_PWM8)) 00438 #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0_PWM0) | \ 00439 PIN_OTYPE_PUSHPULL(GPIOB_PIN1_PWM1) | \ 00440 PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ 00441 PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \ 00442 PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ 00443 PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ 00444 PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ 00445 PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ 00446 PIN_OTYPE_OPENDRAIN(GPIOB_PIN8_SCL) | \ 00447 PIN_OTYPE_OPENDRAIN(GPIOB_PIN9_SDA) | \ 00448 PIN_OTYPE_PUSHPULL(GPIOB_CLK_IN) | \ 00449 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ 00450 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ 00451 PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ 00452 PIN_OTYPE_PUSHPULL(GPIOB_PIN14_PWM9) | \ 00453 PIN_OTYPE_PUSHPULL(GPIOB_PIN15_PWM8)) 00454 #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0_PWM0) | \ 00455 PIN_OSPEED_HIGH(GPIOB_PIN1_PWM1) | \ 00456 PIN_OSPEED_HIGH(GPIOB_PIN2) | \ 00457 PIN_OSPEED_HIGH(GPIOB_SWO) | \ 00458 PIN_OSPEED_HIGH(GPIOB_PIN4) | \ 00459 PIN_OSPEED_HIGH(GPIOB_PIN5) | \ 00460 PIN_OSPEED_HIGH(GPIOB_PIN6) | \ 00461 PIN_OSPEED_HIGH(GPIOB_PIN7) | \ 00462 PIN_OSPEED_HIGH(GPIOB_PIN8_SCL) | \ 00463 PIN_OSPEED_HIGH(GPIOB_PIN9_SDA) | \ 00464 PIN_OSPEED_HIGH(GPIOB_CLK_IN) | \ 00465 PIN_OSPEED_HIGH(GPIOB_PIN11) | \ 00466 PIN_OSPEED_HIGH(GPIOB_PIN12) | \ 00467 PIN_OSPEED_HIGH(GPIOB_PIN13) | \ 00468 PIN_OSPEED_HIGH(GPIOB_PIN14_PWM9) | \ 00469 PIN_OSPEED_HIGH(GPIOB_PIN15_PWM8)) 00470 #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_PIN0_PWM0) | \ 00471 PIN_PUPDR_FLOATING(GPIOB_PIN1_PWM1) | \ 00472 PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ 00473 PIN_PUPDR_FLOATING(GPIOB_SWO) | \ 00474 PIN_PUPDR_FLOATING(GPIOB_PIN4) | \ 00475 PIN_PUPDR_FLOATING(GPIOB_PIN5) | \ 00476 PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ 00477 PIN_PUPDR_FLOATING(GPIOB_PIN7) | \ 00478 PIN_PUPDR_FLOATING(GPIOB_PIN8_SCL) | \ 00479 PIN_PUPDR_FLOATING(GPIOB_PIN9_SDA) | \ 00480 PIN_PUPDR_PULLUP(GPIOB_CLK_IN) | \ 00481 PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ 00482 PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ 00483 PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ 00484 PIN_PUPDR_FLOATING(GPIOB_PIN14_PWM9) | \ 00485 PIN_PUPDR_FLOATING(GPIOB_PIN15_PWM8)) 00486 #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0_PWM0) | \ 00487 PIN_ODR_HIGH(GPIOB_PIN1_PWM1) | \ 00488 PIN_ODR_HIGH(GPIOB_PIN2) | \ 00489 PIN_ODR_HIGH(GPIOB_SWO) | \ 00490 PIN_ODR_LOW(GPIOB_PIN4) | \ 00491 PIN_ODR_LOW(GPIOB_PIN5) | \ 00492 PIN_ODR_HIGH(GPIOB_PIN6) | \ 00493 PIN_ODR_HIGH(GPIOB_PIN7) | \ 00494 PIN_ODR_HIGH(GPIOB_PIN8_SCL) | \ 00495 PIN_ODR_HIGH(GPIOB_PIN9_SDA) | \ 00496 PIN_ODR_HIGH(GPIOB_CLK_IN) | \ 00497 PIN_ODR_HIGH(GPIOB_PIN11) | \ 00498 PIN_ODR_HIGH(GPIOB_PIN12) | \ 00499 PIN_ODR_HIGH(GPIOB_PIN13) | \ 00500 PIN_ODR_HIGH(GPIOB_PIN14_PWM9) | \ 00501 PIN_ODR_HIGH(GPIOB_PIN15_PWM8)) 00502 #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0_PWM0, 2U) | \ 00503 PIN_AFIO_AF(GPIOB_PIN1_PWM1, 2U) | \ 00504 PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ 00505 PIN_AFIO_AF(GPIOB_SWO, 0U) | \ 00506 PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ 00507 PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ 00508 PIN_AFIO_AF(GPIOB_PIN6, 7U) | \ 00509 PIN_AFIO_AF(GPIOB_PIN7, 7U)) 00510 #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8_SCL, 4U) | \ 00511 PIN_AFIO_AF(GPIOB_PIN9_SDA, 4U) | \ 00512 PIN_AFIO_AF(GPIOB_CLK_IN, 0U) | \ 00513 PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ 00514 PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ 00515 PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ 00516 PIN_AFIO_AF(GPIOB_PIN14_PWM9, 0U) | \ 00517 PIN_AFIO_AF(GPIOB_PIN15_PWM8, 0U)) 00518 00519 /* 00520 * GPIOC setup: 00521 * 00522 * PC0 - OTG_FS_POWER_ON (output pushpull maximum). 00523 * PC1 - PIN1 (input pullup). 00524 * PC2 - PIN2 (input pullup). 00525 * PC3 - PDM_OUT (input pullup). 00526 * PC4 - PIN4 (input pullup). 00527 * PC5 - PIN5 (input pullup). 00528 * PC6 - PIN6 (input pullup). 00529 * PC7 - MCLK (alternate 6). 00530 * PC8 - PIN8 (input pullup). 00531 * PC9 - PIN9 (input pullup). 00532 * PC10 - SCLK (alternate 6). 00533 * PC11 - PIN11 (input pullup). 00534 * PC12 - SDIN (alternate 6). 00535 * PC13 - PIN13 (input pullup). 00536 * PC14 - PIN14 (input pullup). 00537 * PC15 - PIN15 (input pullup). 00538 */ 00539 #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_OTG_FS_POWER_ON) |\ 00540 PIN_MODE_INPUT(GPIOC_PIN1) | \ 00541 PIN_MODE_INPUT(GPIOC_PIN2) | \ 00542 PIN_MODE_INPUT(GPIOC_PDM_OUT) | \ 00543 PIN_MODE_INPUT(GPIOC_PIN4) | \ 00544 PIN_MODE_INPUT(GPIOC_PIN5) | \ 00545 PIN_MODE_INPUT(GPIOC_PIN6) | \ 00546 PIN_MODE_ALTERNATE(GPIOC_MCLK) | \ 00547 PIN_MODE_ALTERNATE(GPIOC_PIN8_PWM7) | \ 00548 PIN_MODE_ALTERNATE(GPIOC_PIN9_PWM6) | \ 00549 PIN_MODE_ALTERNATE(GPIOC_PIN10_SPI3_SCLK) | \ 00550 PIN_MODE_ALTERNATE(GPIOC_PIN11_SPI3_MISO) | \ 00551 PIN_MODE_ALTERNATE(GPIOC_PIN12_SPI3_MOSI) | \ 00552 PIN_MODE_INPUT(GPIOC_PIN13) | \ 00553 PIN_MODE_INPUT(GPIOC_PIN14) | \ 00554 PIN_MODE_INPUT(GPIOC_PIN15)) 00555 #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_OTG_FS_POWER_ON) |\ 00556 PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ 00557 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ 00558 PIN_OTYPE_PUSHPULL(GPIOC_PDM_OUT) | \ 00559 PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ 00560 PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ 00561 PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ 00562 PIN_OTYPE_PUSHPULL(GPIOC_MCLK) | \ 00563 PIN_OTYPE_PUSHPULL(GPIOC_PIN8_PWM7) | \ 00564 PIN_OTYPE_PUSHPULL(GPIOC_PIN9_PWM6) | \ 00565 PIN_OTYPE_PUSHPULL(GPIOC_PIN10_SPI3_SCLK) | \ 00566 PIN_OTYPE_PUSHPULL(GPIOC_PIN11_SPI3_MISO) | \ 00567 PIN_OTYPE_PUSHPULL(GPIOC_PIN12_SPI3_MOSI) | \ 00568 PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ 00569 PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ 00570 PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) 00571 #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_OTG_FS_POWER_ON) |\ 00572 PIN_OSPEED_HIGH(GPIOC_PIN1) | \ 00573 PIN_OSPEED_HIGH(GPIOC_PIN2) | \ 00574 PIN_OSPEED_HIGH(GPIOC_PDM_OUT) | \ 00575 PIN_OSPEED_HIGH(GPIOC_PIN4) | \ 00576 PIN_OSPEED_HIGH(GPIOC_PIN5) | \ 00577 PIN_OSPEED_HIGH(GPIOC_PIN6) | \ 00578 PIN_OSPEED_HIGH(GPIOC_MCLK) | \ 00579 PIN_OSPEED_HIGH(GPIOC_PIN8_PWM7) | \ 00580 PIN_OSPEED_HIGH(GPIOC_PIN9_PWM6) | \ 00581 PIN_OSPEED_HIGH(GPIOC_PIN10_SPI3_SCLK) | \ 00582 PIN_OSPEED_HIGH(GPIOC_PIN11_SPI3_MISO) | \ 00583 PIN_OSPEED_HIGH(GPIOC_PIN12_SPI3_MOSI) | \ 00584 PIN_OSPEED_HIGH(GPIOC_PIN13) | \ 00585 PIN_OSPEED_HIGH(GPIOC_PIN14) | \ 00586 PIN_OSPEED_HIGH(GPIOC_PIN15)) 00587 #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_OTG_FS_POWER_ON) |\ 00588 PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ 00589 PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ 00590 PIN_PUPDR_PULLUP(GPIOC_PDM_OUT) | \ 00591 PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ 00592 PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ 00593 PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ 00594 PIN_PUPDR_FLOATING(GPIOC_MCLK) | \ 00595 PIN_PUPDR_FLOATING(GPIOC_PIN8_PWM7) | \ 00596 PIN_PUPDR_FLOATING(GPIOC_PIN9_PWM6) | \ 00597 PIN_PUPDR_FLOATING(GPIOC_PIN10_SPI3_SCLK) | \ 00598 PIN_PUPDR_PULLUP(GPIOC_PIN11_SPI3_MISO) | \ 00599 PIN_PUPDR_FLOATING(GPIOC_PIN12_SPI3_MOSI) | \ 00600 PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ 00601 PIN_PUPDR_PULLUP(GPIOC_PIN14) | \ 00602 PIN_PUPDR_PULLUP(GPIOC_PIN15)) 00603 #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_OTG_FS_POWER_ON) | \ 00604 PIN_ODR_HIGH(GPIOC_PIN1) | \ 00605 PIN_ODR_HIGH(GPIOC_PIN2) | \ 00606 PIN_ODR_HIGH(GPIOC_PDM_OUT) | \ 00607 PIN_ODR_HIGH(GPIOC_PIN4) | \ 00608 PIN_ODR_HIGH(GPIOC_PIN5) | \ 00609 PIN_ODR_HIGH(GPIOC_PIN6) | \ 00610 PIN_ODR_HIGH(GPIOC_MCLK) | \ 00611 PIN_ODR_HIGH(GPIOC_PIN8_PWM7) | \ 00612 PIN_ODR_HIGH(GPIOC_PIN9_PWM6) | \ 00613 PIN_ODR_HIGH(GPIOC_PIN10_SPI3_SCLK) | \ 00614 PIN_ODR_HIGH(GPIOC_PIN11_SPI3_MISO) | \ 00615 PIN_ODR_HIGH(GPIOC_PIN12_SPI3_MOSI) | \ 00616 PIN_ODR_HIGH(GPIOC_PIN13) | \ 00617 PIN_ODR_HIGH(GPIOC_PIN14) | \ 00618 PIN_ODR_HIGH(GPIOC_PIN15)) 00619 #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_OTG_FS_POWER_ON, 0U) |\ 00620 PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ 00621 PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ 00622 PIN_AFIO_AF(GPIOC_PDM_OUT, 0U) | \ 00623 PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ 00624 PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ 00625 PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ 00626 PIN_AFIO_AF(GPIOC_MCLK, 6U)) 00627 #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8_PWM7, 3U) | \ 00628 PIN_AFIO_AF(GPIOC_PIN9_PWM6, 3U) | \ 00629 PIN_AFIO_AF(GPIOC_PIN10_SPI3_SCLK, 6U) | \ 00630 PIN_AFIO_AF(GPIOC_PIN11_SPI3_MISO, 6U) | \ 00631 PIN_AFIO_AF(GPIOC_PIN12_SPI3_MOSI, 6U) | \ 00632 PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ 00633 PIN_AFIO_AF(GPIOC_PIN14, 0U) | \ 00634 PIN_AFIO_AF(GPIOC_PIN15, 0U)) 00635 00636 /* 00637 * GPIOD setup: 00638 * 00639 * PD0 - PIN0 (input pullup). 00640 * PD1 - PIN1 (input pullup). 00641 * PD2 - PIN2 (input pullup). 00642 * PD3 - PIN3 (input pullup). 00643 * PD4 - RESET (output pushpull maximum). 00644 * PD5 - OVER_CURRENT (input floating). 00645 * PD6 - PIN6 (input pullup). 00646 * PD7 - PIN7 (input pullup). 00647 * PD8 - PIN8 (input pullup). 00648 * PD9 - PIN9 (input pullup). 00649 * PD10 - PIN10 (input pullup). 00650 * PD11 - PIN11 (input pullup). 00651 * PD12 - LED4 (output pushpull maximum). 00652 * PD13 - LED3 (output pushpull maximum). 00653 * PD14 - LED5 (output pushpull maximum). 00654 * PD15 - LED6 (output pushpull maximum). 00655 */ 00656 #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ 00657 PIN_MODE_INPUT(GPIOD_PIN1) | \ 00658 PIN_MODE_INPUT(GPIOD_PIN2) | \ 00659 PIN_MODE_INPUT(GPIOD_PIN3) | \ 00660 PIN_MODE_OUTPUT(GPIOD_RESET) | \ 00661 PIN_MODE_INPUT(GPIOD_OVER_CURRENT) | \ 00662 PIN_MODE_INPUT(GPIOD_PIN6) | \ 00663 PIN_MODE_INPUT(GPIOD_PIN7) | \ 00664 PIN_MODE_INPUT(GPIOD_PIN8) | \ 00665 PIN_MODE_INPUT(GPIOD_PIN9) | \ 00666 PIN_MODE_INPUT(GPIOD_PIN10) | \ 00667 PIN_MODE_INPUT(GPIOD_PIN11) | \ 00668 PIN_MODE_OUTPUT(GPIOD_PIN12_LED4) | \ 00669 PIN_MODE_OUTPUT(GPIOD_PIN13_LED3) | \ 00670 PIN_MODE_OUTPUT(GPIOD_PIN14_LED5) | \ 00671 PIN_MODE_OUTPUT(GPIOD_PIN15_LED6)) 00672 #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ 00673 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ 00674 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ 00675 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ 00676 PIN_OTYPE_PUSHPULL(GPIOD_RESET) | \ 00677 PIN_OTYPE_PUSHPULL(GPIOD_OVER_CURRENT) |\ 00678 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ 00679 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ 00680 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ 00681 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ 00682 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ 00683 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ 00684 PIN_OTYPE_PUSHPULL(GPIOD_PIN12_LED4) | \ 00685 PIN_OTYPE_PUSHPULL(GPIOD_PIN13_LED3) | \ 00686 PIN_OTYPE_PUSHPULL(GPIOD_PIN14_LED5) | \ 00687 PIN_OTYPE_PUSHPULL(GPIOD_PIN15_LED6)) 00688 #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ 00689 PIN_OSPEED_HIGH(GPIOD_PIN1) | \ 00690 PIN_OSPEED_HIGH(GPIOD_PIN2) | \ 00691 PIN_OSPEED_HIGH(GPIOD_PIN3) | \ 00692 PIN_OSPEED_HIGH(GPIOD_RESET) | \ 00693 PIN_OSPEED_HIGH(GPIOD_OVER_CURRENT) | \ 00694 PIN_OSPEED_HIGH(GPIOD_PIN6) | \ 00695 PIN_OSPEED_HIGH(GPIOD_PIN7) | \ 00696 PIN_OSPEED_HIGH(GPIOD_PIN8) | \ 00697 PIN_OSPEED_HIGH(GPIOD_PIN9) | \ 00698 PIN_OSPEED_HIGH(GPIOD_PIN10) | \ 00699 PIN_OSPEED_HIGH(GPIOD_PIN11) | \ 00700 PIN_OSPEED_HIGH(GPIOD_PIN12_LED4) | \ 00701 PIN_OSPEED_HIGH(GPIOD_PIN13_LED3) | \ 00702 PIN_OSPEED_HIGH(GPIOD_PIN14_LED5) | \ 00703 PIN_OSPEED_HIGH(GPIOD_PIN15_LED6)) 00704 #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ 00705 PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ 00706 PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ 00707 PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ 00708 PIN_PUPDR_FLOATING(GPIOD_RESET) | \ 00709 PIN_PUPDR_FLOATING(GPIOD_OVER_CURRENT) |\ 00710 PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ 00711 PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ 00712 PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ 00713 PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ 00714 PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ 00715 PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ 00716 PIN_PUPDR_FLOATING(GPIOD_PIN12_LED4) | \ 00717 PIN_PUPDR_FLOATING(GPIOD_PIN13_LED3) | \ 00718 PIN_PUPDR_FLOATING(GPIOD_PIN14_LED5) | \ 00719 PIN_PUPDR_FLOATING(GPIOD_PIN15_LED6)) 00720 #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ 00721 PIN_ODR_HIGH(GPIOD_PIN1) | \ 00722 PIN_ODR_HIGH(GPIOD_PIN2) | \ 00723 PIN_ODR_HIGH(GPIOD_PIN3) | \ 00724 PIN_ODR_HIGH(GPIOD_RESET) | \ 00725 PIN_ODR_HIGH(GPIOD_OVER_CURRENT) | \ 00726 PIN_ODR_HIGH(GPIOD_PIN6) | \ 00727 PIN_ODR_HIGH(GPIOD_PIN7) | \ 00728 PIN_ODR_HIGH(GPIOD_PIN8) | \ 00729 PIN_ODR_HIGH(GPIOD_PIN9) | \ 00730 PIN_ODR_HIGH(GPIOD_PIN10) | \ 00731 PIN_ODR_HIGH(GPIOD_PIN11) | \ 00732 PIN_ODR_LOW(GPIOD_PIN12_LED4) | \ 00733 PIN_ODR_LOW(GPIOD_PIN13_LED3) | \ 00734 PIN_ODR_LOW(GPIOD_PIN14_LED5) | \ 00735 PIN_ODR_LOW(GPIOD_PIN15_LED6)) 00736 #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ 00737 PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ 00738 PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ 00739 PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ 00740 PIN_AFIO_AF(GPIOD_RESET, 0U) | \ 00741 PIN_AFIO_AF(GPIOD_OVER_CURRENT, 0U) | \ 00742 PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ 00743 PIN_AFIO_AF(GPIOD_PIN7, 0U)) 00744 #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ 00745 PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ 00746 PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ 00747 PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ 00748 PIN_AFIO_AF(GPIOD_PIN12_LED4, 0U) | \ 00749 PIN_AFIO_AF(GPIOD_PIN13_LED3, 0U) | \ 00750 PIN_AFIO_AF(GPIOD_PIN14_LED5, 0U) | \ 00751 PIN_AFIO_AF(GPIOD_PIN15_LED6, 0U)) 00752 00753 /* 00754 * GPIOE setup: 00755 * 00756 * PE0 - INT1 (input floating). 00757 * PE1 - INT2 (input floating). 00758 * PE2 - PIN2 (input floating). 00759 * PE3 - CS_SPI (output pushpull maximum). 00760 * PE4 - PIN4 (input floating). 00761 * PE5 - PIN5 (input floating). 00762 * PE6 - PIN6 (input floating). 00763 * PE7 - PIN7 (input floating). 00764 * PE8 - PIN8 (input floating). 00765 * PE9 - PIN9 (input floating). 00766 * PE10 - PIN10 (input floating). 00767 * PE11 - PIN11 (input floating). 00768 * PE12 - PIN12 (input floating). 00769 * PE13 - PIN13 (input floating). 00770 * PE14 - PIN14 (input floating). 00771 * PE15 - PIN15 (input floating). 00772 */ 00773 #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_INT1) | \ 00774 PIN_MODE_INPUT(GPIOE_INT2) | \ 00775 PIN_MODE_INPUT(GPIOE_PIN2) | \ 00776 PIN_MODE_OUTPUT(GPIOE_CS_SPI) | \ 00777 PIN_MODE_INPUT(GPIOE_PIN4) | \ 00778 PIN_MODE_INPUT(GPIOE_PIN5) | \ 00779 PIN_MODE_INPUT(GPIOE_PIN6) | \ 00780 PIN_MODE_INPUT(GPIOE_PIN7) | \ 00781 PIN_MODE_INPUT(GPIOE_PIN8) | \ 00782 PIN_MODE_INPUT(GPIOE_PIN9) | \ 00783 PIN_MODE_INPUT(GPIOE_PIN10) | \ 00784 PIN_MODE_INPUT(GPIOE_PIN11) | \ 00785 PIN_MODE_INPUT(GPIOE_PIN12) | \ 00786 PIN_MODE_INPUT(GPIOE_PIN13) | \ 00787 PIN_MODE_INPUT(GPIOE_PIN14) | \ 00788 PIN_MODE_INPUT(GPIOE_PIN15)) 00789 #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_INT1) | \ 00790 PIN_OTYPE_PUSHPULL(GPIOE_INT2) | \ 00791 PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ 00792 PIN_OTYPE_PUSHPULL(GPIOE_CS_SPI) | \ 00793 PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ 00794 PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ 00795 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ 00796 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ 00797 PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ 00798 PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ 00799 PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ 00800 PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ 00801 PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ 00802 PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ 00803 PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ 00804 PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) 00805 #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_INT1) | \ 00806 PIN_OSPEED_HIGH(GPIOE_INT2) | \ 00807 PIN_OSPEED_HIGH(GPIOE_PIN2) | \ 00808 PIN_OSPEED_HIGH(GPIOE_CS_SPI) | \ 00809 PIN_OSPEED_HIGH(GPIOE_PIN4) | \ 00810 PIN_OSPEED_HIGH(GPIOE_PIN5) | \ 00811 PIN_OSPEED_HIGH(GPIOE_PIN6) | \ 00812 PIN_OSPEED_HIGH(GPIOE_PIN7) | \ 00813 PIN_OSPEED_HIGH(GPIOE_PIN8) | \ 00814 PIN_OSPEED_HIGH(GPIOE_PIN9) | \ 00815 PIN_OSPEED_HIGH(GPIOE_PIN10) | \ 00816 PIN_OSPEED_HIGH(GPIOE_PIN11) | \ 00817 PIN_OSPEED_HIGH(GPIOE_PIN12) | \ 00818 PIN_OSPEED_HIGH(GPIOE_PIN13) | \ 00819 PIN_OSPEED_HIGH(GPIOE_PIN14) | \ 00820 PIN_OSPEED_HIGH(GPIOE_PIN15)) 00821 #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_INT1) | \ 00822 PIN_PUPDR_FLOATING(GPIOE_INT2) | \ 00823 PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ 00824 PIN_PUPDR_FLOATING(GPIOE_CS_SPI) | \ 00825 PIN_PUPDR_FLOATING(GPIOE_PIN4) | \ 00826 PIN_PUPDR_FLOATING(GPIOE_PIN5) | \ 00827 PIN_PUPDR_FLOATING(GPIOE_PIN6) | \ 00828 PIN_PUPDR_FLOATING(GPIOE_PIN7) | \ 00829 PIN_PUPDR_FLOATING(GPIOE_PIN8) | \ 00830 PIN_PUPDR_FLOATING(GPIOE_PIN9) | \ 00831 PIN_PUPDR_FLOATING(GPIOE_PIN10) | \ 00832 PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ 00833 PIN_PUPDR_FLOATING(GPIOE_PIN12) | \ 00834 PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ 00835 PIN_PUPDR_FLOATING(GPIOE_PIN14) | \ 00836 PIN_PUPDR_FLOATING(GPIOE_PIN15)) 00837 #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_INT1) | \ 00838 PIN_ODR_HIGH(GPIOE_INT2) | \ 00839 PIN_ODR_HIGH(GPIOE_PIN2) | \ 00840 PIN_ODR_HIGH(GPIOE_CS_SPI) | \ 00841 PIN_ODR_HIGH(GPIOE_PIN4) | \ 00842 PIN_ODR_HIGH(GPIOE_PIN5) | \ 00843 PIN_ODR_HIGH(GPIOE_PIN6) | \ 00844 PIN_ODR_HIGH(GPIOE_PIN7) | \ 00845 PIN_ODR_HIGH(GPIOE_PIN8) | \ 00846 PIN_ODR_HIGH(GPIOE_PIN9) | \ 00847 PIN_ODR_HIGH(GPIOE_PIN10) | \ 00848 PIN_ODR_HIGH(GPIOE_PIN11) | \ 00849 PIN_ODR_HIGH(GPIOE_PIN12) | \ 00850 PIN_ODR_HIGH(GPIOE_PIN13) | \ 00851 PIN_ODR_HIGH(GPIOE_PIN14) | \ 00852 PIN_ODR_HIGH(GPIOE_PIN15)) 00853 #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_INT1, 0U) | \ 00854 PIN_AFIO_AF(GPIOE_INT2, 0U) | \ 00855 PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ 00856 PIN_AFIO_AF(GPIOE_CS_SPI, 0U) | \ 00857 PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ 00858 PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ 00859 PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ 00860 PIN_AFIO_AF(GPIOE_PIN7, 0U)) 00861 #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ 00862 PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ 00863 PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ 00864 PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ 00865 PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ 00866 PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ 00867 PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ 00868 PIN_AFIO_AF(GPIOE_PIN15, 0U)) 00869 00870 /* 00871 * GPIOF setup: 00872 * 00873 * PF0 - PIN0 (input floating). 00874 * PF1 - PIN1 (input floating). 00875 * PF2 - PIN2 (input floating). 00876 * PF3 - PIN3 (input floating). 00877 * PF4 - PIN4 (input floating). 00878 * PF5 - PIN5 (input floating). 00879 * PF6 - PIN6 (input floating). 00880 * PF7 - PIN7 (input floating). 00881 * PF8 - PIN8 (input floating). 00882 * PF9 - PIN9 (input floating). 00883 * PF10 - PIN10 (input floating). 00884 * PF11 - PIN11 (input floating). 00885 * PF12 - PIN12 (input floating). 00886 * PF13 - PIN13 (input floating). 00887 * PF14 - PIN14 (input floating). 00888 * PF15 - PIN15 (input floating). 00889 */ 00890 #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_PIN0) | \ 00891 PIN_MODE_INPUT(GPIOF_PIN1) | \ 00892 PIN_MODE_INPUT(GPIOF_PIN2) | \ 00893 PIN_MODE_INPUT(GPIOF_PIN3) | \ 00894 PIN_MODE_INPUT(GPIOF_PIN4) | \ 00895 PIN_MODE_INPUT(GPIOF_PIN5) | \ 00896 PIN_MODE_INPUT(GPIOF_PIN6) | \ 00897 PIN_MODE_INPUT(GPIOF_PIN7) | \ 00898 PIN_MODE_INPUT(GPIOF_PIN8) | \ 00899 PIN_MODE_INPUT(GPIOF_PIN9) | \ 00900 PIN_MODE_INPUT(GPIOF_PIN10) | \ 00901 PIN_MODE_INPUT(GPIOF_PIN11) | \ 00902 PIN_MODE_INPUT(GPIOF_PIN12) | \ 00903 PIN_MODE_INPUT(GPIOF_PIN13) | \ 00904 PIN_MODE_INPUT(GPIOF_PIN14) | \ 00905 PIN_MODE_INPUT(GPIOF_PIN15)) 00906 #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ 00907 PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ 00908 PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ 00909 PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ 00910 PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ 00911 PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ 00912 PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ 00913 PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ 00914 PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ 00915 PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ 00916 PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ 00917 PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ 00918 PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ 00919 PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ 00920 PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ 00921 PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) 00922 #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ 00923 PIN_OSPEED_HIGH(GPIOF_PIN1) | \ 00924 PIN_OSPEED_HIGH(GPIOF_PIN2) | \ 00925 PIN_OSPEED_HIGH(GPIOF_PIN3) | \ 00926 PIN_OSPEED_HIGH(GPIOF_PIN4) | \ 00927 PIN_OSPEED_HIGH(GPIOF_PIN5) | \ 00928 PIN_OSPEED_HIGH(GPIOF_PIN6) | \ 00929 PIN_OSPEED_HIGH(GPIOF_PIN7) | \ 00930 PIN_OSPEED_HIGH(GPIOF_PIN8) | \ 00931 PIN_OSPEED_HIGH(GPIOF_PIN9) | \ 00932 PIN_OSPEED_HIGH(GPIOF_PIN10) | \ 00933 PIN_OSPEED_HIGH(GPIOF_PIN11) | \ 00934 PIN_OSPEED_HIGH(GPIOF_PIN12) | \ 00935 PIN_OSPEED_HIGH(GPIOF_PIN13) | \ 00936 PIN_OSPEED_HIGH(GPIOF_PIN14) | \ 00937 PIN_OSPEED_HIGH(GPIOF_PIN15)) 00938 #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \ 00939 PIN_PUPDR_FLOATING(GPIOF_PIN1) | \ 00940 PIN_PUPDR_FLOATING(GPIOF_PIN2) | \ 00941 PIN_PUPDR_FLOATING(GPIOF_PIN3) | \ 00942 PIN_PUPDR_FLOATING(GPIOF_PIN4) | \ 00943 PIN_PUPDR_FLOATING(GPIOF_PIN5) | \ 00944 PIN_PUPDR_FLOATING(GPIOF_PIN6) | \ 00945 PIN_PUPDR_FLOATING(GPIOF_PIN7) | \ 00946 PIN_PUPDR_FLOATING(GPIOF_PIN8) | \ 00947 PIN_PUPDR_FLOATING(GPIOF_PIN9) | \ 00948 PIN_PUPDR_FLOATING(GPIOF_PIN10) | \ 00949 PIN_PUPDR_FLOATING(GPIOF_PIN11) | \ 00950 PIN_PUPDR_FLOATING(GPIOF_PIN12) | \ 00951 PIN_PUPDR_FLOATING(GPIOF_PIN13) | \ 00952 PIN_PUPDR_FLOATING(GPIOF_PIN14) | \ 00953 PIN_PUPDR_FLOATING(GPIOF_PIN15)) 00954 #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ 00955 PIN_ODR_HIGH(GPIOF_PIN1) | \ 00956 PIN_ODR_HIGH(GPIOF_PIN2) | \ 00957 PIN_ODR_HIGH(GPIOF_PIN3) | \ 00958 PIN_ODR_HIGH(GPIOF_PIN4) | \ 00959 PIN_ODR_HIGH(GPIOF_PIN5) | \ 00960 PIN_ODR_HIGH(GPIOF_PIN6) | \ 00961 PIN_ODR_HIGH(GPIOF_PIN7) | \ 00962 PIN_ODR_HIGH(GPIOF_PIN8) | \ 00963 PIN_ODR_HIGH(GPIOF_PIN9) | \ 00964 PIN_ODR_HIGH(GPIOF_PIN10) | \ 00965 PIN_ODR_HIGH(GPIOF_PIN11) | \ 00966 PIN_ODR_HIGH(GPIOF_PIN12) | \ 00967 PIN_ODR_HIGH(GPIOF_PIN13) | \ 00968 PIN_ODR_HIGH(GPIOF_PIN14) | \ 00969 PIN_ODR_HIGH(GPIOF_PIN15)) 00970 #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \ 00971 PIN_AFIO_AF(GPIOF_PIN1, 0U) | \ 00972 PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ 00973 PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ 00974 PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ 00975 PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ 00976 PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ 00977 PIN_AFIO_AF(GPIOF_PIN7, 0U)) 00978 #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ 00979 PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ 00980 PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ 00981 PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ 00982 PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ 00983 PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ 00984 PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ 00985 PIN_AFIO_AF(GPIOF_PIN15, 0U)) 00986 00987 /* 00988 * GPIOG setup: 00989 * 00990 * PG0 - PIN0 (input floating). 00991 * PG1 - PIN1 (input floating). 00992 * PG2 - PIN2 (input floating). 00993 * PG3 - PIN3 (input floating). 00994 * PG4 - PIN4 (input floating). 00995 * PG5 - PIN5 (input floating). 00996 * PG6 - PIN6 (input floating). 00997 * PG7 - PIN7 (input floating). 00998 * PG8 - PIN8 (input floating). 00999 * PG9 - PIN9 (input floating). 01000 * PG10 - PIN10 (input floating). 01001 * PG11 - PIN11 (input floating). 01002 * PG12 - PIN12 (input floating). 01003 * PG13 - PIN13 (input floating). 01004 * PG14 - PIN14 (input floating). 01005 * PG15 - PIN15 (input floating). 01006 */ 01007 #define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ 01008 PIN_MODE_INPUT(GPIOG_PIN1) | \ 01009 PIN_MODE_INPUT(GPIOG_PIN2) | \ 01010 PIN_MODE_INPUT(GPIOG_PIN3) | \ 01011 PIN_MODE_INPUT(GPIOG_PIN4) | \ 01012 PIN_MODE_INPUT(GPIOG_PIN5) | \ 01013 PIN_MODE_INPUT(GPIOG_PIN6) | \ 01014 PIN_MODE_INPUT(GPIOG_PIN7) | \ 01015 PIN_MODE_INPUT(GPIOG_PIN8) | \ 01016 PIN_MODE_INPUT(GPIOG_PIN9) | \ 01017 PIN_MODE_INPUT(GPIOG_PIN10) | \ 01018 PIN_MODE_INPUT(GPIOG_PIN11) | \ 01019 PIN_MODE_INPUT(GPIOG_PIN12) | \ 01020 PIN_MODE_INPUT(GPIOG_PIN13) | \ 01021 PIN_MODE_INPUT(GPIOG_PIN14) | \ 01022 PIN_MODE_INPUT(GPIOG_PIN15)) 01023 #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ 01024 PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ 01025 PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ 01026 PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ 01027 PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ 01028 PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ 01029 PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ 01030 PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ 01031 PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ 01032 PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ 01033 PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ 01034 PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ 01035 PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ 01036 PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ 01037 PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ 01038 PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) 01039 #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ 01040 PIN_OSPEED_HIGH(GPIOG_PIN1) | \ 01041 PIN_OSPEED_HIGH(GPIOG_PIN2) | \ 01042 PIN_OSPEED_HIGH(GPIOG_PIN3) | \ 01043 PIN_OSPEED_HIGH(GPIOG_PIN4) | \ 01044 PIN_OSPEED_HIGH(GPIOG_PIN5) | \ 01045 PIN_OSPEED_HIGH(GPIOG_PIN6) | \ 01046 PIN_OSPEED_HIGH(GPIOG_PIN7) | \ 01047 PIN_OSPEED_HIGH(GPIOG_PIN8) | \ 01048 PIN_OSPEED_HIGH(GPIOG_PIN9) | \ 01049 PIN_OSPEED_HIGH(GPIOG_PIN10) | \ 01050 PIN_OSPEED_HIGH(GPIOG_PIN11) | \ 01051 PIN_OSPEED_HIGH(GPIOG_PIN12) | \ 01052 PIN_OSPEED_HIGH(GPIOG_PIN13) | \ 01053 PIN_OSPEED_HIGH(GPIOG_PIN14) | \ 01054 PIN_OSPEED_HIGH(GPIOG_PIN15)) 01055 #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \ 01056 PIN_PUPDR_FLOATING(GPIOG_PIN1) | \ 01057 PIN_PUPDR_FLOATING(GPIOG_PIN2) | \ 01058 PIN_PUPDR_FLOATING(GPIOG_PIN3) | \ 01059 PIN_PUPDR_FLOATING(GPIOG_PIN4) | \ 01060 PIN_PUPDR_FLOATING(GPIOG_PIN5) | \ 01061 PIN_PUPDR_FLOATING(GPIOG_PIN6) | \ 01062 PIN_PUPDR_FLOATING(GPIOG_PIN7) | \ 01063 PIN_PUPDR_FLOATING(GPIOG_PIN8) | \ 01064 PIN_PUPDR_FLOATING(GPIOG_PIN9) | \ 01065 PIN_PUPDR_FLOATING(GPIOG_PIN10) | \ 01066 PIN_PUPDR_FLOATING(GPIOG_PIN11) | \ 01067 PIN_PUPDR_FLOATING(GPIOG_PIN12) | \ 01068 PIN_PUPDR_FLOATING(GPIOG_PIN13) | \ 01069 PIN_PUPDR_FLOATING(GPIOG_PIN14) | \ 01070 PIN_PUPDR_FLOATING(GPIOG_PIN15)) 01071 #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ 01072 PIN_ODR_HIGH(GPIOG_PIN1) | \ 01073 PIN_ODR_HIGH(GPIOG_PIN2) | \ 01074 PIN_ODR_HIGH(GPIOG_PIN3) | \ 01075 PIN_ODR_HIGH(GPIOG_PIN4) | \ 01076 PIN_ODR_HIGH(GPIOG_PIN5) | \ 01077 PIN_ODR_HIGH(GPIOG_PIN6) | \ 01078 PIN_ODR_HIGH(GPIOG_PIN7) | \ 01079 PIN_ODR_HIGH(GPIOG_PIN8) | \ 01080 PIN_ODR_HIGH(GPIOG_PIN9) | \ 01081 PIN_ODR_HIGH(GPIOG_PIN10) | \ 01082 PIN_ODR_HIGH(GPIOG_PIN11) | \ 01083 PIN_ODR_HIGH(GPIOG_PIN12) | \ 01084 PIN_ODR_HIGH(GPIOG_PIN13) | \ 01085 PIN_ODR_HIGH(GPIOG_PIN14) | \ 01086 PIN_ODR_HIGH(GPIOG_PIN15)) 01087 #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \ 01088 PIN_AFIO_AF(GPIOG_PIN1, 0U) | \ 01089 PIN_AFIO_AF(GPIOG_PIN2, 0U) | \ 01090 PIN_AFIO_AF(GPIOG_PIN3, 0U) | \ 01091 PIN_AFIO_AF(GPIOG_PIN4, 0U) | \ 01092 PIN_AFIO_AF(GPIOG_PIN5, 0U) | \ 01093 PIN_AFIO_AF(GPIOG_PIN6, 0U) | \ 01094 PIN_AFIO_AF(GPIOG_PIN7, 0U)) 01095 #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \ 01096 PIN_AFIO_AF(GPIOG_PIN9, 0U) | \ 01097 PIN_AFIO_AF(GPIOG_PIN10, 0U) | \ 01098 PIN_AFIO_AF(GPIOG_PIN11, 0U) | \ 01099 PIN_AFIO_AF(GPIOG_PIN12, 0U) | \ 01100 PIN_AFIO_AF(GPIOG_PIN13, 0U) | \ 01101 PIN_AFIO_AF(GPIOG_PIN14, 0U) | \ 01102 PIN_AFIO_AF(GPIOG_PIN15, 0U)) 01103 01104 /* 01105 * GPIOH setup: 01106 * 01107 * PH0 - OSC_IN (input floating). 01108 * PH1 - OSC_OUT (input floating). 01109 * PH2 - PIN2 (input floating). 01110 * PH3 - PIN3 (input floating). 01111 * PH4 - PIN4 (input floating). 01112 * PH5 - PIN5 (input floating). 01113 * PH6 - PIN6 (input floating). 01114 * PH7 - PIN7 (input floating). 01115 * PH8 - PIN8 (input floating). 01116 * PH9 - PIN9 (input floating). 01117 * PH10 - PIN10 (input floating). 01118 * PH11 - PIN11 (input floating). 01119 * PH12 - PIN12 (input floating). 01120 * PH13 - PIN13 (input floating). 01121 * PH14 - PIN14 (input floating). 01122 * PH15 - PIN15 (input floating). 01123 */ 01124 #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \ 01125 PIN_MODE_INPUT(GPIOH_OSC_OUT) | \ 01126 PIN_MODE_INPUT(GPIOH_PIN2) | \ 01127 PIN_MODE_INPUT(GPIOH_PIN3) | \ 01128 PIN_MODE_INPUT(GPIOH_PIN4) | \ 01129 PIN_MODE_INPUT(GPIOH_PIN5) | \ 01130 PIN_MODE_INPUT(GPIOH_PIN6) | \ 01131 PIN_MODE_INPUT(GPIOH_PIN7) | \ 01132 PIN_MODE_INPUT(GPIOH_PIN8) | \ 01133 PIN_MODE_INPUT(GPIOH_PIN9) | \ 01134 PIN_MODE_INPUT(GPIOH_PIN10) | \ 01135 PIN_MODE_INPUT(GPIOH_PIN11) | \ 01136 PIN_MODE_INPUT(GPIOH_PIN12) | \ 01137 PIN_MODE_INPUT(GPIOH_PIN13) | \ 01138 PIN_MODE_INPUT(GPIOH_PIN14) | \ 01139 PIN_MODE_INPUT(GPIOH_PIN15)) 01140 #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \ 01141 PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \ 01142 PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ 01143 PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ 01144 PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ 01145 PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ 01146 PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ 01147 PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ 01148 PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ 01149 PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ 01150 PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ 01151 PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ 01152 PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ 01153 PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ 01154 PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ 01155 PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) 01156 #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ 01157 PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ 01158 PIN_OSPEED_HIGH(GPIOH_PIN2) | \ 01159 PIN_OSPEED_HIGH(GPIOH_PIN3) | \ 01160 PIN_OSPEED_HIGH(GPIOH_PIN4) | \ 01161 PIN_OSPEED_HIGH(GPIOH_PIN5) | \ 01162 PIN_OSPEED_HIGH(GPIOH_PIN6) | \ 01163 PIN_OSPEED_HIGH(GPIOH_PIN7) | \ 01164 PIN_OSPEED_HIGH(GPIOH_PIN8) | \ 01165 PIN_OSPEED_HIGH(GPIOH_PIN9) | \ 01166 PIN_OSPEED_HIGH(GPIOH_PIN10) | \ 01167 PIN_OSPEED_HIGH(GPIOH_PIN11) | \ 01168 PIN_OSPEED_HIGH(GPIOH_PIN12) | \ 01169 PIN_OSPEED_HIGH(GPIOH_PIN13) | \ 01170 PIN_OSPEED_HIGH(GPIOH_PIN14) | \ 01171 PIN_OSPEED_HIGH(GPIOH_PIN15)) 01172 #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ 01173 PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ 01174 PIN_PUPDR_FLOATING(GPIOH_PIN2) | \ 01175 PIN_PUPDR_FLOATING(GPIOH_PIN3) | \ 01176 PIN_PUPDR_FLOATING(GPIOH_PIN4) | \ 01177 PIN_PUPDR_FLOATING(GPIOH_PIN5) | \ 01178 PIN_PUPDR_FLOATING(GPIOH_PIN6) | \ 01179 PIN_PUPDR_FLOATING(GPIOH_PIN7) | \ 01180 PIN_PUPDR_FLOATING(GPIOH_PIN8) | \ 01181 PIN_PUPDR_FLOATING(GPIOH_PIN9) | \ 01182 PIN_PUPDR_FLOATING(GPIOH_PIN10) | \ 01183 PIN_PUPDR_FLOATING(GPIOH_PIN11) | \ 01184 PIN_PUPDR_FLOATING(GPIOH_PIN12) | \ 01185 PIN_PUPDR_FLOATING(GPIOH_PIN13) | \ 01186 PIN_PUPDR_FLOATING(GPIOH_PIN14) | \ 01187 PIN_PUPDR_FLOATING(GPIOH_PIN15)) 01188 #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \ 01189 PIN_ODR_HIGH(GPIOH_OSC_OUT) | \ 01190 PIN_ODR_HIGH(GPIOH_PIN2) | \ 01191 PIN_ODR_HIGH(GPIOH_PIN3) | \ 01192 PIN_ODR_HIGH(GPIOH_PIN4) | \ 01193 PIN_ODR_HIGH(GPIOH_PIN5) | \ 01194 PIN_ODR_HIGH(GPIOH_PIN6) | \ 01195 PIN_ODR_HIGH(GPIOH_PIN7) | \ 01196 PIN_ODR_HIGH(GPIOH_PIN8) | \ 01197 PIN_ODR_HIGH(GPIOH_PIN9) | \ 01198 PIN_ODR_HIGH(GPIOH_PIN10) | \ 01199 PIN_ODR_HIGH(GPIOH_PIN11) | \ 01200 PIN_ODR_HIGH(GPIOH_PIN12) | \ 01201 PIN_ODR_HIGH(GPIOH_PIN13) | \ 01202 PIN_ODR_HIGH(GPIOH_PIN14) | \ 01203 PIN_ODR_HIGH(GPIOH_PIN15)) 01204 #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \ 01205 PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \ 01206 PIN_AFIO_AF(GPIOH_PIN2, 0U) | \ 01207 PIN_AFIO_AF(GPIOH_PIN3, 0U) | \ 01208 PIN_AFIO_AF(GPIOH_PIN4, 0U) | \ 01209 PIN_AFIO_AF(GPIOH_PIN5, 0U) | \ 01210 PIN_AFIO_AF(GPIOH_PIN6, 0U) | \ 01211 PIN_AFIO_AF(GPIOH_PIN7, 0U)) 01212 #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \ 01213 PIN_AFIO_AF(GPIOH_PIN9, 0U) | \ 01214 PIN_AFIO_AF(GPIOH_PIN10, 0U) | \ 01215 PIN_AFIO_AF(GPIOH_PIN11, 0U) | \ 01216 PIN_AFIO_AF(GPIOH_PIN12, 0U) | \ 01217 PIN_AFIO_AF(GPIOH_PIN13, 0U) | \ 01218 PIN_AFIO_AF(GPIOH_PIN14, 0U) | \ 01219 PIN_AFIO_AF(GPIOH_PIN15, 0U)) 01220 01221 /* 01222 * GPIOI setup: 01223 * 01224 * PI0 - PIN0 (input floating). 01225 * PI1 - PIN1 (input floating). 01226 * PI2 - PIN2 (input floating). 01227 * PI3 - PIN3 (input floating). 01228 * PI4 - PIN4 (input floating). 01229 * PI5 - PIN5 (input floating). 01230 * PI6 - PIN6 (input floating). 01231 * PI7 - PIN7 (input floating). 01232 * PI8 - PIN8 (input floating). 01233 * PI9 - PIN9 (input floating). 01234 * PI10 - PIN10 (input floating). 01235 * PI11 - PIN11 (input floating). 01236 * PI12 - PIN12 (input floating). 01237 * PI13 - PIN13 (input floating). 01238 * PI14 - PIN14 (input floating). 01239 * PI15 - PIN15 (input floating). 01240 */ 01241 #define VAL_GPIOI_MODER (PIN_MODE_INPUT(GPIOI_PIN0) | \ 01242 PIN_MODE_INPUT(GPIOI_PIN1) | \ 01243 PIN_MODE_INPUT(GPIOI_PIN2) | \ 01244 PIN_MODE_INPUT(GPIOI_PIN3) | \ 01245 PIN_MODE_INPUT(GPIOI_PIN4) | \ 01246 PIN_MODE_INPUT(GPIOI_PIN5) | \ 01247 PIN_MODE_INPUT(GPIOI_PIN6) | \ 01248 PIN_MODE_INPUT(GPIOI_PIN7) | \ 01249 PIN_MODE_INPUT(GPIOI_PIN8) | \ 01250 PIN_MODE_INPUT(GPIOI_PIN9) | \ 01251 PIN_MODE_INPUT(GPIOI_PIN10) | \ 01252 PIN_MODE_INPUT(GPIOI_PIN11) | \ 01253 PIN_MODE_INPUT(GPIOI_PIN12) | \ 01254 PIN_MODE_INPUT(GPIOI_PIN13) | \ 01255 PIN_MODE_INPUT(GPIOI_PIN14) | \ 01256 PIN_MODE_INPUT(GPIOI_PIN15)) 01257 #define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \ 01258 PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \ 01259 PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \ 01260 PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \ 01261 PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \ 01262 PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \ 01263 PIN_OTYPE_PUSHPULL(GPIOI_PIN6) | \ 01264 PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \ 01265 PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \ 01266 PIN_OTYPE_PUSHPULL(GPIOI_PIN9) | \ 01267 PIN_OTYPE_PUSHPULL(GPIOI_PIN10) | \ 01268 PIN_OTYPE_PUSHPULL(GPIOI_PIN11) | \ 01269 PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \ 01270 PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ 01271 PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ 01272 PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) 01273 #define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \ 01274 PIN_OSPEED_HIGH(GPIOI_PIN1) | \ 01275 PIN_OSPEED_HIGH(GPIOI_PIN2) | \ 01276 PIN_OSPEED_HIGH(GPIOI_PIN3) | \ 01277 PIN_OSPEED_HIGH(GPIOI_PIN4) | \ 01278 PIN_OSPEED_HIGH(GPIOI_PIN5) | \ 01279 PIN_OSPEED_HIGH(GPIOI_PIN6) | \ 01280 PIN_OSPEED_HIGH(GPIOI_PIN7) | \ 01281 PIN_OSPEED_HIGH(GPIOI_PIN8) | \ 01282 PIN_OSPEED_HIGH(GPIOI_PIN9) | \ 01283 PIN_OSPEED_HIGH(GPIOI_PIN10) | \ 01284 PIN_OSPEED_HIGH(GPIOI_PIN11) | \ 01285 PIN_OSPEED_HIGH(GPIOI_PIN12) | \ 01286 PIN_OSPEED_HIGH(GPIOI_PIN13) | \ 01287 PIN_OSPEED_HIGH(GPIOI_PIN14) | \ 01288 PIN_OSPEED_HIGH(GPIOI_PIN15)) 01289 #define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \ 01290 PIN_PUPDR_FLOATING(GPIOI_PIN1) | \ 01291 PIN_PUPDR_FLOATING(GPIOI_PIN2) | \ 01292 PIN_PUPDR_FLOATING(GPIOI_PIN3) | \ 01293 PIN_PUPDR_FLOATING(GPIOI_PIN4) | \ 01294 PIN_PUPDR_FLOATING(GPIOI_PIN5) | \ 01295 PIN_PUPDR_FLOATING(GPIOI_PIN6) | \ 01296 PIN_PUPDR_FLOATING(GPIOI_PIN7) | \ 01297 PIN_PUPDR_FLOATING(GPIOI_PIN8) | \ 01298 PIN_PUPDR_FLOATING(GPIOI_PIN9) | \ 01299 PIN_PUPDR_FLOATING(GPIOI_PIN10) | \ 01300 PIN_PUPDR_FLOATING(GPIOI_PIN11) | \ 01301 PIN_PUPDR_FLOATING(GPIOI_PIN12) | \ 01302 PIN_PUPDR_FLOATING(GPIOI_PIN13) | \ 01303 PIN_PUPDR_FLOATING(GPIOI_PIN14) | \ 01304 PIN_PUPDR_FLOATING(GPIOI_PIN15)) 01305 #define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_PIN0) | \ 01306 PIN_ODR_HIGH(GPIOI_PIN1) | \ 01307 PIN_ODR_HIGH(GPIOI_PIN2) | \ 01308 PIN_ODR_HIGH(GPIOI_PIN3) | \ 01309 PIN_ODR_HIGH(GPIOI_PIN4) | \ 01310 PIN_ODR_HIGH(GPIOI_PIN5) | \ 01311 PIN_ODR_HIGH(GPIOI_PIN6) | \ 01312 PIN_ODR_HIGH(GPIOI_PIN7) | \ 01313 PIN_ODR_HIGH(GPIOI_PIN8) | \ 01314 PIN_ODR_HIGH(GPIOI_PIN9) | \ 01315 PIN_ODR_HIGH(GPIOI_PIN10) | \ 01316 PIN_ODR_HIGH(GPIOI_PIN11) | \ 01317 PIN_ODR_HIGH(GPIOI_PIN12) | \ 01318 PIN_ODR_HIGH(GPIOI_PIN13) | \ 01319 PIN_ODR_HIGH(GPIOI_PIN14) | \ 01320 PIN_ODR_HIGH(GPIOI_PIN15)) 01321 #define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0U) | \ 01322 PIN_AFIO_AF(GPIOI_PIN1, 0U) | \ 01323 PIN_AFIO_AF(GPIOI_PIN2, 0U) | \ 01324 PIN_AFIO_AF(GPIOI_PIN3, 0U) | \ 01325 PIN_AFIO_AF(GPIOI_PIN4, 0U) | \ 01326 PIN_AFIO_AF(GPIOI_PIN5, 0U) | \ 01327 PIN_AFIO_AF(GPIOI_PIN6, 0U) | \ 01328 PIN_AFIO_AF(GPIOI_PIN7, 0U)) 01329 #define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0U) | \ 01330 PIN_AFIO_AF(GPIOI_PIN9, 0U) | \ 01331 PIN_AFIO_AF(GPIOI_PIN10, 0U) | \ 01332 PIN_AFIO_AF(GPIOI_PIN11, 0U) | \ 01333 PIN_AFIO_AF(GPIOI_PIN12, 0U) | \ 01334 PIN_AFIO_AF(GPIOI_PIN13, 0U) | \ 01335 PIN_AFIO_AF(GPIOI_PIN14, 0U) | \ 01336 PIN_AFIO_AF(GPIOI_PIN15, 0U)) 01337 01338 01339 #if !defined(_FROM_ASM_) 01340 #ifdef __cplusplus 01341 extern "C" { 01342 #endif 01343 void boardInit(void); 01344 #ifdef __cplusplus 01345 } 01346 #endif 01347 #endif /* _FROM_ASM_ */ 01348 01349 #endif /* BOARD_H */