/* ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing GPIOE_PINrmissions and limitations under the License. */ /* * This file has been automatically generated using ChibiStudio board * generator plugin. Do not edit manually. */ #ifndef BOARD_H #define BOARD_H /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ /* * Setup for STMicroelectronics STM32F4-Discovery board. */ /* * Board identifier. */ #define BOARD_ST_STM32F4_DISCOVERY #define BOARD_NAME "Black STM32F407ZG Board" /* * Board oscillators-related settings. */ #if !defined(STM32_LSECLK) #define STM32_LSECLK 32768U #endif #if !defined(STM32_HSECLK) #define STM32_HSECLK 8000000U #endif /* * Board voltages. * Required for performance limits calculation. */ #define STM32_VDD 330U /* * MCU type as defined in the ST header. */ #define STM32F407xx /* * IO pins assignments. */ #define GPIOA_PIN0 0U #define GPIOA_PIN1 1U #define GPIOA_PIN2 2U #define GPIOA_PIN3 3U #define GPIOA_PIN4 4U #define GPIOA_PIN5 5U #define GPIOA_PIN6 6U #define GPIOA_PIN7 7U #define GPIOA_PIN8 8U #define GPIOA_PIN9 9U #define GPIOA_PIN10 10U #define GPIOA_PIN11 11U #define GPIOA_PIN12 12U #define GPIOA_PIN13 13U #define GPIOA_PIN14 14U #define GPIOA_PIN15 15U #define GPIOB_PIN0 0U #define GPIOB_PIN1 1U #define GPIOB_PIN2 2U #define GPIOB_PIN3 3U #define GPIOB_PIN4 4U #define GPIOB_PIN5 5U #define GPIOB_PIN6 6U #define GPIOB_PIN7 7U #define GPIOB_PIN8 8U #define GPIOB_PIN9 9U #define GPIOB_PIN10 10U #define GPIOB_PIN11 11U #define GPIOB_PIN12 12U #define GPIOB_PIN13 13U #define GPIOB_PIN14 14U #define GPIOB_PIN15 15U #define GPIOC_PIN0 0U #define GPIOC_PIN1 1U #define GPIOC_PIN2 2U #define GPIOC_PIN3 3U #define GPIOC_PIN4 4U #define GPIOC_PIN5 5U #define GPIOC_PIN6 6U #define GPIOC_PIN7 7U #define GPIOC_PIN8 8U #define GPIOC_PIN9 9U #define GPIOC_PIN10 10U #define GPIOC_PIN11 11U #define GPIOC_PIN12 12U #define GPIOC_PIN13 13U #define GPIOC_PIN14 14U #define GPIOC_PIN15 15U #define GPIOD_PIN0 0U #define GPIOD_PIN1 1U #define GPIOD_PIN2 2U #define GPIOD_PIN3 3U #define GPIOD_PIN4 4U #define GPIOD_PIN5 5U #define GPIOD_PIN6 6U #define GPIOD_PIN7 7U #define GPIOD_PIN8 8U #define GPIOD_PIN9 9U #define GPIOD_PIN10 10U #define GPIOD_PIN11 11U #define GPIOD_PIN12 12U #define GPIOD_PIN13 13U #define GPIOD_PIN14 14U #define GPIOD_PIN15 15U #define GPIOE_PIN0 0U #define GPIOE_PIN1 1U #define GPIOE_PIN2 2U #define GPIOE_PIN3 3U #define GPIOE_PIN4 4U #define GPIOE_PIN5 5U #define GPIOE_PIN6 6U #define GPIOE_PIN7 7U #define GPIOE_PIN8 8U #define GPIOE_PIN9 9U #define GPIOE_PIN10 10U #define GPIOE_PIN11 11U #define GPIOE_PIN12 12U #define GPIOE_PIN13 13U #define GPIOE_PIN14 14U #define GPIOE_PIN15 15U #define GPIOF_PIN0 0U #define GPIOF_PIN1 1U #define GPIOF_PIN2 2U #define GPIOF_PIN3 3U #define GPIOF_PIN4 4U #define GPIOF_PIN5 5U #define GPIOF_PIN6 6U #define GPIOF_PIN7 7U #define GPIOF_PIN8 8U #define GPIOF_PIN9 9U #define GPIOF_PIN10 10U #define GPIOF_PIN11 11U #define GPIOF_PIN12 12U #define GPIOF_PIN13 13U #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U #define GPIOG_PIN0 0U #define GPIOG_PIN1 1U #define GPIOG_PIN2 2U #define GPIOG_PIN3 3U #define GPIOG_PIN4 4U #define GPIOG_PIN5 5U #define GPIOG_PIN6 6U #define GPIOG_PIN7 7U #define GPIOG_PIN8 8U #define GPIOG_PIN9 9U #define GPIOG_PIN10 10U #define GPIOG_PIN11 11U #define GPIOG_PIN12 12U #define GPIOG_PIN13 13U #define GPIOG_PIN14 14U #define GPIOG_PIN15 15U #define GPIOH_PIN0 0U #define GPIOH_PIN1 1U #define GPIOH_PIN2 2U #define GPIOH_PIN3 3U #define GPIOH_PIN4 4U #define GPIOH_PIN5 5U #define GPIOH_PIN6 6U #define GPIOH_PIN7 7U #define GPIOH_PIN8 8U #define GPIOH_PIN9 9U #define GPIOH_PIN10 10U #define GPIOH_PIN11 11U #define GPIOH_PIN12 12U #define GPIOH_PIN13 13U #define GPIOH_PIN14 14U #define GPIOH_PIN15 15U /* * Board-integrated GPIOE_PINripherial */ /* User-defined button */ #define WAKE_UP GPIOA_PIN0 #define WAKE_UP_PORT GPIOA #define KEY0 GPIOE_PIN4 #define KEY1 GPIOE_PIN3 #define KEY0_PORT GPIOE #define KEY1_PORT GPIOE /* Custom LED indicator */ #define LED0 GPIOF_PIN9 #define LED1 GPIOF_PIN10 #define LED0_PORT GPIOF #define LED1_PORT GPIOF /* RELAY Control */ #define RELAY0 GPIOB_PIN8 #define RELAY1 GPIOB_PIN9 #define RELAY0_PORT GPIOB #define RELAY1_PORT GPIOB /* FLASH - W25Q16 (16 Mbit / 2 Mbyte / 2097152 byte) */ #define SPI1_SCK GPIOB_PIN3 #define SPI1_MISO GPIOB_PIN4 #define SPI1_MOSI GPIOB_PIN5 #define F_CS GPIOB_PIN14 /* NRF2401 wireless module interface */ #define NRF_CE GPIOG_PIN6 #define NRF_CS GPIOG_PIN7 #define NRF_IRQ GPIOG_PIN8 #define SPI1_SCK GPIOB_PIN3 #define SPI1_MISO GPIOB_PIN4 #define SPI1_MOSI GPIOB_PIN5 /* TF uSD memory card holder */ #define SDIO_D0 GPIOC_PIN8 #define SDIO_D1 GPIOC_PIN9 #define SDIO_D2 GPIOC_PIN10 #define SDIO_D3 GPIOC_PIN11 #define SDIO_SCK GPIOC_PIN12 #define SDIO_CMD GPIOD_PIN2 /* STM32 - USB Slave interface */ #define USB_DM GPIOA_PIN11 #define USB_DP GPIOA_PIN12 /* JTAG/SWD debug interface */ #define TDO GPIOB_PIN3 #define TRST GPIOB_PIN4 #define TMS GPIOA_PIN13 #define TCK GPIOA_PIN14 #define TDI GPIOA_PIN15 /* ISP Serial interface */ #define TXD1 GPIOA_PIN9 #define RXD1 GPIOA_PIN10 /* SDRAM memory module */ #define FSMC_D0 GPIOD_PIN14 #define FSMC_D1 GPIOD_PIN15 #define FSMC_D2 GPIOD_PIN0 #define FSMC_D3 GPIOD_PIN1 #define FSMC_D4 GPIOE_PIN7 #define FSMC_D5 GPIOE_PIN8 #define FSMC_D6 GPIOE_PIN9 #define FSMC_D7 GPIOE_PIN10 #define FSMC_D8 GPIOE_PIN11 #define FSMC_D9 GPIOE_PIN12 #define FSMC_D10 GPIOE_PIN13 #define FSMC_D11 GPIOE_PIN14 #define FSMC_D12 GPIOE_PIN15 #define FSMC_D13 GPIOD_PIN8 #define FSMC_D14 GPIOD_PIN9 #define FSMC_D15 GPIOD_PIN10 #define FSMC_A0 GPIOF_PIN0 #define FSMC_A1 GPIOF_PIN1 #define FSMC_A2 GPIOF_PIN2 #define FSMC_A3 GPIOF_PIN3 #define FSMC_A4 GPIOF_PIN4 #define FSMC_A5 GPIOF_PIN5 #define FSMC_A6 GPIOF_PIN12 #define FSMC_A7 GPIOF_PIN13 #define FSMC_A8 GPIOF_PIN14 #define FSMC_A9 GPIOF_PIN15 #define FSMC_A10 GPIOG_PIN0 #define FSMC_A11 GPIOG_PIN1 #define FSMC_A12 GPIOG_PIN2 #define FSMC_A13 GPIOG_PIN3 #define FSMC_A14 GPIOG_PIN4 #define FSMC_A15 GPIOG_PIN5 #define FSMC_A16 GPIOD_PIN11 #define FSMC_A17 GPIOD_PIN12 #define FSMC_A18 GPIOD_PIN13 #define FSMC_NE3 GPIOG_PIN10 #define FSMC_NWE GPIOD_PIN5 #define FSMC_NOE GPIOD_PIN4 #define FSMC_NBL0 GPIOE_PIN0 #define FSMC_NBL1 GPIOE_PIN1 /* TFT LCD interface */ // J6_1 GND // J6_2 RST #define J6_3 GPIOD_PIN10 #define J6_4 GPIOD_PIN9 #define J6_5 GPIOD_PIN8 #define J6_6 GPIOE_PIN15 #define J6_7 GPIOE_PIN14 #define J6_8 GPIOE_PIN13 #define J6_9 GPIOE_PIN12 #define J6_10 GPIOE_PIN11 #define J6_11 GPIOE_PIN10 #define J6_12 GPIOE_PIN9 #define J6_13 GPIOE_PIN8 #define J6_14 GPIOE_PIN7 #define J6_15 GPIOD_PIN1 #define J6_16 GPIOD_PIN0 #define J6_17 GPIOD_PIN15 #define J6_18 GPIOD_PIN14 #define J6_19 GPIOD_PIN4 #define J6_20 GPIOD_PIN5 #define J6_21 GPIOF_PIN12 #define J6_22 GPIOG_PIN12 #define J6_23 GPIOB_PIN0 #define J6_24 GPIOC_PIN13 #define J6_25 GPIOF_PIN11 #define J6_26 GPIOB_PIN2 #define J6_27 GPIOB_PIN1 // J6_28 LCD_BL // J6_29 NC // J6_30 GND // J6_31 +3.3V // J6_32 GND // FSMC_D0 - FSMC_D15 // FSMC_A6 // FSMC_NOE // FSMC_NWE #define FSMC_NE4 GPIOG_PIN12 #define LCD_BL GPIOB_PIN15 // Soft SPI #define T_MOSI GPIOF_PIN11 #define T_MISO GPIOB_PIN2 #define T_SCK GPIOB_PIN0 #define T_CS GPIOC_PIN13 #define T_PEN GPIOB_PIN1 /* System available I/O external interface */ #define J2_1 GPIOE_PIN1 #define J2_2 GPIOE_PIN0 #define J2_3 GPIOE_PIN3 #define J2_4 GPIOE_PIN2 #define J2_5 GPIOE_PIN5 #define J2_6 GPIOE_PIN4 #define J2_7 GPIOC_PIN13 #define J2_8 GPIOE_PIN6 #define J2_9 GPIOF_PIN1 #define J2_10 GPIOF_PIN0 #define J2_11 GPIOF_PIN3 #define J2_12 GPIOF_PIN2 #define J2_13 GPIOF_PIN5 #define J2_14 GPIOF_PIN4 #define J2_15 GPIOF_PIN7 #define J2_16 GPIOF_PIN6 #define J2_17 GPIOF_PIN9 #define J2_18 GPIOF_PIN8 #define J2_19 GPIOC_PIN0 #define J2_20 GPIOF_PIN10 #define J2_21 GPIOC_PIN2 #define J2_22 GPIOC_PIN3 #define J2_23 GPIOA_PIN0 #define J2_24 GPIOC_PIN3 #define J2_25 GPIOA_PIN2 #define J2_26 GPIOA_PIN1 #define J2_27 GPIOA_PIN4 #define J2_28 GPIOA_PIN3 #define J2_29 GPIOA_PIN6 #define J2_30 GPIOA_PIN5 #define J2_31 GPIOC_PIN4 #define J2_32 GPIOA_PIN7 #define J2_33 GPIOB_PIN0 #define J2_34 GPIOC_PIN5 #define J2_35 GPIOB_PIN2 #define J2_36 GPIOB_PIN1 #define J2_37 GPIOF_PIN12 #define J2_38 GPIOF_PIN11 #define J2_39 GPIOF_PIN14 #define J2_40 GPIOF_PIN13 #define J2_41 GPIOG_PIN0 #define J2_42 GPIOF_PIN15 #define J2_43 GPIOE_PIN7 #define J2_44 GPIOG_PIN1 #define J2_45 GPIOE_PIN9 #define J2_46 GPIOE_PIN8 #define J2_47 GPIOE_PIN11 #define J2_48 GPIOE_PIN10 #define J2_49 GPIOE_PIN13 #define J2_50 GPIOE_PIN12 #define J2_51 GPIOE_PIN15 #define J2_52 GPIOE_PIN14 #define J2_53 GPIOB_PIN11 #define J2_54 GPIOB_PIN10 // J2_55 GND // J2_56 VREF+ // J2_57 BOOT0 // J2_58 BOOT1 // J2_59 +3.3V // J2_60 +3.3V #define J3_1 GPIOB_PIN9 #define J3_2 GPIOB_PIN8 #define J3_3 GPIOB_PIN7 #define J3_4 GPIOB_PIN6 #define J3_5 GPIOB_PIN5 #define J3_6 GPIOB_PIN4 #define J3_7 GPIOB_PIN3 #define J3_8 GPIOG_PIN15 #define J3_9 GPIOG_PIN14 #define J3_10 GPIOG_PIN13 #define J3_11 GPIOG_PIN12 #define J3_12 GPIOG_PIN11 #define J3_13 GPIOG_PIN10 #define J3_14 GPIOG_PIN9 #define J3_15 GPIOD_PIN7 #define J3_16 GPIOD_PIN6 #define J3_17 GPIOD_PIN5 #define J3_18 GPIOD_PIN4 #define J3_19 GPIOD_PIN3 #define J3_20 GPIOD_PIN2 #define J3_21 GPIOD_PIN1 #define J3_22 GPIOD_PIN0 #define J3_23 GPIOC_PIN12 #define J3_24 GPIOC_PIN11 #define J3_25 GPIOC_PIN10 #define J3_26 GPIOA_PIN15 #define J3_27 GPIOA_PIN14 #define J3_28 GPIOA_PIN13 #define J3_29 GPIOA_PIN12 #define J3_30 GPIOA_PIN11 #define J3_31 GPIOA_PIN10 #define J3_32 GPIOA_PIN9 #define J3_33 GPIOA_PIN8 #define J3_34 GPIOC_PIN9 #define J3_35 GPIOC_PIN8 #define J3_36 GPIOC_PIN7 #define J3_37 GPIOC_PIN6 #define J3_38 GPIOG_PIN8 #define J3_39 GPIOG_PIN7 #define J3_40 GPIOG_PIN6 #define J3_41 GPIOG_PIN5 #define J3_42 GPIOG_PIN4 #define J3_43 GPIOG_PIN3 #define J3_44 GPIOG_PIN2 #define J3_45 GPIOD_PIN15 #define J3_46 GPIOD_PIN14 #define J3_47 GPIOD_PIN13 #define J3_48 GPIOD_PIN12 #define J3_49 GPIOD_PIN11 #define J3_50 GPIOD_PIN10 #define J3_51 GPIOD_PIN9 #define J3_52 GPIOD_PIN8 #define J3_53 GPIOB_PIN15 #define J3_54 GPIOB_PIN14 #define J3_55 GPIOB_PIN13 #define J3_56 GPIOB_PIN12 // J3_57 +3.3V // J3_58 GND // J3_59 +5V // J3_60 GND /* * IO lines assignments. */ #define LINE_WAKE_UP PAL_LINE(GPIOA, WAKE_UP) #define LINE_KEY0 PAL_LINE(GPIOE, KEY0) #define LINE_KEY1 PAL_LINE(GPIOE, KEY1) #define LINE_BUTTON1 PAL_LINE(KEY0_PORT, KEY0) #define LINE_BUTTON2 PAL_LINE(KEY1_PORT, KEY1) #define LINE_LED1 PAL_LINE(LED0_PORT, LED0) #define LINE_LED2 PAL_LINE(LED1_PORT, LED1) #define LINE_RELAY1 PAL_LINE(RELAY0_PORT, RELAY0) #define LINE_RELAY2 PAL_LINE(RELAY0_PORT, RELAY1) #define LINE_NRF_IRQ PAL_LINE(GPIOG, NRF_IRQ) #define LINE_NRF_CS PAL_LINE(GPIOG, NRF_CS) #define LINE_NRF_CE PAL_LINE(GPIOG, NRF_CE) #define LINE_F_CS PAL_LINE(GPIOB, F_CS) #define LINE_LCD_BL PAL_LINE(GPIOB, LCD_BL) #define LINE_T_MOSI PAL_LINE(GPIOC, T_MOSI) #define LINE_T_MISO PAL_LINE(GPIOB, T_MISO) #define LINE_T_SCK PAL_LINE(GPIOB, T_SCK) #define LINE_T_CS PAL_LINE(GPIOC, T_CS) #define LINE_T_PEN PAL_LINE(GPIOB, T_PEN) /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ /*===========================================================================*/ /* Driver macros. */ /*===========================================================================*/ /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. * Please refer to the STM32 Reference Manual for details. */ #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) #define PIN_ODR_LOW(n) (0U << (n)) #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) /* * GPIOA setup: * * PA0 - WK_UP (input pullup). * PA1 - PIN1 (input pullup). * PA2 - PIN2 (input pullup). * PA3 - PIN3 (input pullup). * PA4 - PIN4 (input pullup). * PA5 - PIN5 (input pullup). * PA6 - PIN6 (input pullup). * PA7 - PIN7 (input pullup). * PA8 - PIN8 (input pullup). * PA9 - TXD1 (alternate 7). * PA10 - RXD1 (alternate 7). * PA11 - USB_DM (alternate 10). * PA12 - USB_DP (alternate 10). * PA13 - SWDIO (alternate 0). * PA14 - SWCLK (alternate 0). * PA15 - PIN15 (input pullup). */ #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ PIN_MODE_INPUT(GPIOA_PIN1) | \ PIN_MODE_INPUT(GPIOA_PIN2) | \ PIN_MODE_INPUT(GPIOA_PIN3) | \ PIN_MODE_INPUT(GPIOA_PIN4) | \ PIN_MODE_INPUT(GPIOA_PIN5) | \ PIN_MODE_INPUT(GPIOA_PIN6) | \ PIN_MODE_INPUT(GPIOA_PIN7) | \ PIN_MODE_INPUT(GPIOA_PIN8) | \ PIN_MODE_ALTERNATE(GPIOA_PIN9) | \ PIN_MODE_ALTERNATE(GPIOA_PIN10) | \ PIN_MODE_ALTERNATE(GPIOA_PIN11) | \ PIN_MODE_ALTERNATE(GPIOA_PIN12) | \ PIN_MODE_ALTERNATE(GPIOA_PIN13) | \ PIN_MODE_ALTERNATE(GPIOA_PIN14) | \ PIN_MODE_INPUT(GPIOA_PIN15)) #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ PIN_OSPEED_HIGH(GPIOA_PIN1) | \ PIN_OSPEED_HIGH(GPIOA_PIN2) | \ PIN_OSPEED_HIGH(GPIOA_PIN3) | \ PIN_OSPEED_HIGH(GPIOA_PIN4) | \ PIN_OSPEED_HIGH(GPIOA_PIN5) | \ PIN_OSPEED_HIGH(GPIOA_PIN6) | \ PIN_OSPEED_HIGH(GPIOA_PIN7) | \ PIN_OSPEED_HIGH(GPIOA_PIN8) | \ PIN_OSPEED_HIGH(GPIOA_PIN9) | \ PIN_OSPEED_HIGH(GPIOA_PIN10) | \ PIN_OSPEED_HIGH(GPIOA_PIN11) | \ PIN_OSPEED_HIGH(GPIOA_PIN12) | \ PIN_OSPEED_HIGH(GPIOA_PIN13) | \ PIN_OSPEED_HIGH(GPIOA_PIN14) | \ PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ PIN_PUPDR_FLOATING(GPIOA_PIN11) | \ PIN_PUPDR_FLOATING(GPIOA_PIN12) | \ PIN_PUPDR_FLOATING(GPIOA_PIN13) | \ PIN_PUPDR_FLOATING(GPIOA_PIN14) | \ PIN_PUPDR_PULLUP(GPIOA_PIN15)) #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ PIN_ODR_HIGH(GPIOA_PIN1) | \ PIN_ODR_HIGH(GPIOA_PIN2) | \ PIN_ODR_HIGH(GPIOA_PIN3) | \ PIN_ODR_HIGH(GPIOA_PIN4) | \ PIN_ODR_HIGH(GPIOA_PIN5) | \ PIN_ODR_HIGH(GPIOA_PIN6) | \ PIN_ODR_HIGH(GPIOA_PIN7) | \ PIN_ODR_HIGH(GPIOA_PIN8) | \ PIN_ODR_HIGH(GPIOA_PIN9) | \ PIN_ODR_HIGH(GPIOA_PIN10) | \ PIN_ODR_HIGH(GPIOA_PIN11) | \ PIN_ODR_HIGH(GPIOA_PIN12) | \ PIN_ODR_HIGH(GPIOA_PIN13) | \ PIN_ODR_HIGH(GPIOA_PIN14) | \ PIN_ODR_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \ PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ PIN_AFIO_AF(GPIOA_PIN7, 0U)) #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ PIN_AFIO_AF(GPIOA_PIN9, 7U) | \ PIN_AFIO_AF(GPIOA_PIN10, 7U) | \ PIN_AFIO_AF(GPIOA_PIN11, 10U) | \ PIN_AFIO_AF(GPIOA_PIN12, 10U) | \ PIN_AFIO_AF(GPIOA_PIN13, 0U) | \ PIN_AFIO_AF(GPIOA_PIN14, 0U) | \ PIN_AFIO_AF(GPIOA_PIN15, 0U)) /* * GPIOB setup: * * PB0 - PIN0 (input pullup). * PB1 - PIN1 (input pullup). * PB2 - PIN2 (input pullup). * PB3 - SPI1_SCK (alternate 5). * PB4 - SPI1_MISO (alternate 5). * PB5 - SPI1_MOSI (alternate 5). * PB6 - I2C1_SCL (output od, alternate 4). * PB7 - I2C1_SDA (output od, alternate 4). * PB8 - RELAY1 (output pushpull). * PB9 - RELAY2 (output pushpull). * PB10 - PIN10 (input pullup). * PB11 - PIN11 (input pullup). * PB12 - PIN12 (input pullup). * PB13 - PIN13 (input pullup). * PB14 - F_CS (output pushpull). * PB15 - PIN15 (input pullup). */ #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ PIN_MODE_INPUT(GPIOB_PIN1) | \ PIN_MODE_INPUT(GPIOB_PIN2) | \ PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ PIN_MODE_ALTERNATE(GPIOB_PIN4) | \ PIN_MODE_ALTERNATE(GPIOB_PIN5) | \ PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ PIN_MODE_ALTERNATE(GPIOB_PIN7) | \ PIN_MODE_OUTPUT(GPIOB_PIN8) | \ PIN_MODE_OUTPUT(GPIOB_PIN9) | \ PIN_MODE_INPUT(GPIOB_PIN10) | \ PIN_MODE_INPUT(GPIOB_PIN11) | \ PIN_MODE_INPUT(GPIOB_PIN12) | \ PIN_MODE_INPUT(GPIOB_PIN13) | \ PIN_MODE_OUTPUT(GPIOB_PIN14) | \ PIN_MODE_INPUT(GPIOB_PIN15)) #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ PIN_OTYPE_OPENDRAIN(GPIOB_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ PIN_OSPEED_HIGH(GPIOB_PIN1) | \ PIN_OSPEED_HIGH(GPIOB_PIN2) | \ PIN_OSPEED_HIGH(GPIOB_PIN3) | \ PIN_OSPEED_HIGH(GPIOB_PIN4) | \ PIN_OSPEED_HIGH(GPIOB_PIN5) | \ PIN_OSPEED_HIGH(GPIOB_PIN6) | \ PIN_OSPEED_HIGH(GPIOB_PIN7) | \ PIN_OSPEED_HIGH(GPIOB_PIN8) | \ PIN_OSPEED_HIGH(GPIOB_PIN9) | \ PIN_OSPEED_HIGH(GPIOB_PIN10) | \ PIN_OSPEED_HIGH(GPIOB_PIN11) | \ PIN_OSPEED_HIGH(GPIOB_PIN12) | \ PIN_OSPEED_HIGH(GPIOB_PIN13) | \ PIN_OSPEED_HIGH(GPIOB_PIN14) | \ PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ PIN_PUPDR_FLOATING(GPIOB_PIN4) | \ PIN_PUPDR_FLOATING(GPIOB_PIN5) | \ PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ PIN_PUPDR_PULLUP(GPIOB_PIN15)) #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ PIN_ODR_HIGH(GPIOB_PIN1) | \ PIN_ODR_HIGH(GPIOB_PIN2) | \ PIN_ODR_HIGH(GPIOB_PIN3) | \ PIN_ODR_HIGH(GPIOB_PIN4) | \ PIN_ODR_HIGH(GPIOB_PIN5) | \ PIN_ODR_HIGH(GPIOB_PIN6) | \ PIN_ODR_HIGH(GPIOB_PIN7) | \ PIN_ODR_HIGH(GPIOB_PIN8) | \ PIN_ODR_HIGH(GPIOB_PIN9) | \ PIN_ODR_HIGH(GPIOB_PIN10) | \ PIN_ODR_HIGH(GPIOB_PIN11) | \ PIN_ODR_HIGH(GPIOB_PIN12) | \ PIN_ODR_HIGH(GPIOB_PIN13) | \ PIN_ODR_HIGH(GPIOB_PIN14) | \ PIN_ODR_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ PIN_AFIO_AF(GPIOB_PIN3, 5U) | \ PIN_AFIO_AF(GPIOB_PIN4, 5U) | \ PIN_AFIO_AF(GPIOB_PIN5, 5U) | \ PIN_AFIO_AF(GPIOB_PIN6, 4U) | \ PIN_AFIO_AF(GPIOB_PIN7, 4U)) #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ PIN_AFIO_AF(GPIOB_PIN14, 0U) | \ PIN_AFIO_AF(GPIOB_PIN15, 0U)) /* * GPIOC setup: * * PC0 - PIN0 (input pullup). * PC1 - PIN1 (input pullup). * PC2 - PIN2 (input pullup). * PC3 - PIN3 (input pullup). * PC4 - PIN4 (input pullup). * PC5 - PIN5 (input pullup). * PC6 - PIN6 (input pullup). * PC7 - PIN7 (input pullup). * PC8 - SDIO_D0 (alternate 12). * PC9 - SDIO_D1 (alternate 12). * PC10 - SDIO_D2 (alternate 12). * PC11 - SDIO_D3 (alternate 12). * PC12 - SDIO_SCK (alternate 12). * PC13 - PIN13 (input pullup). * PC14 - OSC32_IN (input float). * PC15 - OSC32_OUT (input float). */ #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ PIN_MODE_INPUT(GPIOC_PIN1) | \ PIN_MODE_INPUT(GPIOC_PIN2) | \ PIN_MODE_INPUT(GPIOC_PIN3) | \ PIN_MODE_INPUT(GPIOC_PIN4) | \ PIN_MODE_INPUT(GPIOC_PIN5) | \ PIN_MODE_INPUT(GPIOC_PIN6) | \ PIN_MODE_INPUT(GPIOC_PIN7) | \ PIN_MODE_ALTERNATE(GPIOC_PIN8) | \ PIN_MODE_ALTERNATE(GPIOC_PIN9) | \ PIN_MODE_ALTERNATE(GPIOC_PIN10) | \ PIN_MODE_ALTERNATE(GPIOC_PIN11) | \ PIN_MODE_ALTERNATE(GPIOC_PIN12) | \ PIN_MODE_INPUT(GPIOC_PIN13) | \ PIN_MODE_INPUT(GPIOC_PIN14) | \ PIN_MODE_INPUT(GPIOC_PIN15)) #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ PIN_OSPEED_HIGH(GPIOC_PIN1) | \ PIN_OSPEED_HIGH(GPIOC_PIN2) | \ PIN_OSPEED_HIGH(GPIOC_PIN3) | \ PIN_OSPEED_HIGH(GPIOC_PIN4) | \ PIN_OSPEED_HIGH(GPIOC_PIN5) | \ PIN_OSPEED_HIGH(GPIOC_PIN6) | \ PIN_OSPEED_HIGH(GPIOC_PIN7) | \ PIN_OSPEED_HIGH(GPIOC_PIN8) | \ PIN_OSPEED_HIGH(GPIOC_PIN9) | \ PIN_OSPEED_HIGH(GPIOC_PIN10) | \ PIN_OSPEED_HIGH(GPIOC_PIN11) | \ PIN_OSPEED_HIGH(GPIOC_PIN12) | \ PIN_OSPEED_HIGH(GPIOC_PIN13) | \ PIN_OSPEED_HIGH(GPIOC_PIN14) | \ PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ PIN_PUPDR_FLOATING(GPIOC_PIN8) | \ PIN_PUPDR_FLOATING(GPIOC_PIN9) | \ PIN_PUPDR_FLOATING(GPIOC_PIN10) | \ PIN_PUPDR_FLOATING(GPIOC_PIN11) | \ PIN_PUPDR_FLOATING(GPIOC_PIN12) | \ PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ PIN_PUPDR_FLOATING(GPIOC_PIN15)) #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ PIN_ODR_HIGH(GPIOC_PIN1) | \ PIN_ODR_HIGH(GPIOC_PIN2) | \ PIN_ODR_HIGH(GPIOC_PIN3) | \ PIN_ODR_HIGH(GPIOC_PIN4) | \ PIN_ODR_HIGH(GPIOC_PIN5) | \ PIN_ODR_HIGH(GPIOC_PIN6) | \ PIN_ODR_HIGH(GPIOC_PIN7) | \ PIN_ODR_HIGH(GPIOC_PIN8) | \ PIN_ODR_HIGH(GPIOC_PIN9) | \ PIN_ODR_HIGH(GPIOC_PIN10) | \ PIN_ODR_HIGH(GPIOC_PIN11) | \ PIN_ODR_HIGH(GPIOC_PIN12) | \ PIN_ODR_HIGH(GPIOC_PIN13) | \ PIN_ODR_HIGH(GPIOC_PIN14) | \ PIN_ODR_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \ PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ PIN_AFIO_AF(GPIOC_PIN7, 0U)) #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 12U) | \ PIN_AFIO_AF(GPIOC_PIN9, 12U) | \ PIN_AFIO_AF(GPIOC_PIN10, 12U) | \ PIN_AFIO_AF(GPIOC_PIN11, 12U) | \ PIN_AFIO_AF(GPIOC_PIN12, 12U) | \ PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ PIN_AFIO_AF(GPIOC_PIN14, 0U) | \ PIN_AFIO_AF(GPIOC_PIN15, 0U)) /* * GPIOD setup: * * PD0 - FSMC_D2 (alternate 12). * PD1 - FSMC_D3 (alternate 12). * PD2 - SDIO_CMD (alternate 12). * PD3 - PIN3 (input pullup). * PD4 - FSMC_NOE (alternate 12). * PD5 - FSMC_NWE (alternate 12). * PD6 - PIN6 (input pullup). * PD7 - PIN7 (input pullup). * PD8 - FSMC_D13 (alternate 12). * PD9 - FSMC_D14 (alternate 12). * PD10 - FSMC_D15 (alternate 12). * PD11 - FSMC_A16 (alternate 12). * PD12 - FSMC_A17 (alternate 12). * PD13 - FSMC_A18 (alternate 12). * PD14 - FSMC_D0 (alternate 12). * PD15 - FSMC_D1 (alternate 12). */ #define VAL_GPIOD_MODER (PIN_MODE_ALTERNATE(GPIOD_PIN0) | \ PIN_MODE_ALTERNATE(GPIOD_PIN1) | \ PIN_MODE_ALTERNATE(GPIOD_PIN2) | \ PIN_MODE_INPUT(GPIOD_PIN3) | \ PIN_MODE_ALTERNATE(GPIOD_PIN4) | \ PIN_MODE_ALTERNATE(GPIOD_PIN5) | \ PIN_MODE_INPUT(GPIOD_PIN6) | \ PIN_MODE_INPUT(GPIOD_PIN7) | \ PIN_MODE_ALTERNATE(GPIOD_PIN8) | \ PIN_MODE_ALTERNATE(GPIOD_PIN9) | \ PIN_MODE_ALTERNATE(GPIOD_PIN10) | \ PIN_MODE_ALTERNATE(GPIOD_PIN11) | \ PIN_MODE_ALTERNATE(GPIOD_PIN12) | \ PIN_MODE_ALTERNATE(GPIOD_PIN13) | \ PIN_MODE_ALTERNATE(GPIOD_PIN14) | \ PIN_MODE_ALTERNATE(GPIOD_PIN15)) #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ PIN_OSPEED_HIGH(GPIOD_PIN1) | \ PIN_OSPEED_HIGH(GPIOD_PIN2) | \ PIN_OSPEED_HIGH(GPIOD_PIN3) | \ PIN_OSPEED_HIGH(GPIOD_PIN4) | \ PIN_OSPEED_HIGH(GPIOD_PIN5) | \ PIN_OSPEED_HIGH(GPIOD_PIN6) | \ PIN_OSPEED_HIGH(GPIOD_PIN7) | \ PIN_OSPEED_HIGH(GPIOD_PIN8) | \ PIN_OSPEED_HIGH(GPIOD_PIN9) | \ PIN_OSPEED_HIGH(GPIOD_PIN10) | \ PIN_OSPEED_HIGH(GPIOD_PIN11) | \ PIN_OSPEED_HIGH(GPIOD_PIN12) | \ PIN_OSPEED_HIGH(GPIOD_PIN13) | \ PIN_OSPEED_HIGH(GPIOD_PIN14) | \ PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \ PIN_PUPDR_FLOATING(GPIOD_PIN1) | \ PIN_PUPDR_FLOATING(GPIOD_PIN2) | \ PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ PIN_PUPDR_FLOATING(GPIOD_PIN4) | \ PIN_PUPDR_FLOATING(GPIOD_PIN5) | \ PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ PIN_PUPDR_FLOATING(GPIOD_PIN8) | \ PIN_PUPDR_FLOATING(GPIOD_PIN9) | \ PIN_PUPDR_FLOATING(GPIOD_PIN10) | \ PIN_PUPDR_FLOATING(GPIOD_PIN11) | \ PIN_PUPDR_FLOATING(GPIOD_PIN12) | \ PIN_PUPDR_FLOATING(GPIOD_PIN13) | \ PIN_PUPDR_FLOATING(GPIOD_PIN14) | \ PIN_PUPDR_FLOATING(GPIOD_PIN15)) #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ PIN_ODR_HIGH(GPIOD_PIN1) | \ PIN_ODR_HIGH(GPIOD_PIN2) | \ PIN_ODR_HIGH(GPIOD_PIN3) | \ PIN_ODR_HIGH(GPIOD_PIN4) | \ PIN_ODR_HIGH(GPIOD_PIN5) | \ PIN_ODR_HIGH(GPIOD_PIN6) | \ PIN_ODR_HIGH(GPIOD_PIN7) | \ PIN_ODR_HIGH(GPIOD_PIN8) | \ PIN_ODR_HIGH(GPIOD_PIN9) | \ PIN_ODR_HIGH(GPIOD_PIN10) | \ PIN_ODR_HIGH(GPIOD_PIN11) | \ PIN_ODR_HIGH(GPIOD_PIN12) | \ PIN_ODR_HIGH(GPIOD_PIN13) | \ PIN_ODR_HIGH(GPIOD_PIN14) | \ PIN_ODR_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 12U) | \ PIN_AFIO_AF(GPIOD_PIN1, 12U) | \ PIN_AFIO_AF(GPIOD_PIN2, 12U) | \ PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ PIN_AFIO_AF(GPIOD_PIN4, 12U) | \ PIN_AFIO_AF(GPIOD_PIN5, 12U) | \ PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ PIN_AFIO_AF(GPIOD_PIN7, 0U)) #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 12U) | \ PIN_AFIO_AF(GPIOD_PIN9, 12U) | \ PIN_AFIO_AF(GPIOD_PIN10, 12U) | \ PIN_AFIO_AF(GPIOD_PIN11, 12U) | \ PIN_AFIO_AF(GPIOD_PIN12, 12U) | \ PIN_AFIO_AF(GPIOD_PIN13, 12U) | \ PIN_AFIO_AF(GPIOD_PIN14, 12U) | \ PIN_AFIO_AF(GPIOD_PIN15, 12U)) /* * GPIOE setup: * * PE0 - FSMC_NBL0 (alternate 12). * PE1 - FSMC_NBL1 (alternate 12). * PE2 - PIN2 (input floating). * PE3 - KEY1 (input pullup). * PE4 - KEY0 (input pullup). * PE5 - PIN5 (input floating). * PE6 - PIN6 (input floating). * PE7 - FSMC_D4 (alternate 12). * PE8 - FSMC_D5 (alternate 12). * PE9 - FSMC_D6 (alternate 12). * PE10 - FSMC_D7 (alternate 12). * PE11 - FSMC_D8 (alternate 12). * PE12 - FSMC_D9 (alternate 12). * PE13 - FSMC_D10 (alternate 12). * PE14 - FSMC_D11 (alternate 12). * PE15 - FSMC_D12 (alternate 12). */ #define VAL_GPIOE_MODER (PIN_MODE_ALTERNATE(GPIOE_PIN0) | \ PIN_MODE_ALTERNATE(GPIOE_PIN1) | \ PIN_MODE_INPUT(GPIOE_PIN2) | \ PIN_MODE_INPUT(GPIOE_PIN3) | \ PIN_MODE_INPUT(GPIOE_PIN4) | \ PIN_MODE_INPUT(GPIOE_PIN5) | \ PIN_MODE_INPUT(GPIOE_PIN6) | \ PIN_MODE_ALTERNATE(GPIOE_PIN7) | \ PIN_MODE_ALTERNATE(GPIOE_PIN8) | \ PIN_MODE_ALTERNATE(GPIOE_PIN9) | \ PIN_MODE_ALTERNATE(GPIOE_PIN10) | \ PIN_MODE_ALTERNATE(GPIOE_PIN11) | \ PIN_MODE_ALTERNATE(GPIOE_PIN12) | \ PIN_MODE_ALTERNATE(GPIOE_PIN13) | \ PIN_MODE_ALTERNATE(GPIOE_PIN14) | \ PIN_MODE_ALTERNATE(GPIOE_PIN15)) #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ PIN_OSPEED_HIGH(GPIOE_PIN1) | \ PIN_OSPEED_HIGH(GPIOE_PIN2) | \ PIN_OSPEED_HIGH(GPIOE_PIN3) | \ PIN_OSPEED_HIGH(GPIOE_PIN4) | \ PIN_OSPEED_HIGH(GPIOE_PIN5) | \ PIN_OSPEED_HIGH(GPIOE_PIN6) | \ PIN_OSPEED_HIGH(GPIOE_PIN7) | \ PIN_OSPEED_HIGH(GPIOE_PIN8) | \ PIN_OSPEED_HIGH(GPIOE_PIN9) | \ PIN_OSPEED_HIGH(GPIOE_PIN10) | \ PIN_OSPEED_HIGH(GPIOE_PIN11) | \ PIN_OSPEED_HIGH(GPIOE_PIN12) | \ PIN_OSPEED_HIGH(GPIOE_PIN13) | \ PIN_OSPEED_HIGH(GPIOE_PIN14) | \ PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \ PIN_PUPDR_FLOATING(GPIOE_PIN1) | \ PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ PIN_PUPDR_FLOATING(GPIOE_PIN5) | \ PIN_PUPDR_FLOATING(GPIOE_PIN6) | \ PIN_PUPDR_FLOATING(GPIOE_PIN7) | \ PIN_PUPDR_FLOATING(GPIOE_PIN8) | \ PIN_PUPDR_FLOATING(GPIOE_PIN9) | \ PIN_PUPDR_FLOATING(GPIOE_PIN10) | \ PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ PIN_PUPDR_FLOATING(GPIOE_PIN12) | \ PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ PIN_PUPDR_FLOATING(GPIOE_PIN14) | \ PIN_PUPDR_FLOATING(GPIOE_PIN15)) #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ PIN_ODR_HIGH(GPIOE_PIN1) | \ PIN_ODR_HIGH(GPIOE_PIN2) | \ PIN_ODR_HIGH(GPIOE_PIN3) | \ PIN_ODR_HIGH(GPIOE_PIN4) | \ PIN_ODR_HIGH(GPIOE_PIN5) | \ PIN_ODR_HIGH(GPIOE_PIN6) | \ PIN_ODR_HIGH(GPIOE_PIN7) | \ PIN_ODR_HIGH(GPIOE_PIN8) | \ PIN_ODR_HIGH(GPIOE_PIN9) | \ PIN_ODR_HIGH(GPIOE_PIN10) | \ PIN_ODR_HIGH(GPIOE_PIN11) | \ PIN_ODR_HIGH(GPIOE_PIN12) | \ PIN_ODR_HIGH(GPIOE_PIN13) | \ PIN_ODR_HIGH(GPIOE_PIN14) | \ PIN_ODR_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 12U) | \ PIN_AFIO_AF(GPIOE_PIN1, 12U) | \ PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ PIN_AFIO_AF(GPIOE_PIN7, 12U)) #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 12U) | \ PIN_AFIO_AF(GPIOE_PIN9, 12U) | \ PIN_AFIO_AF(GPIOE_PIN10, 12U) | \ PIN_AFIO_AF(GPIOE_PIN11, 12U) | \ PIN_AFIO_AF(GPIOE_PIN12, 12U) | \ PIN_AFIO_AF(GPIOE_PIN13, 12U) | \ PIN_AFIO_AF(GPIOE_PIN14, 12U) | \ PIN_AFIO_AF(GPIOE_PIN15, 12U)) /* * GPIOF setup: * * PF0 - FSMC_A0 (alternate 12). * PF1 - FSMC_A1 (alternate 12). * PF2 - FSMC_A2 (alternate 12). * PF3 - FSMC_A3 (alternate 12). * PF4 - FSMC_A4 (alternate 12). * PF5 - FSMC_A5 (alternate 12). * PF6 - PIN6 (input floating). * PF7 - PIN7 (input floating). * PF8 - PIN8 (input floating). * PF9 - LED0 (output pushpull). * PF10 - LED1 (output pushpull). * PF11 - PIN11 (input floating). * PF12 - FSMC_A6 (alternate 12). * PF13 - FSMC_A7 (alternate 12). * PF14 - FSMC_A8 (alternate 12). * PF15 - FSMC_A9 (alternate 12). */ #define VAL_GPIOF_MODER (PIN_MODE_ALTERNATE(GPIOF_PIN0) | \ PIN_MODE_ALTERNATE(GPIOF_PIN1) | \ PIN_MODE_ALTERNATE(GPIOF_PIN2) | \ PIN_MODE_ALTERNATE(GPIOF_PIN3) | \ PIN_MODE_ALTERNATE(GPIOF_PIN4) | \ PIN_MODE_ALTERNATE(GPIOF_PIN5) | \ PIN_MODE_INPUT(GPIOF_PIN6) | \ PIN_MODE_INPUT(GPIOF_PIN7) | \ PIN_MODE_INPUT(GPIOF_PIN8) | \ PIN_MODE_OUTPUT(GPIOF_PIN9) | \ PIN_MODE_OUTPUT(GPIOF_PIN10) | \ PIN_MODE_INPUT(GPIOF_PIN11) | \ PIN_MODE_ALTERNATE(GPIOF_PIN12) | \ PIN_MODE_ALTERNATE(GPIOF_PIN13) | \ PIN_MODE_ALTERNATE(GPIOF_PIN14) | \ PIN_MODE_ALTERNATE(GPIOF_PIN15)) #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ PIN_OSPEED_HIGH(GPIOF_PIN1) | \ PIN_OSPEED_HIGH(GPIOF_PIN2) | \ PIN_OSPEED_HIGH(GPIOF_PIN3) | \ PIN_OSPEED_HIGH(GPIOF_PIN4) | \ PIN_OSPEED_HIGH(GPIOF_PIN5) | \ PIN_OSPEED_HIGH(GPIOF_PIN6) | \ PIN_OSPEED_HIGH(GPIOF_PIN7) | \ PIN_OSPEED_HIGH(GPIOF_PIN8) | \ PIN_OSPEED_HIGH(GPIOF_PIN9) | \ PIN_OSPEED_HIGH(GPIOF_PIN10) | \ PIN_OSPEED_HIGH(GPIOF_PIN11) | \ PIN_OSPEED_HIGH(GPIOF_PIN12) | \ PIN_OSPEED_HIGH(GPIOF_PIN13) | \ PIN_OSPEED_HIGH(GPIOF_PIN14) | \ PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \ PIN_PUPDR_FLOATING(GPIOF_PIN1) | \ PIN_PUPDR_FLOATING(GPIOF_PIN2) | \ PIN_PUPDR_FLOATING(GPIOF_PIN3) | \ PIN_PUPDR_FLOATING(GPIOF_PIN4) | \ PIN_PUPDR_FLOATING(GPIOF_PIN5) | \ PIN_PUPDR_FLOATING(GPIOF_PIN6) | \ PIN_PUPDR_FLOATING(GPIOF_PIN7) | \ PIN_PUPDR_FLOATING(GPIOF_PIN8) | \ PIN_PUPDR_FLOATING(GPIOF_PIN9) | \ PIN_PUPDR_FLOATING(GPIOF_PIN10) | \ PIN_PUPDR_FLOATING(GPIOF_PIN11) | \ PIN_PUPDR_FLOATING(GPIOF_PIN12) | \ PIN_PUPDR_FLOATING(GPIOF_PIN13) | \ PIN_PUPDR_FLOATING(GPIOF_PIN14) | \ PIN_PUPDR_FLOATING(GPIOF_PIN15)) #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ PIN_ODR_HIGH(GPIOF_PIN1) | \ PIN_ODR_HIGH(GPIOF_PIN2) | \ PIN_ODR_HIGH(GPIOF_PIN3) | \ PIN_ODR_HIGH(GPIOF_PIN4) | \ PIN_ODR_HIGH(GPIOF_PIN5) | \ PIN_ODR_HIGH(GPIOF_PIN6) | \ PIN_ODR_HIGH(GPIOF_PIN7) | \ PIN_ODR_HIGH(GPIOF_PIN8) | \ PIN_ODR_HIGH(GPIOF_PIN9) | \ PIN_ODR_HIGH(GPIOF_PIN10) | \ PIN_ODR_HIGH(GPIOF_PIN11) | \ PIN_ODR_HIGH(GPIOF_PIN12) | \ PIN_ODR_HIGH(GPIOF_PIN13) | \ PIN_ODR_HIGH(GPIOF_PIN14) | \ PIN_ODR_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 12U) | \ PIN_AFIO_AF(GPIOF_PIN1, 12U) | \ PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ PIN_AFIO_AF(GPIOF_PIN7, 0U)) #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ PIN_AFIO_AF(GPIOF_PIN12, 12U) | \ PIN_AFIO_AF(GPIOF_PIN13, 12U) | \ PIN_AFIO_AF(GPIOF_PIN14, 12U) | \ PIN_AFIO_AF(GPIOF_PIN15, 12U)) /* * GPIOG setup: * * PG0 - FSMC_A10 (alternate 12). * PG1 - FSMC_A11 (alternate 12). * PG2 - FSMC_A12 (alternate 12). * PG3 - FSMC_A13 (alternate 12). * PG4 - FSMC_A14 (alternate 12). * PG5 - FSMC_A15 (alternate 12). * PG6 - NRF_CE (output pushpull). * PG7 - NRF_CS (output pushpull). * PG8 - NRF_IRQ (input pullup). * PG9 - PIN9 (input floating). * PG10 - FSMC_NE3 (alternate 12). * PG11 - PIN11 (input floating). * PG12 - FSMC_NE4 (alternate 12). * PG13 - PIN13 (input floating). * PG14 - PIN14 (input floating). * PG15 - PIN15 (input floating). */ #define VAL_GPIOG_MODER (PIN_MODE_ALTERNATE(GPIOG_PIN0) | \ PIN_MODE_ALTERNATE(GPIOG_PIN1) | \ PIN_MODE_ALTERNATE(GPIOG_PIN2) | \ PIN_MODE_ALTERNATE(GPIOG_PIN3) | \ PIN_MODE_ALTERNATE(GPIOG_PIN4) | \ PIN_MODE_ALTERNATE(GPIOG_PIN5) | \ PIN_MODE_OUTPUT(GPIOG_PIN6) | \ PIN_MODE_OUTPUT(GPIOG_PIN7) | \ PIN_MODE_INPUT(GPIOG_PIN8) | \ PIN_MODE_INPUT(GPIOG_PIN9) | \ PIN_MODE_ALTERNATE(GPIOG_PIN10) | \ PIN_MODE_INPUT(GPIOG_PIN11) | \ PIN_MODE_ALTERNATE(GPIOG_PIN12) | \ PIN_MODE_INPUT(GPIOG_PIN13) | \ PIN_MODE_INPUT(GPIOG_PIN14) | \ PIN_MODE_INPUT(GPIOG_PIN15)) #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ PIN_OSPEED_HIGH(GPIOG_PIN1) | \ PIN_OSPEED_HIGH(GPIOG_PIN2) | \ PIN_OSPEED_HIGH(GPIOG_PIN3) | \ PIN_OSPEED_HIGH(GPIOG_PIN4) | \ PIN_OSPEED_HIGH(GPIOG_PIN5) | \ PIN_OSPEED_HIGH(GPIOG_PIN6) | \ PIN_OSPEED_HIGH(GPIOG_PIN7) | \ PIN_OSPEED_HIGH(GPIOG_PIN8) | \ PIN_OSPEED_HIGH(GPIOG_PIN9) | \ PIN_OSPEED_HIGH(GPIOG_PIN10) | \ PIN_OSPEED_HIGH(GPIOG_PIN11) | \ PIN_OSPEED_HIGH(GPIOG_PIN12) | \ PIN_OSPEED_HIGH(GPIOG_PIN13) | \ PIN_OSPEED_HIGH(GPIOG_PIN14) | \ PIN_OSPEED_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \ PIN_PUPDR_FLOATING(GPIOG_PIN1) | \ PIN_PUPDR_FLOATING(GPIOG_PIN2) | \ PIN_PUPDR_FLOATING(GPIOG_PIN3) | \ PIN_PUPDR_FLOATING(GPIOG_PIN4) | \ PIN_PUPDR_FLOATING(GPIOG_PIN5) | \ PIN_PUPDR_FLOATING(GPIOG_PIN6) | \ PIN_PUPDR_FLOATING(GPIOG_PIN7) | \ PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ PIN_PUPDR_FLOATING(GPIOG_PIN9) | \ PIN_PUPDR_FLOATING(GPIOG_PIN10) | \ PIN_PUPDR_FLOATING(GPIOG_PIN11) | \ PIN_PUPDR_FLOATING(GPIOG_PIN12) | \ PIN_PUPDR_FLOATING(GPIOG_PIN13) | \ PIN_PUPDR_FLOATING(GPIOG_PIN14) | \ PIN_PUPDR_FLOATING(GPIOG_PIN15)) #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ PIN_ODR_HIGH(GPIOG_PIN1) | \ PIN_ODR_HIGH(GPIOG_PIN2) | \ PIN_ODR_HIGH(GPIOG_PIN3) | \ PIN_ODR_HIGH(GPIOG_PIN4) | \ PIN_ODR_HIGH(GPIOG_PIN5) | \ PIN_ODR_HIGH(GPIOG_PIN6) | \ PIN_ODR_HIGH(GPIOG_PIN7) | \ PIN_ODR_HIGH(GPIOG_PIN8) | \ PIN_ODR_HIGH(GPIOG_PIN9) | \ PIN_ODR_HIGH(GPIOG_PIN10) | \ PIN_ODR_HIGH(GPIOG_PIN11) | \ PIN_ODR_HIGH(GPIOG_PIN12) | \ PIN_ODR_HIGH(GPIOG_PIN13) | \ PIN_ODR_HIGH(GPIOG_PIN14) | \ PIN_ODR_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 12U) | \ PIN_AFIO_AF(GPIOG_PIN1, 12U) | \ PIN_AFIO_AF(GPIOG_PIN2, 12U) | \ PIN_AFIO_AF(GPIOG_PIN3, 12U) | \ PIN_AFIO_AF(GPIOG_PIN4, 12U) | \ PIN_AFIO_AF(GPIOG_PIN5, 12U) | \ PIN_AFIO_AF(GPIOG_PIN6, 0U) | \ PIN_AFIO_AF(GPIOG_PIN7, 0U)) #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \ PIN_AFIO_AF(GPIOG_PIN9, 0U) | \ PIN_AFIO_AF(GPIOG_PIN10, 12U) | \ PIN_AFIO_AF(GPIOG_PIN11, 0U) | \ PIN_AFIO_AF(GPIOG_PIN12, 12U) | \ PIN_AFIO_AF(GPIOG_PIN13, 0U) | \ PIN_AFIO_AF(GPIOG_PIN14, 0U) | \ PIN_AFIO_AF(GPIOG_PIN15, 0U)) /* * GPIOH setup: * * PH0 - OSC_IN (input floating). * PH1 - OSC_OUT (input floating). * PH2 - none (input pullup). * PH3 - none (input pullup). * PH4 - none (input pullup). * PH5 - none (input pullup). * PH6 - none (input pullup). * PH7 - none (input pullup). * PH8 - none (input pullup). * PH9 - none (input pullup). * PH10 - none (input pullup). * PH11 - none (input pullup). * PH12 - none (input pullup). * PH13 - none (input pullup). * PH14 - none (input pullup). * PH15 - none (input pullup). */ #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ PIN_MODE_INPUT(GPIOH_PIN1) | \ PIN_MODE_INPUT(GPIOH_PIN2) | \ PIN_MODE_INPUT(GPIOH_PIN3) | \ PIN_MODE_INPUT(GPIOH_PIN4) | \ PIN_MODE_INPUT(GPIOH_PIN5) | \ PIN_MODE_INPUT(GPIOH_PIN6) | \ PIN_MODE_INPUT(GPIOH_PIN7) | \ PIN_MODE_INPUT(GPIOH_PIN8) | \ PIN_MODE_INPUT(GPIOH_PIN9) | \ PIN_MODE_INPUT(GPIOH_PIN10) | \ PIN_MODE_INPUT(GPIOH_PIN11) | \ PIN_MODE_INPUT(GPIOH_PIN12) | \ PIN_MODE_INPUT(GPIOH_PIN13) | \ PIN_MODE_INPUT(GPIOH_PIN14) | \ PIN_MODE_INPUT(GPIOH_PIN15)) #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_PIN0) | \ PIN_OSPEED_HIGH(GPIOH_PIN1) | \ PIN_OSPEED_HIGH(GPIOH_PIN2) | \ PIN_OSPEED_HIGH(GPIOH_PIN3) | \ PIN_OSPEED_HIGH(GPIOH_PIN4) | \ PIN_OSPEED_HIGH(GPIOH_PIN5) | \ PIN_OSPEED_HIGH(GPIOH_PIN6) | \ PIN_OSPEED_HIGH(GPIOH_PIN7) | \ PIN_OSPEED_HIGH(GPIOH_PIN8) | \ PIN_OSPEED_HIGH(GPIOH_PIN9) | \ PIN_OSPEED_HIGH(GPIOH_PIN10) | \ PIN_OSPEED_HIGH(GPIOH_PIN11) | \ PIN_OSPEED_HIGH(GPIOH_PIN12) | \ PIN_OSPEED_HIGH(GPIOH_PIN13) | \ PIN_OSPEED_HIGH(GPIOH_PIN14) | \ PIN_OSPEED_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_PIN0) | \ PIN_PUPDR_FLOATING(GPIOH_PIN1) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ PIN_PUPDR_PULLUP(GPIOH_PIN15)) #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ PIN_ODR_HIGH(GPIOH_PIN1) | \ PIN_ODR_HIGH(GPIOH_PIN2) | \ PIN_ODR_HIGH(GPIOH_PIN3) | \ PIN_ODR_HIGH(GPIOH_PIN4) | \ PIN_ODR_HIGH(GPIOH_PIN5) | \ PIN_ODR_HIGH(GPIOH_PIN6) | \ PIN_ODR_HIGH(GPIOH_PIN7) | \ PIN_ODR_HIGH(GPIOH_PIN8) | \ PIN_ODR_HIGH(GPIOH_PIN9) | \ PIN_ODR_HIGH(GPIOH_PIN10) | \ PIN_ODR_HIGH(GPIOH_PIN11) | \ PIN_ODR_HIGH(GPIOH_PIN12) | \ PIN_ODR_HIGH(GPIOH_PIN13) | \ PIN_ODR_HIGH(GPIOH_PIN14) | \ PIN_ODR_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0U) | \ PIN_AFIO_AF(GPIOH_PIN1, 0U) | \ PIN_AFIO_AF(GPIOH_PIN2, 0U) | \ PIN_AFIO_AF(GPIOH_PIN3, 0U) | \ PIN_AFIO_AF(GPIOH_PIN4, 0U) | \ PIN_AFIO_AF(GPIOH_PIN5, 0U) | \ PIN_AFIO_AF(GPIOH_PIN6, 0U) | \ PIN_AFIO_AF(GPIOH_PIN7, 0U)) #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \ PIN_AFIO_AF(GPIOH_PIN9, 0U) | \ PIN_AFIO_AF(GPIOH_PIN10, 0U) | \ PIN_AFIO_AF(GPIOH_PIN11, 0U) | \ PIN_AFIO_AF(GPIOH_PIN12, 0U) | \ PIN_AFIO_AF(GPIOH_PIN13, 0U) | \ PIN_AFIO_AF(GPIOH_PIN14, 0U) | \ PIN_AFIO_AF(GPIOH_PIN15, 0U)) /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ #if !defined(_FROM_ASM_) #ifdef __cplusplus extern "C" { #endif void boardInit(void); #ifdef __cplusplus } #endif #endif /* _FROM_ASM_ */ #endif /* BOARD_H */