diff options
| author | Andrew Kannan <andrew.kannan@gmail.com> | 2020-04-07 00:01:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-07 14:01:11 +1000 |
| commit | 0a643be39eb710649560f80c6ce0bc32576813fd (patch) | |
| tree | c8636568f352c1e71634d475899740a7f9480ea0 | |
| parent | 6c8e205fc0e5bc6372f057a257937ec3f88d5b8d (diff) | |
| download | qmk_firmware-0a643be39eb710649560f80c6ce0bc32576813fd.tar.gz qmk_firmware-0a643be39eb710649560f80c6ce0bc32576813fd.zip | |
Update 072 based CannonKeys boards to rely on core QMK support (#8716)
* Swap CannonKeys 072 boards over to rely on core QMK backlight support
* Rename keymap
* Rename via_tsangan back to via
50 files changed, 42 insertions, 14199 deletions
diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null | |||
| @@ -1,268 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "hal.h" | ||
| 23 | #include "stm32_gpio.h" | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver local definitions. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /*===========================================================================*/ | ||
| 30 | /* Driver exported variables. */ | ||
| 31 | /*===========================================================================*/ | ||
| 32 | |||
| 33 | /*===========================================================================*/ | ||
| 34 | /* Driver local variables and types. */ | ||
| 35 | /*===========================================================================*/ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @brief Type of STM32 GPIO port setup. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | uint32_t moder; | ||
| 42 | uint32_t otyper; | ||
| 43 | uint32_t ospeedr; | ||
| 44 | uint32_t pupdr; | ||
| 45 | uint32_t odr; | ||
| 46 | uint32_t afrl; | ||
| 47 | uint32_t afrh; | ||
| 48 | } gpio_setup_t; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Type of STM32 GPIO initialization data. | ||
| 52 | */ | ||
| 53 | typedef struct { | ||
| 54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
| 55 | gpio_setup_t PAData; | ||
| 56 | #endif | ||
| 57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
| 58 | gpio_setup_t PBData; | ||
| 59 | #endif | ||
| 60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
| 61 | gpio_setup_t PCData; | ||
| 62 | #endif | ||
| 63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
| 64 | gpio_setup_t PDData; | ||
| 65 | #endif | ||
| 66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
| 67 | gpio_setup_t PEData; | ||
| 68 | #endif | ||
| 69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
| 70 | gpio_setup_t PFData; | ||
| 71 | #endif | ||
| 72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
| 73 | gpio_setup_t PGData; | ||
| 74 | #endif | ||
| 75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
| 76 | gpio_setup_t PHData; | ||
| 77 | #endif | ||
| 78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
| 79 | gpio_setup_t PIData; | ||
| 80 | #endif | ||
| 81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
| 82 | gpio_setup_t PJData; | ||
| 83 | #endif | ||
| 84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
| 85 | gpio_setup_t PKData; | ||
| 86 | #endif | ||
| 87 | } gpio_config_t; | ||
| 88 | |||
| 89 | /** | ||
| 90 | * @brief STM32 GPIO static initialization data. | ||
| 91 | */ | ||
| 92 | static const gpio_config_t gpio_default_config = { | ||
| 93 | #if STM32_HAS_GPIOA | ||
| 94 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
| 95 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, | ||
| 96 | #endif | ||
| 97 | #if STM32_HAS_GPIOB | ||
| 98 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
| 99 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, | ||
| 100 | #endif | ||
| 101 | #if STM32_HAS_GPIOC | ||
| 102 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
| 103 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, | ||
| 104 | #endif | ||
| 105 | #if STM32_HAS_GPIOD | ||
| 106 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
| 107 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, | ||
| 108 | #endif | ||
| 109 | #if STM32_HAS_GPIOE | ||
| 110 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
| 111 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, | ||
| 112 | #endif | ||
| 113 | #if STM32_HAS_GPIOF | ||
| 114 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
| 115 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, | ||
| 116 | #endif | ||
| 117 | #if STM32_HAS_GPIOG | ||
| 118 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
| 119 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, | ||
| 120 | #endif | ||
| 121 | #if STM32_HAS_GPIOH | ||
| 122 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
| 123 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, | ||
| 124 | #endif | ||
| 125 | #if STM32_HAS_GPIOI | ||
| 126 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
| 127 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, | ||
| 128 | #endif | ||
| 129 | #if STM32_HAS_GPIOJ | ||
| 130 | {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
| 131 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, | ||
| 132 | #endif | ||
| 133 | #if STM32_HAS_GPIOK | ||
| 134 | {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
| 135 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} | ||
| 136 | #endif | ||
| 137 | }; | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /* Driver local functions. */ | ||
| 141 | /*===========================================================================*/ | ||
| 142 | |||
| 143 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
| 144 | |||
| 145 | gpiop->OTYPER = config->otyper; | ||
| 146 | gpiop->OSPEEDR = config->ospeedr; | ||
| 147 | gpiop->PUPDR = config->pupdr; | ||
| 148 | gpiop->ODR = config->odr; | ||
| 149 | gpiop->AFRL = config->afrl; | ||
| 150 | gpiop->AFRH = config->afrh; | ||
| 151 | gpiop->MODER = config->moder; | ||
| 152 | } | ||
| 153 | |||
| 154 | static void stm32_gpio_init(void) { | ||
| 155 | |||
| 156 | /* Enabling GPIO-related clocks, the mask comes from the | ||
| 157 | registry header file.*/ | ||
| 158 | rccResetAHB(STM32_GPIO_EN_MASK); | ||
| 159 | rccEnableAHB(STM32_GPIO_EN_MASK, true); | ||
| 160 | |||
| 161 | /* Initializing all the defined GPIO ports.*/ | ||
| 162 | #if STM32_HAS_GPIOA | ||
| 163 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
| 164 | #endif | ||
| 165 | #if STM32_HAS_GPIOB | ||
| 166 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
| 167 | #endif | ||
| 168 | #if STM32_HAS_GPIOC | ||
| 169 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
| 170 | #endif | ||
| 171 | #if STM32_HAS_GPIOD | ||
| 172 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
| 173 | #endif | ||
| 174 | #if STM32_HAS_GPIOE | ||
| 175 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
| 176 | #endif | ||
| 177 | #if STM32_HAS_GPIOF | ||
| 178 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
| 179 | #endif | ||
| 180 | #if STM32_HAS_GPIOG | ||
| 181 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
| 182 | #endif | ||
| 183 | #if STM32_HAS_GPIOH | ||
| 184 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
| 185 | #endif | ||
| 186 | #if STM32_HAS_GPIOI | ||
| 187 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
| 188 | #endif | ||
| 189 | #if STM32_HAS_GPIOJ | ||
| 190 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
| 191 | #endif | ||
| 192 | #if STM32_HAS_GPIOK | ||
| 193 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* Driver interrupt handlers. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /*===========================================================================*/ | ||
| 202 | /* Driver exported functions. */ | ||
| 203 | /*===========================================================================*/ | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @brief Early initialization code. | ||
| 207 | * @details GPIO ports and system clocks are initialized before everything | ||
| 208 | * else. | ||
| 209 | */ | ||
| 210 | void __early_init(void) { | ||
| 211 | extern void enter_bootloader_mode_if_requested(void); | ||
| 212 | enter_bootloader_mode_if_requested(); | ||
| 213 | stm32_gpio_init(); | ||
| 214 | stm32_clock_init(); | ||
| 215 | } | ||
| 216 | |||
| 217 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
| 218 | /** | ||
| 219 | * @brief SDC card detection. | ||
| 220 | */ | ||
| 221 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
| 222 | |||
| 223 | (void)sdcp; | ||
| 224 | /* TODO: Fill the implementation.*/ | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | |||
| 228 | /** | ||
| 229 | * @brief SDC card write protection detection. | ||
| 230 | */ | ||
| 231 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
| 232 | |||
| 233 | (void)sdcp; | ||
| 234 | /* TODO: Fill the implementation.*/ | ||
| 235 | return false; | ||
| 236 | } | ||
| 237 | #endif /* HAL_USE_SDC */ | ||
| 238 | |||
| 239 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
| 240 | /** | ||
| 241 | * @brief MMC_SPI card detection. | ||
| 242 | */ | ||
| 243 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
| 244 | |||
| 245 | (void)mmcp; | ||
| 246 | /* TODO: Fill the implementation.*/ | ||
| 247 | return true; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @brief MMC_SPI card write protection detection. | ||
| 252 | */ | ||
| 253 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
| 254 | |||
| 255 | (void)mmcp; | ||
| 256 | /* TODO: Fill the implementation.*/ | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif | ||
| 260 | |||
| 261 | /** | ||
| 262 | * @brief Board-specific initialization code. | ||
| 263 | * @todo Add your board-specific code, if any. | ||
| 264 | */ | ||
| 265 | void boardInit(void) { | ||
| 266 | SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; | ||
| 267 | SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); | ||
| 268 | } | ||
diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 57636d1f1..000000000 --- a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,940 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef BOARD_H | ||
| 23 | #define BOARD_H | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver constants. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Setup for ST STM32F072B-Discovery board. | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Board identifier. | ||
| 35 | */ | ||
| 36 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 37 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Board oscillators-related settings. | ||
| 41 | * NOTE: HSE not fitted. | ||
| 42 | */ | ||
| 43 | #if !defined(STM32_LSECLK) | ||
| 44 | #define STM32_LSECLK 32768 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define STM32_LSEDRV (3U << 3U) | ||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK) | ||
| 50 | #define STM32_HSECLK 0U | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define STM32_HSE_BYPASS | ||
| 54 | |||
| 55 | /* | ||
| 56 | * MCU type as defined in the ST header. | ||
| 57 | */ | ||
| 58 | #define STM32F072xB | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IO pins assignments. | ||
| 62 | */ | ||
| 63 | #define GPIOA_BUTTON 0U | ||
| 64 | #define GPIOA_PIN1 1U | ||
| 65 | #define GPIOA_PIN2 2U | ||
| 66 | #define GPIOA_PIN3 3U | ||
| 67 | #define GPIOA_PIN4 4U | ||
| 68 | #define GPIOA_PIN5 5U | ||
| 69 | #define GPIOA_PIN6 6U | ||
| 70 | #define GPIOA_PIN7 7U | ||
| 71 | #define GPIOA_PIN8 8U | ||
| 72 | #define GPIOA_PIN9 9U | ||
| 73 | #define GPIOA_PIN10 10U | ||
| 74 | #define GPIOA_USB_DM 11U | ||
| 75 | #define GPIOA_USB_DP 12U | ||
| 76 | #define GPIOA_SWDIO 13U | ||
| 77 | #define GPIOA_SWCLK 14U | ||
| 78 | #define GPIOA_PIN15 15U | ||
| 79 | |||
| 80 | #define GPIOB_PIN0 0U | ||
| 81 | #define GPIOB_PIN1 1U | ||
| 82 | #define GPIOB_PIN2 2U | ||
| 83 | #define GPIOB_PIN3 3U | ||
| 84 | #define GPIOB_PIN4 4U | ||
| 85 | #define GPIOB_PIN5 5U | ||
| 86 | #define GPIOB_PIN6 6U | ||
| 87 | #define GPIOB_PIN7 7U | ||
| 88 | #define GPIOB_PIN8 8U | ||
| 89 | #define GPIOB_PIN9 9U | ||
| 90 | #define GPIOB_PIN10 10U | ||
| 91 | #define GPIOB_PIN11 11U | ||
| 92 | #define GPIOB_PIN12 12U | ||
| 93 | #define GPIOB_SPI2_SCK 13U | ||
| 94 | #define GPIOB_SPI2_MISO 14U | ||
| 95 | #define GPIOB_SPI2_MOSI 15U | ||
| 96 | |||
| 97 | #define GPIOC_MEMS_CS 0U | ||
| 98 | #define GPIOC_PIN1 1U | ||
| 99 | #define GPIOC_PIN2 2U | ||
| 100 | #define GPIOC_PIN3 3U | ||
| 101 | #define GPIOC_PIN4 4U | ||
| 102 | #define GPIOC_PIN5 5U | ||
| 103 | #define GPIOC_LED_RED 6U | ||
| 104 | #define GPIOC_LED_BLUE 7U | ||
| 105 | #define GPIOC_LED_ORANGE 8U | ||
| 106 | #define GPIOC_LED_GREEN 9U | ||
| 107 | #define GPIOC_PIN10 10U | ||
| 108 | #define GPIOC_PIN11 11U | ||
| 109 | #define GPIOC_PIN12 12U | ||
| 110 | #define GPIOC_PIN13 13U | ||
| 111 | #define GPIOC_OSC32_IN 14U | ||
| 112 | #define GPIOC_OSC32_OUT 15U | ||
| 113 | |||
| 114 | #define GPIOD_PIN0 0U | ||
| 115 | #define GPIOD_PIN1 1U | ||
| 116 | #define GPIOD_PIN2 2U | ||
| 117 | #define GPIOD_PIN3 3U | ||
| 118 | #define GPIOD_PIN4 4U | ||
| 119 | #define GPIOD_PIN5 5U | ||
| 120 | #define GPIOD_PIN6 6U | ||
| 121 | #define GPIOD_PIN7 7U | ||
| 122 | #define GPIOD_PIN8 8U | ||
| 123 | #define GPIOD_PIN9 9U | ||
| 124 | #define GPIOD_PIN10 10U | ||
| 125 | #define GPIOD_PIN11 11U | ||
| 126 | #define GPIOD_PIN12 12U | ||
| 127 | #define GPIOD_PIN13 13U | ||
| 128 | #define GPIOD_PIN14 14U | ||
| 129 | #define GPIOD_PIN15 15U | ||
| 130 | |||
| 131 | #define GPIOE_PIN0 0U | ||
| 132 | #define GPIOE_PIN1 1U | ||
| 133 | #define GPIOE_PIN2 2U | ||
| 134 | #define GPIOE_PIN3 3U | ||
| 135 | #define GPIOE_PIN4 4U | ||
| 136 | #define GPIOE_PIN5 5U | ||
| 137 | #define GPIOE_PIN6 6U | ||
| 138 | #define GPIOE_PIN7 7U | ||
| 139 | #define GPIOE_PIN8 8U | ||
| 140 | #define GPIOE_PIN9 9U | ||
| 141 | #define GPIOE_PIN10 10U | ||
| 142 | #define GPIOE_PIN11 11U | ||
| 143 | #define GPIOE_PIN12 12U | ||
| 144 | #define GPIOE_PIN13 13U | ||
| 145 | #define GPIOE_PIN14 14U | ||
| 146 | #define GPIOE_PIN15 15U | ||
| 147 | |||
| 148 | #define GPIOF_OSC_IN 0U | ||
| 149 | #define GPIOF_OSC_OUT 1U | ||
| 150 | #define GPIOF_PIN2 2U | ||
| 151 | #define GPIOF_PIN3 3U | ||
| 152 | #define GPIOF_PIN4 4U | ||
| 153 | #define GPIOF_PIN5 5U | ||
| 154 | #define GPIOF_PIN6 6U | ||
| 155 | #define GPIOF_PIN7 7U | ||
| 156 | #define GPIOF_PIN8 8U | ||
| 157 | #define GPIOF_PIN9 9U | ||
| 158 | #define GPIOF_PIN10 10U | ||
| 159 | #define GPIOF_PIN11 11U | ||
| 160 | #define GPIOF_PIN12 12U | ||
| 161 | #define GPIOF_PIN13 13U | ||
| 162 | #define GPIOF_PIN14 14U | ||
| 163 | #define GPIOF_PIN15 15U | ||
| 164 | |||
| 165 | /* | ||
| 166 | * IO lines assignments. | ||
| 167 | */ | ||
| 168 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 169 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 170 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 171 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 172 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 173 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 174 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 175 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 176 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 177 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 178 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 179 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 180 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 181 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 182 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 183 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 184 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 185 | |||
| 186 | /*===========================================================================*/ | ||
| 187 | /* Driver pre-compile time settings. */ | ||
| 188 | /*===========================================================================*/ | ||
| 189 | |||
| 190 | /*===========================================================================*/ | ||
| 191 | /* Derived constants and error checks. */ | ||
| 192 | /*===========================================================================*/ | ||
| 193 | |||
| 194 | /*===========================================================================*/ | ||
| 195 | /* Driver data structures and types. */ | ||
| 196 | /*===========================================================================*/ | ||
| 197 | |||
| 198 | /*===========================================================================*/ | ||
| 199 | /* Driver macros. */ | ||
| 200 | /*===========================================================================*/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 204 | * in the initialization code. | ||
| 205 | * Please refer to the STM32 Reference Manual for details. | ||
| 206 | */ | ||
| 207 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 208 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 209 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 210 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 211 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 212 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 213 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 214 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 215 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 216 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 217 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 218 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 219 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 220 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 221 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 222 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * GPIOA setup: | ||
| 226 | * | ||
| 227 | * PA0 - BUTTON (input floating). | ||
| 228 | * PA1 - PIN1 (input pullup). | ||
| 229 | * PA2 - PIN2 (input pullup). | ||
| 230 | * PA3 - PIN3 (input pullup). | ||
| 231 | * PA4 - PIN4 (input pullup). | ||
| 232 | * PA5 - PIN5 (input pullup). | ||
| 233 | * PA6 - PIN6 (input pullup). | ||
| 234 | * PA7 - PIN7 (input pullup). | ||
| 235 | * PA8 - PIN8 (input pullup). | ||
| 236 | * PA9 - PIN9 (input pullup). | ||
| 237 | * PA10 - PIN10 (input pullup). | ||
| 238 | * PA11 - USB_DM (input floating). | ||
| 239 | * PA12 - USB_DP (input floating). | ||
| 240 | * PA13 - SWDIO (alternate 0). | ||
| 241 | * PA14 - SWCLK (alternate 0). | ||
| 242 | * PA15 - PIN15 (input pullup). | ||
| 243 | */ | ||
| 244 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 246 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 247 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 248 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 249 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 250 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 251 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 252 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 253 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 254 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 255 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 256 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 257 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 258 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 259 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 260 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 265 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 267 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 268 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 269 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 270 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 271 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 272 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 273 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 274 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 275 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 276 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 277 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 278 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 279 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 280 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 281 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 282 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 283 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 284 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 285 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 286 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 287 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 288 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 289 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 290 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 291 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 292 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 294 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 295 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 296 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 297 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 298 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 299 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 300 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 301 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 302 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 303 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 304 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 305 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 306 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 307 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 308 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 310 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 311 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 312 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 313 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 314 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 315 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 316 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 317 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 318 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 319 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 320 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 321 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 322 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 323 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 324 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 326 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 327 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 328 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 329 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 330 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 331 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 332 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 333 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 334 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 335 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 336 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 337 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 338 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 339 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 340 | |||
| 341 | /* | ||
| 342 | * GPIOB setup: | ||
| 343 | * | ||
| 344 | * PB0 - PIN0 (input pullup). | ||
| 345 | * PB1 - PIN1 (input pullup). | ||
| 346 | * PB2 - PIN2 (input pullup). | ||
| 347 | * PB3 - PIN3 (input pullup). | ||
| 348 | * PB4 - PIN4 (input pullup). | ||
| 349 | * PB5 - PIN5 (input pullup). | ||
| 350 | * PB6 - PIN6 (input pullup). | ||
| 351 | * PB7 - PIN7 (input pullup). | ||
| 352 | * PB8 - PIN8 (input pullup). | ||
| 353 | * PB9 - PIN9 (input pullup). | ||
| 354 | * PB10 - PIN10 (input pullup). | ||
| 355 | * PB11 - PIN11 (input pullup). | ||
| 356 | * PB12 - PIN12 (input pullup). | ||
| 357 | * PB13 - SPI2_SCK (alternate 0). | ||
| 358 | * PB14 - SPI2_MISO (alternate 0). | ||
| 359 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 360 | */ | ||
| 361 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 362 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 363 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 364 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 365 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 366 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 367 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 368 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 369 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 370 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 371 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 372 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 373 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 374 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 375 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 376 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 377 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 379 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 380 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 381 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 382 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 383 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 384 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 385 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 386 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 387 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 388 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 389 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 390 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 391 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 392 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 393 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 395 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 396 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 397 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 398 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 399 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 400 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 401 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 402 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 403 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 404 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 405 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 406 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 407 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 408 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 409 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 410 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 411 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 412 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 413 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 414 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 415 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 416 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 417 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 418 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 419 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 420 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 421 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 422 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 423 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 424 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 425 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 427 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 428 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 429 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 430 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 431 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 432 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 433 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 434 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 435 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 436 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 437 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 438 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 439 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 440 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 441 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 443 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 444 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 445 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 446 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 447 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 448 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 449 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 450 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 451 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 452 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 453 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 454 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 455 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 456 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 457 | |||
| 458 | /* | ||
| 459 | * GPIOC setup: | ||
| 460 | * | ||
| 461 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 462 | * PC1 - PIN1 (input pullup). | ||
| 463 | * PC2 - PIN2 (input pullup). | ||
| 464 | * PC3 - PIN3 (input pullup). | ||
| 465 | * PC4 - PIN4 (input pullup). | ||
| 466 | * PC5 - PIN5 (input pullup). | ||
| 467 | * PC6 - LED_RED (output pushpull maximum). | ||
| 468 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 469 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 470 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 471 | * PC10 - PIN10 (input pullup). | ||
| 472 | * PC11 - PIN11 (input pullup). | ||
| 473 | * PC12 - PIN12 (input pullup). | ||
| 474 | * PC13 - PIN13 (input pullup). | ||
| 475 | * PC14 - OSC32_IN (input floating). | ||
| 476 | * PC15 - OSC32_OUT (input floating). | ||
| 477 | */ | ||
| 478 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 480 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 481 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 482 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 483 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 484 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 485 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 486 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 487 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 488 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 489 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 490 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 491 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 492 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 493 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 494 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 496 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 497 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 498 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 499 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 500 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 501 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 502 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 503 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 504 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 505 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 506 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 507 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 508 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 509 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 510 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 511 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 512 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 513 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 514 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 515 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 516 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 517 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 518 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 519 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 520 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 521 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 522 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 523 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 524 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 525 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 526 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 527 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 528 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 529 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 530 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 531 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 532 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 533 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 534 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 535 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 536 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 537 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 538 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 539 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 540 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 541 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 542 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 544 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 545 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 546 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 547 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 548 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 549 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 550 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 551 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 552 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 553 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 554 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 555 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 556 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 557 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 558 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 560 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 561 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 562 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 563 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 564 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 565 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 566 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 567 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 568 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 569 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 570 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 571 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 572 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 573 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 574 | |||
| 575 | /* | ||
| 576 | * GPIOD setup: | ||
| 577 | * | ||
| 578 | * PD0 - PIN0 (input pullup). | ||
| 579 | * PD1 - PIN1 (input pullup). | ||
| 580 | * PD2 - PIN2 (input pullup). | ||
| 581 | * PD3 - PIN3 (input pullup). | ||
| 582 | * PD4 - PIN4 (input pullup). | ||
| 583 | * PD5 - PIN5 (input pullup). | ||
| 584 | * PD6 - PIN6 (input pullup). | ||
| 585 | * PD7 - PIN7 (input pullup). | ||
| 586 | * PD8 - PIN8 (input pullup). | ||
| 587 | * PD9 - PIN9 (input pullup). | ||
| 588 | * PD10 - PIN10 (input pullup). | ||
| 589 | * PD11 - PIN11 (input pullup). | ||
| 590 | * PD12 - PIN12 (input pullup). | ||
| 591 | * PD13 - PIN13 (input pullup). | ||
| 592 | * PD14 - PIN14 (input pullup). | ||
| 593 | * PD15 - PIN15 (input pullup). | ||
| 594 | */ | ||
| 595 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 597 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 598 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 599 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 600 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 601 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 602 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 603 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 604 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 605 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 606 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 607 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 608 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 609 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 610 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 611 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 613 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 614 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 615 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 616 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 617 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 618 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 619 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 620 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 621 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 622 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 623 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 624 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 625 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 626 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 627 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 629 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 630 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 631 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 632 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 633 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 634 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 635 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 636 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 637 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 638 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 639 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 640 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 641 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 642 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 643 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 645 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 646 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 647 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 648 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 649 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 650 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 651 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 652 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 653 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 654 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 655 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 656 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 657 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 658 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 659 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 661 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 662 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 663 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 664 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 665 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 666 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 667 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 668 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 669 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 670 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 671 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 672 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 673 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 674 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 675 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 677 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 678 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 679 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 680 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 681 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 682 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 683 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 684 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 685 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 686 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 687 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 688 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 689 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 690 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 691 | |||
| 692 | /* | ||
| 693 | * GPIOE setup: | ||
| 694 | * | ||
| 695 | * PE0 - PIN0 (input pullup). | ||
| 696 | * PE1 - PIN1 (input pullup). | ||
| 697 | * PE2 - PIN2 (input pullup). | ||
| 698 | * PE3 - PIN3 (input pullup). | ||
| 699 | * PE4 - PIN4 (input pullup). | ||
| 700 | * PE5 - PIN5 (input pullup). | ||
| 701 | * PE6 - PIN6 (input pullup). | ||
| 702 | * PE7 - PIN7 (input pullup). | ||
| 703 | * PE8 - PIN8 (input pullup). | ||
| 704 | * PE9 - PIN9 (input pullup). | ||
| 705 | * PE10 - PIN10 (input pullup). | ||
| 706 | * PE11 - PIN11 (input pullup). | ||
| 707 | * PE12 - PIN12 (input pullup). | ||
| 708 | * PE13 - PIN13 (input pullup). | ||
| 709 | * PE14 - PIN14 (input pullup). | ||
| 710 | * PE15 - PIN15 (input pullup). | ||
| 711 | */ | ||
| 712 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 714 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 715 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 716 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 717 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 718 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 719 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 720 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 721 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 722 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 723 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 724 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 725 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 726 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 727 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 728 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 730 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 731 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 732 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 733 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 734 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 735 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 736 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 737 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 738 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 739 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 740 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 741 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 742 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 743 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 744 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 746 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 747 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 748 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 749 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 750 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 751 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 752 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 753 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 754 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 755 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 756 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 757 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 758 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 759 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 760 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 762 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 763 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 764 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 765 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 766 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 767 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 768 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 769 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 770 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 771 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 772 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 773 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 774 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 775 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 776 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 778 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 779 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 780 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 781 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 782 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 783 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 784 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 785 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 786 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 787 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 788 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 789 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 790 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 791 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 792 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 794 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 795 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 796 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 797 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 798 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 799 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 800 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 801 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 802 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 803 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 804 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 805 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 806 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 807 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 808 | |||
| 809 | /* | ||
| 810 | * GPIOF setup: | ||
| 811 | * | ||
| 812 | * PF0 - OSC_IN (input floating). | ||
| 813 | * PF1 - OSC_OUT (input floating). | ||
| 814 | * PF2 - PIN2 (input pullup). | ||
| 815 | * PF3 - PIN3 (input pullup). | ||
| 816 | * PF4 - PIN4 (input pullup). | ||
| 817 | * PF5 - PIN5 (input pullup). | ||
| 818 | * PF6 - PIN6 (input pullup). | ||
| 819 | * PF7 - PIN7 (input pullup). | ||
| 820 | * PF8 - PIN8 (input pullup). | ||
| 821 | * PF9 - PIN9 (input pullup). | ||
| 822 | * PF10 - PIN10 (input pullup). | ||
| 823 | * PF11 - PIN11 (input pullup). | ||
| 824 | * PF12 - PIN12 (input pullup). | ||
| 825 | * PF13 - PIN13 (input pullup). | ||
| 826 | * PF14 - PIN14 (input pullup). | ||
| 827 | * PF15 - PIN15 (input pullup). | ||
| 828 | */ | ||
| 829 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 831 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 832 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 833 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 834 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 835 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 836 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 837 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 838 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 839 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 840 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 841 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 842 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 843 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 844 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 845 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 847 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 848 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 849 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 850 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 851 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 852 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 853 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 854 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 855 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 856 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 857 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 858 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 859 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 860 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 861 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 863 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 864 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 865 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 866 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 867 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 868 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 869 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 870 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 871 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 872 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 873 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 874 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 875 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 876 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 877 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 878 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 879 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 880 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 881 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 882 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 883 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 884 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 885 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 886 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 887 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 888 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 889 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 890 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 891 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 892 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 893 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 895 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 896 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 897 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 898 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 899 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 900 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 901 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 902 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 903 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 904 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 905 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 906 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 907 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 908 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 909 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 911 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 912 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 913 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 914 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 915 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 916 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 917 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 918 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 919 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 920 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 921 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 922 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 923 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 924 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 925 | |||
| 926 | /*===========================================================================*/ | ||
| 927 | /* External declarations. */ | ||
| 928 | /*===========================================================================*/ | ||
| 929 | |||
| 930 | #if !defined(_FROM_ASM_) | ||
| 931 | #ifdef __cplusplus | ||
| 932 | extern "C" { | ||
| 933 | #endif | ||
| 934 | void boardInit(void); | ||
| 935 | #ifdef __cplusplus | ||
| 936 | } | ||
| 937 | #endif | ||
| 938 | #endif /* _FROM_ASM_ */ | ||
| 939 | |||
| 940 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # List of all the board related files. | ||
| 2 | BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c | ||
| 3 | |||
| 4 | # Required include directories | ||
| 5 | BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY | ||
diff --git a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg deleted file mode 100644 index 9c7cf4fd7..000000000 --- a/keyboards/cannonkeys/an_c/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg +++ /dev/null | |||
| @@ -1,703 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!-- STM32F0xx board Template --> | ||
| 3 | <board | ||
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 5 | xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> | ||
| 6 | <configuration_settings> | ||
| 7 | <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> | ||
| 8 | <output_path>..</output_path> | ||
| 9 | <hal_version>3.0.x</hal_version> | ||
| 10 | </configuration_settings> | ||
| 11 | <board_name>ST STM32F072B-Discovery</board_name> | ||
| 12 | <board_id>ST_STM32F072B_DISCOVERY</board_id> | ||
| 13 | <board_functions></board_functions> | ||
| 14 | <subtype>STM32F072xB</subtype> | ||
| 15 | <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" | ||
| 16 | LSEBypass="false" LSEDrive="3 High Drive (default)" /> | ||
| 17 | <ports> | ||
| 18 | <GPIOA> | ||
| 19 | <pin0 | ||
| 20 | ID="BUTTON" | ||
| 21 | Type="PushPull" | ||
| 22 | Speed="Minimum" | ||
| 23 | Resistor="Floating" | ||
| 24 | Level="High" | ||
| 25 | Mode="Input" | ||
| 26 | Alternate="0" /> | ||
| 27 | <pin1 | ||
| 28 | ID="" | ||
| 29 | Type="PushPull" | ||
| 30 | Speed="Minimum" | ||
| 31 | Resistor="PullUp" | ||
| 32 | Level="High" | ||
| 33 | Mode="Input" | ||
| 34 | Alternate="0" /> | ||
| 35 | <pin2 | ||
| 36 | ID="" | ||
| 37 | Type="PushPull" | ||
| 38 | Speed="Minimum" | ||
| 39 | Resistor="PullUp" | ||
| 40 | Level="High" | ||
| 41 | Mode="Input" | ||
| 42 | Alternate="0" /> | ||
| 43 | <pin3 | ||
| 44 | ID="" | ||
| 45 | Type="PushPull" | ||
| 46 | Speed="Minimum" | ||
| 47 | Resistor="PullUp" | ||
| 48 | Level="High" | ||
| 49 | Mode="Input" | ||
| 50 | Alternate="0" /> | ||
| 51 | <pin4 | ||
| 52 | ID="" | ||
| 53 | Type="PushPull" | ||
| 54 | Speed="Minimum" | ||
| 55 | Resistor="PullUp" | ||
| 56 | Level="High" | ||
| 57 | Mode="Input" | ||
| 58 | Alternate="0" /> | ||
| 59 | <pin5 | ||
| 60 | ID="" | ||
| 61 | Type="PushPull" | ||
| 62 | Speed="Minimum" | ||
| 63 | Resistor="PullUp" | ||
| 64 | Level="High" | ||
| 65 | Mode="Input" | ||
| 66 | Alternate="0" /> | ||
| 67 | <pin6 | ||
| 68 | ID="" | ||
| 69 | Type="PushPull" | ||
| 70 | Speed="Minimum" | ||
| 71 | Resistor="PullUp" | ||
| 72 | Level="High" | ||
| 73 | Mode="Input" | ||
| 74 | Alternate="0" /> | ||
| 75 | <pin7 | ||
| 76 | ID="" | ||
| 77 | Type="PushPull" | ||
| 78 | Speed="Minimum" | ||
| 79 | Resistor="PullUp" | ||
| 80 | Level="High" | ||
| 81 | Mode="Input" | ||
| 82 | Alternate="0" /> | ||
| 83 | <pin8 | ||
| 84 | ID="" | ||
| 85 | Type="PushPull" | ||
| 86 | Speed="Minimum" | ||
| 87 | Resistor="PullUp" | ||
| 88 | Level="High" | ||
| 89 | Mode="Input" | ||
| 90 | Alternate="0" /> | ||
| 91 | <pin9 | ||
| 92 | ID="" | ||
| 93 | Type="PushPull" | ||
| 94 | Speed="Minimum" | ||
| 95 | Resistor="PullUp" | ||
| 96 | Level="High" | ||
| 97 | Mode="Input" | ||
| 98 | Alternate="0" /> | ||
| 99 | <pin10 | ||
| 100 | ID="" | ||
| 101 | Type="PushPull" | ||
| 102 | Speed="Minimum" | ||
| 103 | Resistor="PullUp" | ||
| 104 | Level="High" | ||
| 105 | Mode="Input" | ||
| 106 | Alternate="0" /> | ||
| 107 | <pin11 | ||
| 108 | ID="USB_DM" | ||
| 109 | Type="PushPull" | ||
| 110 | Speed="Minimum" | ||
| 111 | Resistor="Floating" | ||
| 112 | Level="High" | ||
| 113 | Mode="Input" | ||
| 114 | Alternate="0" /> | ||
| 115 | <pin12 | ||
| 116 | ID="USB_DP" | ||
| 117 | Type="PushPull" | ||
| 118 | Speed="Minimum" | ||
| 119 | Resistor="Floating" | ||
| 120 | Level="High" | ||
| 121 | Mode="Input" | ||
| 122 | Alternate="0" /> | ||
| 123 | <pin13 | ||
| 124 | ID="SWDIO" | ||
| 125 | Type="PushPull" | ||
| 126 | Speed="Maximum" | ||
| 127 | Resistor="PullUp" | ||
| 128 | Level="High" | ||
| 129 | Mode="Alternate" | ||
| 130 | Alternate="0" /> | ||
| 131 | <pin14 | ||
| 132 | ID="SWCLK" | ||
| 133 | Type="PushPull" | ||
| 134 | Speed="Maximum" | ||
| 135 | Resistor="PullDown" | ||
| 136 | Level="High" | ||
| 137 | Mode="Alternate" | ||
| 138 | Alternate="0" /> | ||
| 139 | <pin15 | ||
| 140 | ID="" | ||
| 141 | Type="PushPull" | ||
| 142 | Speed="Maximum" | ||
| 143 | Resistor="PullUp" | ||
| 144 | Level="High" | ||
| 145 | Mode="Input" | ||
| 146 | Alternate="0" /> | ||
| 147 | </GPIOA> | ||
| 148 | <GPIOB> | ||
| 149 | <pin0 | ||
| 150 | ID="" | ||
| 151 | Type="PushPull" | ||
| 152 | Speed="Minimum" | ||
| 153 | Resistor="PullUp" | ||
| 154 | Level="High" | ||
| 155 | Mode="Input" | ||
| 156 | Alternate="0" /> | ||
| 157 | <pin1 | ||
| 158 | ID="" | ||
| 159 | Type="PushPull" | ||
| 160 | Speed="Minimum" | ||
| 161 | Resistor="PullUp" | ||
| 162 | Level="High" | ||
| 163 | Mode="Input" | ||
| 164 | Alternate="0" /> | ||
| 165 | <pin2 | ||
| 166 | ID="" | ||
| 167 | Type="PushPull" | ||
| 168 | Speed="Maximum" | ||
| 169 | Resistor="PullUp" | ||
| 170 | Level="High" | ||
| 171 | Mode="Input" | ||
| 172 | Alternate="0" /> | ||
| 173 | <pin3 | ||
| 174 | ID="" | ||
| 175 | Type="PushPull" | ||
| 176 | Speed="Maximum" | ||
| 177 | Resistor="PullUp" | ||
| 178 | Level="High" | ||
| 179 | Mode="Input" | ||
| 180 | Alternate="0" /> | ||
| 181 | <pin4 | ||
| 182 | ID="" | ||
| 183 | Type="PushPull" | ||
| 184 | Speed="Maximum" | ||
| 185 | Resistor="PullUp" | ||
| 186 | Level="High" | ||
| 187 | Mode="Input" | ||
| 188 | Alternate="0" /> | ||
| 189 | <pin5 | ||
| 190 | ID="" | ||
| 191 | Type="PushPull" | ||
| 192 | Speed="Minimum" | ||
| 193 | Resistor="PullUp" | ||
| 194 | Level="High" | ||
| 195 | Mode="Input" | ||
| 196 | Alternate="0" /> | ||
| 197 | <pin6 | ||
| 198 | ID="" | ||
| 199 | Type="PushPull" | ||
| 200 | Speed="Minimum" | ||
| 201 | Resistor="PullUp" | ||
| 202 | Level="High" | ||
| 203 | Mode="Input" | ||
| 204 | Alternate="0" /> | ||
| 205 | <pin7 | ||
| 206 | ID="" | ||
| 207 | Type="PushPull" | ||
| 208 | Speed="Minimum" | ||
| 209 | Resistor="PullUp" | ||
| 210 | Level="High" | ||
| 211 | Mode="Input" | ||
| 212 | Alternate="0" /> | ||
| 213 | <pin8 | ||
| 214 | ID="" | ||
| 215 | Type="PushPull" | ||
| 216 | Speed="Minimum" | ||
| 217 | Resistor="PullUp" | ||
| 218 | Level="High" | ||
| 219 | Mode="Input" | ||
| 220 | Alternate="0" /> | ||
| 221 | <pin9 | ||
| 222 | ID="" | ||
| 223 | Type="PushPull" | ||
| 224 | Speed="Minimum" | ||
| 225 | Resistor="PullUp" | ||
| 226 | Level="High" | ||
| 227 | Mode="Input" | ||
| 228 | Alternate="0" /> | ||
| 229 | <pin10 | ||
| 230 | ID="" | ||
| 231 | Type="PushPull" | ||
| 232 | Speed="Minimum" | ||
| 233 | Resistor="PullUp" | ||
| 234 | Level="High" | ||
| 235 | Mode="Input" | ||
| 236 | Alternate="0" /> | ||
| 237 | <pin11 | ||
| 238 | ID="" | ||
| 239 | Type="PushPull" | ||
| 240 | Speed="Minimum" | ||
| 241 | Resistor="PullUp" | ||
| 242 | Level="High" | ||
| 243 | Mode="Input" | ||
| 244 | Alternate="0" /> | ||
| 245 | <pin12 | ||
| 246 | ID="" | ||
| 247 | Type="PushPull" | ||
| 248 | Speed="Minimum" | ||
| 249 | Resistor="PullUp" | ||
| 250 | Level="High" | ||
| 251 | Mode="Input" | ||
| 252 | Alternate="0" /> | ||
| 253 | <pin13 | ||
| 254 | ID="SPI2_SCK" | ||
| 255 | Type="PushPull" | ||
| 256 | Speed="Minimum" | ||
| 257 | Resistor="Floating" | ||
| 258 | Level="High" | ||
| 259 | Mode="Alternate" | ||
| 260 | Alternate="0" /> | ||
| 261 | <pin14 | ||
| 262 | ID="SPI2_MISO" | ||
| 263 | Type="PushPull" | ||
| 264 | Speed="Minimum" | ||
| 265 | Resistor="Floating" | ||
| 266 | Level="High" | ||
| 267 | Mode="Alternate" | ||
| 268 | Alternate="0" /> | ||
| 269 | <pin15 | ||
| 270 | ID="SPI2_MOSI" | ||
| 271 | Type="PushPull" | ||
| 272 | Speed="Minimum" | ||
| 273 | Resistor="Floating" | ||
| 274 | Level="High" | ||
| 275 | Mode="Alternate" | ||
| 276 | Alternate="0" /> | ||
| 277 | </GPIOB> | ||
| 278 | <GPIOC> | ||
| 279 | <pin0 | ||
| 280 | ID="MEMS_CS" | ||
| 281 | Type="PushPull" | ||
| 282 | Speed="Maximum" | ||
| 283 | Resistor="Floating" | ||
| 284 | Level="High" | ||
| 285 | Mode="Output" | ||
| 286 | Alternate="0" /> | ||
| 287 | <pin1 | ||
| 288 | ID="" | ||
| 289 | Type="PushPull" | ||
| 290 | Speed="Minimum" | ||
| 291 | Resistor="PullUp" | ||
| 292 | Level="High" | ||
| 293 | Mode="Input" | ||
| 294 | Alternate="0" /> | ||
| 295 | <pin2 | ||
| 296 | ID="" | ||
| 297 | Type="PushPull" | ||
| 298 | Speed="Minimum" | ||
| 299 | Resistor="PullUp" | ||
| 300 | Level="High" | ||
| 301 | Mode="Input" | ||
| 302 | Alternate="0" /> | ||
| 303 | <pin3 | ||
| 304 | ID="" | ||
| 305 | Type="PushPull" | ||
| 306 | Speed="Minimum" | ||
| 307 | Resistor="PullUp" | ||
| 308 | Level="High" | ||
| 309 | Mode="Input" | ||
| 310 | Alternate="0" /> | ||
| 311 | <pin4 | ||
| 312 | ID="" | ||
| 313 | Type="PushPull" | ||
| 314 | Speed="Minimum" | ||
| 315 | Resistor="PullUp" | ||
| 316 | Level="High" | ||
| 317 | Mode="Input" | ||
| 318 | Alternate="0" /> | ||
| 319 | <pin5 | ||
| 320 | ID="" | ||
| 321 | Type="PushPull" | ||
| 322 | Speed="Minimum" | ||
| 323 | Resistor="PullUp" | ||
| 324 | Level="High" | ||
| 325 | Mode="Input" | ||
| 326 | Alternate="0" /> | ||
| 327 | <pin6 | ||
| 328 | ID="LED_RED" | ||
| 329 | Type="PushPull" | ||
| 330 | Speed="Maximum" | ||
| 331 | Resistor="Floating" | ||
| 332 | Level="Low" | ||
| 333 | Mode="Output" | ||
| 334 | Alternate="0" /> | ||
| 335 | <pin7 | ||
| 336 | ID="LED_BLUE" | ||
| 337 | Type="PushPull" | ||
| 338 | Speed="Maximum" | ||
| 339 | Resistor="Floating" | ||
| 340 | Level="Low" | ||
| 341 | Mode="Output" | ||
| 342 | Alternate="0" /> | ||
| 343 | <pin8 | ||
| 344 | ID="LED_ORANGE" | ||
| 345 | Type="PushPull" | ||
| 346 | Speed="Maximum" | ||
| 347 | Resistor="Floating" | ||
| 348 | Level="Low" | ||
| 349 | Mode="Output" | ||
| 350 | Alternate="0" ></pin8> | ||
| 351 | <pin9 | ||
| 352 | ID="LED_GREEN" | ||
| 353 | Type="PushPull" | ||
| 354 | Speed="Maximum" | ||
| 355 | Resistor="Floating" | ||
| 356 | Level="Low" | ||
| 357 | Mode="Output" | ||
| 358 | Alternate="0" /> | ||
| 359 | <pin10 | ||
| 360 | ID="" | ||
| 361 | Type="PushPull" | ||
| 362 | Speed="Minimum" | ||
| 363 | Resistor="PullUp" | ||
| 364 | Level="High" | ||
| 365 | Mode="Input" | ||
| 366 | Alternate="0" /> | ||
| 367 | <pin11 | ||
| 368 | ID="" | ||
| 369 | Type="PushPull" | ||
| 370 | Speed="Minimum" | ||
| 371 | Resistor="PullUp" | ||
| 372 | Level="High" | ||
| 373 | Mode="Input" | ||
| 374 | Alternate="0" /> | ||
| 375 | <pin12 | ||
| 376 | ID="" | ||
| 377 | Type="PushPull" | ||
| 378 | Speed="Minimum" | ||
| 379 | Resistor="PullUp" | ||
| 380 | Level="High" | ||
| 381 | Mode="Input" | ||
| 382 | Alternate="0" /> | ||
| 383 | <pin13 | ||
| 384 | ID="" | ||
| 385 | Type="PushPull" | ||
| 386 | Speed="Minimum" | ||
| 387 | Resistor="PullUp" | ||
| 388 | Level="High" | ||
| 389 | Mode="Input" | ||
| 390 | Alternate="0" /> | ||
| 391 | <pin14 | ||
| 392 | ID="OSC32_IN" | ||
| 393 | Type="PushPull" | ||
| 394 | Speed="Maximum" | ||
| 395 | Resistor="Floating" | ||
| 396 | Level="High" | ||
| 397 | Mode="Input" | ||
| 398 | Alternate="0" /> | ||
| 399 | <pin15 | ||
| 400 | ID="OSC32_OUT" | ||
| 401 | Type="PushPull" | ||
| 402 | Speed="Maximum" | ||
| 403 | Resistor="Floating" | ||
| 404 | Level="High" | ||
| 405 | Mode="Input" | ||
| 406 | Alternate="0" /> | ||
| 407 | </GPIOC> | ||
| 408 | <GPIOD> | ||
| 409 | <pin0 | ||
| 410 | ID="" | ||
| 411 | Type="PushPull" | ||
| 412 | Speed="Minimum" | ||
| 413 | Resistor="PullUp" | ||
| 414 | Level="High" | ||
| 415 | Mode="Input" | ||
| 416 | Alternate="0" /> | ||
| 417 | <pin1 | ||
| 418 | ID="" | ||
| 419 | Type="PushPull" | ||
| 420 | Speed="Minimum" | ||
| 421 | Resistor="PullUp" | ||
| 422 | Level="High" | ||
| 423 | Mode="Input" | ||
| 424 | Alternate="0" /> | ||
| 425 | <pin2 | ||
| 426 | ID="" | ||
| 427 | Type="PushPull" | ||
| 428 | Speed="Minimum" | ||
| 429 | Resistor="PullUp" | ||
| 430 | Level="High" | ||
| 431 | Mode="Input" | ||
| 432 | Alternate="0" /> | ||
| 433 | <pin3 | ||
| 434 | ID="" | ||
| 435 | Type="PushPull" | ||
| 436 | Speed="Minimum" | ||
| 437 | Resistor="PullUp" | ||
| 438 | Level="High" | ||
| 439 | Mode="Input" | ||
| 440 | Alternate="0" /> | ||
| 441 | <pin4 | ||
| 442 | ID="" | ||
| 443 | Type="PushPull" | ||
| 444 | Speed="Minimum" | ||
| 445 | Resistor="PullUp" | ||
| 446 | Level="High" | ||
| 447 | Mode="Input" | ||
| 448 | Alternate="0" /> | ||
| 449 | <pin5 | ||
| 450 | ID="" | ||
| 451 | Type="PushPull" | ||
| 452 | Speed="Minimum" | ||
| 453 | Resistor="PullUp" | ||
| 454 | Level="High" | ||
| 455 | Mode="Input" | ||
| 456 | Alternate="0" /> | ||
| 457 | <pin6 | ||
| 458 | ID="" | ||
| 459 | Type="PushPull" | ||
| 460 | Speed="Minimum" | ||
| 461 | Resistor="PullUp" | ||
| 462 | Level="High" | ||
| 463 | Mode="Input" | ||
| 464 | Alternate="0" /> | ||
| 465 | <pin7 | ||
| 466 | ID="" | ||
| 467 | Type="PushPull" | ||
| 468 | Speed="Minimum" | ||
| 469 | Resistor="PullUp" | ||
| 470 | Level="High" | ||
| 471 | Mode="Input" | ||
| 472 | Alternate="0" /> | ||
| 473 | <pin8 | ||
| 474 | ID="" | ||
| 475 | Type="PushPull" | ||
| 476 | Speed="Minimum" | ||
| 477 | Resistor="PullUp" | ||
| 478 | Level="High" | ||
| 479 | Mode="Input" | ||
| 480 | Alternate="0" /> | ||
| 481 | <pin9 | ||
| 482 | ID="" | ||
| 483 | Type="PushPull" | ||
| 484 | Speed="Minimum" | ||
| 485 | Resistor="PullUp" | ||
| 486 | Level="High" | ||
| 487 | Mode="Input" | ||
| 488 | Alternate="0" /> | ||
| 489 | <pin10 | ||
| 490 | ID="" | ||
| 491 | Type="PushPull" | ||
| 492 | Speed="Minimum" | ||
| 493 | Resistor="PullUp" | ||
| 494 | Level="High" | ||
| 495 | Mode="Input" | ||
| 496 | Alternate="0" /> | ||
| 497 | <pin11 | ||
| 498 | ID="" | ||
| 499 | Type="PushPull" | ||
| 500 | Speed="Minimum" | ||
| 501 | Resistor="PullUp" | ||
| 502 | Level="High" | ||
| 503 | Mode="Input" | ||
| 504 | Alternate="0" /> | ||
| 505 | <pin12 | ||
| 506 | ID="" | ||
| 507 | Type="PushPull" | ||
| 508 | Speed="Minimum" | ||
| 509 | Resistor="PullUp" | ||
| 510 | Level="High" | ||
| 511 | Mode="Input" | ||
| 512 | Alternate="0" /> | ||
| 513 | <pin13 | ||
| 514 | ID="" | ||
| 515 | Type="PushPull" | ||
| 516 | Speed="Minimum" | ||
| 517 | Resistor="PullUp" | ||
| 518 | Level="High" | ||
| 519 | Mode="Input" | ||
| 520 | Alternate="0" /> | ||
| 521 | <pin14 | ||
| 522 | ID="" | ||
| 523 | Type="PushPull" | ||
| 524 | Speed="Minimum" | ||
| 525 | Resistor="PullUp" | ||
| 526 | Level="High" | ||
| 527 | Mode="Input" | ||
| 528 | Alternate="0" /> | ||
| 529 | <pin15 | ||
| 530 | ID="" | ||
| 531 | Type="PushPull" | ||
| 532 | Speed="Minimum" | ||
| 533 | Resistor="PullUp" | ||
| 534 | Level="High" | ||
| 535 | Mode="Input" | ||
| 536 | Alternate="0" /> | ||
| 537 | </GPIOD> | ||
| 538 | <GPIOE> | ||
| 539 | <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 540 | Level="High" Mode="Input" Alternate="0" /> | ||
| 541 | <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 542 | Level="High" Mode="Input" Alternate="0" /> | ||
| 543 | <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 544 | Level="High" Mode="Input" Alternate="0" /> | ||
| 545 | <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 546 | Level="High" Mode="Input" Alternate="0" /> | ||
| 547 | <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 548 | Level="High" Mode="Input" Alternate="0" /> | ||
| 549 | <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 550 | Level="High" Mode="Input" Alternate="0" /> | ||
| 551 | <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 552 | Level="High" Mode="Input" Alternate="0" /> | ||
| 553 | <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 554 | Level="High" Mode="Input" Alternate="0" /> | ||
| 555 | <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 556 | Level="High" Mode="Input" Alternate="0" /> | ||
| 557 | <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 558 | Level="High" Mode="Input" Alternate="0" /> | ||
| 559 | <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 560 | Level="High" Mode="Input" Alternate="0" /> | ||
| 561 | <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 562 | Level="High" Mode="Input" Alternate="0" /> | ||
| 563 | <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 564 | Level="High" Mode="Input" Alternate="0" /> | ||
| 565 | <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 566 | Level="High" Mode="Input" Alternate="0" /> | ||
| 567 | <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 568 | Level="High" Mode="Input" Alternate="0" /> | ||
| 569 | <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 570 | Level="High" Mode="Input" Alternate="0" /> | ||
| 571 | </GPIOE> | ||
| 572 | <GPIOF> | ||
| 573 | <pin0 | ||
| 574 | ID="OSC_IN" | ||
| 575 | Type="PushPull" | ||
| 576 | Speed="Minimum" | ||
| 577 | Resistor="Floating" | ||
| 578 | Level="High" | ||
| 579 | Mode="Input" | ||
| 580 | Alternate="0" /> | ||
| 581 | <pin1 | ||
| 582 | ID="OSC_OUT" | ||
| 583 | Type="PushPull" | ||
| 584 | Speed="Minimum" | ||
| 585 | Resistor="Floating" | ||
| 586 | Level="High" | ||
| 587 | Mode="Input" | ||
| 588 | Alternate="0" /> | ||
| 589 | <pin2 | ||
| 590 | ID="" | ||
| 591 | Type="PushPull" | ||
| 592 | Speed="Minimum" | ||
| 593 | Resistor="PullUp" | ||
| 594 | Level="High" | ||
| 595 | Mode="Input" | ||
| 596 | Alternate="0" /> | ||
| 597 | <pin3 | ||
| 598 | ID="" | ||
| 599 | Type="PushPull" | ||
| 600 | Speed="Minimum" | ||
| 601 | Resistor="PullUp" | ||
| 602 | Level="High" | ||
| 603 | Mode="Input" | ||
| 604 | Alternate="0" /> | ||
| 605 | <pin4 | ||
| 606 | ID="" | ||
| 607 | Type="PushPull" | ||
| 608 | Speed="Minimum" | ||
| 609 | Resistor="PullUp" | ||
| 610 | Level="High" | ||
| 611 | Mode="Input" | ||
| 612 | Alternate="0" /> | ||
| 613 | <pin5 | ||
| 614 | ID="" | ||
| 615 | Type="PushPull" | ||
| 616 | Speed="Minimum" | ||
| 617 | Resistor="PullUp" | ||
| 618 | Level="High" | ||
| 619 | Mode="Input" | ||
| 620 | Alternate="0" /> | ||
| 621 | <pin6 | ||
| 622 | ID="" | ||
| 623 | Type="PushPull" | ||
| 624 | Speed="Minimum" | ||
| 625 | Resistor="PullUp" | ||
| 626 | Level="High" | ||
| 627 | Mode="Input" | ||
| 628 | Alternate="0" /> | ||
| 629 | <pin7 | ||
| 630 | ID="" | ||
| 631 | Type="PushPull" | ||
| 632 | Speed="Minimum" | ||
| 633 | Resistor="PullUp" | ||
| 634 | Level="High" | ||
| 635 | Mode="Input" | ||
| 636 | Alternate="0" /> | ||
| 637 | <pin8 | ||
| 638 | ID="" | ||
| 639 | Type="PushPull" | ||
| 640 | Speed="Minimum" | ||
| 641 | Resistor="PullUp" | ||
| 642 | Level="High" | ||
| 643 | Mode="Input" | ||
| 644 | Alternate="0" /> | ||
| 645 | <pin9 | ||
| 646 | ID="" | ||
| 647 | Type="PushPull" | ||
| 648 | Speed="Minimum" | ||
| 649 | Resistor="PullUp" | ||
| 650 | Level="High" | ||
| 651 | Mode="Input" | ||
| 652 | Alternate="0" /> | ||
| 653 | <pin10 | ||
| 654 | ID="" | ||
| 655 | Type="PushPull" | ||
| 656 | Speed="Minimum" | ||
| 657 | Resistor="PullUp" | ||
| 658 | Level="High" | ||
| 659 | Mode="Input" | ||
| 660 | Alternate="0" /> | ||
| 661 | <pin11 | ||
| 662 | ID="" | ||
| 663 | Type="PushPull" | ||
| 664 | Speed="Minimum" | ||
| 665 | Resistor="PullUp" | ||
| 666 | Level="High" | ||
| 667 | Mode="Input" | ||
| 668 | Alternate="0" /> | ||
| 669 | <pin12 | ||
| 670 | ID="" | ||
| 671 | Type="PushPull" | ||
| 672 | Speed="Minimum" | ||
| 673 | Resistor="PullUp" | ||
| 674 | Level="High" | ||
| 675 | Mode="Input" | ||
| 676 | Alternate="0" /> | ||
| 677 | <pin13 | ||
| 678 | ID="" | ||
| 679 | Type="PushPull" | ||
| 680 | Speed="Minimum" | ||
| 681 | Resistor="PullUp" | ||
| 682 | Level="High" | ||
| 683 | Mode="Input" | ||
| 684 | Alternate="0" /> | ||
| 685 | <pin14 | ||
| 686 | ID="" | ||
| 687 | Type="PushPull" | ||
| 688 | Speed="Minimum" | ||
| 689 | Resistor="PullUp" | ||
| 690 | Level="High" | ||
| 691 | Mode="Input" | ||
| 692 | Alternate="0" /> | ||
| 693 | <pin15 | ||
| 694 | ID="" | ||
| 695 | Type="PushPull" | ||
| 696 | Speed="Minimum" | ||
| 697 | Resistor="PullUp" | ||
| 698 | Level="High" | ||
| 699 | Mode="Input" | ||
| 700 | Alternate="0" /> | ||
| 701 | </GPIOF> | ||
| 702 | </ports> | ||
| 703 | </board> | ||
diff --git a/keyboards/cannonkeys/an_c/config.h b/keyboards/cannonkeys/an_c/config.h index fd73aad8b..0eb1d730f 100644 --- a/keyboards/cannonkeys/an_c/config.h +++ b/keyboards/cannonkeys/an_c/config.h | |||
| @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 33 | #define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } | 33 | #define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } |
| 34 | #define DIODE_DIRECTION COL2ROW | 34 | #define DIODE_DIRECTION COL2ROW |
| 35 | 35 | ||
| 36 | #define BACKLIGHT_PIN A6 | ||
| 37 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 38 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 39 | #define BACKLIGHT_PAL_MODE 1 | ||
| 36 | #define BACKLIGHT_LEVELS 6 | 40 | #define BACKLIGHT_LEVELS 6 |
| 37 | #define BACKLIGHT_BREATHING | 41 | #define BACKLIGHT_BREATHING |
| 38 | #define BREATHING_PERIOD 6 | 42 | #define BREATHING_PERIOD 6 |
| @@ -52,16 +56,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 52 | #define RGB_DI_PIN B15 | 56 | #define RGB_DI_PIN B15 |
| 53 | #define RGBLED_NUM 14 | 57 | #define RGBLED_NUM 14 |
| 54 | #define WS2812_SPI SPID2 | 58 | #define WS2812_SPI SPID2 |
| 55 | 59 | #define WS2812_SPI_MOSI_PAL_MODE 0 | |
| 56 | // Backlight config starts after VIA's EEPROM usage, | ||
| 57 | // dynamic keymaps start after this. | ||
| 58 | #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 1 | ||
| 59 | |||
| 60 | // VIA lighting is handled by the keyboard-level code | ||
| 61 | #define VIA_CUSTOM_LIGHTING_ENABLE | ||
| 62 | |||
| 63 | // Let VIA handle the QMK RGBLIGHT | ||
| 64 | #define VIA_QMK_RGBLIGHT_ENABLE | ||
| 65 | 60 | ||
| 66 | /* | 61 | /* |
| 67 | * Feature disable options | 62 | * Feature disable options |
diff --git a/keyboards/cannonkeys/an_c/rules.mk b/keyboards/cannonkeys/an_c/rules.mk index 4c432cf98..d97022249 100644 --- a/keyboards/cannonkeys/an_c/rules.mk +++ b/keyboards/cannonkeys/an_c/rules.mk | |||
| @@ -1,15 +1,10 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = STM32F072 | 2 | MCU = STM32F072 |
| 3 | BOARD = ST_STM32F072B_DISCOVERY | ||
| 4 | 3 | ||
| 5 | # Build Options | 4 | # Build Options |
| 6 | # comment out to disable the options. | 5 | # comment out to disable the options. |
| 7 | # | 6 | # |
| 8 | 7 | ||
| 9 | # project specific files | ||
| 10 | VPATH += keyboards/cannonkeys/stm32f072 | ||
| 11 | SRC = keyboard.c \ | ||
| 12 | led.c | ||
| 13 | 8 | ||
| 14 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | 9 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 15 | MOUSEKEY_ENABLE = yes # Mouse keys | 10 | MOUSEKEY_ENABLE = yes # Mouse keys |
| @@ -19,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 19 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 20 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 21 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
| 22 | # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason | 17 | BACKLIGHT_ENABLE = yes |
| 23 | RGBLIGHT_ENABLE = yes | 18 | RGBLIGHT_ENABLE = yes |
| 24 | WS2812_DRIVER = spi | 19 | WS2812_DRIVER = spi |
| 25 | 20 | ||
diff --git a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null | |||
| @@ -1,268 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "hal.h" | ||
| 23 | #include "stm32_gpio.h" | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver local definitions. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /*===========================================================================*/ | ||
| 30 | /* Driver exported variables. */ | ||
| 31 | /*===========================================================================*/ | ||
| 32 | |||
| 33 | /*===========================================================================*/ | ||
| 34 | /* Driver local variables and types. */ | ||
| 35 | /*===========================================================================*/ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @brief Type of STM32 GPIO port setup. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | uint32_t moder; | ||
| 42 | uint32_t otyper; | ||
| 43 | uint32_t ospeedr; | ||
| 44 | uint32_t pupdr; | ||
| 45 | uint32_t odr; | ||
| 46 | uint32_t afrl; | ||
| 47 | uint32_t afrh; | ||
| 48 | } gpio_setup_t; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Type of STM32 GPIO initialization data. | ||
| 52 | */ | ||
| 53 | typedef struct { | ||
| 54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
| 55 | gpio_setup_t PAData; | ||
| 56 | #endif | ||
| 57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
| 58 | gpio_setup_t PBData; | ||
| 59 | #endif | ||
| 60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
| 61 | gpio_setup_t PCData; | ||
| 62 | #endif | ||
| 63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
| 64 | gpio_setup_t PDData; | ||
| 65 | #endif | ||
| 66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
| 67 | gpio_setup_t PEData; | ||
| 68 | #endif | ||
| 69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
| 70 | gpio_setup_t PFData; | ||
| 71 | #endif | ||
| 72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
| 73 | gpio_setup_t PGData; | ||
| 74 | #endif | ||
| 75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
| 76 | gpio_setup_t PHData; | ||
| 77 | #endif | ||
| 78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
| 79 | gpio_setup_t PIData; | ||
| 80 | #endif | ||
| 81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
| 82 | gpio_setup_t PJData; | ||
| 83 | #endif | ||
| 84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
| 85 | gpio_setup_t PKData; | ||
| 86 | #endif | ||
| 87 | } gpio_config_t; | ||
| 88 | |||
| 89 | /** | ||
| 90 | * @brief STM32 GPIO static initialization data. | ||
| 91 | */ | ||
| 92 | static const gpio_config_t gpio_default_config = { | ||
| 93 | #if STM32_HAS_GPIOA | ||
| 94 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
| 95 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, | ||
| 96 | #endif | ||
| 97 | #if STM32_HAS_GPIOB | ||
| 98 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
| 99 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, | ||
| 100 | #endif | ||
| 101 | #if STM32_HAS_GPIOC | ||
| 102 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
| 103 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, | ||
| 104 | #endif | ||
| 105 | #if STM32_HAS_GPIOD | ||
| 106 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
| 107 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, | ||
| 108 | #endif | ||
| 109 | #if STM32_HAS_GPIOE | ||
| 110 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
| 111 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, | ||
| 112 | #endif | ||
| 113 | #if STM32_HAS_GPIOF | ||
| 114 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
| 115 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, | ||
| 116 | #endif | ||
| 117 | #if STM32_HAS_GPIOG | ||
| 118 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
| 119 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, | ||
| 120 | #endif | ||
| 121 | #if STM32_HAS_GPIOH | ||
| 122 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
| 123 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, | ||
| 124 | #endif | ||
| 125 | #if STM32_HAS_GPIOI | ||
| 126 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
| 127 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, | ||
| 128 | #endif | ||
| 129 | #if STM32_HAS_GPIOJ | ||
| 130 | {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
| 131 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, | ||
| 132 | #endif | ||
| 133 | #if STM32_HAS_GPIOK | ||
| 134 | {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
| 135 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} | ||
| 136 | #endif | ||
| 137 | }; | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /* Driver local functions. */ | ||
| 141 | /*===========================================================================*/ | ||
| 142 | |||
| 143 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
| 144 | |||
| 145 | gpiop->OTYPER = config->otyper; | ||
| 146 | gpiop->OSPEEDR = config->ospeedr; | ||
| 147 | gpiop->PUPDR = config->pupdr; | ||
| 148 | gpiop->ODR = config->odr; | ||
| 149 | gpiop->AFRL = config->afrl; | ||
| 150 | gpiop->AFRH = config->afrh; | ||
| 151 | gpiop->MODER = config->moder; | ||
| 152 | } | ||
| 153 | |||
| 154 | static void stm32_gpio_init(void) { | ||
| 155 | |||
| 156 | /* Enabling GPIO-related clocks, the mask comes from the | ||
| 157 | registry header file.*/ | ||
| 158 | rccResetAHB(STM32_GPIO_EN_MASK); | ||
| 159 | rccEnableAHB(STM32_GPIO_EN_MASK, true); | ||
| 160 | |||
| 161 | /* Initializing all the defined GPIO ports.*/ | ||
| 162 | #if STM32_HAS_GPIOA | ||
| 163 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
| 164 | #endif | ||
| 165 | #if STM32_HAS_GPIOB | ||
| 166 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
| 167 | #endif | ||
| 168 | #if STM32_HAS_GPIOC | ||
| 169 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
| 170 | #endif | ||
| 171 | #if STM32_HAS_GPIOD | ||
| 172 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
| 173 | #endif | ||
| 174 | #if STM32_HAS_GPIOE | ||
| 175 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
| 176 | #endif | ||
| 177 | #if STM32_HAS_GPIOF | ||
| 178 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
| 179 | #endif | ||
| 180 | #if STM32_HAS_GPIOG | ||
| 181 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
| 182 | #endif | ||
| 183 | #if STM32_HAS_GPIOH | ||
| 184 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
| 185 | #endif | ||
| 186 | #if STM32_HAS_GPIOI | ||
| 187 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
| 188 | #endif | ||
| 189 | #if STM32_HAS_GPIOJ | ||
| 190 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
| 191 | #endif | ||
| 192 | #if STM32_HAS_GPIOK | ||
| 193 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* Driver interrupt handlers. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /*===========================================================================*/ | ||
| 202 | /* Driver exported functions. */ | ||
| 203 | /*===========================================================================*/ | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @brief Early initialization code. | ||
| 207 | * @details GPIO ports and system clocks are initialized before everything | ||
| 208 | * else. | ||
| 209 | */ | ||
| 210 | void __early_init(void) { | ||
| 211 | extern void enter_bootloader_mode_if_requested(void); | ||
| 212 | enter_bootloader_mode_if_requested(); | ||
| 213 | stm32_gpio_init(); | ||
| 214 | stm32_clock_init(); | ||
| 215 | } | ||
| 216 | |||
| 217 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
| 218 | /** | ||
| 219 | * @brief SDC card detection. | ||
| 220 | */ | ||
| 221 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
| 222 | |||
| 223 | (void)sdcp; | ||
| 224 | /* TODO: Fill the implementation.*/ | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | |||
| 228 | /** | ||
| 229 | * @brief SDC card write protection detection. | ||
| 230 | */ | ||
| 231 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
| 232 | |||
| 233 | (void)sdcp; | ||
| 234 | /* TODO: Fill the implementation.*/ | ||
| 235 | return false; | ||
| 236 | } | ||
| 237 | #endif /* HAL_USE_SDC */ | ||
| 238 | |||
| 239 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
| 240 | /** | ||
| 241 | * @brief MMC_SPI card detection. | ||
| 242 | */ | ||
| 243 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
| 244 | |||
| 245 | (void)mmcp; | ||
| 246 | /* TODO: Fill the implementation.*/ | ||
| 247 | return true; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @brief MMC_SPI card write protection detection. | ||
| 252 | */ | ||
| 253 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
| 254 | |||
| 255 | (void)mmcp; | ||
| 256 | /* TODO: Fill the implementation.*/ | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif | ||
| 260 | |||
| 261 | /** | ||
| 262 | * @brief Board-specific initialization code. | ||
| 263 | * @todo Add your board-specific code, if any. | ||
| 264 | */ | ||
| 265 | void boardInit(void) { | ||
| 266 | SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; | ||
| 267 | SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); | ||
| 268 | } | ||
diff --git a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 57636d1f1..000000000 --- a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,940 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef BOARD_H | ||
| 23 | #define BOARD_H | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver constants. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Setup for ST STM32F072B-Discovery board. | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Board identifier. | ||
| 35 | */ | ||
| 36 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 37 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Board oscillators-related settings. | ||
| 41 | * NOTE: HSE not fitted. | ||
| 42 | */ | ||
| 43 | #if !defined(STM32_LSECLK) | ||
| 44 | #define STM32_LSECLK 32768 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define STM32_LSEDRV (3U << 3U) | ||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK) | ||
| 50 | #define STM32_HSECLK 0U | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define STM32_HSE_BYPASS | ||
| 54 | |||
| 55 | /* | ||
| 56 | * MCU type as defined in the ST header. | ||
| 57 | */ | ||
| 58 | #define STM32F072xB | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IO pins assignments. | ||
| 62 | */ | ||
| 63 | #define GPIOA_BUTTON 0U | ||
| 64 | #define GPIOA_PIN1 1U | ||
| 65 | #define GPIOA_PIN2 2U | ||
| 66 | #define GPIOA_PIN3 3U | ||
| 67 | #define GPIOA_PIN4 4U | ||
| 68 | #define GPIOA_PIN5 5U | ||
| 69 | #define GPIOA_PIN6 6U | ||
| 70 | #define GPIOA_PIN7 7U | ||
| 71 | #define GPIOA_PIN8 8U | ||
| 72 | #define GPIOA_PIN9 9U | ||
| 73 | #define GPIOA_PIN10 10U | ||
| 74 | #define GPIOA_USB_DM 11U | ||
| 75 | #define GPIOA_USB_DP 12U | ||
| 76 | #define GPIOA_SWDIO 13U | ||
| 77 | #define GPIOA_SWCLK 14U | ||
| 78 | #define GPIOA_PIN15 15U | ||
| 79 | |||
| 80 | #define GPIOB_PIN0 0U | ||
| 81 | #define GPIOB_PIN1 1U | ||
| 82 | #define GPIOB_PIN2 2U | ||
| 83 | #define GPIOB_PIN3 3U | ||
| 84 | #define GPIOB_PIN4 4U | ||
| 85 | #define GPIOB_PIN5 5U | ||
| 86 | #define GPIOB_PIN6 6U | ||
| 87 | #define GPIOB_PIN7 7U | ||
| 88 | #define GPIOB_PIN8 8U | ||
| 89 | #define GPIOB_PIN9 9U | ||
| 90 | #define GPIOB_PIN10 10U | ||
| 91 | #define GPIOB_PIN11 11U | ||
| 92 | #define GPIOB_PIN12 12U | ||
| 93 | #define GPIOB_SPI2_SCK 13U | ||
| 94 | #define GPIOB_SPI2_MISO 14U | ||
| 95 | #define GPIOB_SPI2_MOSI 15U | ||
| 96 | |||
| 97 | #define GPIOC_MEMS_CS 0U | ||
| 98 | #define GPIOC_PIN1 1U | ||
| 99 | #define GPIOC_PIN2 2U | ||
| 100 | #define GPIOC_PIN3 3U | ||
| 101 | #define GPIOC_PIN4 4U | ||
| 102 | #define GPIOC_PIN5 5U | ||
| 103 | #define GPIOC_LED_RED 6U | ||
| 104 | #define GPIOC_LED_BLUE 7U | ||
| 105 | #define GPIOC_LED_ORANGE 8U | ||
| 106 | #define GPIOC_LED_GREEN 9U | ||
| 107 | #define GPIOC_PIN10 10U | ||
| 108 | #define GPIOC_PIN11 11U | ||
| 109 | #define GPIOC_PIN12 12U | ||
| 110 | #define GPIOC_PIN13 13U | ||
| 111 | #define GPIOC_OSC32_IN 14U | ||
| 112 | #define GPIOC_OSC32_OUT 15U | ||
| 113 | |||
| 114 | #define GPIOD_PIN0 0U | ||
| 115 | #define GPIOD_PIN1 1U | ||
| 116 | #define GPIOD_PIN2 2U | ||
| 117 | #define GPIOD_PIN3 3U | ||
| 118 | #define GPIOD_PIN4 4U | ||
| 119 | #define GPIOD_PIN5 5U | ||
| 120 | #define GPIOD_PIN6 6U | ||
| 121 | #define GPIOD_PIN7 7U | ||
| 122 | #define GPIOD_PIN8 8U | ||
| 123 | #define GPIOD_PIN9 9U | ||
| 124 | #define GPIOD_PIN10 10U | ||
| 125 | #define GPIOD_PIN11 11U | ||
| 126 | #define GPIOD_PIN12 12U | ||
| 127 | #define GPIOD_PIN13 13U | ||
| 128 | #define GPIOD_PIN14 14U | ||
| 129 | #define GPIOD_PIN15 15U | ||
| 130 | |||
| 131 | #define GPIOE_PIN0 0U | ||
| 132 | #define GPIOE_PIN1 1U | ||
| 133 | #define GPIOE_PIN2 2U | ||
| 134 | #define GPIOE_PIN3 3U | ||
| 135 | #define GPIOE_PIN4 4U | ||
| 136 | #define GPIOE_PIN5 5U | ||
| 137 | #define GPIOE_PIN6 6U | ||
| 138 | #define GPIOE_PIN7 7U | ||
| 139 | #define GPIOE_PIN8 8U | ||
| 140 | #define GPIOE_PIN9 9U | ||
| 141 | #define GPIOE_PIN10 10U | ||
| 142 | #define GPIOE_PIN11 11U | ||
| 143 | #define GPIOE_PIN12 12U | ||
| 144 | #define GPIOE_PIN13 13U | ||
| 145 | #define GPIOE_PIN14 14U | ||
| 146 | #define GPIOE_PIN15 15U | ||
| 147 | |||
| 148 | #define GPIOF_OSC_IN 0U | ||
| 149 | #define GPIOF_OSC_OUT 1U | ||
| 150 | #define GPIOF_PIN2 2U | ||
| 151 | #define GPIOF_PIN3 3U | ||
| 152 | #define GPIOF_PIN4 4U | ||
| 153 | #define GPIOF_PIN5 5U | ||
| 154 | #define GPIOF_PIN6 6U | ||
| 155 | #define GPIOF_PIN7 7U | ||
| 156 | #define GPIOF_PIN8 8U | ||
| 157 | #define GPIOF_PIN9 9U | ||
| 158 | #define GPIOF_PIN10 10U | ||
| 159 | #define GPIOF_PIN11 11U | ||
| 160 | #define GPIOF_PIN12 12U | ||
| 161 | #define GPIOF_PIN13 13U | ||
| 162 | #define GPIOF_PIN14 14U | ||
| 163 | #define GPIOF_PIN15 15U | ||
| 164 | |||
| 165 | /* | ||
| 166 | * IO lines assignments. | ||
| 167 | */ | ||
| 168 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 169 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 170 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 171 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 172 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 173 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 174 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 175 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 176 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 177 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 178 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 179 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 180 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 181 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 182 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 183 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 184 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 185 | |||
| 186 | /*===========================================================================*/ | ||
| 187 | /* Driver pre-compile time settings. */ | ||
| 188 | /*===========================================================================*/ | ||
| 189 | |||
| 190 | /*===========================================================================*/ | ||
| 191 | /* Derived constants and error checks. */ | ||
| 192 | /*===========================================================================*/ | ||
| 193 | |||
| 194 | /*===========================================================================*/ | ||
| 195 | /* Driver data structures and types. */ | ||
| 196 | /*===========================================================================*/ | ||
| 197 | |||
| 198 | /*===========================================================================*/ | ||
| 199 | /* Driver macros. */ | ||
| 200 | /*===========================================================================*/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 204 | * in the initialization code. | ||
| 205 | * Please refer to the STM32 Reference Manual for details. | ||
| 206 | */ | ||
| 207 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 208 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 209 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 210 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 211 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 212 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 213 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 214 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 215 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 216 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 217 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 218 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 219 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 220 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 221 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 222 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * GPIOA setup: | ||
| 226 | * | ||
| 227 | * PA0 - BUTTON (input floating). | ||
| 228 | * PA1 - PIN1 (input pullup). | ||
| 229 | * PA2 - PIN2 (input pullup). | ||
| 230 | * PA3 - PIN3 (input pullup). | ||
| 231 | * PA4 - PIN4 (input pullup). | ||
| 232 | * PA5 - PIN5 (input pullup). | ||
| 233 | * PA6 - PIN6 (input pullup). | ||
| 234 | * PA7 - PIN7 (input pullup). | ||
| 235 | * PA8 - PIN8 (input pullup). | ||
| 236 | * PA9 - PIN9 (input pullup). | ||
| 237 | * PA10 - PIN10 (input pullup). | ||
| 238 | * PA11 - USB_DM (input floating). | ||
| 239 | * PA12 - USB_DP (input floating). | ||
| 240 | * PA13 - SWDIO (alternate 0). | ||
| 241 | * PA14 - SWCLK (alternate 0). | ||
| 242 | * PA15 - PIN15 (input pullup). | ||
| 243 | */ | ||
| 244 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 246 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 247 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 248 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 249 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 250 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 251 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 252 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 253 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 254 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 255 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 256 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 257 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 258 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 259 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 260 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 265 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 267 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 268 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 269 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 270 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 271 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 272 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 273 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 274 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 275 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 276 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 277 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 278 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 279 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 280 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 281 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 282 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 283 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 284 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 285 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 286 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 287 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 288 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 289 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 290 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 291 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 292 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 294 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 295 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 296 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 297 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 298 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 299 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 300 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 301 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 302 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 303 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 304 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 305 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 306 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 307 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 308 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 310 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 311 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 312 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 313 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 314 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 315 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 316 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 317 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 318 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 319 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 320 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 321 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 322 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 323 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 324 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 326 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 327 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 328 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 329 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 330 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 331 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 332 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 333 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 334 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 335 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 336 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 337 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 338 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 339 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 340 | |||
| 341 | /* | ||
| 342 | * GPIOB setup: | ||
| 343 | * | ||
| 344 | * PB0 - PIN0 (input pullup). | ||
| 345 | * PB1 - PIN1 (input pullup). | ||
| 346 | * PB2 - PIN2 (input pullup). | ||
| 347 | * PB3 - PIN3 (input pullup). | ||
| 348 | * PB4 - PIN4 (input pullup). | ||
| 349 | * PB5 - PIN5 (input pullup). | ||
| 350 | * PB6 - PIN6 (input pullup). | ||
| 351 | * PB7 - PIN7 (input pullup). | ||
| 352 | * PB8 - PIN8 (input pullup). | ||
| 353 | * PB9 - PIN9 (input pullup). | ||
| 354 | * PB10 - PIN10 (input pullup). | ||
| 355 | * PB11 - PIN11 (input pullup). | ||
| 356 | * PB12 - PIN12 (input pullup). | ||
| 357 | * PB13 - SPI2_SCK (alternate 0). | ||
| 358 | * PB14 - SPI2_MISO (alternate 0). | ||
| 359 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 360 | */ | ||
| 361 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 362 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 363 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 364 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 365 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 366 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 367 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 368 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 369 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 370 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 371 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 372 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 373 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 374 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 375 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 376 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 377 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 379 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 380 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 381 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 382 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 383 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 384 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 385 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 386 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 387 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 388 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 389 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 390 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 391 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 392 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 393 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 395 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 396 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 397 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 398 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 399 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 400 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 401 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 402 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 403 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 404 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 405 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 406 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 407 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 408 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 409 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 410 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 411 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 412 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 413 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 414 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 415 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 416 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 417 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 418 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 419 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 420 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 421 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 422 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 423 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 424 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 425 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 427 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 428 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 429 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 430 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 431 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 432 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 433 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 434 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 435 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 436 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 437 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 438 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 439 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 440 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 441 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 443 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 444 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 445 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 446 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 447 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 448 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 449 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 450 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 451 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 452 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 453 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 454 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 455 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 456 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 457 | |||
| 458 | /* | ||
| 459 | * GPIOC setup: | ||
| 460 | * | ||
| 461 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 462 | * PC1 - PIN1 (input pullup). | ||
| 463 | * PC2 - PIN2 (input pullup). | ||
| 464 | * PC3 - PIN3 (input pullup). | ||
| 465 | * PC4 - PIN4 (input pullup). | ||
| 466 | * PC5 - PIN5 (input pullup). | ||
| 467 | * PC6 - LED_RED (output pushpull maximum). | ||
| 468 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 469 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 470 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 471 | * PC10 - PIN10 (input pullup). | ||
| 472 | * PC11 - PIN11 (input pullup). | ||
| 473 | * PC12 - PIN12 (input pullup). | ||
| 474 | * PC13 - PIN13 (input pullup). | ||
| 475 | * PC14 - OSC32_IN (input floating). | ||
| 476 | * PC15 - OSC32_OUT (input floating). | ||
| 477 | */ | ||
| 478 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 480 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 481 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 482 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 483 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 484 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 485 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 486 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 487 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 488 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 489 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 490 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 491 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 492 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 493 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 494 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 496 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 497 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 498 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 499 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 500 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 501 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 502 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 503 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 504 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 505 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 506 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 507 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 508 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 509 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 510 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 511 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 512 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 513 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 514 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 515 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 516 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 517 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 518 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 519 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 520 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 521 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 522 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 523 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 524 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 525 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 526 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 527 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 528 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 529 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 530 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 531 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 532 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 533 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 534 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 535 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 536 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 537 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 538 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 539 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 540 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 541 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 542 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 544 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 545 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 546 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 547 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 548 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 549 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 550 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 551 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 552 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 553 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 554 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 555 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 556 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 557 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 558 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 560 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 561 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 562 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 563 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 564 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 565 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 566 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 567 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 568 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 569 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 570 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 571 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 572 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 573 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 574 | |||
| 575 | /* | ||
| 576 | * GPIOD setup: | ||
| 577 | * | ||
| 578 | * PD0 - PIN0 (input pullup). | ||
| 579 | * PD1 - PIN1 (input pullup). | ||
| 580 | * PD2 - PIN2 (input pullup). | ||
| 581 | * PD3 - PIN3 (input pullup). | ||
| 582 | * PD4 - PIN4 (input pullup). | ||
| 583 | * PD5 - PIN5 (input pullup). | ||
| 584 | * PD6 - PIN6 (input pullup). | ||
| 585 | * PD7 - PIN7 (input pullup). | ||
| 586 | * PD8 - PIN8 (input pullup). | ||
| 587 | * PD9 - PIN9 (input pullup). | ||
| 588 | * PD10 - PIN10 (input pullup). | ||
| 589 | * PD11 - PIN11 (input pullup). | ||
| 590 | * PD12 - PIN12 (input pullup). | ||
| 591 | * PD13 - PIN13 (input pullup). | ||
| 592 | * PD14 - PIN14 (input pullup). | ||
| 593 | * PD15 - PIN15 (input pullup). | ||
| 594 | */ | ||
| 595 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 597 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 598 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 599 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 600 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 601 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 602 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 603 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 604 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 605 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 606 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 607 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 608 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 609 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 610 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 611 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 613 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 614 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 615 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 616 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 617 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 618 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 619 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 620 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 621 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 622 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 623 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 624 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 625 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 626 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 627 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 629 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 630 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 631 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 632 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 633 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 634 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 635 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 636 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 637 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 638 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 639 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 640 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 641 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 642 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 643 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 645 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 646 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 647 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 648 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 649 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 650 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 651 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 652 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 653 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 654 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 655 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 656 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 657 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 658 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 659 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 661 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 662 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 663 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 664 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 665 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 666 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 667 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 668 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 669 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 670 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 671 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 672 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 673 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 674 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 675 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 677 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 678 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 679 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 680 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 681 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 682 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 683 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 684 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 685 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 686 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 687 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 688 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 689 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 690 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 691 | |||
| 692 | /* | ||
| 693 | * GPIOE setup: | ||
| 694 | * | ||
| 695 | * PE0 - PIN0 (input pullup). | ||
| 696 | * PE1 - PIN1 (input pullup). | ||
| 697 | * PE2 - PIN2 (input pullup). | ||
| 698 | * PE3 - PIN3 (input pullup). | ||
| 699 | * PE4 - PIN4 (input pullup). | ||
| 700 | * PE5 - PIN5 (input pullup). | ||
| 701 | * PE6 - PIN6 (input pullup). | ||
| 702 | * PE7 - PIN7 (input pullup). | ||
| 703 | * PE8 - PIN8 (input pullup). | ||
| 704 | * PE9 - PIN9 (input pullup). | ||
| 705 | * PE10 - PIN10 (input pullup). | ||
| 706 | * PE11 - PIN11 (input pullup). | ||
| 707 | * PE12 - PIN12 (input pullup). | ||
| 708 | * PE13 - PIN13 (input pullup). | ||
| 709 | * PE14 - PIN14 (input pullup). | ||
| 710 | * PE15 - PIN15 (input pullup). | ||
| 711 | */ | ||
| 712 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 714 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 715 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 716 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 717 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 718 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 719 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 720 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 721 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 722 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 723 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 724 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 725 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 726 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 727 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 728 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 730 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 731 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 732 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 733 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 734 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 735 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 736 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 737 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 738 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 739 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 740 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 741 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 742 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 743 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 744 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 746 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 747 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 748 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 749 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 750 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 751 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 752 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 753 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 754 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 755 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 756 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 757 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 758 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 759 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 760 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 762 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 763 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 764 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 765 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 766 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 767 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 768 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 769 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 770 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 771 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 772 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 773 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 774 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 775 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 776 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 778 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 779 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 780 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 781 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 782 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 783 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 784 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 785 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 786 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 787 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 788 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 789 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 790 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 791 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 792 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 794 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 795 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 796 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 797 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 798 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 799 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 800 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 801 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 802 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 803 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 804 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 805 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 806 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 807 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 808 | |||
| 809 | /* | ||
| 810 | * GPIOF setup: | ||
| 811 | * | ||
| 812 | * PF0 - OSC_IN (input floating). | ||
| 813 | * PF1 - OSC_OUT (input floating). | ||
| 814 | * PF2 - PIN2 (input pullup). | ||
| 815 | * PF3 - PIN3 (input pullup). | ||
| 816 | * PF4 - PIN4 (input pullup). | ||
| 817 | * PF5 - PIN5 (input pullup). | ||
| 818 | * PF6 - PIN6 (input pullup). | ||
| 819 | * PF7 - PIN7 (input pullup). | ||
| 820 | * PF8 - PIN8 (input pullup). | ||
| 821 | * PF9 - PIN9 (input pullup). | ||
| 822 | * PF10 - PIN10 (input pullup). | ||
| 823 | * PF11 - PIN11 (input pullup). | ||
| 824 | * PF12 - PIN12 (input pullup). | ||
| 825 | * PF13 - PIN13 (input pullup). | ||
| 826 | * PF14 - PIN14 (input pullup). | ||
| 827 | * PF15 - PIN15 (input pullup). | ||
| 828 | */ | ||
| 829 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 831 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 832 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 833 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 834 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 835 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 836 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 837 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 838 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 839 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 840 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 841 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 842 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 843 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 844 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 845 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 847 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 848 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 849 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 850 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 851 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 852 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 853 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 854 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 855 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 856 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 857 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 858 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 859 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 860 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 861 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 863 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 864 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 865 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 866 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 867 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 868 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 869 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 870 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 871 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 872 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 873 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 874 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 875 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 876 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 877 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 878 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 879 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 880 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 881 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 882 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 883 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 884 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 885 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 886 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 887 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 888 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 889 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 890 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 891 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 892 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 893 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 895 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 896 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 897 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 898 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 899 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 900 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 901 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 902 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 903 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 904 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 905 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 906 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 907 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 908 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 909 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 911 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 912 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 913 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 914 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 915 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 916 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 917 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 918 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 919 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 920 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 921 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 922 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 923 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 924 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 925 | |||
| 926 | /*===========================================================================*/ | ||
| 927 | /* External declarations. */ | ||
| 928 | /*===========================================================================*/ | ||
| 929 | |||
| 930 | #if !defined(_FROM_ASM_) | ||
| 931 | #ifdef __cplusplus | ||
| 932 | extern "C" { | ||
| 933 | #endif | ||
| 934 | void boardInit(void); | ||
| 935 | #ifdef __cplusplus | ||
| 936 | } | ||
| 937 | #endif | ||
| 938 | #endif /* _FROM_ASM_ */ | ||
| 939 | |||
| 940 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # List of all the board related files. | ||
| 2 | BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c | ||
| 3 | |||
| 4 | # Required include directories | ||
| 5 | BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY | ||
diff --git a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg deleted file mode 100644 index 9c7cf4fd7..000000000 --- a/keyboards/cannonkeys/chimera65/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg +++ /dev/null | |||
| @@ -1,703 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!-- STM32F0xx board Template --> | ||
| 3 | <board | ||
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 5 | xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> | ||
| 6 | <configuration_settings> | ||
| 7 | <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> | ||
| 8 | <output_path>..</output_path> | ||
| 9 | <hal_version>3.0.x</hal_version> | ||
| 10 | </configuration_settings> | ||
| 11 | <board_name>ST STM32F072B-Discovery</board_name> | ||
| 12 | <board_id>ST_STM32F072B_DISCOVERY</board_id> | ||
| 13 | <board_functions></board_functions> | ||
| 14 | <subtype>STM32F072xB</subtype> | ||
| 15 | <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" | ||
| 16 | LSEBypass="false" LSEDrive="3 High Drive (default)" /> | ||
| 17 | <ports> | ||
| 18 | <GPIOA> | ||
| 19 | <pin0 | ||
| 20 | ID="BUTTON" | ||
| 21 | Type="PushPull" | ||
| 22 | Speed="Minimum" | ||
| 23 | Resistor="Floating" | ||
| 24 | Level="High" | ||
| 25 | Mode="Input" | ||
| 26 | Alternate="0" /> | ||
| 27 | <pin1 | ||
| 28 | ID="" | ||
| 29 | Type="PushPull" | ||
| 30 | Speed="Minimum" | ||
| 31 | Resistor="PullUp" | ||
| 32 | Level="High" | ||
| 33 | Mode="Input" | ||
| 34 | Alternate="0" /> | ||
| 35 | <pin2 | ||
| 36 | ID="" | ||
| 37 | Type="PushPull" | ||
| 38 | Speed="Minimum" | ||
| 39 | Resistor="PullUp" | ||
| 40 | Level="High" | ||
| 41 | Mode="Input" | ||
| 42 | Alternate="0" /> | ||
| 43 | <pin3 | ||
| 44 | ID="" | ||
| 45 | Type="PushPull" | ||
| 46 | Speed="Minimum" | ||
| 47 | Resistor="PullUp" | ||
| 48 | Level="High" | ||
| 49 | Mode="Input" | ||
| 50 | Alternate="0" /> | ||
| 51 | <pin4 | ||
| 52 | ID="" | ||
| 53 | Type="PushPull" | ||
| 54 | Speed="Minimum" | ||
| 55 | Resistor="PullUp" | ||
| 56 | Level="High" | ||
| 57 | Mode="Input" | ||
| 58 | Alternate="0" /> | ||
| 59 | <pin5 | ||
| 60 | ID="" | ||
| 61 | Type="PushPull" | ||
| 62 | Speed="Minimum" | ||
| 63 | Resistor="PullUp" | ||
| 64 | Level="High" | ||
| 65 | Mode="Input" | ||
| 66 | Alternate="0" /> | ||
| 67 | <pin6 | ||
| 68 | ID="" | ||
| 69 | Type="PushPull" | ||
| 70 | Speed="Minimum" | ||
| 71 | Resistor="PullUp" | ||
| 72 | Level="High" | ||
| 73 | Mode="Input" | ||
| 74 | Alternate="0" /> | ||
| 75 | <pin7 | ||
| 76 | ID="" | ||
| 77 | Type="PushPull" | ||
| 78 | Speed="Minimum" | ||
| 79 | Resistor="PullUp" | ||
| 80 | Level="High" | ||
| 81 | Mode="Input" | ||
| 82 | Alternate="0" /> | ||
| 83 | <pin8 | ||
| 84 | ID="" | ||
| 85 | Type="PushPull" | ||
| 86 | Speed="Minimum" | ||
| 87 | Resistor="PullUp" | ||
| 88 | Level="High" | ||
| 89 | Mode="Input" | ||
| 90 | Alternate="0" /> | ||
| 91 | <pin9 | ||
| 92 | ID="" | ||
| 93 | Type="PushPull" | ||
| 94 | Speed="Minimum" | ||
| 95 | Resistor="PullUp" | ||
| 96 | Level="High" | ||
| 97 | Mode="Input" | ||
| 98 | Alternate="0" /> | ||
| 99 | <pin10 | ||
| 100 | ID="" | ||
| 101 | Type="PushPull" | ||
| 102 | Speed="Minimum" | ||
| 103 | Resistor="PullUp" | ||
| 104 | Level="High" | ||
| 105 | Mode="Input" | ||
| 106 | Alternate="0" /> | ||
| 107 | <pin11 | ||
| 108 | ID="USB_DM" | ||
| 109 | Type="PushPull" | ||
| 110 | Speed="Minimum" | ||
| 111 | Resistor="Floating" | ||
| 112 | Level="High" | ||
| 113 | Mode="Input" | ||
| 114 | Alternate="0" /> | ||
| 115 | <pin12 | ||
| 116 | ID="USB_DP" | ||
| 117 | Type="PushPull" | ||
| 118 | Speed="Minimum" | ||
| 119 | Resistor="Floating" | ||
| 120 | Level="High" | ||
| 121 | Mode="Input" | ||
| 122 | Alternate="0" /> | ||
| 123 | <pin13 | ||
| 124 | ID="SWDIO" | ||
| 125 | Type="PushPull" | ||
| 126 | Speed="Maximum" | ||
| 127 | Resistor="PullUp" | ||
| 128 | Level="High" | ||
| 129 | Mode="Alternate" | ||
| 130 | Alternate="0" /> | ||
| 131 | <pin14 | ||
| 132 | ID="SWCLK" | ||
| 133 | Type="PushPull" | ||
| 134 | Speed="Maximum" | ||
| 135 | Resistor="PullDown" | ||
| 136 | Level="High" | ||
| 137 | Mode="Alternate" | ||
| 138 | Alternate="0" /> | ||
| 139 | <pin15 | ||
| 140 | ID="" | ||
| 141 | Type="PushPull" | ||
| 142 | Speed="Maximum" | ||
| 143 | Resistor="PullUp" | ||
| 144 | Level="High" | ||
| 145 | Mode="Input" | ||
| 146 | Alternate="0" /> | ||
| 147 | </GPIOA> | ||
| 148 | <GPIOB> | ||
| 149 | <pin0 | ||
| 150 | ID="" | ||
| 151 | Type="PushPull" | ||
| 152 | Speed="Minimum" | ||
| 153 | Resistor="PullUp" | ||
| 154 | Level="High" | ||
| 155 | Mode="Input" | ||
| 156 | Alternate="0" /> | ||
| 157 | <pin1 | ||
| 158 | ID="" | ||
| 159 | Type="PushPull" | ||
| 160 | Speed="Minimum" | ||
| 161 | Resistor="PullUp" | ||
| 162 | Level="High" | ||
| 163 | Mode="Input" | ||
| 164 | Alternate="0" /> | ||
| 165 | <pin2 | ||
| 166 | ID="" | ||
| 167 | Type="PushPull" | ||
| 168 | Speed="Maximum" | ||
| 169 | Resistor="PullUp" | ||
| 170 | Level="High" | ||
| 171 | Mode="Input" | ||
| 172 | Alternate="0" /> | ||
| 173 | <pin3 | ||
| 174 | ID="" | ||
| 175 | Type="PushPull" | ||
| 176 | Speed="Maximum" | ||
| 177 | Resistor="PullUp" | ||
| 178 | Level="High" | ||
| 179 | Mode="Input" | ||
| 180 | Alternate="0" /> | ||
| 181 | <pin4 | ||
| 182 | ID="" | ||
| 183 | Type="PushPull" | ||
| 184 | Speed="Maximum" | ||
| 185 | Resistor="PullUp" | ||
| 186 | Level="High" | ||
| 187 | Mode="Input" | ||
| 188 | Alternate="0" /> | ||
| 189 | <pin5 | ||
| 190 | ID="" | ||
| 191 | Type="PushPull" | ||
| 192 | Speed="Minimum" | ||
| 193 | Resistor="PullUp" | ||
| 194 | Level="High" | ||
| 195 | Mode="Input" | ||
| 196 | Alternate="0" /> | ||
| 197 | <pin6 | ||
| 198 | ID="" | ||
| 199 | Type="PushPull" | ||
| 200 | Speed="Minimum" | ||
| 201 | Resistor="PullUp" | ||
| 202 | Level="High" | ||
| 203 | Mode="Input" | ||
| 204 | Alternate="0" /> | ||
| 205 | <pin7 | ||
| 206 | ID="" | ||
| 207 | Type="PushPull" | ||
| 208 | Speed="Minimum" | ||
| 209 | Resistor="PullUp" | ||
| 210 | Level="High" | ||
| 211 | Mode="Input" | ||
| 212 | Alternate="0" /> | ||
| 213 | <pin8 | ||
| 214 | ID="" | ||
| 215 | Type="PushPull" | ||
| 216 | Speed="Minimum" | ||
| 217 | Resistor="PullUp" | ||
| 218 | Level="High" | ||
| 219 | Mode="Input" | ||
| 220 | Alternate="0" /> | ||
| 221 | <pin9 | ||
| 222 | ID="" | ||
| 223 | Type="PushPull" | ||
| 224 | Speed="Minimum" | ||
| 225 | Resistor="PullUp" | ||
| 226 | Level="High" | ||
| 227 | Mode="Input" | ||
| 228 | Alternate="0" /> | ||
| 229 | <pin10 | ||
| 230 | ID="" | ||
| 231 | Type="PushPull" | ||
| 232 | Speed="Minimum" | ||
| 233 | Resistor="PullUp" | ||
| 234 | Level="High" | ||
| 235 | Mode="Input" | ||
| 236 | Alternate="0" /> | ||
| 237 | <pin11 | ||
| 238 | ID="" | ||
| 239 | Type="PushPull" | ||
| 240 | Speed="Minimum" | ||
| 241 | Resistor="PullUp" | ||
| 242 | Level="High" | ||
| 243 | Mode="Input" | ||
| 244 | Alternate="0" /> | ||
| 245 | <pin12 | ||
| 246 | ID="" | ||
| 247 | Type="PushPull" | ||
| 248 | Speed="Minimum" | ||
| 249 | Resistor="PullUp" | ||
| 250 | Level="High" | ||
| 251 | Mode="Input" | ||
| 252 | Alternate="0" /> | ||
| 253 | <pin13 | ||
| 254 | ID="SPI2_SCK" | ||
| 255 | Type="PushPull" | ||
| 256 | Speed="Minimum" | ||
| 257 | Resistor="Floating" | ||
| 258 | Level="High" | ||
| 259 | Mode="Alternate" | ||
| 260 | Alternate="0" /> | ||
| 261 | <pin14 | ||
| 262 | ID="SPI2_MISO" | ||
| 263 | Type="PushPull" | ||
| 264 | Speed="Minimum" | ||
| 265 | Resistor="Floating" | ||
| 266 | Level="High" | ||
| 267 | Mode="Alternate" | ||
| 268 | Alternate="0" /> | ||
| 269 | <pin15 | ||
| 270 | ID="SPI2_MOSI" | ||
| 271 | Type="PushPull" | ||
| 272 | Speed="Minimum" | ||
| 273 | Resistor="Floating" | ||
| 274 | Level="High" | ||
| 275 | Mode="Alternate" | ||
| 276 | Alternate="0" /> | ||
| 277 | </GPIOB> | ||
| 278 | <GPIOC> | ||
| 279 | <pin0 | ||
| 280 | ID="MEMS_CS" | ||
| 281 | Type="PushPull" | ||
| 282 | Speed="Maximum" | ||
| 283 | Resistor="Floating" | ||
| 284 | Level="High" | ||
| 285 | Mode="Output" | ||
| 286 | Alternate="0" /> | ||
| 287 | <pin1 | ||
| 288 | ID="" | ||
| 289 | Type="PushPull" | ||
| 290 | Speed="Minimum" | ||
| 291 | Resistor="PullUp" | ||
| 292 | Level="High" | ||
| 293 | Mode="Input" | ||
| 294 | Alternate="0" /> | ||
| 295 | <pin2 | ||
| 296 | ID="" | ||
| 297 | Type="PushPull" | ||
| 298 | Speed="Minimum" | ||
| 299 | Resistor="PullUp" | ||
| 300 | Level="High" | ||
| 301 | Mode="Input" | ||
| 302 | Alternate="0" /> | ||
| 303 | <pin3 | ||
| 304 | ID="" | ||
| 305 | Type="PushPull" | ||
| 306 | Speed="Minimum" | ||
| 307 | Resistor="PullUp" | ||
| 308 | Level="High" | ||
| 309 | Mode="Input" | ||
| 310 | Alternate="0" /> | ||
| 311 | <pin4 | ||
| 312 | ID="" | ||
| 313 | Type="PushPull" | ||
| 314 | Speed="Minimum" | ||
| 315 | Resistor="PullUp" | ||
| 316 | Level="High" | ||
| 317 | Mode="Input" | ||
| 318 | Alternate="0" /> | ||
| 319 | <pin5 | ||
| 320 | ID="" | ||
| 321 | Type="PushPull" | ||
| 322 | Speed="Minimum" | ||
| 323 | Resistor="PullUp" | ||
| 324 | Level="High" | ||
| 325 | Mode="Input" | ||
| 326 | Alternate="0" /> | ||
| 327 | <pin6 | ||
| 328 | ID="LED_RED" | ||
| 329 | Type="PushPull" | ||
| 330 | Speed="Maximum" | ||
| 331 | Resistor="Floating" | ||
| 332 | Level="Low" | ||
| 333 | Mode="Output" | ||
| 334 | Alternate="0" /> | ||
| 335 | <pin7 | ||
| 336 | ID="LED_BLUE" | ||
| 337 | Type="PushPull" | ||
| 338 | Speed="Maximum" | ||
| 339 | Resistor="Floating" | ||
| 340 | Level="Low" | ||
| 341 | Mode="Output" | ||
| 342 | Alternate="0" /> | ||
| 343 | <pin8 | ||
| 344 | ID="LED_ORANGE" | ||
| 345 | Type="PushPull" | ||
| 346 | Speed="Maximum" | ||
| 347 | Resistor="Floating" | ||
| 348 | Level="Low" | ||
| 349 | Mode="Output" | ||
| 350 | Alternate="0" ></pin8> | ||
| 351 | <pin9 | ||
| 352 | ID="LED_GREEN" | ||
| 353 | Type="PushPull" | ||
| 354 | Speed="Maximum" | ||
| 355 | Resistor="Floating" | ||
| 356 | Level="Low" | ||
| 357 | Mode="Output" | ||
| 358 | Alternate="0" /> | ||
| 359 | <pin10 | ||
| 360 | ID="" | ||
| 361 | Type="PushPull" | ||
| 362 | Speed="Minimum" | ||
| 363 | Resistor="PullUp" | ||
| 364 | Level="High" | ||
| 365 | Mode="Input" | ||
| 366 | Alternate="0" /> | ||
| 367 | <pin11 | ||
| 368 | ID="" | ||
| 369 | Type="PushPull" | ||
| 370 | Speed="Minimum" | ||
| 371 | Resistor="PullUp" | ||
| 372 | Level="High" | ||
| 373 | Mode="Input" | ||
| 374 | Alternate="0" /> | ||
| 375 | <pin12 | ||
| 376 | ID="" | ||
| 377 | Type="PushPull" | ||
| 378 | Speed="Minimum" | ||
| 379 | Resistor="PullUp" | ||
| 380 | Level="High" | ||
| 381 | Mode="Input" | ||
| 382 | Alternate="0" /> | ||
| 383 | <pin13 | ||
| 384 | ID="" | ||
| 385 | Type="PushPull" | ||
| 386 | Speed="Minimum" | ||
| 387 | Resistor="PullUp" | ||
| 388 | Level="High" | ||
| 389 | Mode="Input" | ||
| 390 | Alternate="0" /> | ||
| 391 | <pin14 | ||
| 392 | ID="OSC32_IN" | ||
| 393 | Type="PushPull" | ||
| 394 | Speed="Maximum" | ||
| 395 | Resistor="Floating" | ||
| 396 | Level="High" | ||
| 397 | Mode="Input" | ||
| 398 | Alternate="0" /> | ||
| 399 | <pin15 | ||
| 400 | ID="OSC32_OUT" | ||
| 401 | Type="PushPull" | ||
| 402 | Speed="Maximum" | ||
| 403 | Resistor="Floating" | ||
| 404 | Level="High" | ||
| 405 | Mode="Input" | ||
| 406 | Alternate="0" /> | ||
| 407 | </GPIOC> | ||
| 408 | <GPIOD> | ||
| 409 | <pin0 | ||
| 410 | ID="" | ||
| 411 | Type="PushPull" | ||
| 412 | Speed="Minimum" | ||
| 413 | Resistor="PullUp" | ||
| 414 | Level="High" | ||
| 415 | Mode="Input" | ||
| 416 | Alternate="0" /> | ||
| 417 | <pin1 | ||
| 418 | ID="" | ||
| 419 | Type="PushPull" | ||
| 420 | Speed="Minimum" | ||
| 421 | Resistor="PullUp" | ||
| 422 | Level="High" | ||
| 423 | Mode="Input" | ||
| 424 | Alternate="0" /> | ||
| 425 | <pin2 | ||
| 426 | ID="" | ||
| 427 | Type="PushPull" | ||
| 428 | Speed="Minimum" | ||
| 429 | Resistor="PullUp" | ||
| 430 | Level="High" | ||
| 431 | Mode="Input" | ||
| 432 | Alternate="0" /> | ||
| 433 | <pin3 | ||
| 434 | ID="" | ||
| 435 | Type="PushPull" | ||
| 436 | Speed="Minimum" | ||
| 437 | Resistor="PullUp" | ||
| 438 | Level="High" | ||
| 439 | Mode="Input" | ||
| 440 | Alternate="0" /> | ||
| 441 | <pin4 | ||
| 442 | ID="" | ||
| 443 | Type="PushPull" | ||
| 444 | Speed="Minimum" | ||
| 445 | Resistor="PullUp" | ||
| 446 | Level="High" | ||
| 447 | Mode="Input" | ||
| 448 | Alternate="0" /> | ||
| 449 | <pin5 | ||
| 450 | ID="" | ||
| 451 | Type="PushPull" | ||
| 452 | Speed="Minimum" | ||
| 453 | Resistor="PullUp" | ||
| 454 | Level="High" | ||
| 455 | Mode="Input" | ||
| 456 | Alternate="0" /> | ||
| 457 | <pin6 | ||
| 458 | ID="" | ||
| 459 | Type="PushPull" | ||
| 460 | Speed="Minimum" | ||
| 461 | Resistor="PullUp" | ||
| 462 | Level="High" | ||
| 463 | Mode="Input" | ||
| 464 | Alternate="0" /> | ||
| 465 | <pin7 | ||
| 466 | ID="" | ||
| 467 | Type="PushPull" | ||
| 468 | Speed="Minimum" | ||
| 469 | Resistor="PullUp" | ||
| 470 | Level="High" | ||
| 471 | Mode="Input" | ||
| 472 | Alternate="0" /> | ||
| 473 | <pin8 | ||
| 474 | ID="" | ||
| 475 | Type="PushPull" | ||
| 476 | Speed="Minimum" | ||
| 477 | Resistor="PullUp" | ||
| 478 | Level="High" | ||
| 479 | Mode="Input" | ||
| 480 | Alternate="0" /> | ||
| 481 | <pin9 | ||
| 482 | ID="" | ||
| 483 | Type="PushPull" | ||
| 484 | Speed="Minimum" | ||
| 485 | Resistor="PullUp" | ||
| 486 | Level="High" | ||
| 487 | Mode="Input" | ||
| 488 | Alternate="0" /> | ||
| 489 | <pin10 | ||
| 490 | ID="" | ||
| 491 | Type="PushPull" | ||
| 492 | Speed="Minimum" | ||
| 493 | Resistor="PullUp" | ||
| 494 | Level="High" | ||
| 495 | Mode="Input" | ||
| 496 | Alternate="0" /> | ||
| 497 | <pin11 | ||
| 498 | ID="" | ||
| 499 | Type="PushPull" | ||
| 500 | Speed="Minimum" | ||
| 501 | Resistor="PullUp" | ||
| 502 | Level="High" | ||
| 503 | Mode="Input" | ||
| 504 | Alternate="0" /> | ||
| 505 | <pin12 | ||
| 506 | ID="" | ||
| 507 | Type="PushPull" | ||
| 508 | Speed="Minimum" | ||
| 509 | Resistor="PullUp" | ||
| 510 | Level="High" | ||
| 511 | Mode="Input" | ||
| 512 | Alternate="0" /> | ||
| 513 | <pin13 | ||
| 514 | ID="" | ||
| 515 | Type="PushPull" | ||
| 516 | Speed="Minimum" | ||
| 517 | Resistor="PullUp" | ||
| 518 | Level="High" | ||
| 519 | Mode="Input" | ||
| 520 | Alternate="0" /> | ||
| 521 | <pin14 | ||
| 522 | ID="" | ||
| 523 | Type="PushPull" | ||
| 524 | Speed="Minimum" | ||
| 525 | Resistor="PullUp" | ||
| 526 | Level="High" | ||
| 527 | Mode="Input" | ||
| 528 | Alternate="0" /> | ||
| 529 | <pin15 | ||
| 530 | ID="" | ||
| 531 | Type="PushPull" | ||
| 532 | Speed="Minimum" | ||
| 533 | Resistor="PullUp" | ||
| 534 | Level="High" | ||
| 535 | Mode="Input" | ||
| 536 | Alternate="0" /> | ||
| 537 | </GPIOD> | ||
| 538 | <GPIOE> | ||
| 539 | <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 540 | Level="High" Mode="Input" Alternate="0" /> | ||
| 541 | <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 542 | Level="High" Mode="Input" Alternate="0" /> | ||
| 543 | <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 544 | Level="High" Mode="Input" Alternate="0" /> | ||
| 545 | <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 546 | Level="High" Mode="Input" Alternate="0" /> | ||
| 547 | <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 548 | Level="High" Mode="Input" Alternate="0" /> | ||
| 549 | <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 550 | Level="High" Mode="Input" Alternate="0" /> | ||
| 551 | <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 552 | Level="High" Mode="Input" Alternate="0" /> | ||
| 553 | <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 554 | Level="High" Mode="Input" Alternate="0" /> | ||
| 555 | <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 556 | Level="High" Mode="Input" Alternate="0" /> | ||
| 557 | <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 558 | Level="High" Mode="Input" Alternate="0" /> | ||
| 559 | <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 560 | Level="High" Mode="Input" Alternate="0" /> | ||
| 561 | <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 562 | Level="High" Mode="Input" Alternate="0" /> | ||
| 563 | <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 564 | Level="High" Mode="Input" Alternate="0" /> | ||
| 565 | <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 566 | Level="High" Mode="Input" Alternate="0" /> | ||
| 567 | <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 568 | Level="High" Mode="Input" Alternate="0" /> | ||
| 569 | <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 570 | Level="High" Mode="Input" Alternate="0" /> | ||
| 571 | </GPIOE> | ||
| 572 | <GPIOF> | ||
| 573 | <pin0 | ||
| 574 | ID="OSC_IN" | ||
| 575 | Type="PushPull" | ||
| 576 | Speed="Minimum" | ||
| 577 | Resistor="Floating" | ||
| 578 | Level="High" | ||
| 579 | Mode="Input" | ||
| 580 | Alternate="0" /> | ||
| 581 | <pin1 | ||
| 582 | ID="OSC_OUT" | ||
| 583 | Type="PushPull" | ||
| 584 | Speed="Minimum" | ||
| 585 | Resistor="Floating" | ||
| 586 | Level="High" | ||
| 587 | Mode="Input" | ||
| 588 | Alternate="0" /> | ||
| 589 | <pin2 | ||
| 590 | ID="" | ||
| 591 | Type="PushPull" | ||
| 592 | Speed="Minimum" | ||
| 593 | Resistor="PullUp" | ||
| 594 | Level="High" | ||
| 595 | Mode="Input" | ||
| 596 | Alternate="0" /> | ||
| 597 | <pin3 | ||
| 598 | ID="" | ||
| 599 | Type="PushPull" | ||
| 600 | Speed="Minimum" | ||
| 601 | Resistor="PullUp" | ||
| 602 | Level="High" | ||
| 603 | Mode="Input" | ||
| 604 | Alternate="0" /> | ||
| 605 | <pin4 | ||
| 606 | ID="" | ||
| 607 | Type="PushPull" | ||
| 608 | Speed="Minimum" | ||
| 609 | Resistor="PullUp" | ||
| 610 | Level="High" | ||
| 611 | Mode="Input" | ||
| 612 | Alternate="0" /> | ||
| 613 | <pin5 | ||
| 614 | ID="" | ||
| 615 | Type="PushPull" | ||
| 616 | Speed="Minimum" | ||
| 617 | Resistor="PullUp" | ||
| 618 | Level="High" | ||
| 619 | Mode="Input" | ||
| 620 | Alternate="0" /> | ||
| 621 | <pin6 | ||
| 622 | ID="" | ||
| 623 | Type="PushPull" | ||
| 624 | Speed="Minimum" | ||
| 625 | Resistor="PullUp" | ||
| 626 | Level="High" | ||
| 627 | Mode="Input" | ||
| 628 | Alternate="0" /> | ||
| 629 | <pin7 | ||
| 630 | ID="" | ||
| 631 | Type="PushPull" | ||
| 632 | Speed="Minimum" | ||
| 633 | Resistor="PullUp" | ||
| 634 | Level="High" | ||
| 635 | Mode="Input" | ||
| 636 | Alternate="0" /> | ||
| 637 | <pin8 | ||
| 638 | ID="" | ||
| 639 | Type="PushPull" | ||
| 640 | Speed="Minimum" | ||
| 641 | Resistor="PullUp" | ||
| 642 | Level="High" | ||
| 643 | Mode="Input" | ||
| 644 | Alternate="0" /> | ||
| 645 | <pin9 | ||
| 646 | ID="" | ||
| 647 | Type="PushPull" | ||
| 648 | Speed="Minimum" | ||
| 649 | Resistor="PullUp" | ||
| 650 | Level="High" | ||
| 651 | Mode="Input" | ||
| 652 | Alternate="0" /> | ||
| 653 | <pin10 | ||
| 654 | ID="" | ||
| 655 | Type="PushPull" | ||
| 656 | Speed="Minimum" | ||
| 657 | Resistor="PullUp" | ||
| 658 | Level="High" | ||
| 659 | Mode="Input" | ||
| 660 | Alternate="0" /> | ||
| 661 | <pin11 | ||
| 662 | ID="" | ||
| 663 | Type="PushPull" | ||
| 664 | Speed="Minimum" | ||
| 665 | Resistor="PullUp" | ||
| 666 | Level="High" | ||
| 667 | Mode="Input" | ||
| 668 | Alternate="0" /> | ||
| 669 | <pin12 | ||
| 670 | ID="" | ||
| 671 | Type="PushPull" | ||
| 672 | Speed="Minimum" | ||
| 673 | Resistor="PullUp" | ||
| 674 | Level="High" | ||
| 675 | Mode="Input" | ||
| 676 | Alternate="0" /> | ||
| 677 | <pin13 | ||
| 678 | ID="" | ||
| 679 | Type="PushPull" | ||
| 680 | Speed="Minimum" | ||
| 681 | Resistor="PullUp" | ||
| 682 | Level="High" | ||
| 683 | Mode="Input" | ||
| 684 | Alternate="0" /> | ||
| 685 | <pin14 | ||
| 686 | ID="" | ||
| 687 | Type="PushPull" | ||
| 688 | Speed="Minimum" | ||
| 689 | Resistor="PullUp" | ||
| 690 | Level="High" | ||
| 691 | Mode="Input" | ||
| 692 | Alternate="0" /> | ||
| 693 | <pin15 | ||
| 694 | ID="" | ||
| 695 | Type="PushPull" | ||
| 696 | Speed="Minimum" | ||
| 697 | Resistor="PullUp" | ||
| 698 | Level="High" | ||
| 699 | Mode="Input" | ||
| 700 | Alternate="0" /> | ||
| 701 | </GPIOF> | ||
| 702 | </ports> | ||
| 703 | </board> | ||
diff --git a/keyboards/cannonkeys/chimera65/config.h b/keyboards/cannonkeys/chimera65/config.h index 663d9cca9..d4338fb0a 100644 --- a/keyboards/cannonkeys/chimera65/config.h +++ b/keyboards/cannonkeys/chimera65/config.h | |||
| @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 33 | #define MATRIX_ROW_PINS { A13, A14, A15, C13, B8 } | 33 | #define MATRIX_ROW_PINS { A13, A14, A15, C13, B8 } |
| 34 | #define DIODE_DIRECTION COL2ROW | 34 | #define DIODE_DIRECTION COL2ROW |
| 35 | 35 | ||
| 36 | #define BACKLIGHT_PIN A6 | ||
| 37 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 38 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 39 | #define BACKLIGHT_PAL_MODE 1 | ||
| 36 | #define BACKLIGHT_LEVELS 6 | 40 | #define BACKLIGHT_LEVELS 6 |
| 37 | #define BACKLIGHT_BREATHING | 41 | #define BACKLIGHT_BREATHING |
| 38 | #define BREATHING_PERIOD 6 | 42 | #define BREATHING_PERIOD 6 |
diff --git a/keyboards/cannonkeys/chimera65/rules.mk b/keyboards/cannonkeys/chimera65/rules.mk index 795e2baf8..4d940da78 100644 --- a/keyboards/cannonkeys/chimera65/rules.mk +++ b/keyboards/cannonkeys/chimera65/rules.mk | |||
| @@ -1,15 +1,10 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = STM32F072 | 2 | MCU = STM32F072 |
| 3 | BOARD = ST_STM32F072B_DISCOVERY | ||
| 4 | 3 | ||
| 5 | # Build Options | 4 | # Build Options |
| 6 | # comment out to disable the options. | 5 | # comment out to disable the options. |
| 7 | # | 6 | # |
| 8 | 7 | ||
| 9 | # project specific files | ||
| 10 | VPATH += keyboards/cannonkeys/stm32f072 | ||
| 11 | SRC = keyboard.c \ | ||
| 12 | led.c | ||
| 13 | 8 | ||
| 14 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | 9 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 15 | MOUSEKEY_ENABLE = yes # Mouse keys | 10 | MOUSEKEY_ENABLE = yes # Mouse keys |
| @@ -19,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 19 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 20 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 21 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
| 22 | # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason | 17 | BACKLIGHT_ENABLE = yes |
| 23 | RGBLIGHT_ENABLE = no | 18 | RGBLIGHT_ENABLE = no |
| 24 | 19 | ||
| 25 | 20 | ||
diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null | |||
| @@ -1,268 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "hal.h" | ||
| 23 | #include "stm32_gpio.h" | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver local definitions. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /*===========================================================================*/ | ||
| 30 | /* Driver exported variables. */ | ||
| 31 | /*===========================================================================*/ | ||
| 32 | |||
| 33 | /*===========================================================================*/ | ||
| 34 | /* Driver local variables and types. */ | ||
| 35 | /*===========================================================================*/ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @brief Type of STM32 GPIO port setup. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | uint32_t moder; | ||
| 42 | uint32_t otyper; | ||
| 43 | uint32_t ospeedr; | ||
| 44 | uint32_t pupdr; | ||
| 45 | uint32_t odr; | ||
| 46 | uint32_t afrl; | ||
| 47 | uint32_t afrh; | ||
| 48 | } gpio_setup_t; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Type of STM32 GPIO initialization data. | ||
| 52 | */ | ||
| 53 | typedef struct { | ||
| 54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
| 55 | gpio_setup_t PAData; | ||
| 56 | #endif | ||
| 57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
| 58 | gpio_setup_t PBData; | ||
| 59 | #endif | ||
| 60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
| 61 | gpio_setup_t PCData; | ||
| 62 | #endif | ||
| 63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
| 64 | gpio_setup_t PDData; | ||
| 65 | #endif | ||
| 66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
| 67 | gpio_setup_t PEData; | ||
| 68 | #endif | ||
| 69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
| 70 | gpio_setup_t PFData; | ||
| 71 | #endif | ||
| 72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
| 73 | gpio_setup_t PGData; | ||
| 74 | #endif | ||
| 75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
| 76 | gpio_setup_t PHData; | ||
| 77 | #endif | ||
| 78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
| 79 | gpio_setup_t PIData; | ||
| 80 | #endif | ||
| 81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
| 82 | gpio_setup_t PJData; | ||
| 83 | #endif | ||
| 84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
| 85 | gpio_setup_t PKData; | ||
| 86 | #endif | ||
| 87 | } gpio_config_t; | ||
| 88 | |||
| 89 | /** | ||
| 90 | * @brief STM32 GPIO static initialization data. | ||
| 91 | */ | ||
| 92 | static const gpio_config_t gpio_default_config = { | ||
| 93 | #if STM32_HAS_GPIOA | ||
| 94 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
| 95 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, | ||
| 96 | #endif | ||
| 97 | #if STM32_HAS_GPIOB | ||
| 98 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
| 99 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, | ||
| 100 | #endif | ||
| 101 | #if STM32_HAS_GPIOC | ||
| 102 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
| 103 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, | ||
| 104 | #endif | ||
| 105 | #if STM32_HAS_GPIOD | ||
| 106 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
| 107 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, | ||
| 108 | #endif | ||
| 109 | #if STM32_HAS_GPIOE | ||
| 110 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
| 111 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, | ||
| 112 | #endif | ||
| 113 | #if STM32_HAS_GPIOF | ||
| 114 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
| 115 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, | ||
| 116 | #endif | ||
| 117 | #if STM32_HAS_GPIOG | ||
| 118 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
| 119 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, | ||
| 120 | #endif | ||
| 121 | #if STM32_HAS_GPIOH | ||
| 122 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
| 123 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, | ||
| 124 | #endif | ||
| 125 | #if STM32_HAS_GPIOI | ||
| 126 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
| 127 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, | ||
| 128 | #endif | ||
| 129 | #if STM32_HAS_GPIOJ | ||
| 130 | {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
| 131 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, | ||
| 132 | #endif | ||
| 133 | #if STM32_HAS_GPIOK | ||
| 134 | {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
| 135 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} | ||
| 136 | #endif | ||
| 137 | }; | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /* Driver local functions. */ | ||
| 141 | /*===========================================================================*/ | ||
| 142 | |||
| 143 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
| 144 | |||
| 145 | gpiop->OTYPER = config->otyper; | ||
| 146 | gpiop->OSPEEDR = config->ospeedr; | ||
| 147 | gpiop->PUPDR = config->pupdr; | ||
| 148 | gpiop->ODR = config->odr; | ||
| 149 | gpiop->AFRL = config->afrl; | ||
| 150 | gpiop->AFRH = config->afrh; | ||
| 151 | gpiop->MODER = config->moder; | ||
| 152 | } | ||
| 153 | |||
| 154 | static void stm32_gpio_init(void) { | ||
| 155 | |||
| 156 | /* Enabling GPIO-related clocks, the mask comes from the | ||
| 157 | registry header file.*/ | ||
| 158 | rccResetAHB(STM32_GPIO_EN_MASK); | ||
| 159 | rccEnableAHB(STM32_GPIO_EN_MASK, true); | ||
| 160 | |||
| 161 | /* Initializing all the defined GPIO ports.*/ | ||
| 162 | #if STM32_HAS_GPIOA | ||
| 163 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
| 164 | #endif | ||
| 165 | #if STM32_HAS_GPIOB | ||
| 166 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
| 167 | #endif | ||
| 168 | #if STM32_HAS_GPIOC | ||
| 169 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
| 170 | #endif | ||
| 171 | #if STM32_HAS_GPIOD | ||
| 172 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
| 173 | #endif | ||
| 174 | #if STM32_HAS_GPIOE | ||
| 175 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
| 176 | #endif | ||
| 177 | #if STM32_HAS_GPIOF | ||
| 178 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
| 179 | #endif | ||
| 180 | #if STM32_HAS_GPIOG | ||
| 181 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
| 182 | #endif | ||
| 183 | #if STM32_HAS_GPIOH | ||
| 184 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
| 185 | #endif | ||
| 186 | #if STM32_HAS_GPIOI | ||
| 187 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
| 188 | #endif | ||
| 189 | #if STM32_HAS_GPIOJ | ||
| 190 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
| 191 | #endif | ||
| 192 | #if STM32_HAS_GPIOK | ||
| 193 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* Driver interrupt handlers. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /*===========================================================================*/ | ||
| 202 | /* Driver exported functions. */ | ||
| 203 | /*===========================================================================*/ | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @brief Early initialization code. | ||
| 207 | * @details GPIO ports and system clocks are initialized before everything | ||
| 208 | * else. | ||
| 209 | */ | ||
| 210 | void __early_init(void) { | ||
| 211 | extern void enter_bootloader_mode_if_requested(void); | ||
| 212 | enter_bootloader_mode_if_requested(); | ||
| 213 | stm32_gpio_init(); | ||
| 214 | stm32_clock_init(); | ||
| 215 | } | ||
| 216 | |||
| 217 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
| 218 | /** | ||
| 219 | * @brief SDC card detection. | ||
| 220 | */ | ||
| 221 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
| 222 | |||
| 223 | (void)sdcp; | ||
| 224 | /* TODO: Fill the implementation.*/ | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | |||
| 228 | /** | ||
| 229 | * @brief SDC card write protection detection. | ||
| 230 | */ | ||
| 231 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
| 232 | |||
| 233 | (void)sdcp; | ||
| 234 | /* TODO: Fill the implementation.*/ | ||
| 235 | return false; | ||
| 236 | } | ||
| 237 | #endif /* HAL_USE_SDC */ | ||
| 238 | |||
| 239 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
| 240 | /** | ||
| 241 | * @brief MMC_SPI card detection. | ||
| 242 | */ | ||
| 243 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
| 244 | |||
| 245 | (void)mmcp; | ||
| 246 | /* TODO: Fill the implementation.*/ | ||
| 247 | return true; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @brief MMC_SPI card write protection detection. | ||
| 252 | */ | ||
| 253 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
| 254 | |||
| 255 | (void)mmcp; | ||
| 256 | /* TODO: Fill the implementation.*/ | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif | ||
| 260 | |||
| 261 | /** | ||
| 262 | * @brief Board-specific initialization code. | ||
| 263 | * @todo Add your board-specific code, if any. | ||
| 264 | */ | ||
| 265 | void boardInit(void) { | ||
| 266 | SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; | ||
| 267 | SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); | ||
| 268 | } | ||
diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 57636d1f1..000000000 --- a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,940 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef BOARD_H | ||
| 23 | #define BOARD_H | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver constants. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Setup for ST STM32F072B-Discovery board. | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Board identifier. | ||
| 35 | */ | ||
| 36 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 37 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Board oscillators-related settings. | ||
| 41 | * NOTE: HSE not fitted. | ||
| 42 | */ | ||
| 43 | #if !defined(STM32_LSECLK) | ||
| 44 | #define STM32_LSECLK 32768 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define STM32_LSEDRV (3U << 3U) | ||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK) | ||
| 50 | #define STM32_HSECLK 0U | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define STM32_HSE_BYPASS | ||
| 54 | |||
| 55 | /* | ||
| 56 | * MCU type as defined in the ST header. | ||
| 57 | */ | ||
| 58 | #define STM32F072xB | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IO pins assignments. | ||
| 62 | */ | ||
| 63 | #define GPIOA_BUTTON 0U | ||
| 64 | #define GPIOA_PIN1 1U | ||
| 65 | #define GPIOA_PIN2 2U | ||
| 66 | #define GPIOA_PIN3 3U | ||
| 67 | #define GPIOA_PIN4 4U | ||
| 68 | #define GPIOA_PIN5 5U | ||
| 69 | #define GPIOA_PIN6 6U | ||
| 70 | #define GPIOA_PIN7 7U | ||
| 71 | #define GPIOA_PIN8 8U | ||
| 72 | #define GPIOA_PIN9 9U | ||
| 73 | #define GPIOA_PIN10 10U | ||
| 74 | #define GPIOA_USB_DM 11U | ||
| 75 | #define GPIOA_USB_DP 12U | ||
| 76 | #define GPIOA_SWDIO 13U | ||
| 77 | #define GPIOA_SWCLK 14U | ||
| 78 | #define GPIOA_PIN15 15U | ||
| 79 | |||
| 80 | #define GPIOB_PIN0 0U | ||
| 81 | #define GPIOB_PIN1 1U | ||
| 82 | #define GPIOB_PIN2 2U | ||
| 83 | #define GPIOB_PIN3 3U | ||
| 84 | #define GPIOB_PIN4 4U | ||
| 85 | #define GPIOB_PIN5 5U | ||
| 86 | #define GPIOB_PIN6 6U | ||
| 87 | #define GPIOB_PIN7 7U | ||
| 88 | #define GPIOB_PIN8 8U | ||
| 89 | #define GPIOB_PIN9 9U | ||
| 90 | #define GPIOB_PIN10 10U | ||
| 91 | #define GPIOB_PIN11 11U | ||
| 92 | #define GPIOB_PIN12 12U | ||
| 93 | #define GPIOB_SPI2_SCK 13U | ||
| 94 | #define GPIOB_SPI2_MISO 14U | ||
| 95 | #define GPIOB_SPI2_MOSI 15U | ||
| 96 | |||
| 97 | #define GPIOC_MEMS_CS 0U | ||
| 98 | #define GPIOC_PIN1 1U | ||
| 99 | #define GPIOC_PIN2 2U | ||
| 100 | #define GPIOC_PIN3 3U | ||
| 101 | #define GPIOC_PIN4 4U | ||
| 102 | #define GPIOC_PIN5 5U | ||
| 103 | #define GPIOC_LED_RED 6U | ||
| 104 | #define GPIOC_LED_BLUE 7U | ||
| 105 | #define GPIOC_LED_ORANGE 8U | ||
| 106 | #define GPIOC_LED_GREEN 9U | ||
| 107 | #define GPIOC_PIN10 10U | ||
| 108 | #define GPIOC_PIN11 11U | ||
| 109 | #define GPIOC_PIN12 12U | ||
| 110 | #define GPIOC_PIN13 13U | ||
| 111 | #define GPIOC_OSC32_IN 14U | ||
| 112 | #define GPIOC_OSC32_OUT 15U | ||
| 113 | |||
| 114 | #define GPIOD_PIN0 0U | ||
| 115 | #define GPIOD_PIN1 1U | ||
| 116 | #define GPIOD_PIN2 2U | ||
| 117 | #define GPIOD_PIN3 3U | ||
| 118 | #define GPIOD_PIN4 4U | ||
| 119 | #define GPIOD_PIN5 5U | ||
| 120 | #define GPIOD_PIN6 6U | ||
| 121 | #define GPIOD_PIN7 7U | ||
| 122 | #define GPIOD_PIN8 8U | ||
| 123 | #define GPIOD_PIN9 9U | ||
| 124 | #define GPIOD_PIN10 10U | ||
| 125 | #define GPIOD_PIN11 11U | ||
| 126 | #define GPIOD_PIN12 12U | ||
| 127 | #define GPIOD_PIN13 13U | ||
| 128 | #define GPIOD_PIN14 14U | ||
| 129 | #define GPIOD_PIN15 15U | ||
| 130 | |||
| 131 | #define GPIOE_PIN0 0U | ||
| 132 | #define GPIOE_PIN1 1U | ||
| 133 | #define GPIOE_PIN2 2U | ||
| 134 | #define GPIOE_PIN3 3U | ||
| 135 | #define GPIOE_PIN4 4U | ||
| 136 | #define GPIOE_PIN5 5U | ||
| 137 | #define GPIOE_PIN6 6U | ||
| 138 | #define GPIOE_PIN7 7U | ||
| 139 | #define GPIOE_PIN8 8U | ||
| 140 | #define GPIOE_PIN9 9U | ||
| 141 | #define GPIOE_PIN10 10U | ||
| 142 | #define GPIOE_PIN11 11U | ||
| 143 | #define GPIOE_PIN12 12U | ||
| 144 | #define GPIOE_PIN13 13U | ||
| 145 | #define GPIOE_PIN14 14U | ||
| 146 | #define GPIOE_PIN15 15U | ||
| 147 | |||
| 148 | #define GPIOF_OSC_IN 0U | ||
| 149 | #define GPIOF_OSC_OUT 1U | ||
| 150 | #define GPIOF_PIN2 2U | ||
| 151 | #define GPIOF_PIN3 3U | ||
| 152 | #define GPIOF_PIN4 4U | ||
| 153 | #define GPIOF_PIN5 5U | ||
| 154 | #define GPIOF_PIN6 6U | ||
| 155 | #define GPIOF_PIN7 7U | ||
| 156 | #define GPIOF_PIN8 8U | ||
| 157 | #define GPIOF_PIN9 9U | ||
| 158 | #define GPIOF_PIN10 10U | ||
| 159 | #define GPIOF_PIN11 11U | ||
| 160 | #define GPIOF_PIN12 12U | ||
| 161 | #define GPIOF_PIN13 13U | ||
| 162 | #define GPIOF_PIN14 14U | ||
| 163 | #define GPIOF_PIN15 15U | ||
| 164 | |||
| 165 | /* | ||
| 166 | * IO lines assignments. | ||
| 167 | */ | ||
| 168 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 169 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 170 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 171 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 172 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 173 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 174 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 175 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 176 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 177 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 178 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 179 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 180 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 181 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 182 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 183 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 184 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 185 | |||
| 186 | /*===========================================================================*/ | ||
| 187 | /* Driver pre-compile time settings. */ | ||
| 188 | /*===========================================================================*/ | ||
| 189 | |||
| 190 | /*===========================================================================*/ | ||
| 191 | /* Derived constants and error checks. */ | ||
| 192 | /*===========================================================================*/ | ||
| 193 | |||
| 194 | /*===========================================================================*/ | ||
| 195 | /* Driver data structures and types. */ | ||
| 196 | /*===========================================================================*/ | ||
| 197 | |||
| 198 | /*===========================================================================*/ | ||
| 199 | /* Driver macros. */ | ||
| 200 | /*===========================================================================*/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 204 | * in the initialization code. | ||
| 205 | * Please refer to the STM32 Reference Manual for details. | ||
| 206 | */ | ||
| 207 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 208 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 209 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 210 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 211 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 212 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 213 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 214 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 215 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 216 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 217 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 218 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 219 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 220 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 221 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 222 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * GPIOA setup: | ||
| 226 | * | ||
| 227 | * PA0 - BUTTON (input floating). | ||
| 228 | * PA1 - PIN1 (input pullup). | ||
| 229 | * PA2 - PIN2 (input pullup). | ||
| 230 | * PA3 - PIN3 (input pullup). | ||
| 231 | * PA4 - PIN4 (input pullup). | ||
| 232 | * PA5 - PIN5 (input pullup). | ||
| 233 | * PA6 - PIN6 (input pullup). | ||
| 234 | * PA7 - PIN7 (input pullup). | ||
| 235 | * PA8 - PIN8 (input pullup). | ||
| 236 | * PA9 - PIN9 (input pullup). | ||
| 237 | * PA10 - PIN10 (input pullup). | ||
| 238 | * PA11 - USB_DM (input floating). | ||
| 239 | * PA12 - USB_DP (input floating). | ||
| 240 | * PA13 - SWDIO (alternate 0). | ||
| 241 | * PA14 - SWCLK (alternate 0). | ||
| 242 | * PA15 - PIN15 (input pullup). | ||
| 243 | */ | ||
| 244 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 246 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 247 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 248 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 249 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 250 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 251 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 252 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 253 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 254 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 255 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 256 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 257 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 258 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 259 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 260 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 265 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 267 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 268 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 269 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 270 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 271 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 272 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 273 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 274 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 275 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 276 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 277 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 278 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 279 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 280 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 281 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 282 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 283 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 284 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 285 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 286 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 287 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 288 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 289 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 290 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 291 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 292 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 294 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 295 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 296 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 297 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 298 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 299 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 300 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 301 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 302 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 303 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 304 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 305 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 306 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 307 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 308 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 310 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 311 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 312 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 313 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 314 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 315 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 316 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 317 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 318 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 319 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 320 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 321 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 322 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 323 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 324 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 326 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 327 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 328 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 329 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 330 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 331 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 332 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 333 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 334 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 335 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 336 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 337 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 338 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 339 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 340 | |||
| 341 | /* | ||
| 342 | * GPIOB setup: | ||
| 343 | * | ||
| 344 | * PB0 - PIN0 (input pullup). | ||
| 345 | * PB1 - PIN1 (input pullup). | ||
| 346 | * PB2 - PIN2 (input pullup). | ||
| 347 | * PB3 - PIN3 (input pullup). | ||
| 348 | * PB4 - PIN4 (input pullup). | ||
| 349 | * PB5 - PIN5 (input pullup). | ||
| 350 | * PB6 - PIN6 (input pullup). | ||
| 351 | * PB7 - PIN7 (input pullup). | ||
| 352 | * PB8 - PIN8 (input pullup). | ||
| 353 | * PB9 - PIN9 (input pullup). | ||
| 354 | * PB10 - PIN10 (input pullup). | ||
| 355 | * PB11 - PIN11 (input pullup). | ||
| 356 | * PB12 - PIN12 (input pullup). | ||
| 357 | * PB13 - SPI2_SCK (alternate 0). | ||
| 358 | * PB14 - SPI2_MISO (alternate 0). | ||
| 359 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 360 | */ | ||
| 361 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 362 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 363 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 364 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 365 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 366 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 367 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 368 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 369 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 370 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 371 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 372 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 373 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 374 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 375 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 376 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 377 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 379 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 380 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 381 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 382 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 383 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 384 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 385 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 386 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 387 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 388 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 389 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 390 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 391 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 392 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 393 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 395 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 396 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 397 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 398 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 399 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 400 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 401 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 402 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 403 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 404 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 405 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 406 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 407 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 408 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 409 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 410 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 411 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 412 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 413 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 414 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 415 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 416 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 417 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 418 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 419 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 420 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 421 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 422 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 423 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 424 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 425 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 427 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 428 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 429 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 430 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 431 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 432 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 433 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 434 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 435 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 436 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 437 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 438 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 439 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 440 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 441 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 443 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 444 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 445 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 446 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 447 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 448 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 449 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 450 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 451 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 452 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 453 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 454 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 455 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 456 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 457 | |||
| 458 | /* | ||
| 459 | * GPIOC setup: | ||
| 460 | * | ||
| 461 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 462 | * PC1 - PIN1 (input pullup). | ||
| 463 | * PC2 - PIN2 (input pullup). | ||
| 464 | * PC3 - PIN3 (input pullup). | ||
| 465 | * PC4 - PIN4 (input pullup). | ||
| 466 | * PC5 - PIN5 (input pullup). | ||
| 467 | * PC6 - LED_RED (output pushpull maximum). | ||
| 468 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 469 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 470 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 471 | * PC10 - PIN10 (input pullup). | ||
| 472 | * PC11 - PIN11 (input pullup). | ||
| 473 | * PC12 - PIN12 (input pullup). | ||
| 474 | * PC13 - PIN13 (input pullup). | ||
| 475 | * PC14 - OSC32_IN (input floating). | ||
| 476 | * PC15 - OSC32_OUT (input floating). | ||
| 477 | */ | ||
| 478 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 480 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 481 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 482 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 483 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 484 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 485 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 486 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 487 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 488 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 489 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 490 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 491 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 492 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 493 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 494 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 496 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 497 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 498 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 499 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 500 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 501 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 502 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 503 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 504 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 505 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 506 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 507 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 508 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 509 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 510 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 511 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 512 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 513 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 514 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 515 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 516 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 517 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 518 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 519 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 520 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 521 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 522 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 523 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 524 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 525 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 526 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 527 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 528 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 529 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 530 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 531 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 532 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 533 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 534 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 535 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 536 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 537 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 538 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 539 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 540 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 541 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 542 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 544 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 545 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 546 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 547 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 548 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 549 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 550 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 551 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 552 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 553 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 554 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 555 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 556 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 557 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 558 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 560 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 561 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 562 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 563 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 564 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 565 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 566 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 567 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 568 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 569 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 570 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 571 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 572 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 573 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 574 | |||
| 575 | /* | ||
| 576 | * GPIOD setup: | ||
| 577 | * | ||
| 578 | * PD0 - PIN0 (input pullup). | ||
| 579 | * PD1 - PIN1 (input pullup). | ||
| 580 | * PD2 - PIN2 (input pullup). | ||
| 581 | * PD3 - PIN3 (input pullup). | ||
| 582 | * PD4 - PIN4 (input pullup). | ||
| 583 | * PD5 - PIN5 (input pullup). | ||
| 584 | * PD6 - PIN6 (input pullup). | ||
| 585 | * PD7 - PIN7 (input pullup). | ||
| 586 | * PD8 - PIN8 (input pullup). | ||
| 587 | * PD9 - PIN9 (input pullup). | ||
| 588 | * PD10 - PIN10 (input pullup). | ||
| 589 | * PD11 - PIN11 (input pullup). | ||
| 590 | * PD12 - PIN12 (input pullup). | ||
| 591 | * PD13 - PIN13 (input pullup). | ||
| 592 | * PD14 - PIN14 (input pullup). | ||
| 593 | * PD15 - PIN15 (input pullup). | ||
| 594 | */ | ||
| 595 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 597 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 598 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 599 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 600 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 601 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 602 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 603 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 604 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 605 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 606 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 607 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 608 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 609 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 610 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 611 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 613 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 614 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 615 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 616 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 617 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 618 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 619 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 620 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 621 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 622 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 623 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 624 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 625 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 626 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 627 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 629 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 630 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 631 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 632 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 633 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 634 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 635 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 636 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 637 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 638 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 639 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 640 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 641 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 642 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 643 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 645 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 646 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 647 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 648 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 649 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 650 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 651 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 652 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 653 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 654 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 655 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 656 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 657 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 658 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 659 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 661 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 662 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 663 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 664 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 665 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 666 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 667 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 668 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 669 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 670 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 671 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 672 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 673 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 674 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 675 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 677 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 678 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 679 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 680 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 681 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 682 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 683 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 684 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 685 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 686 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 687 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 688 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 689 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 690 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 691 | |||
| 692 | /* | ||
| 693 | * GPIOE setup: | ||
| 694 | * | ||
| 695 | * PE0 - PIN0 (input pullup). | ||
| 696 | * PE1 - PIN1 (input pullup). | ||
| 697 | * PE2 - PIN2 (input pullup). | ||
| 698 | * PE3 - PIN3 (input pullup). | ||
| 699 | * PE4 - PIN4 (input pullup). | ||
| 700 | * PE5 - PIN5 (input pullup). | ||
| 701 | * PE6 - PIN6 (input pullup). | ||
| 702 | * PE7 - PIN7 (input pullup). | ||
| 703 | * PE8 - PIN8 (input pullup). | ||
| 704 | * PE9 - PIN9 (input pullup). | ||
| 705 | * PE10 - PIN10 (input pullup). | ||
| 706 | * PE11 - PIN11 (input pullup). | ||
| 707 | * PE12 - PIN12 (input pullup). | ||
| 708 | * PE13 - PIN13 (input pullup). | ||
| 709 | * PE14 - PIN14 (input pullup). | ||
| 710 | * PE15 - PIN15 (input pullup). | ||
| 711 | */ | ||
| 712 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 714 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 715 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 716 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 717 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 718 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 719 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 720 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 721 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 722 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 723 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 724 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 725 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 726 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 727 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 728 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 730 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 731 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 732 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 733 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 734 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 735 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 736 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 737 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 738 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 739 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 740 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 741 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 742 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 743 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 744 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 746 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 747 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 748 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 749 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 750 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 751 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 752 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 753 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 754 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 755 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 756 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 757 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 758 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 759 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 760 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 762 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 763 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 764 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 765 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 766 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 767 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 768 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 769 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 770 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 771 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 772 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 773 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 774 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 775 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 776 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 778 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 779 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 780 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 781 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 782 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 783 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 784 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 785 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 786 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 787 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 788 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 789 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 790 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 791 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 792 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 794 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 795 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 796 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 797 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 798 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 799 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 800 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 801 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 802 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 803 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 804 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 805 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 806 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 807 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 808 | |||
| 809 | /* | ||
| 810 | * GPIOF setup: | ||
| 811 | * | ||
| 812 | * PF0 - OSC_IN (input floating). | ||
| 813 | * PF1 - OSC_OUT (input floating). | ||
| 814 | * PF2 - PIN2 (input pullup). | ||
| 815 | * PF3 - PIN3 (input pullup). | ||
| 816 | * PF4 - PIN4 (input pullup). | ||
| 817 | * PF5 - PIN5 (input pullup). | ||
| 818 | * PF6 - PIN6 (input pullup). | ||
| 819 | * PF7 - PIN7 (input pullup). | ||
| 820 | * PF8 - PIN8 (input pullup). | ||
| 821 | * PF9 - PIN9 (input pullup). | ||
| 822 | * PF10 - PIN10 (input pullup). | ||
| 823 | * PF11 - PIN11 (input pullup). | ||
| 824 | * PF12 - PIN12 (input pullup). | ||
| 825 | * PF13 - PIN13 (input pullup). | ||
| 826 | * PF14 - PIN14 (input pullup). | ||
| 827 | * PF15 - PIN15 (input pullup). | ||
| 828 | */ | ||
| 829 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 831 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 832 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 833 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 834 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 835 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 836 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 837 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 838 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 839 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 840 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 841 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 842 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 843 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 844 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 845 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 847 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 848 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 849 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 850 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 851 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 852 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 853 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 854 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 855 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 856 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 857 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 858 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 859 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 860 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 861 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 863 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 864 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 865 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 866 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 867 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 868 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 869 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 870 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 871 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 872 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 873 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 874 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 875 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 876 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 877 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 878 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 879 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 880 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 881 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 882 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 883 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 884 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 885 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 886 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 887 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 888 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 889 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 890 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 891 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 892 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 893 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 895 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 896 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 897 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 898 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 899 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 900 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 901 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 902 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 903 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 904 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 905 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 906 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 907 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 908 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 909 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 911 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 912 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 913 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 914 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 915 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 916 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 917 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 918 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 919 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 920 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 921 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 922 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 923 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 924 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 925 | |||
| 926 | /*===========================================================================*/ | ||
| 927 | /* External declarations. */ | ||
| 928 | /*===========================================================================*/ | ||
| 929 | |||
| 930 | #if !defined(_FROM_ASM_) | ||
| 931 | #ifdef __cplusplus | ||
| 932 | extern "C" { | ||
| 933 | #endif | ||
| 934 | void boardInit(void); | ||
| 935 | #ifdef __cplusplus | ||
| 936 | } | ||
| 937 | #endif | ||
| 938 | #endif /* _FROM_ASM_ */ | ||
| 939 | |||
| 940 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # List of all the board related files. | ||
| 2 | BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c | ||
| 3 | |||
| 4 | # Required include directories | ||
| 5 | BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY | ||
diff --git a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg deleted file mode 100644 index 9c7cf4fd7..000000000 --- a/keyboards/cannonkeys/instant60/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg +++ /dev/null | |||
| @@ -1,703 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!-- STM32F0xx board Template --> | ||
| 3 | <board | ||
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 5 | xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> | ||
| 6 | <configuration_settings> | ||
| 7 | <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> | ||
| 8 | <output_path>..</output_path> | ||
| 9 | <hal_version>3.0.x</hal_version> | ||
| 10 | </configuration_settings> | ||
| 11 | <board_name>ST STM32F072B-Discovery</board_name> | ||
| 12 | <board_id>ST_STM32F072B_DISCOVERY</board_id> | ||
| 13 | <board_functions></board_functions> | ||
| 14 | <subtype>STM32F072xB</subtype> | ||
| 15 | <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" | ||
| 16 | LSEBypass="false" LSEDrive="3 High Drive (default)" /> | ||
| 17 | <ports> | ||
| 18 | <GPIOA> | ||
| 19 | <pin0 | ||
| 20 | ID="BUTTON" | ||
| 21 | Type="PushPull" | ||
| 22 | Speed="Minimum" | ||
| 23 | Resistor="Floating" | ||
| 24 | Level="High" | ||
| 25 | Mode="Input" | ||
| 26 | Alternate="0" /> | ||
| 27 | <pin1 | ||
| 28 | ID="" | ||
| 29 | Type="PushPull" | ||
| 30 | Speed="Minimum" | ||
| 31 | Resistor="PullUp" | ||
| 32 | Level="High" | ||
| 33 | Mode="Input" | ||
| 34 | Alternate="0" /> | ||
| 35 | <pin2 | ||
| 36 | ID="" | ||
| 37 | Type="PushPull" | ||
| 38 | Speed="Minimum" | ||
| 39 | Resistor="PullUp" | ||
| 40 | Level="High" | ||
| 41 | Mode="Input" | ||
| 42 | Alternate="0" /> | ||
| 43 | <pin3 | ||
| 44 | ID="" | ||
| 45 | Type="PushPull" | ||
| 46 | Speed="Minimum" | ||
| 47 | Resistor="PullUp" | ||
| 48 | Level="High" | ||
| 49 | Mode="Input" | ||
| 50 | Alternate="0" /> | ||
| 51 | <pin4 | ||
| 52 | ID="" | ||
| 53 | Type="PushPull" | ||
| 54 | Speed="Minimum" | ||
| 55 | Resistor="PullUp" | ||
| 56 | Level="High" | ||
| 57 | Mode="Input" | ||
| 58 | Alternate="0" /> | ||
| 59 | <pin5 | ||
| 60 | ID="" | ||
| 61 | Type="PushPull" | ||
| 62 | Speed="Minimum" | ||
| 63 | Resistor="PullUp" | ||
| 64 | Level="High" | ||
| 65 | Mode="Input" | ||
| 66 | Alternate="0" /> | ||
| 67 | <pin6 | ||
| 68 | ID="" | ||
| 69 | Type="PushPull" | ||
| 70 | Speed="Minimum" | ||
| 71 | Resistor="PullUp" | ||
| 72 | Level="High" | ||
| 73 | Mode="Input" | ||
| 74 | Alternate="0" /> | ||
| 75 | <pin7 | ||
| 76 | ID="" | ||
| 77 | Type="PushPull" | ||
| 78 | Speed="Minimum" | ||
| 79 | Resistor="PullUp" | ||
| 80 | Level="High" | ||
| 81 | Mode="Input" | ||
| 82 | Alternate="0" /> | ||
| 83 | <pin8 | ||
| 84 | ID="" | ||
| 85 | Type="PushPull" | ||
| 86 | Speed="Minimum" | ||
| 87 | Resistor="PullUp" | ||
| 88 | Level="High" | ||
| 89 | Mode="Input" | ||
| 90 | Alternate="0" /> | ||
| 91 | <pin9 | ||
| 92 | ID="" | ||
| 93 | Type="PushPull" | ||
| 94 | Speed="Minimum" | ||
| 95 | Resistor="PullUp" | ||
| 96 | Level="High" | ||
| 97 | Mode="Input" | ||
| 98 | Alternate="0" /> | ||
| 99 | <pin10 | ||
| 100 | ID="" | ||
| 101 | Type="PushPull" | ||
| 102 | Speed="Minimum" | ||
| 103 | Resistor="PullUp" | ||
| 104 | Level="High" | ||
| 105 | Mode="Input" | ||
| 106 | Alternate="0" /> | ||
| 107 | <pin11 | ||
| 108 | ID="USB_DM" | ||
| 109 | Type="PushPull" | ||
| 110 | Speed="Minimum" | ||
| 111 | Resistor="Floating" | ||
| 112 | Level="High" | ||
| 113 | Mode="Input" | ||
| 114 | Alternate="0" /> | ||
| 115 | <pin12 | ||
| 116 | ID="USB_DP" | ||
| 117 | Type="PushPull" | ||
| 118 | Speed="Minimum" | ||
| 119 | Resistor="Floating" | ||
| 120 | Level="High" | ||
| 121 | Mode="Input" | ||
| 122 | Alternate="0" /> | ||
| 123 | <pin13 | ||
| 124 | ID="SWDIO" | ||
| 125 | Type="PushPull" | ||
| 126 | Speed="Maximum" | ||
| 127 | Resistor="PullUp" | ||
| 128 | Level="High" | ||
| 129 | Mode="Alternate" | ||
| 130 | Alternate="0" /> | ||
| 131 | <pin14 | ||
| 132 | ID="SWCLK" | ||
| 133 | Type="PushPull" | ||
| 134 | Speed="Maximum" | ||
| 135 | Resistor="PullDown" | ||
| 136 | Level="High" | ||
| 137 | Mode="Alternate" | ||
| 138 | Alternate="0" /> | ||
| 139 | <pin15 | ||
| 140 | ID="" | ||
| 141 | Type="PushPull" | ||
| 142 | Speed="Maximum" | ||
| 143 | Resistor="PullUp" | ||
| 144 | Level="High" | ||
| 145 | Mode="Input" | ||
| 146 | Alternate="0" /> | ||
| 147 | </GPIOA> | ||
| 148 | <GPIOB> | ||
| 149 | <pin0 | ||
| 150 | ID="" | ||
| 151 | Type="PushPull" | ||
| 152 | Speed="Minimum" | ||
| 153 | Resistor="PullUp" | ||
| 154 | Level="High" | ||
| 155 | Mode="Input" | ||
| 156 | Alternate="0" /> | ||
| 157 | <pin1 | ||
| 158 | ID="" | ||
| 159 | Type="PushPull" | ||
| 160 | Speed="Minimum" | ||
| 161 | Resistor="PullUp" | ||
| 162 | Level="High" | ||
| 163 | Mode="Input" | ||
| 164 | Alternate="0" /> | ||
| 165 | <pin2 | ||
| 166 | ID="" | ||
| 167 | Type="PushPull" | ||
| 168 | Speed="Maximum" | ||
| 169 | Resistor="PullUp" | ||
| 170 | Level="High" | ||
| 171 | Mode="Input" | ||
| 172 | Alternate="0" /> | ||
| 173 | <pin3 | ||
| 174 | ID="" | ||
| 175 | Type="PushPull" | ||
| 176 | Speed="Maximum" | ||
| 177 | Resistor="PullUp" | ||
| 178 | Level="High" | ||
| 179 | Mode="Input" | ||
| 180 | Alternate="0" /> | ||
| 181 | <pin4 | ||
| 182 | ID="" | ||
| 183 | Type="PushPull" | ||
| 184 | Speed="Maximum" | ||
| 185 | Resistor="PullUp" | ||
| 186 | Level="High" | ||
| 187 | Mode="Input" | ||
| 188 | Alternate="0" /> | ||
| 189 | <pin5 | ||
| 190 | ID="" | ||
| 191 | Type="PushPull" | ||
| 192 | Speed="Minimum" | ||
| 193 | Resistor="PullUp" | ||
| 194 | Level="High" | ||
| 195 | Mode="Input" | ||
| 196 | Alternate="0" /> | ||
| 197 | <pin6 | ||
| 198 | ID="" | ||
| 199 | Type="PushPull" | ||
| 200 | Speed="Minimum" | ||
| 201 | Resistor="PullUp" | ||
| 202 | Level="High" | ||
| 203 | Mode="Input" | ||
| 204 | Alternate="0" /> | ||
| 205 | <pin7 | ||
| 206 | ID="" | ||
| 207 | Type="PushPull" | ||
| 208 | Speed="Minimum" | ||
| 209 | Resistor="PullUp" | ||
| 210 | Level="High" | ||
| 211 | Mode="Input" | ||
| 212 | Alternate="0" /> | ||
| 213 | <pin8 | ||
| 214 | ID="" | ||
| 215 | Type="PushPull" | ||
| 216 | Speed="Minimum" | ||
| 217 | Resistor="PullUp" | ||
| 218 | Level="High" | ||
| 219 | Mode="Input" | ||
| 220 | Alternate="0" /> | ||
| 221 | <pin9 | ||
| 222 | ID="" | ||
| 223 | Type="PushPull" | ||
| 224 | Speed="Minimum" | ||
| 225 | Resistor="PullUp" | ||
| 226 | Level="High" | ||
| 227 | Mode="Input" | ||
| 228 | Alternate="0" /> | ||
| 229 | <pin10 | ||
| 230 | ID="" | ||
| 231 | Type="PushPull" | ||
| 232 | Speed="Minimum" | ||
| 233 | Resistor="PullUp" | ||
| 234 | Level="High" | ||
| 235 | Mode="Input" | ||
| 236 | Alternate="0" /> | ||
| 237 | <pin11 | ||
| 238 | ID="" | ||
| 239 | Type="PushPull" | ||
| 240 | Speed="Minimum" | ||
| 241 | Resistor="PullUp" | ||
| 242 | Level="High" | ||
| 243 | Mode="Input" | ||
| 244 | Alternate="0" /> | ||
| 245 | <pin12 | ||
| 246 | ID="" | ||
| 247 | Type="PushPull" | ||
| 248 | Speed="Minimum" | ||
| 249 | Resistor="PullUp" | ||
| 250 | Level="High" | ||
| 251 | Mode="Input" | ||
| 252 | Alternate="0" /> | ||
| 253 | <pin13 | ||
| 254 | ID="SPI2_SCK" | ||
| 255 | Type="PushPull" | ||
| 256 | Speed="Minimum" | ||
| 257 | Resistor="Floating" | ||
| 258 | Level="High" | ||
| 259 | Mode="Alternate" | ||
| 260 | Alternate="0" /> | ||
| 261 | <pin14 | ||
| 262 | ID="SPI2_MISO" | ||
| 263 | Type="PushPull" | ||
| 264 | Speed="Minimum" | ||
| 265 | Resistor="Floating" | ||
| 266 | Level="High" | ||
| 267 | Mode="Alternate" | ||
| 268 | Alternate="0" /> | ||
| 269 | <pin15 | ||
| 270 | ID="SPI2_MOSI" | ||
| 271 | Type="PushPull" | ||
| 272 | Speed="Minimum" | ||
| 273 | Resistor="Floating" | ||
| 274 | Level="High" | ||
| 275 | Mode="Alternate" | ||
| 276 | Alternate="0" /> | ||
| 277 | </GPIOB> | ||
| 278 | <GPIOC> | ||
| 279 | <pin0 | ||
| 280 | ID="MEMS_CS" | ||
| 281 | Type="PushPull" | ||
| 282 | Speed="Maximum" | ||
| 283 | Resistor="Floating" | ||
| 284 | Level="High" | ||
| 285 | Mode="Output" | ||
| 286 | Alternate="0" /> | ||
| 287 | <pin1 | ||
| 288 | ID="" | ||
| 289 | Type="PushPull" | ||
| 290 | Speed="Minimum" | ||
| 291 | Resistor="PullUp" | ||
| 292 | Level="High" | ||
| 293 | Mode="Input" | ||
| 294 | Alternate="0" /> | ||
| 295 | <pin2 | ||
| 296 | ID="" | ||
| 297 | Type="PushPull" | ||
| 298 | Speed="Minimum" | ||
| 299 | Resistor="PullUp" | ||
| 300 | Level="High" | ||
| 301 | Mode="Input" | ||
| 302 | Alternate="0" /> | ||
| 303 | <pin3 | ||
| 304 | ID="" | ||
| 305 | Type="PushPull" | ||
| 306 | Speed="Minimum" | ||
| 307 | Resistor="PullUp" | ||
| 308 | Level="High" | ||
| 309 | Mode="Input" | ||
| 310 | Alternate="0" /> | ||
| 311 | <pin4 | ||
| 312 | ID="" | ||
| 313 | Type="PushPull" | ||
| 314 | Speed="Minimum" | ||
| 315 | Resistor="PullUp" | ||
| 316 | Level="High" | ||
| 317 | Mode="Input" | ||
| 318 | Alternate="0" /> | ||
| 319 | <pin5 | ||
| 320 | ID="" | ||
| 321 | Type="PushPull" | ||
| 322 | Speed="Minimum" | ||
| 323 | Resistor="PullUp" | ||
| 324 | Level="High" | ||
| 325 | Mode="Input" | ||
| 326 | Alternate="0" /> | ||
| 327 | <pin6 | ||
| 328 | ID="LED_RED" | ||
| 329 | Type="PushPull" | ||
| 330 | Speed="Maximum" | ||
| 331 | Resistor="Floating" | ||
| 332 | Level="Low" | ||
| 333 | Mode="Output" | ||
| 334 | Alternate="0" /> | ||
| 335 | <pin7 | ||
| 336 | ID="LED_BLUE" | ||
| 337 | Type="PushPull" | ||
| 338 | Speed="Maximum" | ||
| 339 | Resistor="Floating" | ||
| 340 | Level="Low" | ||
| 341 | Mode="Output" | ||
| 342 | Alternate="0" /> | ||
| 343 | <pin8 | ||
| 344 | ID="LED_ORANGE" | ||
| 345 | Type="PushPull" | ||
| 346 | Speed="Maximum" | ||
| 347 | Resistor="Floating" | ||
| 348 | Level="Low" | ||
| 349 | Mode="Output" | ||
| 350 | Alternate="0" ></pin8> | ||
| 351 | <pin9 | ||
| 352 | ID="LED_GREEN" | ||
| 353 | Type="PushPull" | ||
| 354 | Speed="Maximum" | ||
| 355 | Resistor="Floating" | ||
| 356 | Level="Low" | ||
| 357 | Mode="Output" | ||
| 358 | Alternate="0" /> | ||
| 359 | <pin10 | ||
| 360 | ID="" | ||
| 361 | Type="PushPull" | ||
| 362 | Speed="Minimum" | ||
| 363 | Resistor="PullUp" | ||
| 364 | Level="High" | ||
| 365 | Mode="Input" | ||
| 366 | Alternate="0" /> | ||
| 367 | <pin11 | ||
| 368 | ID="" | ||
| 369 | Type="PushPull" | ||
| 370 | Speed="Minimum" | ||
| 371 | Resistor="PullUp" | ||
| 372 | Level="High" | ||
| 373 | Mode="Input" | ||
| 374 | Alternate="0" /> | ||
| 375 | <pin12 | ||
| 376 | ID="" | ||
| 377 | Type="PushPull" | ||
| 378 | Speed="Minimum" | ||
| 379 | Resistor="PullUp" | ||
| 380 | Level="High" | ||
| 381 | Mode="Input" | ||
| 382 | Alternate="0" /> | ||
| 383 | <pin13 | ||
| 384 | ID="" | ||
| 385 | Type="PushPull" | ||
| 386 | Speed="Minimum" | ||
| 387 | Resistor="PullUp" | ||
| 388 | Level="High" | ||
| 389 | Mode="Input" | ||
| 390 | Alternate="0" /> | ||
| 391 | <pin14 | ||
| 392 | ID="OSC32_IN" | ||
| 393 | Type="PushPull" | ||
| 394 | Speed="Maximum" | ||
| 395 | Resistor="Floating" | ||
| 396 | Level="High" | ||
| 397 | Mode="Input" | ||
| 398 | Alternate="0" /> | ||
| 399 | <pin15 | ||
| 400 | ID="OSC32_OUT" | ||
| 401 | Type="PushPull" | ||
| 402 | Speed="Maximum" | ||
| 403 | Resistor="Floating" | ||
| 404 | Level="High" | ||
| 405 | Mode="Input" | ||
| 406 | Alternate="0" /> | ||
| 407 | </GPIOC> | ||
| 408 | <GPIOD> | ||
| 409 | <pin0 | ||
| 410 | ID="" | ||
| 411 | Type="PushPull" | ||
| 412 | Speed="Minimum" | ||
| 413 | Resistor="PullUp" | ||
| 414 | Level="High" | ||
| 415 | Mode="Input" | ||
| 416 | Alternate="0" /> | ||
| 417 | <pin1 | ||
| 418 | ID="" | ||
| 419 | Type="PushPull" | ||
| 420 | Speed="Minimum" | ||
| 421 | Resistor="PullUp" | ||
| 422 | Level="High" | ||
| 423 | Mode="Input" | ||
| 424 | Alternate="0" /> | ||
| 425 | <pin2 | ||
| 426 | ID="" | ||
| 427 | Type="PushPull" | ||
| 428 | Speed="Minimum" | ||
| 429 | Resistor="PullUp" | ||
| 430 | Level="High" | ||
| 431 | Mode="Input" | ||
| 432 | Alternate="0" /> | ||
| 433 | <pin3 | ||
| 434 | ID="" | ||
| 435 | Type="PushPull" | ||
| 436 | Speed="Minimum" | ||
| 437 | Resistor="PullUp" | ||
| 438 | Level="High" | ||
| 439 | Mode="Input" | ||
| 440 | Alternate="0" /> | ||
| 441 | <pin4 | ||
| 442 | ID="" | ||
| 443 | Type="PushPull" | ||
| 444 | Speed="Minimum" | ||
| 445 | Resistor="PullUp" | ||
| 446 | Level="High" | ||
| 447 | Mode="Input" | ||
| 448 | Alternate="0" /> | ||
| 449 | <pin5 | ||
| 450 | ID="" | ||
| 451 | Type="PushPull" | ||
| 452 | Speed="Minimum" | ||
| 453 | Resistor="PullUp" | ||
| 454 | Level="High" | ||
| 455 | Mode="Input" | ||
| 456 | Alternate="0" /> | ||
| 457 | <pin6 | ||
| 458 | ID="" | ||
| 459 | Type="PushPull" | ||
| 460 | Speed="Minimum" | ||
| 461 | Resistor="PullUp" | ||
| 462 | Level="High" | ||
| 463 | Mode="Input" | ||
| 464 | Alternate="0" /> | ||
| 465 | <pin7 | ||
| 466 | ID="" | ||
| 467 | Type="PushPull" | ||
| 468 | Speed="Minimum" | ||
| 469 | Resistor="PullUp" | ||
| 470 | Level="High" | ||
| 471 | Mode="Input" | ||
| 472 | Alternate="0" /> | ||
| 473 | <pin8 | ||
| 474 | ID="" | ||
| 475 | Type="PushPull" | ||
| 476 | Speed="Minimum" | ||
| 477 | Resistor="PullUp" | ||
| 478 | Level="High" | ||
| 479 | Mode="Input" | ||
| 480 | Alternate="0" /> | ||
| 481 | <pin9 | ||
| 482 | ID="" | ||
| 483 | Type="PushPull" | ||
| 484 | Speed="Minimum" | ||
| 485 | Resistor="PullUp" | ||
| 486 | Level="High" | ||
| 487 | Mode="Input" | ||
| 488 | Alternate="0" /> | ||
| 489 | <pin10 | ||
| 490 | ID="" | ||
| 491 | Type="PushPull" | ||
| 492 | Speed="Minimum" | ||
| 493 | Resistor="PullUp" | ||
| 494 | Level="High" | ||
| 495 | Mode="Input" | ||
| 496 | Alternate="0" /> | ||
| 497 | <pin11 | ||
| 498 | ID="" | ||
| 499 | Type="PushPull" | ||
| 500 | Speed="Minimum" | ||
| 501 | Resistor="PullUp" | ||
| 502 | Level="High" | ||
| 503 | Mode="Input" | ||
| 504 | Alternate="0" /> | ||
| 505 | <pin12 | ||
| 506 | ID="" | ||
| 507 | Type="PushPull" | ||
| 508 | Speed="Minimum" | ||
| 509 | Resistor="PullUp" | ||
| 510 | Level="High" | ||
| 511 | Mode="Input" | ||
| 512 | Alternate="0" /> | ||
| 513 | <pin13 | ||
| 514 | ID="" | ||
| 515 | Type="PushPull" | ||
| 516 | Speed="Minimum" | ||
| 517 | Resistor="PullUp" | ||
| 518 | Level="High" | ||
| 519 | Mode="Input" | ||
| 520 | Alternate="0" /> | ||
| 521 | <pin14 | ||
| 522 | ID="" | ||
| 523 | Type="PushPull" | ||
| 524 | Speed="Minimum" | ||
| 525 | Resistor="PullUp" | ||
| 526 | Level="High" | ||
| 527 | Mode="Input" | ||
| 528 | Alternate="0" /> | ||
| 529 | <pin15 | ||
| 530 | ID="" | ||
| 531 | Type="PushPull" | ||
| 532 | Speed="Minimum" | ||
| 533 | Resistor="PullUp" | ||
| 534 | Level="High" | ||
| 535 | Mode="Input" | ||
| 536 | Alternate="0" /> | ||
| 537 | </GPIOD> | ||
| 538 | <GPIOE> | ||
| 539 | <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 540 | Level="High" Mode="Input" Alternate="0" /> | ||
| 541 | <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 542 | Level="High" Mode="Input" Alternate="0" /> | ||
| 543 | <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 544 | Level="High" Mode="Input" Alternate="0" /> | ||
| 545 | <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 546 | Level="High" Mode="Input" Alternate="0" /> | ||
| 547 | <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 548 | Level="High" Mode="Input" Alternate="0" /> | ||
| 549 | <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 550 | Level="High" Mode="Input" Alternate="0" /> | ||
| 551 | <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 552 | Level="High" Mode="Input" Alternate="0" /> | ||
| 553 | <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 554 | Level="High" Mode="Input" Alternate="0" /> | ||
| 555 | <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 556 | Level="High" Mode="Input" Alternate="0" /> | ||
| 557 | <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 558 | Level="High" Mode="Input" Alternate="0" /> | ||
| 559 | <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 560 | Level="High" Mode="Input" Alternate="0" /> | ||
| 561 | <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 562 | Level="High" Mode="Input" Alternate="0" /> | ||
| 563 | <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 564 | Level="High" Mode="Input" Alternate="0" /> | ||
| 565 | <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 566 | Level="High" Mode="Input" Alternate="0" /> | ||
| 567 | <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 568 | Level="High" Mode="Input" Alternate="0" /> | ||
| 569 | <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 570 | Level="High" Mode="Input" Alternate="0" /> | ||
| 571 | </GPIOE> | ||
| 572 | <GPIOF> | ||
| 573 | <pin0 | ||
| 574 | ID="OSC_IN" | ||
| 575 | Type="PushPull" | ||
| 576 | Speed="Minimum" | ||
| 577 | Resistor="Floating" | ||
| 578 | Level="High" | ||
| 579 | Mode="Input" | ||
| 580 | Alternate="0" /> | ||
| 581 | <pin1 | ||
| 582 | ID="OSC_OUT" | ||
| 583 | Type="PushPull" | ||
| 584 | Speed="Minimum" | ||
| 585 | Resistor="Floating" | ||
| 586 | Level="High" | ||
| 587 | Mode="Input" | ||
| 588 | Alternate="0" /> | ||
| 589 | <pin2 | ||
| 590 | ID="" | ||
| 591 | Type="PushPull" | ||
| 592 | Speed="Minimum" | ||
| 593 | Resistor="PullUp" | ||
| 594 | Level="High" | ||
| 595 | Mode="Input" | ||
| 596 | Alternate="0" /> | ||
| 597 | <pin3 | ||
| 598 | ID="" | ||
| 599 | Type="PushPull" | ||
| 600 | Speed="Minimum" | ||
| 601 | Resistor="PullUp" | ||
| 602 | Level="High" | ||
| 603 | Mode="Input" | ||
| 604 | Alternate="0" /> | ||
| 605 | <pin4 | ||
| 606 | ID="" | ||
| 607 | Type="PushPull" | ||
| 608 | Speed="Minimum" | ||
| 609 | Resistor="PullUp" | ||
| 610 | Level="High" | ||
| 611 | Mode="Input" | ||
| 612 | Alternate="0" /> | ||
| 613 | <pin5 | ||
| 614 | ID="" | ||
| 615 | Type="PushPull" | ||
| 616 | Speed="Minimum" | ||
| 617 | Resistor="PullUp" | ||
| 618 | Level="High" | ||
| 619 | Mode="Input" | ||
| 620 | Alternate="0" /> | ||
| 621 | <pin6 | ||
| 622 | ID="" | ||
| 623 | Type="PushPull" | ||
| 624 | Speed="Minimum" | ||
| 625 | Resistor="PullUp" | ||
| 626 | Level="High" | ||
| 627 | Mode="Input" | ||
| 628 | Alternate="0" /> | ||
| 629 | <pin7 | ||
| 630 | ID="" | ||
| 631 | Type="PushPull" | ||
| 632 | Speed="Minimum" | ||
| 633 | Resistor="PullUp" | ||
| 634 | Level="High" | ||
| 635 | Mode="Input" | ||
| 636 | Alternate="0" /> | ||
| 637 | <pin8 | ||
| 638 | ID="" | ||
| 639 | Type="PushPull" | ||
| 640 | Speed="Minimum" | ||
| 641 | Resistor="PullUp" | ||
| 642 | Level="High" | ||
| 643 | Mode="Input" | ||
| 644 | Alternate="0" /> | ||
| 645 | <pin9 | ||
| 646 | ID="" | ||
| 647 | Type="PushPull" | ||
| 648 | Speed="Minimum" | ||
| 649 | Resistor="PullUp" | ||
| 650 | Level="High" | ||
| 651 | Mode="Input" | ||
| 652 | Alternate="0" /> | ||
| 653 | <pin10 | ||
| 654 | ID="" | ||
| 655 | Type="PushPull" | ||
| 656 | Speed="Minimum" | ||
| 657 | Resistor="PullUp" | ||
| 658 | Level="High" | ||
| 659 | Mode="Input" | ||
| 660 | Alternate="0" /> | ||
| 661 | <pin11 | ||
| 662 | ID="" | ||
| 663 | Type="PushPull" | ||
| 664 | Speed="Minimum" | ||
| 665 | Resistor="PullUp" | ||
| 666 | Level="High" | ||
| 667 | Mode="Input" | ||
| 668 | Alternate="0" /> | ||
| 669 | <pin12 | ||
| 670 | ID="" | ||
| 671 | Type="PushPull" | ||
| 672 | Speed="Minimum" | ||
| 673 | Resistor="PullUp" | ||
| 674 | Level="High" | ||
| 675 | Mode="Input" | ||
| 676 | Alternate="0" /> | ||
| 677 | <pin13 | ||
| 678 | ID="" | ||
| 679 | Type="PushPull" | ||
| 680 | Speed="Minimum" | ||
| 681 | Resistor="PullUp" | ||
| 682 | Level="High" | ||
| 683 | Mode="Input" | ||
| 684 | Alternate="0" /> | ||
| 685 | <pin14 | ||
| 686 | ID="" | ||
| 687 | Type="PushPull" | ||
| 688 | Speed="Minimum" | ||
| 689 | Resistor="PullUp" | ||
| 690 | Level="High" | ||
| 691 | Mode="Input" | ||
| 692 | Alternate="0" /> | ||
| 693 | <pin15 | ||
| 694 | ID="" | ||
| 695 | Type="PushPull" | ||
| 696 | Speed="Minimum" | ||
| 697 | Resistor="PullUp" | ||
| 698 | Level="High" | ||
| 699 | Mode="Input" | ||
| 700 | Alternate="0" /> | ||
| 701 | </GPIOF> | ||
| 702 | </ports> | ||
| 703 | </board> | ||
diff --git a/keyboards/cannonkeys/instant60/config.h b/keyboards/cannonkeys/instant60/config.h index 1c4325187..73b2ad533 100644 --- a/keyboards/cannonkeys/instant60/config.h +++ b/keyboards/cannonkeys/instant60/config.h | |||
| @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 33 | #define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } | 33 | #define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } |
| 34 | #define DIODE_DIRECTION COL2ROW | 34 | #define DIODE_DIRECTION COL2ROW |
| 35 | 35 | ||
| 36 | #define BACKLIGHT_PIN A6 | ||
| 37 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 38 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 39 | #define BACKLIGHT_PAL_MODE 1 | ||
| 36 | #define BACKLIGHT_LEVELS 6 | 40 | #define BACKLIGHT_LEVELS 6 |
| 37 | #define BACKLIGHT_BREATHING | 41 | #define BACKLIGHT_BREATHING |
| 38 | #define BREATHING_PERIOD 6 | 42 | #define BREATHING_PERIOD 6 |
| @@ -52,16 +56,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 52 | #define RGB_DI_PIN B15 | 56 | #define RGB_DI_PIN B15 |
| 53 | #define RGBLED_NUM 14 | 57 | #define RGBLED_NUM 14 |
| 54 | #define WS2812_SPI SPID2 | 58 | #define WS2812_SPI SPID2 |
| 55 | 59 | #define WS2812_SPI_MOSI_PAL_MODE 0 | |
| 56 | // Backlight config starts after VIA's EEPROM usage, | ||
| 57 | // dynamic keymaps start after this. | ||
| 58 | #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 1 | ||
| 59 | |||
| 60 | // VIA lighting is handled by the keyboard-level code | ||
| 61 | #define VIA_CUSTOM_LIGHTING_ENABLE | ||
| 62 | |||
| 63 | // Let VIA handle the QMK RGBLIGHT | ||
| 64 | #define VIA_QMK_RGBLIGHT_ENABLE | ||
| 65 | 60 | ||
| 66 | /* | 61 | /* |
| 67 | * Feature disable options | 62 | * Feature disable options |
diff --git a/keyboards/cannonkeys/instant60/rules.mk b/keyboards/cannonkeys/instant60/rules.mk index 4c432cf98..b863bfadd 100644 --- a/keyboards/cannonkeys/instant60/rules.mk +++ b/keyboards/cannonkeys/instant60/rules.mk | |||
| @@ -1,16 +1,10 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = STM32F072 | 2 | MCU = STM32F072 |
| 3 | BOARD = ST_STM32F072B_DISCOVERY | ||
| 4 | 3 | ||
| 5 | # Build Options | 4 | # Build Options |
| 6 | # comment out to disable the options. | 5 | # comment out to disable the options. |
| 7 | # | 6 | # |
| 8 | 7 | ||
| 9 | # project specific files | ||
| 10 | VPATH += keyboards/cannonkeys/stm32f072 | ||
| 11 | SRC = keyboard.c \ | ||
| 12 | led.c | ||
| 13 | |||
| 14 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | 8 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 15 | MOUSEKEY_ENABLE = yes # Mouse keys | 9 | MOUSEKEY_ENABLE = yes # Mouse keys |
| 16 | EXTRAKEY_ENABLE = yes # Audio control and System control | 10 | EXTRAKEY_ENABLE = yes # Audio control and System control |
| @@ -19,7 +13,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 19 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 13 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 20 | NKRO_ENABLE = yes # USB Nkey Rollover | 14 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 21 | CUSTOM_MATRIX = no # Custom matrix file | 15 | CUSTOM_MATRIX = no # Custom matrix file |
| 22 | # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason | 16 | BACKLIGHT_ENABLE = yes |
| 23 | RGBLIGHT_ENABLE = yes | 17 | RGBLIGHT_ENABLE = yes |
| 24 | WS2812_DRIVER = spi | 18 | WS2812_DRIVER = spi |
| 25 | 19 | ||
diff --git a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null | |||
| @@ -1,268 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "hal.h" | ||
| 23 | #include "stm32_gpio.h" | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver local definitions. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /*===========================================================================*/ | ||
| 30 | /* Driver exported variables. */ | ||
| 31 | /*===========================================================================*/ | ||
| 32 | |||
| 33 | /*===========================================================================*/ | ||
| 34 | /* Driver local variables and types. */ | ||
| 35 | /*===========================================================================*/ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @brief Type of STM32 GPIO port setup. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | uint32_t moder; | ||
| 42 | uint32_t otyper; | ||
| 43 | uint32_t ospeedr; | ||
| 44 | uint32_t pupdr; | ||
| 45 | uint32_t odr; | ||
| 46 | uint32_t afrl; | ||
| 47 | uint32_t afrh; | ||
| 48 | } gpio_setup_t; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Type of STM32 GPIO initialization data. | ||
| 52 | */ | ||
| 53 | typedef struct { | ||
| 54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
| 55 | gpio_setup_t PAData; | ||
| 56 | #endif | ||
| 57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
| 58 | gpio_setup_t PBData; | ||
| 59 | #endif | ||
| 60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
| 61 | gpio_setup_t PCData; | ||
| 62 | #endif | ||
| 63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
| 64 | gpio_setup_t PDData; | ||
| 65 | #endif | ||
| 66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
| 67 | gpio_setup_t PEData; | ||
| 68 | #endif | ||
| 69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
| 70 | gpio_setup_t PFData; | ||
| 71 | #endif | ||
| 72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
| 73 | gpio_setup_t PGData; | ||
| 74 | #endif | ||
| 75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
| 76 | gpio_setup_t PHData; | ||
| 77 | #endif | ||
| 78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
| 79 | gpio_setup_t PIData; | ||
| 80 | #endif | ||
| 81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
| 82 | gpio_setup_t PJData; | ||
| 83 | #endif | ||
| 84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
| 85 | gpio_setup_t PKData; | ||
| 86 | #endif | ||
| 87 | } gpio_config_t; | ||
| 88 | |||
| 89 | /** | ||
| 90 | * @brief STM32 GPIO static initialization data. | ||
| 91 | */ | ||
| 92 | static const gpio_config_t gpio_default_config = { | ||
| 93 | #if STM32_HAS_GPIOA | ||
| 94 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
| 95 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, | ||
| 96 | #endif | ||
| 97 | #if STM32_HAS_GPIOB | ||
| 98 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
| 99 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, | ||
| 100 | #endif | ||
| 101 | #if STM32_HAS_GPIOC | ||
| 102 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
| 103 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, | ||
| 104 | #endif | ||
| 105 | #if STM32_HAS_GPIOD | ||
| 106 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
| 107 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, | ||
| 108 | #endif | ||
| 109 | #if STM32_HAS_GPIOE | ||
| 110 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
| 111 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, | ||
| 112 | #endif | ||
| 113 | #if STM32_HAS_GPIOF | ||
| 114 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
| 115 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, | ||
| 116 | #endif | ||
| 117 | #if STM32_HAS_GPIOG | ||
| 118 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
| 119 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, | ||
| 120 | #endif | ||
| 121 | #if STM32_HAS_GPIOH | ||
| 122 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
| 123 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, | ||
| 124 | #endif | ||
| 125 | #if STM32_HAS_GPIOI | ||
| 126 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
| 127 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, | ||
| 128 | #endif | ||
| 129 | #if STM32_HAS_GPIOJ | ||
| 130 | {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
| 131 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, | ||
| 132 | #endif | ||
| 133 | #if STM32_HAS_GPIOK | ||
| 134 | {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
| 135 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} | ||
| 136 | #endif | ||
| 137 | }; | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /* Driver local functions. */ | ||
| 141 | /*===========================================================================*/ | ||
| 142 | |||
| 143 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
| 144 | |||
| 145 | gpiop->OTYPER = config->otyper; | ||
| 146 | gpiop->OSPEEDR = config->ospeedr; | ||
| 147 | gpiop->PUPDR = config->pupdr; | ||
| 148 | gpiop->ODR = config->odr; | ||
| 149 | gpiop->AFRL = config->afrl; | ||
| 150 | gpiop->AFRH = config->afrh; | ||
| 151 | gpiop->MODER = config->moder; | ||
| 152 | } | ||
| 153 | |||
| 154 | static void stm32_gpio_init(void) { | ||
| 155 | |||
| 156 | /* Enabling GPIO-related clocks, the mask comes from the | ||
| 157 | registry header file.*/ | ||
| 158 | rccResetAHB(STM32_GPIO_EN_MASK); | ||
| 159 | rccEnableAHB(STM32_GPIO_EN_MASK, true); | ||
| 160 | |||
| 161 | /* Initializing all the defined GPIO ports.*/ | ||
| 162 | #if STM32_HAS_GPIOA | ||
| 163 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
| 164 | #endif | ||
| 165 | #if STM32_HAS_GPIOB | ||
| 166 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
| 167 | #endif | ||
| 168 | #if STM32_HAS_GPIOC | ||
| 169 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
| 170 | #endif | ||
| 171 | #if STM32_HAS_GPIOD | ||
| 172 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
| 173 | #endif | ||
| 174 | #if STM32_HAS_GPIOE | ||
| 175 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
| 176 | #endif | ||
| 177 | #if STM32_HAS_GPIOF | ||
| 178 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
| 179 | #endif | ||
| 180 | #if STM32_HAS_GPIOG | ||
| 181 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
| 182 | #endif | ||
| 183 | #if STM32_HAS_GPIOH | ||
| 184 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
| 185 | #endif | ||
| 186 | #if STM32_HAS_GPIOI | ||
| 187 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
| 188 | #endif | ||
| 189 | #if STM32_HAS_GPIOJ | ||
| 190 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
| 191 | #endif | ||
| 192 | #if STM32_HAS_GPIOK | ||
| 193 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* Driver interrupt handlers. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /*===========================================================================*/ | ||
| 202 | /* Driver exported functions. */ | ||
| 203 | /*===========================================================================*/ | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @brief Early initialization code. | ||
| 207 | * @details GPIO ports and system clocks are initialized before everything | ||
| 208 | * else. | ||
| 209 | */ | ||
| 210 | void __early_init(void) { | ||
| 211 | extern void enter_bootloader_mode_if_requested(void); | ||
| 212 | enter_bootloader_mode_if_requested(); | ||
| 213 | stm32_gpio_init(); | ||
| 214 | stm32_clock_init(); | ||
| 215 | } | ||
| 216 | |||
| 217 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
| 218 | /** | ||
| 219 | * @brief SDC card detection. | ||
| 220 | */ | ||
| 221 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
| 222 | |||
| 223 | (void)sdcp; | ||
| 224 | /* TODO: Fill the implementation.*/ | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | |||
| 228 | /** | ||
| 229 | * @brief SDC card write protection detection. | ||
| 230 | */ | ||
| 231 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
| 232 | |||
| 233 | (void)sdcp; | ||
| 234 | /* TODO: Fill the implementation.*/ | ||
| 235 | return false; | ||
| 236 | } | ||
| 237 | #endif /* HAL_USE_SDC */ | ||
| 238 | |||
| 239 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
| 240 | /** | ||
| 241 | * @brief MMC_SPI card detection. | ||
| 242 | */ | ||
| 243 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
| 244 | |||
| 245 | (void)mmcp; | ||
| 246 | /* TODO: Fill the implementation.*/ | ||
| 247 | return true; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @brief MMC_SPI card write protection detection. | ||
| 252 | */ | ||
| 253 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
| 254 | |||
| 255 | (void)mmcp; | ||
| 256 | /* TODO: Fill the implementation.*/ | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif | ||
| 260 | |||
| 261 | /** | ||
| 262 | * @brief Board-specific initialization code. | ||
| 263 | * @todo Add your board-specific code, if any. | ||
| 264 | */ | ||
| 265 | void boardInit(void) { | ||
| 266 | SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; | ||
| 267 | SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); | ||
| 268 | } | ||
diff --git a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 57636d1f1..000000000 --- a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,940 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef BOARD_H | ||
| 23 | #define BOARD_H | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver constants. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Setup for ST STM32F072B-Discovery board. | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Board identifier. | ||
| 35 | */ | ||
| 36 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 37 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Board oscillators-related settings. | ||
| 41 | * NOTE: HSE not fitted. | ||
| 42 | */ | ||
| 43 | #if !defined(STM32_LSECLK) | ||
| 44 | #define STM32_LSECLK 32768 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define STM32_LSEDRV (3U << 3U) | ||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK) | ||
| 50 | #define STM32_HSECLK 0U | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define STM32_HSE_BYPASS | ||
| 54 | |||
| 55 | /* | ||
| 56 | * MCU type as defined in the ST header. | ||
| 57 | */ | ||
| 58 | #define STM32F072xB | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IO pins assignments. | ||
| 62 | */ | ||
| 63 | #define GPIOA_BUTTON 0U | ||
| 64 | #define GPIOA_PIN1 1U | ||
| 65 | #define GPIOA_PIN2 2U | ||
| 66 | #define GPIOA_PIN3 3U | ||
| 67 | #define GPIOA_PIN4 4U | ||
| 68 | #define GPIOA_PIN5 5U | ||
| 69 | #define GPIOA_PIN6 6U | ||
| 70 | #define GPIOA_PIN7 7U | ||
| 71 | #define GPIOA_PIN8 8U | ||
| 72 | #define GPIOA_PIN9 9U | ||
| 73 | #define GPIOA_PIN10 10U | ||
| 74 | #define GPIOA_USB_DM 11U | ||
| 75 | #define GPIOA_USB_DP 12U | ||
| 76 | #define GPIOA_SWDIO 13U | ||
| 77 | #define GPIOA_SWCLK 14U | ||
| 78 | #define GPIOA_PIN15 15U | ||
| 79 | |||
| 80 | #define GPIOB_PIN0 0U | ||
| 81 | #define GPIOB_PIN1 1U | ||
| 82 | #define GPIOB_PIN2 2U | ||
| 83 | #define GPIOB_PIN3 3U | ||
| 84 | #define GPIOB_PIN4 4U | ||
| 85 | #define GPIOB_PIN5 5U | ||
| 86 | #define GPIOB_PIN6 6U | ||
| 87 | #define GPIOB_PIN7 7U | ||
| 88 | #define GPIOB_PIN8 8U | ||
| 89 | #define GPIOB_PIN9 9U | ||
| 90 | #define GPIOB_PIN10 10U | ||
| 91 | #define GPIOB_PIN11 11U | ||
| 92 | #define GPIOB_PIN12 12U | ||
| 93 | #define GPIOB_SPI2_SCK 13U | ||
| 94 | #define GPIOB_SPI2_MISO 14U | ||
| 95 | #define GPIOB_SPI2_MOSI 15U | ||
| 96 | |||
| 97 | #define GPIOC_MEMS_CS 0U | ||
| 98 | #define GPIOC_PIN1 1U | ||
| 99 | #define GPIOC_PIN2 2U | ||
| 100 | #define GPIOC_PIN3 3U | ||
| 101 | #define GPIOC_PIN4 4U | ||
| 102 | #define GPIOC_PIN5 5U | ||
| 103 | #define GPIOC_LED_RED 6U | ||
| 104 | #define GPIOC_LED_BLUE 7U | ||
| 105 | #define GPIOC_LED_ORANGE 8U | ||
| 106 | #define GPIOC_LED_GREEN 9U | ||
| 107 | #define GPIOC_PIN10 10U | ||
| 108 | #define GPIOC_PIN11 11U | ||
| 109 | #define GPIOC_PIN12 12U | ||
| 110 | #define GPIOC_PIN13 13U | ||
| 111 | #define GPIOC_OSC32_IN 14U | ||
| 112 | #define GPIOC_OSC32_OUT 15U | ||
| 113 | |||
| 114 | #define GPIOD_PIN0 0U | ||
| 115 | #define GPIOD_PIN1 1U | ||
| 116 | #define GPIOD_PIN2 2U | ||
| 117 | #define GPIOD_PIN3 3U | ||
| 118 | #define GPIOD_PIN4 4U | ||
| 119 | #define GPIOD_PIN5 5U | ||
| 120 | #define GPIOD_PIN6 6U | ||
| 121 | #define GPIOD_PIN7 7U | ||
| 122 | #define GPIOD_PIN8 8U | ||
| 123 | #define GPIOD_PIN9 9U | ||
| 124 | #define GPIOD_PIN10 10U | ||
| 125 | #define GPIOD_PIN11 11U | ||
| 126 | #define GPIOD_PIN12 12U | ||
| 127 | #define GPIOD_PIN13 13U | ||
| 128 | #define GPIOD_PIN14 14U | ||
| 129 | #define GPIOD_PIN15 15U | ||
| 130 | |||
| 131 | #define GPIOE_PIN0 0U | ||
| 132 | #define GPIOE_PIN1 1U | ||
| 133 | #define GPIOE_PIN2 2U | ||
| 134 | #define GPIOE_PIN3 3U | ||
| 135 | #define GPIOE_PIN4 4U | ||
| 136 | #define GPIOE_PIN5 5U | ||
| 137 | #define GPIOE_PIN6 6U | ||
| 138 | #define GPIOE_PIN7 7U | ||
| 139 | #define GPIOE_PIN8 8U | ||
| 140 | #define GPIOE_PIN9 9U | ||
| 141 | #define GPIOE_PIN10 10U | ||
| 142 | #define GPIOE_PIN11 11U | ||
| 143 | #define GPIOE_PIN12 12U | ||
| 144 | #define GPIOE_PIN13 13U | ||
| 145 | #define GPIOE_PIN14 14U | ||
| 146 | #define GPIOE_PIN15 15U | ||
| 147 | |||
| 148 | #define GPIOF_OSC_IN 0U | ||
| 149 | #define GPIOF_OSC_OUT 1U | ||
| 150 | #define GPIOF_PIN2 2U | ||
| 151 | #define GPIOF_PIN3 3U | ||
| 152 | #define GPIOF_PIN4 4U | ||
| 153 | #define GPIOF_PIN5 5U | ||
| 154 | #define GPIOF_PIN6 6U | ||
| 155 | #define GPIOF_PIN7 7U | ||
| 156 | #define GPIOF_PIN8 8U | ||
| 157 | #define GPIOF_PIN9 9U | ||
| 158 | #define GPIOF_PIN10 10U | ||
| 159 | #define GPIOF_PIN11 11U | ||
| 160 | #define GPIOF_PIN12 12U | ||
| 161 | #define GPIOF_PIN13 13U | ||
| 162 | #define GPIOF_PIN14 14U | ||
| 163 | #define GPIOF_PIN15 15U | ||
| 164 | |||
| 165 | /* | ||
| 166 | * IO lines assignments. | ||
| 167 | */ | ||
| 168 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 169 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 170 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 171 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 172 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 173 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 174 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 175 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 176 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 177 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 178 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 179 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 180 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 181 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 182 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 183 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 184 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 185 | |||
| 186 | /*===========================================================================*/ | ||
| 187 | /* Driver pre-compile time settings. */ | ||
| 188 | /*===========================================================================*/ | ||
| 189 | |||
| 190 | /*===========================================================================*/ | ||
| 191 | /* Derived constants and error checks. */ | ||
| 192 | /*===========================================================================*/ | ||
| 193 | |||
| 194 | /*===========================================================================*/ | ||
| 195 | /* Driver data structures and types. */ | ||
| 196 | /*===========================================================================*/ | ||
| 197 | |||
| 198 | /*===========================================================================*/ | ||
| 199 | /* Driver macros. */ | ||
| 200 | /*===========================================================================*/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 204 | * in the initialization code. | ||
| 205 | * Please refer to the STM32 Reference Manual for details. | ||
| 206 | */ | ||
| 207 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 208 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 209 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 210 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 211 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 212 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 213 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 214 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 215 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 216 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 217 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 218 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 219 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 220 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 221 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 222 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * GPIOA setup: | ||
| 226 | * | ||
| 227 | * PA0 - BUTTON (input floating). | ||
| 228 | * PA1 - PIN1 (input pullup). | ||
| 229 | * PA2 - PIN2 (input pullup). | ||
| 230 | * PA3 - PIN3 (input pullup). | ||
| 231 | * PA4 - PIN4 (input pullup). | ||
| 232 | * PA5 - PIN5 (input pullup). | ||
| 233 | * PA6 - PIN6 (input pullup). | ||
| 234 | * PA7 - PIN7 (input pullup). | ||
| 235 | * PA8 - PIN8 (input pullup). | ||
| 236 | * PA9 - PIN9 (input pullup). | ||
| 237 | * PA10 - PIN10 (input pullup). | ||
| 238 | * PA11 - USB_DM (input floating). | ||
| 239 | * PA12 - USB_DP (input floating). | ||
| 240 | * PA13 - SWDIO (alternate 0). | ||
| 241 | * PA14 - SWCLK (alternate 0). | ||
| 242 | * PA15 - PIN15 (input pullup). | ||
| 243 | */ | ||
| 244 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 246 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 247 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 248 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 249 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 250 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 251 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 252 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 253 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 254 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 255 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 256 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 257 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 258 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 259 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 260 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 265 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 267 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 268 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 269 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 270 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 271 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 272 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 273 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 274 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 275 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 276 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 277 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 278 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 279 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 280 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 281 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 282 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 283 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 284 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 285 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 286 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 287 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 288 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 289 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 290 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 291 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 292 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 294 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 295 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 296 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 297 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 298 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 299 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 300 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 301 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 302 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 303 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 304 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 305 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 306 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 307 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 308 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 310 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 311 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 312 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 313 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 314 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 315 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 316 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 317 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 318 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 319 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 320 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 321 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 322 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 323 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 324 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 326 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 327 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 328 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 329 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 330 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 331 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 332 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 333 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 334 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 335 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 336 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 337 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 338 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 339 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 340 | |||
| 341 | /* | ||
| 342 | * GPIOB setup: | ||
| 343 | * | ||
| 344 | * PB0 - PIN0 (input pullup). | ||
| 345 | * PB1 - PIN1 (input pullup). | ||
| 346 | * PB2 - PIN2 (input pullup). | ||
| 347 | * PB3 - PIN3 (input pullup). | ||
| 348 | * PB4 - PIN4 (input pullup). | ||
| 349 | * PB5 - PIN5 (input pullup). | ||
| 350 | * PB6 - PIN6 (input pullup). | ||
| 351 | * PB7 - PIN7 (input pullup). | ||
| 352 | * PB8 - PIN8 (input pullup). | ||
| 353 | * PB9 - PIN9 (input pullup). | ||
| 354 | * PB10 - PIN10 (input pullup). | ||
| 355 | * PB11 - PIN11 (input pullup). | ||
| 356 | * PB12 - PIN12 (input pullup). | ||
| 357 | * PB13 - SPI2_SCK (alternate 0). | ||
| 358 | * PB14 - SPI2_MISO (alternate 0). | ||
| 359 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 360 | */ | ||
| 361 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 362 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 363 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 364 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 365 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 366 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 367 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 368 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 369 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 370 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 371 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 372 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 373 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 374 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 375 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 376 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 377 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 379 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 380 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 381 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 382 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 383 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 384 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 385 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 386 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 387 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 388 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 389 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 390 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 391 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 392 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 393 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 395 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 396 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 397 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 398 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 399 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 400 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 401 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 402 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 403 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 404 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 405 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 406 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 407 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 408 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 409 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 410 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 411 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 412 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 413 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 414 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 415 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 416 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 417 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 418 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 419 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 420 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 421 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 422 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 423 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 424 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 425 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 427 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 428 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 429 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 430 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 431 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 432 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 433 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 434 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 435 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 436 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 437 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 438 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 439 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 440 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 441 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 443 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 444 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 445 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 446 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 447 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 448 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 449 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 450 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 451 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 452 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 453 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 454 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 455 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 456 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 457 | |||
| 458 | /* | ||
| 459 | * GPIOC setup: | ||
| 460 | * | ||
| 461 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 462 | * PC1 - PIN1 (input pullup). | ||
| 463 | * PC2 - PIN2 (input pullup). | ||
| 464 | * PC3 - PIN3 (input pullup). | ||
| 465 | * PC4 - PIN4 (input pullup). | ||
| 466 | * PC5 - PIN5 (input pullup). | ||
| 467 | * PC6 - LED_RED (output pushpull maximum). | ||
| 468 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 469 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 470 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 471 | * PC10 - PIN10 (input pullup). | ||
| 472 | * PC11 - PIN11 (input pullup). | ||
| 473 | * PC12 - PIN12 (input pullup). | ||
| 474 | * PC13 - PIN13 (input pullup). | ||
| 475 | * PC14 - OSC32_IN (input floating). | ||
| 476 | * PC15 - OSC32_OUT (input floating). | ||
| 477 | */ | ||
| 478 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 480 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 481 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 482 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 483 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 484 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 485 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 486 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 487 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 488 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 489 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 490 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 491 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 492 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 493 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 494 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 496 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 497 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 498 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 499 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 500 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 501 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 502 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 503 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 504 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 505 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 506 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 507 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 508 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 509 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 510 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 511 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 512 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 513 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 514 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 515 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 516 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 517 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 518 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 519 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 520 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 521 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 522 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 523 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 524 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 525 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 526 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 527 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 528 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 529 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 530 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 531 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 532 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 533 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 534 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 535 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 536 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 537 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 538 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 539 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 540 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 541 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 542 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 544 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 545 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 546 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 547 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 548 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 549 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 550 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 551 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 552 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 553 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 554 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 555 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 556 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 557 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 558 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 560 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 561 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 562 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 563 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 564 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 565 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 566 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 567 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 568 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 569 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 570 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 571 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 572 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 573 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 574 | |||
| 575 | /* | ||
| 576 | * GPIOD setup: | ||
| 577 | * | ||
| 578 | * PD0 - PIN0 (input pullup). | ||
| 579 | * PD1 - PIN1 (input pullup). | ||
| 580 | * PD2 - PIN2 (input pullup). | ||
| 581 | * PD3 - PIN3 (input pullup). | ||
| 582 | * PD4 - PIN4 (input pullup). | ||
| 583 | * PD5 - PIN5 (input pullup). | ||
| 584 | * PD6 - PIN6 (input pullup). | ||
| 585 | * PD7 - PIN7 (input pullup). | ||
| 586 | * PD8 - PIN8 (input pullup). | ||
| 587 | * PD9 - PIN9 (input pullup). | ||
| 588 | * PD10 - PIN10 (input pullup). | ||
| 589 | * PD11 - PIN11 (input pullup). | ||
| 590 | * PD12 - PIN12 (input pullup). | ||
| 591 | * PD13 - PIN13 (input pullup). | ||
| 592 | * PD14 - PIN14 (input pullup). | ||
| 593 | * PD15 - PIN15 (input pullup). | ||
| 594 | */ | ||
| 595 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 597 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 598 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 599 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 600 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 601 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 602 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 603 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 604 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 605 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 606 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 607 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 608 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 609 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 610 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 611 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 613 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 614 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 615 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 616 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 617 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 618 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 619 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 620 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 621 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 622 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 623 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 624 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 625 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 626 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 627 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 629 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 630 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 631 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 632 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 633 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 634 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 635 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 636 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 637 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 638 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 639 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 640 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 641 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 642 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 643 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 645 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 646 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 647 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 648 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 649 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 650 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 651 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 652 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 653 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 654 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 655 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 656 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 657 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 658 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 659 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 661 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 662 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 663 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 664 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 665 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 666 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 667 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 668 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 669 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 670 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 671 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 672 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 673 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 674 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 675 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 677 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 678 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 679 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 680 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 681 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 682 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 683 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 684 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 685 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 686 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 687 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 688 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 689 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 690 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 691 | |||
| 692 | /* | ||
| 693 | * GPIOE setup: | ||
| 694 | * | ||
| 695 | * PE0 - PIN0 (input pullup). | ||
| 696 | * PE1 - PIN1 (input pullup). | ||
| 697 | * PE2 - PIN2 (input pullup). | ||
| 698 | * PE3 - PIN3 (input pullup). | ||
| 699 | * PE4 - PIN4 (input pullup). | ||
| 700 | * PE5 - PIN5 (input pullup). | ||
| 701 | * PE6 - PIN6 (input pullup). | ||
| 702 | * PE7 - PIN7 (input pullup). | ||
| 703 | * PE8 - PIN8 (input pullup). | ||
| 704 | * PE9 - PIN9 (input pullup). | ||
| 705 | * PE10 - PIN10 (input pullup). | ||
| 706 | * PE11 - PIN11 (input pullup). | ||
| 707 | * PE12 - PIN12 (input pullup). | ||
| 708 | * PE13 - PIN13 (input pullup). | ||
| 709 | * PE14 - PIN14 (input pullup). | ||
| 710 | * PE15 - PIN15 (input pullup). | ||
| 711 | */ | ||
| 712 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 714 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 715 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 716 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 717 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 718 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 719 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 720 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 721 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 722 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 723 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 724 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 725 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 726 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 727 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 728 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 730 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 731 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 732 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 733 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 734 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 735 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 736 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 737 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 738 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 739 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 740 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 741 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 742 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 743 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 744 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 746 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 747 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 748 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 749 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 750 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 751 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 752 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 753 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 754 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 755 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 756 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 757 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 758 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 759 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 760 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 762 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 763 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 764 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 765 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 766 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 767 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 768 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 769 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 770 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 771 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 772 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 773 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 774 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 775 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 776 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 778 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 779 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 780 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 781 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 782 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 783 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 784 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 785 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 786 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 787 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 788 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 789 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 790 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 791 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 792 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 794 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 795 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 796 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 797 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 798 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 799 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 800 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 801 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 802 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 803 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 804 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 805 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 806 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 807 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 808 | |||
| 809 | /* | ||
| 810 | * GPIOF setup: | ||
| 811 | * | ||
| 812 | * PF0 - OSC_IN (input floating). | ||
| 813 | * PF1 - OSC_OUT (input floating). | ||
| 814 | * PF2 - PIN2 (input pullup). | ||
| 815 | * PF3 - PIN3 (input pullup). | ||
| 816 | * PF4 - PIN4 (input pullup). | ||
| 817 | * PF5 - PIN5 (input pullup). | ||
| 818 | * PF6 - PIN6 (input pullup). | ||
| 819 | * PF7 - PIN7 (input pullup). | ||
| 820 | * PF8 - PIN8 (input pullup). | ||
| 821 | * PF9 - PIN9 (input pullup). | ||
| 822 | * PF10 - PIN10 (input pullup). | ||
| 823 | * PF11 - PIN11 (input pullup). | ||
| 824 | * PF12 - PIN12 (input pullup). | ||
| 825 | * PF13 - PIN13 (input pullup). | ||
| 826 | * PF14 - PIN14 (input pullup). | ||
| 827 | * PF15 - PIN15 (input pullup). | ||
| 828 | */ | ||
| 829 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 831 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 832 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 833 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 834 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 835 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 836 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 837 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 838 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 839 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 840 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 841 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 842 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 843 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 844 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 845 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 847 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 848 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 849 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 850 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 851 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 852 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 853 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 854 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 855 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 856 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 857 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 858 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 859 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 860 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 861 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 863 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 864 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 865 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 866 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 867 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 868 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 869 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 870 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 871 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 872 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 873 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 874 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 875 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 876 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 877 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 878 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 879 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 880 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 881 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 882 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 883 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 884 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 885 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 886 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 887 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 888 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 889 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 890 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 891 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 892 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 893 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 895 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 896 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 897 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 898 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 899 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 900 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 901 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 902 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 903 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 904 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 905 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 906 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 907 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 908 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 909 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 911 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 912 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 913 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 914 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 915 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 916 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 917 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 918 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 919 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 920 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 921 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 922 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 923 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 924 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 925 | |||
| 926 | /*===========================================================================*/ | ||
| 927 | /* External declarations. */ | ||
| 928 | /*===========================================================================*/ | ||
| 929 | |||
| 930 | #if !defined(_FROM_ASM_) | ||
| 931 | #ifdef __cplusplus | ||
| 932 | extern "C" { | ||
| 933 | #endif | ||
| 934 | void boardInit(void); | ||
| 935 | #ifdef __cplusplus | ||
| 936 | } | ||
| 937 | #endif | ||
| 938 | #endif /* _FROM_ASM_ */ | ||
| 939 | |||
| 940 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # List of all the board related files. | ||
| 2 | BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c | ||
| 3 | |||
| 4 | # Required include directories | ||
| 5 | BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY | ||
diff --git a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg deleted file mode 100644 index 9c7cf4fd7..000000000 --- a/keyboards/cannonkeys/iron165/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg +++ /dev/null | |||
| @@ -1,703 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!-- STM32F0xx board Template --> | ||
| 3 | <board | ||
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 5 | xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> | ||
| 6 | <configuration_settings> | ||
| 7 | <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> | ||
| 8 | <output_path>..</output_path> | ||
| 9 | <hal_version>3.0.x</hal_version> | ||
| 10 | </configuration_settings> | ||
| 11 | <board_name>ST STM32F072B-Discovery</board_name> | ||
| 12 | <board_id>ST_STM32F072B_DISCOVERY</board_id> | ||
| 13 | <board_functions></board_functions> | ||
| 14 | <subtype>STM32F072xB</subtype> | ||
| 15 | <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" | ||
| 16 | LSEBypass="false" LSEDrive="3 High Drive (default)" /> | ||
| 17 | <ports> | ||
| 18 | <GPIOA> | ||
| 19 | <pin0 | ||
| 20 | ID="BUTTON" | ||
| 21 | Type="PushPull" | ||
| 22 | Speed="Minimum" | ||
| 23 | Resistor="Floating" | ||
| 24 | Level="High" | ||
| 25 | Mode="Input" | ||
| 26 | Alternate="0" /> | ||
| 27 | <pin1 | ||
| 28 | ID="" | ||
| 29 | Type="PushPull" | ||
| 30 | Speed="Minimum" | ||
| 31 | Resistor="PullUp" | ||
| 32 | Level="High" | ||
| 33 | Mode="Input" | ||
| 34 | Alternate="0" /> | ||
| 35 | <pin2 | ||
| 36 | ID="" | ||
| 37 | Type="PushPull" | ||
| 38 | Speed="Minimum" | ||
| 39 | Resistor="PullUp" | ||
| 40 | Level="High" | ||
| 41 | Mode="Input" | ||
| 42 | Alternate="0" /> | ||
| 43 | <pin3 | ||
| 44 | ID="" | ||
| 45 | Type="PushPull" | ||
| 46 | Speed="Minimum" | ||
| 47 | Resistor="PullUp" | ||
| 48 | Level="High" | ||
| 49 | Mode="Input" | ||
| 50 | Alternate="0" /> | ||
| 51 | <pin4 | ||
| 52 | ID="" | ||
| 53 | Type="PushPull" | ||
| 54 | Speed="Minimum" | ||
| 55 | Resistor="PullUp" | ||
| 56 | Level="High" | ||
| 57 | Mode="Input" | ||
| 58 | Alternate="0" /> | ||
| 59 | <pin5 | ||
| 60 | ID="" | ||
| 61 | Type="PushPull" | ||
| 62 | Speed="Minimum" | ||
| 63 | Resistor="PullUp" | ||
| 64 | Level="High" | ||
| 65 | Mode="Input" | ||
| 66 | Alternate="0" /> | ||
| 67 | <pin6 | ||
| 68 | ID="" | ||
| 69 | Type="PushPull" | ||
| 70 | Speed="Minimum" | ||
| 71 | Resistor="PullUp" | ||
| 72 | Level="High" | ||
| 73 | Mode="Input" | ||
| 74 | Alternate="0" /> | ||
| 75 | <pin7 | ||
| 76 | ID="" | ||
| 77 | Type="PushPull" | ||
| 78 | Speed="Minimum" | ||
| 79 | Resistor="PullUp" | ||
| 80 | Level="High" | ||
| 81 | Mode="Input" | ||
| 82 | Alternate="0" /> | ||
| 83 | <pin8 | ||
| 84 | ID="" | ||
| 85 | Type="PushPull" | ||
| 86 | Speed="Minimum" | ||
| 87 | Resistor="PullUp" | ||
| 88 | Level="High" | ||
| 89 | Mode="Input" | ||
| 90 | Alternate="0" /> | ||
| 91 | <pin9 | ||
| 92 | ID="" | ||
| 93 | Type="PushPull" | ||
| 94 | Speed="Minimum" | ||
| 95 | Resistor="PullUp" | ||
| 96 | Level="High" | ||
| 97 | Mode="Input" | ||
| 98 | Alternate="0" /> | ||
| 99 | <pin10 | ||
| 100 | ID="" | ||
| 101 | Type="PushPull" | ||
| 102 | Speed="Minimum" | ||
| 103 | Resistor="PullUp" | ||
| 104 | Level="High" | ||
| 105 | Mode="Input" | ||
| 106 | Alternate="0" /> | ||
| 107 | <pin11 | ||
| 108 | ID="USB_DM" | ||
| 109 | Type="PushPull" | ||
| 110 | Speed="Minimum" | ||
| 111 | Resistor="Floating" | ||
| 112 | Level="High" | ||
| 113 | Mode="Input" | ||
| 114 | Alternate="0" /> | ||
| 115 | <pin12 | ||
| 116 | ID="USB_DP" | ||
| 117 | Type="PushPull" | ||
| 118 | Speed="Minimum" | ||
| 119 | Resistor="Floating" | ||
| 120 | Level="High" | ||
| 121 | Mode="Input" | ||
| 122 | Alternate="0" /> | ||
| 123 | <pin13 | ||
| 124 | ID="SWDIO" | ||
| 125 | Type="PushPull" | ||
| 126 | Speed="Maximum" | ||
| 127 | Resistor="PullUp" | ||
| 128 | Level="High" | ||
| 129 | Mode="Alternate" | ||
| 130 | Alternate="0" /> | ||
| 131 | <pin14 | ||
| 132 | ID="SWCLK" | ||
| 133 | Type="PushPull" | ||
| 134 | Speed="Maximum" | ||
| 135 | Resistor="PullDown" | ||
| 136 | Level="High" | ||
| 137 | Mode="Alternate" | ||
| 138 | Alternate="0" /> | ||
| 139 | <pin15 | ||
| 140 | ID="" | ||
| 141 | Type="PushPull" | ||
| 142 | Speed="Maximum" | ||
| 143 | Resistor="PullUp" | ||
| 144 | Level="High" | ||
| 145 | Mode="Input" | ||
| 146 | Alternate="0" /> | ||
| 147 | </GPIOA> | ||
| 148 | <GPIOB> | ||
| 149 | <pin0 | ||
| 150 | ID="" | ||
| 151 | Type="PushPull" | ||
| 152 | Speed="Minimum" | ||
| 153 | Resistor="PullUp" | ||
| 154 | Level="High" | ||
| 155 | Mode="Input" | ||
| 156 | Alternate="0" /> | ||
| 157 | <pin1 | ||
| 158 | ID="" | ||
| 159 | Type="PushPull" | ||
| 160 | Speed="Minimum" | ||
| 161 | Resistor="PullUp" | ||
| 162 | Level="High" | ||
| 163 | Mode="Input" | ||
| 164 | Alternate="0" /> | ||
| 165 | <pin2 | ||
| 166 | ID="" | ||
| 167 | Type="PushPull" | ||
| 168 | Speed="Maximum" | ||
| 169 | Resistor="PullUp" | ||
| 170 | Level="High" | ||
| 171 | Mode="Input" | ||
| 172 | Alternate="0" /> | ||
| 173 | <pin3 | ||
| 174 | ID="" | ||
| 175 | Type="PushPull" | ||
| 176 | Speed="Maximum" | ||
| 177 | Resistor="PullUp" | ||
| 178 | Level="High" | ||
| 179 | Mode="Input" | ||
| 180 | Alternate="0" /> | ||
| 181 | <pin4 | ||
| 182 | ID="" | ||
| 183 | Type="PushPull" | ||
| 184 | Speed="Maximum" | ||
| 185 | Resistor="PullUp" | ||
| 186 | Level="High" | ||
| 187 | Mode="Input" | ||
| 188 | Alternate="0" /> | ||
| 189 | <pin5 | ||
| 190 | ID="" | ||
| 191 | Type="PushPull" | ||
| 192 | Speed="Minimum" | ||
| 193 | Resistor="PullUp" | ||
| 194 | Level="High" | ||
| 195 | Mode="Input" | ||
| 196 | Alternate="0" /> | ||
| 197 | <pin6 | ||
| 198 | ID="" | ||
| 199 | Type="PushPull" | ||
| 200 | Speed="Minimum" | ||
| 201 | Resistor="PullUp" | ||
| 202 | Level="High" | ||
| 203 | Mode="Input" | ||
| 204 | Alternate="0" /> | ||
| 205 | <pin7 | ||
| 206 | ID="" | ||
| 207 | Type="PushPull" | ||
| 208 | Speed="Minimum" | ||
| 209 | Resistor="PullUp" | ||
| 210 | Level="High" | ||
| 211 | Mode="Input" | ||
| 212 | Alternate="0" /> | ||
| 213 | <pin8 | ||
| 214 | ID="" | ||
| 215 | Type="PushPull" | ||
| 216 | Speed="Minimum" | ||
| 217 | Resistor="PullUp" | ||
| 218 | Level="High" | ||
| 219 | Mode="Input" | ||
| 220 | Alternate="0" /> | ||
| 221 | <pin9 | ||
| 222 | ID="" | ||
| 223 | Type="PushPull" | ||
| 224 | Speed="Minimum" | ||
| 225 | Resistor="PullUp" | ||
| 226 | Level="High" | ||
| 227 | Mode="Input" | ||
| 228 | Alternate="0" /> | ||
| 229 | <pin10 | ||
| 230 | ID="" | ||
| 231 | Type="PushPull" | ||
| 232 | Speed="Minimum" | ||
| 233 | Resistor="PullUp" | ||
| 234 | Level="High" | ||
| 235 | Mode="Input" | ||
| 236 | Alternate="0" /> | ||
| 237 | <pin11 | ||
| 238 | ID="" | ||
| 239 | Type="PushPull" | ||
| 240 | Speed="Minimum" | ||
| 241 | Resistor="PullUp" | ||
| 242 | Level="High" | ||
| 243 | Mode="Input" | ||
| 244 | Alternate="0" /> | ||
| 245 | <pin12 | ||
| 246 | ID="" | ||
| 247 | Type="PushPull" | ||
| 248 | Speed="Minimum" | ||
| 249 | Resistor="PullUp" | ||
| 250 | Level="High" | ||
| 251 | Mode="Input" | ||
| 252 | Alternate="0" /> | ||
| 253 | <pin13 | ||
| 254 | ID="SPI2_SCK" | ||
| 255 | Type="PushPull" | ||
| 256 | Speed="Minimum" | ||
| 257 | Resistor="Floating" | ||
| 258 | Level="High" | ||
| 259 | Mode="Alternate" | ||
| 260 | Alternate="0" /> | ||
| 261 | <pin14 | ||
| 262 | ID="SPI2_MISO" | ||
| 263 | Type="PushPull" | ||
| 264 | Speed="Minimum" | ||
| 265 | Resistor="Floating" | ||
| 266 | Level="High" | ||
| 267 | Mode="Alternate" | ||
| 268 | Alternate="0" /> | ||
| 269 | <pin15 | ||
| 270 | ID="SPI2_MOSI" | ||
| 271 | Type="PushPull" | ||
| 272 | Speed="Minimum" | ||
| 273 | Resistor="Floating" | ||
| 274 | Level="High" | ||
| 275 | Mode="Alternate" | ||
| 276 | Alternate="0" /> | ||
| 277 | </GPIOB> | ||
| 278 | <GPIOC> | ||
| 279 | <pin0 | ||
| 280 | ID="MEMS_CS" | ||
| 281 | Type="PushPull" | ||
| 282 | Speed="Maximum" | ||
| 283 | Resistor="Floating" | ||
| 284 | Level="High" | ||
| 285 | Mode="Output" | ||
| 286 | Alternate="0" /> | ||
| 287 | <pin1 | ||
| 288 | ID="" | ||
| 289 | Type="PushPull" | ||
| 290 | Speed="Minimum" | ||
| 291 | Resistor="PullUp" | ||
| 292 | Level="High" | ||
| 293 | Mode="Input" | ||
| 294 | Alternate="0" /> | ||
| 295 | <pin2 | ||
| 296 | ID="" | ||
| 297 | Type="PushPull" | ||
| 298 | Speed="Minimum" | ||
| 299 | Resistor="PullUp" | ||
| 300 | Level="High" | ||
| 301 | Mode="Input" | ||
| 302 | Alternate="0" /> | ||
| 303 | <pin3 | ||
| 304 | ID="" | ||
| 305 | Type="PushPull" | ||
| 306 | Speed="Minimum" | ||
| 307 | Resistor="PullUp" | ||
| 308 | Level="High" | ||
| 309 | Mode="Input" | ||
| 310 | Alternate="0" /> | ||
| 311 | <pin4 | ||
| 312 | ID="" | ||
| 313 | Type="PushPull" | ||
| 314 | Speed="Minimum" | ||
| 315 | Resistor="PullUp" | ||
| 316 | Level="High" | ||
| 317 | Mode="Input" | ||
| 318 | Alternate="0" /> | ||
| 319 | <pin5 | ||
| 320 | ID="" | ||
| 321 | Type="PushPull" | ||
| 322 | Speed="Minimum" | ||
| 323 | Resistor="PullUp" | ||
| 324 | Level="High" | ||
| 325 | Mode="Input" | ||
| 326 | Alternate="0" /> | ||
| 327 | <pin6 | ||
| 328 | ID="LED_RED" | ||
| 329 | Type="PushPull" | ||
| 330 | Speed="Maximum" | ||
| 331 | Resistor="Floating" | ||
| 332 | Level="Low" | ||
| 333 | Mode="Output" | ||
| 334 | Alternate="0" /> | ||
| 335 | <pin7 | ||
| 336 | ID="LED_BLUE" | ||
| 337 | Type="PushPull" | ||
| 338 | Speed="Maximum" | ||
| 339 | Resistor="Floating" | ||
| 340 | Level="Low" | ||
| 341 | Mode="Output" | ||
| 342 | Alternate="0" /> | ||
| 343 | <pin8 | ||
| 344 | ID="LED_ORANGE" | ||
| 345 | Type="PushPull" | ||
| 346 | Speed="Maximum" | ||
| 347 | Resistor="Floating" | ||
| 348 | Level="Low" | ||
| 349 | Mode="Output" | ||
| 350 | Alternate="0" ></pin8> | ||
| 351 | <pin9 | ||
| 352 | ID="LED_GREEN" | ||
| 353 | Type="PushPull" | ||
| 354 | Speed="Maximum" | ||
| 355 | Resistor="Floating" | ||
| 356 | Level="Low" | ||
| 357 | Mode="Output" | ||
| 358 | Alternate="0" /> | ||
| 359 | <pin10 | ||
| 360 | ID="" | ||
| 361 | Type="PushPull" | ||
| 362 | Speed="Minimum" | ||
| 363 | Resistor="PullUp" | ||
| 364 | Level="High" | ||
| 365 | Mode="Input" | ||
| 366 | Alternate="0" /> | ||
| 367 | <pin11 | ||
| 368 | ID="" | ||
| 369 | Type="PushPull" | ||
| 370 | Speed="Minimum" | ||
| 371 | Resistor="PullUp" | ||
| 372 | Level="High" | ||
| 373 | Mode="Input" | ||
| 374 | Alternate="0" /> | ||
| 375 | <pin12 | ||
| 376 | ID="" | ||
| 377 | Type="PushPull" | ||
| 378 | Speed="Minimum" | ||
| 379 | Resistor="PullUp" | ||
| 380 | Level="High" | ||
| 381 | Mode="Input" | ||
| 382 | Alternate="0" /> | ||
| 383 | <pin13 | ||
| 384 | ID="" | ||
| 385 | Type="PushPull" | ||
| 386 | Speed="Minimum" | ||
| 387 | Resistor="PullUp" | ||
| 388 | Level="High" | ||
| 389 | Mode="Input" | ||
| 390 | Alternate="0" /> | ||
| 391 | <pin14 | ||
| 392 | ID="OSC32_IN" | ||
| 393 | Type="PushPull" | ||
| 394 | Speed="Maximum" | ||
| 395 | Resistor="Floating" | ||
| 396 | Level="High" | ||
| 397 | Mode="Input" | ||
| 398 | Alternate="0" /> | ||
| 399 | <pin15 | ||
| 400 | ID="OSC32_OUT" | ||
| 401 | Type="PushPull" | ||
| 402 | Speed="Maximum" | ||
| 403 | Resistor="Floating" | ||
| 404 | Level="High" | ||
| 405 | Mode="Input" | ||
| 406 | Alternate="0" /> | ||
| 407 | </GPIOC> | ||
| 408 | <GPIOD> | ||
| 409 | <pin0 | ||
| 410 | ID="" | ||
| 411 | Type="PushPull" | ||
| 412 | Speed="Minimum" | ||
| 413 | Resistor="PullUp" | ||
| 414 | Level="High" | ||
| 415 | Mode="Input" | ||
| 416 | Alternate="0" /> | ||
| 417 | <pin1 | ||
| 418 | ID="" | ||
| 419 | Type="PushPull" | ||
| 420 | Speed="Minimum" | ||
| 421 | Resistor="PullUp" | ||
| 422 | Level="High" | ||
| 423 | Mode="Input" | ||
| 424 | Alternate="0" /> | ||
| 425 | <pin2 | ||
| 426 | ID="" | ||
| 427 | Type="PushPull" | ||
| 428 | Speed="Minimum" | ||
| 429 | Resistor="PullUp" | ||
| 430 | Level="High" | ||
| 431 | Mode="Input" | ||
| 432 | Alternate="0" /> | ||
| 433 | <pin3 | ||
| 434 | ID="" | ||
| 435 | Type="PushPull" | ||
| 436 | Speed="Minimum" | ||
| 437 | Resistor="PullUp" | ||
| 438 | Level="High" | ||
| 439 | Mode="Input" | ||
| 440 | Alternate="0" /> | ||
| 441 | <pin4 | ||
| 442 | ID="" | ||
| 443 | Type="PushPull" | ||
| 444 | Speed="Minimum" | ||
| 445 | Resistor="PullUp" | ||
| 446 | Level="High" | ||
| 447 | Mode="Input" | ||
| 448 | Alternate="0" /> | ||
| 449 | <pin5 | ||
| 450 | ID="" | ||
| 451 | Type="PushPull" | ||
| 452 | Speed="Minimum" | ||
| 453 | Resistor="PullUp" | ||
| 454 | Level="High" | ||
| 455 | Mode="Input" | ||
| 456 | Alternate="0" /> | ||
| 457 | <pin6 | ||
| 458 | ID="" | ||
| 459 | Type="PushPull" | ||
| 460 | Speed="Minimum" | ||
| 461 | Resistor="PullUp" | ||
| 462 | Level="High" | ||
| 463 | Mode="Input" | ||
| 464 | Alternate="0" /> | ||
| 465 | <pin7 | ||
| 466 | ID="" | ||
| 467 | Type="PushPull" | ||
| 468 | Speed="Minimum" | ||
| 469 | Resistor="PullUp" | ||
| 470 | Level="High" | ||
| 471 | Mode="Input" | ||
| 472 | Alternate="0" /> | ||
| 473 | <pin8 | ||
| 474 | ID="" | ||
| 475 | Type="PushPull" | ||
| 476 | Speed="Minimum" | ||
| 477 | Resistor="PullUp" | ||
| 478 | Level="High" | ||
| 479 | Mode="Input" | ||
| 480 | Alternate="0" /> | ||
| 481 | <pin9 | ||
| 482 | ID="" | ||
| 483 | Type="PushPull" | ||
| 484 | Speed="Minimum" | ||
| 485 | Resistor="PullUp" | ||
| 486 | Level="High" | ||
| 487 | Mode="Input" | ||
| 488 | Alternate="0" /> | ||
| 489 | <pin10 | ||
| 490 | ID="" | ||
| 491 | Type="PushPull" | ||
| 492 | Speed="Minimum" | ||
| 493 | Resistor="PullUp" | ||
| 494 | Level="High" | ||
| 495 | Mode="Input" | ||
| 496 | Alternate="0" /> | ||
| 497 | <pin11 | ||
| 498 | ID="" | ||
| 499 | Type="PushPull" | ||
| 500 | Speed="Minimum" | ||
| 501 | Resistor="PullUp" | ||
| 502 | Level="High" | ||
| 503 | Mode="Input" | ||
| 504 | Alternate="0" /> | ||
| 505 | <pin12 | ||
| 506 | ID="" | ||
| 507 | Type="PushPull" | ||
| 508 | Speed="Minimum" | ||
| 509 | Resistor="PullUp" | ||
| 510 | Level="High" | ||
| 511 | Mode="Input" | ||
| 512 | Alternate="0" /> | ||
| 513 | <pin13 | ||
| 514 | ID="" | ||
| 515 | Type="PushPull" | ||
| 516 | Speed="Minimum" | ||
| 517 | Resistor="PullUp" | ||
| 518 | Level="High" | ||
| 519 | Mode="Input" | ||
| 520 | Alternate="0" /> | ||
| 521 | <pin14 | ||
| 522 | ID="" | ||
| 523 | Type="PushPull" | ||
| 524 | Speed="Minimum" | ||
| 525 | Resistor="PullUp" | ||
| 526 | Level="High" | ||
| 527 | Mode="Input" | ||
| 528 | Alternate="0" /> | ||
| 529 | <pin15 | ||
| 530 | ID="" | ||
| 531 | Type="PushPull" | ||
| 532 | Speed="Minimum" | ||
| 533 | Resistor="PullUp" | ||
| 534 | Level="High" | ||
| 535 | Mode="Input" | ||
| 536 | Alternate="0" /> | ||
| 537 | </GPIOD> | ||
| 538 | <GPIOE> | ||
| 539 | <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 540 | Level="High" Mode="Input" Alternate="0" /> | ||
| 541 | <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 542 | Level="High" Mode="Input" Alternate="0" /> | ||
| 543 | <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 544 | Level="High" Mode="Input" Alternate="0" /> | ||
| 545 | <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 546 | Level="High" Mode="Input" Alternate="0" /> | ||
| 547 | <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 548 | Level="High" Mode="Input" Alternate="0" /> | ||
| 549 | <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 550 | Level="High" Mode="Input" Alternate="0" /> | ||
| 551 | <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 552 | Level="High" Mode="Input" Alternate="0" /> | ||
| 553 | <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 554 | Level="High" Mode="Input" Alternate="0" /> | ||
| 555 | <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 556 | Level="High" Mode="Input" Alternate="0" /> | ||
| 557 | <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 558 | Level="High" Mode="Input" Alternate="0" /> | ||
| 559 | <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 560 | Level="High" Mode="Input" Alternate="0" /> | ||
| 561 | <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 562 | Level="High" Mode="Input" Alternate="0" /> | ||
| 563 | <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 564 | Level="High" Mode="Input" Alternate="0" /> | ||
| 565 | <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 566 | Level="High" Mode="Input" Alternate="0" /> | ||
| 567 | <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 568 | Level="High" Mode="Input" Alternate="0" /> | ||
| 569 | <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 570 | Level="High" Mode="Input" Alternate="0" /> | ||
| 571 | </GPIOE> | ||
| 572 | <GPIOF> | ||
| 573 | <pin0 | ||
| 574 | ID="OSC_IN" | ||
| 575 | Type="PushPull" | ||
| 576 | Speed="Minimum" | ||
| 577 | Resistor="Floating" | ||
| 578 | Level="High" | ||
| 579 | Mode="Input" | ||
| 580 | Alternate="0" /> | ||
| 581 | <pin1 | ||
| 582 | ID="OSC_OUT" | ||
| 583 | Type="PushPull" | ||
| 584 | Speed="Minimum" | ||
| 585 | Resistor="Floating" | ||
| 586 | Level="High" | ||
| 587 | Mode="Input" | ||
| 588 | Alternate="0" /> | ||
| 589 | <pin2 | ||
| 590 | ID="" | ||
| 591 | Type="PushPull" | ||
| 592 | Speed="Minimum" | ||
| 593 | Resistor="PullUp" | ||
| 594 | Level="High" | ||
| 595 | Mode="Input" | ||
| 596 | Alternate="0" /> | ||
| 597 | <pin3 | ||
| 598 | ID="" | ||
| 599 | Type="PushPull" | ||
| 600 | Speed="Minimum" | ||
| 601 | Resistor="PullUp" | ||
| 602 | Level="High" | ||
| 603 | Mode="Input" | ||
| 604 | Alternate="0" /> | ||
| 605 | <pin4 | ||
| 606 | ID="" | ||
| 607 | Type="PushPull" | ||
| 608 | Speed="Minimum" | ||
| 609 | Resistor="PullUp" | ||
| 610 | Level="High" | ||
| 611 | Mode="Input" | ||
| 612 | Alternate="0" /> | ||
| 613 | <pin5 | ||
| 614 | ID="" | ||
| 615 | Type="PushPull" | ||
| 616 | Speed="Minimum" | ||
| 617 | Resistor="PullUp" | ||
| 618 | Level="High" | ||
| 619 | Mode="Input" | ||
| 620 | Alternate="0" /> | ||
| 621 | <pin6 | ||
| 622 | ID="" | ||
| 623 | Type="PushPull" | ||
| 624 | Speed="Minimum" | ||
| 625 | Resistor="PullUp" | ||
| 626 | Level="High" | ||
| 627 | Mode="Input" | ||
| 628 | Alternate="0" /> | ||
| 629 | <pin7 | ||
| 630 | ID="" | ||
| 631 | Type="PushPull" | ||
| 632 | Speed="Minimum" | ||
| 633 | Resistor="PullUp" | ||
| 634 | Level="High" | ||
| 635 | Mode="Input" | ||
| 636 | Alternate="0" /> | ||
| 637 | <pin8 | ||
| 638 | ID="" | ||
| 639 | Type="PushPull" | ||
| 640 | Speed="Minimum" | ||
| 641 | Resistor="PullUp" | ||
| 642 | Level="High" | ||
| 643 | Mode="Input" | ||
| 644 | Alternate="0" /> | ||
| 645 | <pin9 | ||
| 646 | ID="" | ||
| 647 | Type="PushPull" | ||
| 648 | Speed="Minimum" | ||
| 649 | Resistor="PullUp" | ||
| 650 | Level="High" | ||
| 651 | Mode="Input" | ||
| 652 | Alternate="0" /> | ||
| 653 | <pin10 | ||
| 654 | ID="" | ||
| 655 | Type="PushPull" | ||
| 656 | Speed="Minimum" | ||
| 657 | Resistor="PullUp" | ||
| 658 | Level="High" | ||
| 659 | Mode="Input" | ||
| 660 | Alternate="0" /> | ||
| 661 | <pin11 | ||
| 662 | ID="" | ||
| 663 | Type="PushPull" | ||
| 664 | Speed="Minimum" | ||
| 665 | Resistor="PullUp" | ||
| 666 | Level="High" | ||
| 667 | Mode="Input" | ||
| 668 | Alternate="0" /> | ||
| 669 | <pin12 | ||
| 670 | ID="" | ||
| 671 | Type="PushPull" | ||
| 672 | Speed="Minimum" | ||
| 673 | Resistor="PullUp" | ||
| 674 | Level="High" | ||
| 675 | Mode="Input" | ||
| 676 | Alternate="0" /> | ||
| 677 | <pin13 | ||
| 678 | ID="" | ||
| 679 | Type="PushPull" | ||
| 680 | Speed="Minimum" | ||
| 681 | Resistor="PullUp" | ||
| 682 | Level="High" | ||
| 683 | Mode="Input" | ||
| 684 | Alternate="0" /> | ||
| 685 | <pin14 | ||
| 686 | ID="" | ||
| 687 | Type="PushPull" | ||
| 688 | Speed="Minimum" | ||
| 689 | Resistor="PullUp" | ||
| 690 | Level="High" | ||
| 691 | Mode="Input" | ||
| 692 | Alternate="0" /> | ||
| 693 | <pin15 | ||
| 694 | ID="" | ||
| 695 | Type="PushPull" | ||
| 696 | Speed="Minimum" | ||
| 697 | Resistor="PullUp" | ||
| 698 | Level="High" | ||
| 699 | Mode="Input" | ||
| 700 | Alternate="0" /> | ||
| 701 | </GPIOF> | ||
| 702 | </ports> | ||
| 703 | </board> | ||
diff --git a/keyboards/cannonkeys/iron165/config.h b/keyboards/cannonkeys/iron165/config.h index c8be89da9..a92883919 100644 --- a/keyboards/cannonkeys/iron165/config.h +++ b/keyboards/cannonkeys/iron165/config.h | |||
| @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 33 | #define MATRIX_ROW_PINS { B12, B13, B14, B15, A1 } | 33 | #define MATRIX_ROW_PINS { B12, B13, B14, B15, A1 } |
| 34 | #define DIODE_DIRECTION COL2ROW | 34 | #define DIODE_DIRECTION COL2ROW |
| 35 | 35 | ||
| 36 | #define BACKLIGHT_PIN A6 | ||
| 37 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 38 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 39 | #define BACKLIGHT_PAL_MODE 1 | ||
| 36 | #define BACKLIGHT_LEVELS 6 | 40 | #define BACKLIGHT_LEVELS 6 |
| 37 | #define BACKLIGHT_BREATHING | 41 | #define BACKLIGHT_BREATHING |
| 38 | #define BREATHING_PERIOD 6 | 42 | #define BREATHING_PERIOD 6 |
| @@ -48,12 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 48 | /* Locking resynchronize hack */ | 52 | /* Locking resynchronize hack */ |
| 49 | #define LOCKING_RESYNC_ENABLE | 53 | #define LOCKING_RESYNC_ENABLE |
| 50 | 54 | ||
| 51 | // Backlight config starts after VIA's EEPROM usage, | ||
| 52 | // dynamic keymaps start after this. | ||
| 53 | #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 1 | ||
| 54 | |||
| 55 | // VIA lighting is handled by the keyboard-level code | ||
| 56 | #define VIA_CUSTOM_LIGHTING_ENABLE | ||
| 57 | 55 | ||
| 58 | /* | 56 | /* |
| 59 | * Feature disable options | 57 | * Feature disable options |
diff --git a/keyboards/cannonkeys/iron165/rules.mk b/keyboards/cannonkeys/iron165/rules.mk index 795e2baf8..3925458dd 100644 --- a/keyboards/cannonkeys/iron165/rules.mk +++ b/keyboards/cannonkeys/iron165/rules.mk | |||
| @@ -1,16 +1,9 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = STM32F072 | 2 | MCU = STM32F072 |
| 3 | BOARD = ST_STM32F072B_DISCOVERY | ||
| 4 | 3 | ||
| 5 | # Build Options | 4 | # Build Options |
| 6 | # comment out to disable the options. | 5 | # comment out to disable the options. |
| 7 | # | 6 | # |
| 8 | |||
| 9 | # project specific files | ||
| 10 | VPATH += keyboards/cannonkeys/stm32f072 | ||
| 11 | SRC = keyboard.c \ | ||
| 12 | led.c | ||
| 13 | |||
| 14 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | 7 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 15 | MOUSEKEY_ENABLE = yes # Mouse keys | 8 | MOUSEKEY_ENABLE = yes # Mouse keys |
| 16 | EXTRAKEY_ENABLE = yes # Audio control and System control | 9 | EXTRAKEY_ENABLE = yes # Audio control and System control |
| @@ -19,7 +12,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 19 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 12 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 20 | NKRO_ENABLE = yes # USB Nkey Rollover | 13 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 21 | CUSTOM_MATRIX = no # Custom matrix file | 14 | CUSTOM_MATRIX = no # Custom matrix file |
| 22 | # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason | 15 | BACKLIGHT_ENABLE = yes |
| 23 | RGBLIGHT_ENABLE = no | 16 | RGBLIGHT_ENABLE = no |
| 24 | 17 | ||
| 25 | 18 | ||
diff --git a/keyboards/cannonkeys/satisfaction75/rules.mk b/keyboards/cannonkeys/satisfaction75/rules.mk index 6584bb5ff..80f57181a 100644 --- a/keyboards/cannonkeys/satisfaction75/rules.mk +++ b/keyboards/cannonkeys/satisfaction75/rules.mk | |||
| @@ -10,7 +10,7 @@ SRC += led.c \ | |||
| 10 | satisfaction_encoder.c \ | 10 | satisfaction_encoder.c \ |
| 11 | satisfaction_oled.c | 11 | satisfaction_oled.c |
| 12 | 12 | ||
| 13 | #BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration | 13 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 14 | MOUSEKEY_ENABLE = yes # Mouse keys | 14 | MOUSEKEY_ENABLE = yes # Mouse keys |
| 15 | EXTRAKEY_ENABLE = yes # Audio control and System control | 15 | EXTRAKEY_ENABLE = yes # Audio control and System control |
| 16 | CONSOLE_ENABLE = yes # Console for debug | 16 | CONSOLE_ENABLE = yes # Console for debug |
diff --git a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null | |||
| @@ -1,268 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "hal.h" | ||
| 23 | #include "stm32_gpio.h" | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver local definitions. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /*===========================================================================*/ | ||
| 30 | /* Driver exported variables. */ | ||
| 31 | /*===========================================================================*/ | ||
| 32 | |||
| 33 | /*===========================================================================*/ | ||
| 34 | /* Driver local variables and types. */ | ||
| 35 | /*===========================================================================*/ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @brief Type of STM32 GPIO port setup. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | uint32_t moder; | ||
| 42 | uint32_t otyper; | ||
| 43 | uint32_t ospeedr; | ||
| 44 | uint32_t pupdr; | ||
| 45 | uint32_t odr; | ||
| 46 | uint32_t afrl; | ||
| 47 | uint32_t afrh; | ||
| 48 | } gpio_setup_t; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Type of STM32 GPIO initialization data. | ||
| 52 | */ | ||
| 53 | typedef struct { | ||
| 54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
| 55 | gpio_setup_t PAData; | ||
| 56 | #endif | ||
| 57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
| 58 | gpio_setup_t PBData; | ||
| 59 | #endif | ||
| 60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
| 61 | gpio_setup_t PCData; | ||
| 62 | #endif | ||
| 63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
| 64 | gpio_setup_t PDData; | ||
| 65 | #endif | ||
| 66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
| 67 | gpio_setup_t PEData; | ||
| 68 | #endif | ||
| 69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
| 70 | gpio_setup_t PFData; | ||
| 71 | #endif | ||
| 72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
| 73 | gpio_setup_t PGData; | ||
| 74 | #endif | ||
| 75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
| 76 | gpio_setup_t PHData; | ||
| 77 | #endif | ||
| 78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
| 79 | gpio_setup_t PIData; | ||
| 80 | #endif | ||
| 81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
| 82 | gpio_setup_t PJData; | ||
| 83 | #endif | ||
| 84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
| 85 | gpio_setup_t PKData; | ||
| 86 | #endif | ||
| 87 | } gpio_config_t; | ||
| 88 | |||
| 89 | /** | ||
| 90 | * @brief STM32 GPIO static initialization data. | ||
| 91 | */ | ||
| 92 | static const gpio_config_t gpio_default_config = { | ||
| 93 | #if STM32_HAS_GPIOA | ||
| 94 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
| 95 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, | ||
| 96 | #endif | ||
| 97 | #if STM32_HAS_GPIOB | ||
| 98 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
| 99 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, | ||
| 100 | #endif | ||
| 101 | #if STM32_HAS_GPIOC | ||
| 102 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
| 103 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, | ||
| 104 | #endif | ||
| 105 | #if STM32_HAS_GPIOD | ||
| 106 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
| 107 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, | ||
| 108 | #endif | ||
| 109 | #if STM32_HAS_GPIOE | ||
| 110 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
| 111 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, | ||
| 112 | #endif | ||
| 113 | #if STM32_HAS_GPIOF | ||
| 114 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
| 115 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, | ||
| 116 | #endif | ||
| 117 | #if STM32_HAS_GPIOG | ||
| 118 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
| 119 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, | ||
| 120 | #endif | ||
| 121 | #if STM32_HAS_GPIOH | ||
| 122 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
| 123 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, | ||
| 124 | #endif | ||
| 125 | #if STM32_HAS_GPIOI | ||
| 126 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
| 127 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, | ||
| 128 | #endif | ||
| 129 | #if STM32_HAS_GPIOJ | ||
| 130 | {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
| 131 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, | ||
| 132 | #endif | ||
| 133 | #if STM32_HAS_GPIOK | ||
| 134 | {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
| 135 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} | ||
| 136 | #endif | ||
| 137 | }; | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /* Driver local functions. */ | ||
| 141 | /*===========================================================================*/ | ||
| 142 | |||
| 143 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
| 144 | |||
| 145 | gpiop->OTYPER = config->otyper; | ||
| 146 | gpiop->OSPEEDR = config->ospeedr; | ||
| 147 | gpiop->PUPDR = config->pupdr; | ||
| 148 | gpiop->ODR = config->odr; | ||
| 149 | gpiop->AFRL = config->afrl; | ||
| 150 | gpiop->AFRH = config->afrh; | ||
| 151 | gpiop->MODER = config->moder; | ||
| 152 | } | ||
| 153 | |||
| 154 | static void stm32_gpio_init(void) { | ||
| 155 | |||
| 156 | /* Enabling GPIO-related clocks, the mask comes from the | ||
| 157 | registry header file.*/ | ||
| 158 | rccResetAHB(STM32_GPIO_EN_MASK); | ||
| 159 | rccEnableAHB(STM32_GPIO_EN_MASK, true); | ||
| 160 | |||
| 161 | /* Initializing all the defined GPIO ports.*/ | ||
| 162 | #if STM32_HAS_GPIOA | ||
| 163 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
| 164 | #endif | ||
| 165 | #if STM32_HAS_GPIOB | ||
| 166 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
| 167 | #endif | ||
| 168 | #if STM32_HAS_GPIOC | ||
| 169 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
| 170 | #endif | ||
| 171 | #if STM32_HAS_GPIOD | ||
| 172 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
| 173 | #endif | ||
| 174 | #if STM32_HAS_GPIOE | ||
| 175 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
| 176 | #endif | ||
| 177 | #if STM32_HAS_GPIOF | ||
| 178 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
| 179 | #endif | ||
| 180 | #if STM32_HAS_GPIOG | ||
| 181 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
| 182 | #endif | ||
| 183 | #if STM32_HAS_GPIOH | ||
| 184 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
| 185 | #endif | ||
| 186 | #if STM32_HAS_GPIOI | ||
| 187 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
| 188 | #endif | ||
| 189 | #if STM32_HAS_GPIOJ | ||
| 190 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
| 191 | #endif | ||
| 192 | #if STM32_HAS_GPIOK | ||
| 193 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* Driver interrupt handlers. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /*===========================================================================*/ | ||
| 202 | /* Driver exported functions. */ | ||
| 203 | /*===========================================================================*/ | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @brief Early initialization code. | ||
| 207 | * @details GPIO ports and system clocks are initialized before everything | ||
| 208 | * else. | ||
| 209 | */ | ||
| 210 | void __early_init(void) { | ||
| 211 | extern void enter_bootloader_mode_if_requested(void); | ||
| 212 | enter_bootloader_mode_if_requested(); | ||
| 213 | stm32_gpio_init(); | ||
| 214 | stm32_clock_init(); | ||
| 215 | } | ||
| 216 | |||
| 217 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
| 218 | /** | ||
| 219 | * @brief SDC card detection. | ||
| 220 | */ | ||
| 221 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
| 222 | |||
| 223 | (void)sdcp; | ||
| 224 | /* TODO: Fill the implementation.*/ | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | |||
| 228 | /** | ||
| 229 | * @brief SDC card write protection detection. | ||
| 230 | */ | ||
| 231 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
| 232 | |||
| 233 | (void)sdcp; | ||
| 234 | /* TODO: Fill the implementation.*/ | ||
| 235 | return false; | ||
| 236 | } | ||
| 237 | #endif /* HAL_USE_SDC */ | ||
| 238 | |||
| 239 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
| 240 | /** | ||
| 241 | * @brief MMC_SPI card detection. | ||
| 242 | */ | ||
| 243 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
| 244 | |||
| 245 | (void)mmcp; | ||
| 246 | /* TODO: Fill the implementation.*/ | ||
| 247 | return true; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @brief MMC_SPI card write protection detection. | ||
| 252 | */ | ||
| 253 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
| 254 | |||
| 255 | (void)mmcp; | ||
| 256 | /* TODO: Fill the implementation.*/ | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif | ||
| 260 | |||
| 261 | /** | ||
| 262 | * @brief Board-specific initialization code. | ||
| 263 | * @todo Add your board-specific code, if any. | ||
| 264 | */ | ||
| 265 | void boardInit(void) { | ||
| 266 | SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; | ||
| 267 | SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); | ||
| 268 | } | ||
diff --git a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 57636d1f1..000000000 --- a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,940 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef BOARD_H | ||
| 23 | #define BOARD_H | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver constants. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Setup for ST STM32F072B-Discovery board. | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Board identifier. | ||
| 35 | */ | ||
| 36 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 37 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Board oscillators-related settings. | ||
| 41 | * NOTE: HSE not fitted. | ||
| 42 | */ | ||
| 43 | #if !defined(STM32_LSECLK) | ||
| 44 | #define STM32_LSECLK 32768 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define STM32_LSEDRV (3U << 3U) | ||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK) | ||
| 50 | #define STM32_HSECLK 0U | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define STM32_HSE_BYPASS | ||
| 54 | |||
| 55 | /* | ||
| 56 | * MCU type as defined in the ST header. | ||
| 57 | */ | ||
| 58 | #define STM32F072xB | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IO pins assignments. | ||
| 62 | */ | ||
| 63 | #define GPIOA_BUTTON 0U | ||
| 64 | #define GPIOA_PIN1 1U | ||
| 65 | #define GPIOA_PIN2 2U | ||
| 66 | #define GPIOA_PIN3 3U | ||
| 67 | #define GPIOA_PIN4 4U | ||
| 68 | #define GPIOA_PIN5 5U | ||
| 69 | #define GPIOA_PIN6 6U | ||
| 70 | #define GPIOA_PIN7 7U | ||
| 71 | #define GPIOA_PIN8 8U | ||
| 72 | #define GPIOA_PIN9 9U | ||
| 73 | #define GPIOA_PIN10 10U | ||
| 74 | #define GPIOA_USB_DM 11U | ||
| 75 | #define GPIOA_USB_DP 12U | ||
| 76 | #define GPIOA_SWDIO 13U | ||
| 77 | #define GPIOA_SWCLK 14U | ||
| 78 | #define GPIOA_PIN15 15U | ||
| 79 | |||
| 80 | #define GPIOB_PIN0 0U | ||
| 81 | #define GPIOB_PIN1 1U | ||
| 82 | #define GPIOB_PIN2 2U | ||
| 83 | #define GPIOB_PIN3 3U | ||
| 84 | #define GPIOB_PIN4 4U | ||
| 85 | #define GPIOB_PIN5 5U | ||
| 86 | #define GPIOB_PIN6 6U | ||
| 87 | #define GPIOB_PIN7 7U | ||
| 88 | #define GPIOB_PIN8 8U | ||
| 89 | #define GPIOB_PIN9 9U | ||
| 90 | #define GPIOB_PIN10 10U | ||
| 91 | #define GPIOB_PIN11 11U | ||
| 92 | #define GPIOB_PIN12 12U | ||
| 93 | #define GPIOB_SPI2_SCK 13U | ||
| 94 | #define GPIOB_SPI2_MISO 14U | ||
| 95 | #define GPIOB_SPI2_MOSI 15U | ||
| 96 | |||
| 97 | #define GPIOC_MEMS_CS 0U | ||
| 98 | #define GPIOC_PIN1 1U | ||
| 99 | #define GPIOC_PIN2 2U | ||
| 100 | #define GPIOC_PIN3 3U | ||
| 101 | #define GPIOC_PIN4 4U | ||
| 102 | #define GPIOC_PIN5 5U | ||
| 103 | #define GPIOC_LED_RED 6U | ||
| 104 | #define GPIOC_LED_BLUE 7U | ||
| 105 | #define GPIOC_LED_ORANGE 8U | ||
| 106 | #define GPIOC_LED_GREEN 9U | ||
| 107 | #define GPIOC_PIN10 10U | ||
| 108 | #define GPIOC_PIN11 11U | ||
| 109 | #define GPIOC_PIN12 12U | ||
| 110 | #define GPIOC_PIN13 13U | ||
| 111 | #define GPIOC_OSC32_IN 14U | ||
| 112 | #define GPIOC_OSC32_OUT 15U | ||
| 113 | |||
| 114 | #define GPIOD_PIN0 0U | ||
| 115 | #define GPIOD_PIN1 1U | ||
| 116 | #define GPIOD_PIN2 2U | ||
| 117 | #define GPIOD_PIN3 3U | ||
| 118 | #define GPIOD_PIN4 4U | ||
| 119 | #define GPIOD_PIN5 5U | ||
| 120 | #define GPIOD_PIN6 6U | ||
| 121 | #define GPIOD_PIN7 7U | ||
| 122 | #define GPIOD_PIN8 8U | ||
| 123 | #define GPIOD_PIN9 9U | ||
| 124 | #define GPIOD_PIN10 10U | ||
| 125 | #define GPIOD_PIN11 11U | ||
| 126 | #define GPIOD_PIN12 12U | ||
| 127 | #define GPIOD_PIN13 13U | ||
| 128 | #define GPIOD_PIN14 14U | ||
| 129 | #define GPIOD_PIN15 15U | ||
| 130 | |||
| 131 | #define GPIOE_PIN0 0U | ||
| 132 | #define GPIOE_PIN1 1U | ||
| 133 | #define GPIOE_PIN2 2U | ||
| 134 | #define GPIOE_PIN3 3U | ||
| 135 | #define GPIOE_PIN4 4U | ||
| 136 | #define GPIOE_PIN5 5U | ||
| 137 | #define GPIOE_PIN6 6U | ||
| 138 | #define GPIOE_PIN7 7U | ||
| 139 | #define GPIOE_PIN8 8U | ||
| 140 | #define GPIOE_PIN9 9U | ||
| 141 | #define GPIOE_PIN10 10U | ||
| 142 | #define GPIOE_PIN11 11U | ||
| 143 | #define GPIOE_PIN12 12U | ||
| 144 | #define GPIOE_PIN13 13U | ||
| 145 | #define GPIOE_PIN14 14U | ||
| 146 | #define GPIOE_PIN15 15U | ||
| 147 | |||
| 148 | #define GPIOF_OSC_IN 0U | ||
| 149 | #define GPIOF_OSC_OUT 1U | ||
| 150 | #define GPIOF_PIN2 2U | ||
| 151 | #define GPIOF_PIN3 3U | ||
| 152 | #define GPIOF_PIN4 4U | ||
| 153 | #define GPIOF_PIN5 5U | ||
| 154 | #define GPIOF_PIN6 6U | ||
| 155 | #define GPIOF_PIN7 7U | ||
| 156 | #define GPIOF_PIN8 8U | ||
| 157 | #define GPIOF_PIN9 9U | ||
| 158 | #define GPIOF_PIN10 10U | ||
| 159 | #define GPIOF_PIN11 11U | ||
| 160 | #define GPIOF_PIN12 12U | ||
| 161 | #define GPIOF_PIN13 13U | ||
| 162 | #define GPIOF_PIN14 14U | ||
| 163 | #define GPIOF_PIN15 15U | ||
| 164 | |||
| 165 | /* | ||
| 166 | * IO lines assignments. | ||
| 167 | */ | ||
| 168 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 169 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 170 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 171 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 172 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 173 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 174 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 175 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 176 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 177 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 178 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 179 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 180 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 181 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 182 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 183 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 184 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 185 | |||
| 186 | /*===========================================================================*/ | ||
| 187 | /* Driver pre-compile time settings. */ | ||
| 188 | /*===========================================================================*/ | ||
| 189 | |||
| 190 | /*===========================================================================*/ | ||
| 191 | /* Derived constants and error checks. */ | ||
| 192 | /*===========================================================================*/ | ||
| 193 | |||
| 194 | /*===========================================================================*/ | ||
| 195 | /* Driver data structures and types. */ | ||
| 196 | /*===========================================================================*/ | ||
| 197 | |||
| 198 | /*===========================================================================*/ | ||
| 199 | /* Driver macros. */ | ||
| 200 | /*===========================================================================*/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 204 | * in the initialization code. | ||
| 205 | * Please refer to the STM32 Reference Manual for details. | ||
| 206 | */ | ||
| 207 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 208 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 209 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 210 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 211 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 212 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 213 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 214 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 215 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 216 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 217 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 218 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 219 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 220 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 221 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 222 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * GPIOA setup: | ||
| 226 | * | ||
| 227 | * PA0 - BUTTON (input floating). | ||
| 228 | * PA1 - PIN1 (input pullup). | ||
| 229 | * PA2 - PIN2 (input pullup). | ||
| 230 | * PA3 - PIN3 (input pullup). | ||
| 231 | * PA4 - PIN4 (input pullup). | ||
| 232 | * PA5 - PIN5 (input pullup). | ||
| 233 | * PA6 - PIN6 (input pullup). | ||
| 234 | * PA7 - PIN7 (input pullup). | ||
| 235 | * PA8 - PIN8 (input pullup). | ||
| 236 | * PA9 - PIN9 (input pullup). | ||
| 237 | * PA10 - PIN10 (input pullup). | ||
| 238 | * PA11 - USB_DM (input floating). | ||
| 239 | * PA12 - USB_DP (input floating). | ||
| 240 | * PA13 - SWDIO (alternate 0). | ||
| 241 | * PA14 - SWCLK (alternate 0). | ||
| 242 | * PA15 - PIN15 (input pullup). | ||
| 243 | */ | ||
| 244 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 246 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 247 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 248 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 249 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 250 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 251 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 252 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 253 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 254 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 255 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 256 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 257 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 258 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 259 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 260 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 265 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 267 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 268 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 269 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 270 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 271 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 272 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 273 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 274 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 275 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 276 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 277 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 278 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 279 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 280 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 281 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 282 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 283 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 284 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 285 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 286 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 287 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 288 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 289 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 290 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 291 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 292 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 294 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 295 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 296 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 297 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 298 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 299 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 300 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 301 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 302 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 303 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 304 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 305 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 306 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 307 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 308 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 310 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 311 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 312 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 313 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 314 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 315 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 316 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 317 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 318 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 319 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 320 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 321 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 322 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 323 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 324 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 326 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 327 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 328 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 329 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 330 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 331 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 332 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 333 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 334 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 335 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 336 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 337 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 338 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 339 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 340 | |||
| 341 | /* | ||
| 342 | * GPIOB setup: | ||
| 343 | * | ||
| 344 | * PB0 - PIN0 (input pullup). | ||
| 345 | * PB1 - PIN1 (input pullup). | ||
| 346 | * PB2 - PIN2 (input pullup). | ||
| 347 | * PB3 - PIN3 (input pullup). | ||
| 348 | * PB4 - PIN4 (input pullup). | ||
| 349 | * PB5 - PIN5 (input pullup). | ||
| 350 | * PB6 - PIN6 (input pullup). | ||
| 351 | * PB7 - PIN7 (input pullup). | ||
| 352 | * PB8 - PIN8 (input pullup). | ||
| 353 | * PB9 - PIN9 (input pullup). | ||
| 354 | * PB10 - PIN10 (input pullup). | ||
| 355 | * PB11 - PIN11 (input pullup). | ||
| 356 | * PB12 - PIN12 (input pullup). | ||
| 357 | * PB13 - SPI2_SCK (alternate 0). | ||
| 358 | * PB14 - SPI2_MISO (alternate 0). | ||
| 359 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 360 | */ | ||
| 361 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 362 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 363 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 364 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 365 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 366 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 367 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 368 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 369 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 370 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 371 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 372 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 373 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 374 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 375 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 376 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 377 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 379 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 380 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 381 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 382 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 383 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 384 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 385 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 386 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 387 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 388 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 389 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 390 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 391 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 392 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 393 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 395 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 396 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 397 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 398 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 399 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 400 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 401 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 402 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 403 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 404 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 405 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 406 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 407 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 408 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 409 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 410 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 411 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 412 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 413 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 414 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 415 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 416 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 417 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 418 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 419 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 420 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 421 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 422 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 423 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 424 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 425 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 427 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 428 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 429 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 430 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 431 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 432 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 433 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 434 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 435 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 436 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 437 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 438 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 439 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 440 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 441 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 443 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 444 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 445 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 446 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 447 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 448 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 449 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 450 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 451 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 452 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 453 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 454 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 455 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 456 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 457 | |||
| 458 | /* | ||
| 459 | * GPIOC setup: | ||
| 460 | * | ||
| 461 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 462 | * PC1 - PIN1 (input pullup). | ||
| 463 | * PC2 - PIN2 (input pullup). | ||
| 464 | * PC3 - PIN3 (input pullup). | ||
| 465 | * PC4 - PIN4 (input pullup). | ||
| 466 | * PC5 - PIN5 (input pullup). | ||
| 467 | * PC6 - LED_RED (output pushpull maximum). | ||
| 468 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 469 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 470 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 471 | * PC10 - PIN10 (input pullup). | ||
| 472 | * PC11 - PIN11 (input pullup). | ||
| 473 | * PC12 - PIN12 (input pullup). | ||
| 474 | * PC13 - PIN13 (input pullup). | ||
| 475 | * PC14 - OSC32_IN (input floating). | ||
| 476 | * PC15 - OSC32_OUT (input floating). | ||
| 477 | */ | ||
| 478 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 480 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 481 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 482 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 483 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 484 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 485 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 486 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 487 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 488 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 489 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 490 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 491 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 492 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 493 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 494 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 496 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 497 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 498 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 499 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 500 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 501 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 502 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 503 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 504 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 505 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 506 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 507 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 508 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 509 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 510 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 511 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 512 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 513 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 514 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 515 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 516 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 517 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 518 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 519 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 520 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 521 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 522 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 523 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 524 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 525 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 526 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 527 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 528 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 529 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 530 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 531 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 532 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 533 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 534 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 535 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 536 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 537 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 538 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 539 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 540 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 541 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 542 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 544 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 545 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 546 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 547 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 548 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 549 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 550 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 551 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 552 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 553 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 554 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 555 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 556 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 557 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 558 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 560 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 561 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 562 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 563 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 564 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 565 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 566 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 567 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 568 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 569 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 570 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 571 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 572 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 573 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 574 | |||
| 575 | /* | ||
| 576 | * GPIOD setup: | ||
| 577 | * | ||
| 578 | * PD0 - PIN0 (input pullup). | ||
| 579 | * PD1 - PIN1 (input pullup). | ||
| 580 | * PD2 - PIN2 (input pullup). | ||
| 581 | * PD3 - PIN3 (input pullup). | ||
| 582 | * PD4 - PIN4 (input pullup). | ||
| 583 | * PD5 - PIN5 (input pullup). | ||
| 584 | * PD6 - PIN6 (input pullup). | ||
| 585 | * PD7 - PIN7 (input pullup). | ||
| 586 | * PD8 - PIN8 (input pullup). | ||
| 587 | * PD9 - PIN9 (input pullup). | ||
| 588 | * PD10 - PIN10 (input pullup). | ||
| 589 | * PD11 - PIN11 (input pullup). | ||
| 590 | * PD12 - PIN12 (input pullup). | ||
| 591 | * PD13 - PIN13 (input pullup). | ||
| 592 | * PD14 - PIN14 (input pullup). | ||
| 593 | * PD15 - PIN15 (input pullup). | ||
| 594 | */ | ||
| 595 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 597 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 598 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 599 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 600 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 601 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 602 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 603 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 604 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 605 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 606 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 607 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 608 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 609 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 610 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 611 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 613 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 614 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 615 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 616 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 617 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 618 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 619 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 620 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 621 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 622 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 623 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 624 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 625 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 626 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 627 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 629 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 630 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 631 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 632 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 633 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 634 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 635 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 636 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 637 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 638 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 639 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 640 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 641 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 642 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 643 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 645 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 646 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 647 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 648 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 649 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 650 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 651 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 652 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 653 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 654 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 655 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 656 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 657 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 658 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 659 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 661 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 662 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 663 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 664 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 665 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 666 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 667 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 668 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 669 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 670 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 671 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 672 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 673 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 674 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 675 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 677 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 678 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 679 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 680 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 681 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 682 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 683 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 684 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 685 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 686 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 687 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 688 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 689 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 690 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 691 | |||
| 692 | /* | ||
| 693 | * GPIOE setup: | ||
| 694 | * | ||
| 695 | * PE0 - PIN0 (input pullup). | ||
| 696 | * PE1 - PIN1 (input pullup). | ||
| 697 | * PE2 - PIN2 (input pullup). | ||
| 698 | * PE3 - PIN3 (input pullup). | ||
| 699 | * PE4 - PIN4 (input pullup). | ||
| 700 | * PE5 - PIN5 (input pullup). | ||
| 701 | * PE6 - PIN6 (input pullup). | ||
| 702 | * PE7 - PIN7 (input pullup). | ||
| 703 | * PE8 - PIN8 (input pullup). | ||
| 704 | * PE9 - PIN9 (input pullup). | ||
| 705 | * PE10 - PIN10 (input pullup). | ||
| 706 | * PE11 - PIN11 (input pullup). | ||
| 707 | * PE12 - PIN12 (input pullup). | ||
| 708 | * PE13 - PIN13 (input pullup). | ||
| 709 | * PE14 - PIN14 (input pullup). | ||
| 710 | * PE15 - PIN15 (input pullup). | ||
| 711 | */ | ||
| 712 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 714 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 715 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 716 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 717 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 718 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 719 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 720 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 721 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 722 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 723 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 724 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 725 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 726 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 727 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 728 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 730 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 731 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 732 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 733 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 734 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 735 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 736 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 737 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 738 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 739 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 740 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 741 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 742 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 743 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 744 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 746 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 747 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 748 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 749 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 750 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 751 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 752 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 753 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 754 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 755 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 756 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 757 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 758 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 759 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 760 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 762 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 763 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 764 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 765 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 766 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 767 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 768 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 769 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 770 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 771 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 772 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 773 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 774 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 775 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 776 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 778 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 779 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 780 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 781 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 782 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 783 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 784 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 785 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 786 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 787 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 788 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 789 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 790 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 791 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 792 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 794 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 795 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 796 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 797 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 798 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 799 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 800 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 801 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 802 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 803 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 804 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 805 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 806 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 807 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 808 | |||
| 809 | /* | ||
| 810 | * GPIOF setup: | ||
| 811 | * | ||
| 812 | * PF0 - OSC_IN (input floating). | ||
| 813 | * PF1 - OSC_OUT (input floating). | ||
| 814 | * PF2 - PIN2 (input pullup). | ||
| 815 | * PF3 - PIN3 (input pullup). | ||
| 816 | * PF4 - PIN4 (input pullup). | ||
| 817 | * PF5 - PIN5 (input pullup). | ||
| 818 | * PF6 - PIN6 (input pullup). | ||
| 819 | * PF7 - PIN7 (input pullup). | ||
| 820 | * PF8 - PIN8 (input pullup). | ||
| 821 | * PF9 - PIN9 (input pullup). | ||
| 822 | * PF10 - PIN10 (input pullup). | ||
| 823 | * PF11 - PIN11 (input pullup). | ||
| 824 | * PF12 - PIN12 (input pullup). | ||
| 825 | * PF13 - PIN13 (input pullup). | ||
| 826 | * PF14 - PIN14 (input pullup). | ||
| 827 | * PF15 - PIN15 (input pullup). | ||
| 828 | */ | ||
| 829 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 831 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 832 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 833 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 834 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 835 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 836 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 837 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 838 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 839 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 840 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 841 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 842 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 843 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 844 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 845 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 847 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 848 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 849 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 850 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 851 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 852 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 853 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 854 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 855 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 856 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 857 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 858 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 859 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 860 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 861 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 863 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 864 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 865 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 866 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 867 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 868 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 869 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 870 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 871 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 872 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 873 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 874 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 875 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 876 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 877 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 878 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 879 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 880 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 881 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 882 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 883 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 884 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 885 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 886 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 887 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 888 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 889 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 890 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 891 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 892 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 893 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 895 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 896 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 897 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 898 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 899 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 900 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 901 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 902 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 903 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 904 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 905 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 906 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 907 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 908 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 909 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 911 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 912 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 913 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 914 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 915 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 916 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 917 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 918 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 919 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 920 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 921 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 922 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 923 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 924 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 925 | |||
| 926 | /*===========================================================================*/ | ||
| 927 | /* External declarations. */ | ||
| 928 | /*===========================================================================*/ | ||
| 929 | |||
| 930 | #if !defined(_FROM_ASM_) | ||
| 931 | #ifdef __cplusplus | ||
| 932 | extern "C" { | ||
| 933 | #endif | ||
| 934 | void boardInit(void); | ||
| 935 | #ifdef __cplusplus | ||
| 936 | } | ||
| 937 | #endif | ||
| 938 | #endif /* _FROM_ASM_ */ | ||
| 939 | |||
| 940 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # List of all the board related files. | ||
| 2 | BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c | ||
| 3 | |||
| 4 | # Required include directories | ||
| 5 | BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY | ||
diff --git a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg deleted file mode 100644 index 9c7cf4fd7..000000000 --- a/keyboards/cannonkeys/savage65/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg +++ /dev/null | |||
| @@ -1,703 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!-- STM32F0xx board Template --> | ||
| 3 | <board | ||
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 5 | xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> | ||
| 6 | <configuration_settings> | ||
| 7 | <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> | ||
| 8 | <output_path>..</output_path> | ||
| 9 | <hal_version>3.0.x</hal_version> | ||
| 10 | </configuration_settings> | ||
| 11 | <board_name>ST STM32F072B-Discovery</board_name> | ||
| 12 | <board_id>ST_STM32F072B_DISCOVERY</board_id> | ||
| 13 | <board_functions></board_functions> | ||
| 14 | <subtype>STM32F072xB</subtype> | ||
| 15 | <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" | ||
| 16 | LSEBypass="false" LSEDrive="3 High Drive (default)" /> | ||
| 17 | <ports> | ||
| 18 | <GPIOA> | ||
| 19 | <pin0 | ||
| 20 | ID="BUTTON" | ||
| 21 | Type="PushPull" | ||
| 22 | Speed="Minimum" | ||
| 23 | Resistor="Floating" | ||
| 24 | Level="High" | ||
| 25 | Mode="Input" | ||
| 26 | Alternate="0" /> | ||
| 27 | <pin1 | ||
| 28 | ID="" | ||
| 29 | Type="PushPull" | ||
| 30 | Speed="Minimum" | ||
| 31 | Resistor="PullUp" | ||
| 32 | Level="High" | ||
| 33 | Mode="Input" | ||
| 34 | Alternate="0" /> | ||
| 35 | <pin2 | ||
| 36 | ID="" | ||
| 37 | Type="PushPull" | ||
| 38 | Speed="Minimum" | ||
| 39 | Resistor="PullUp" | ||
| 40 | Level="High" | ||
| 41 | Mode="Input" | ||
| 42 | Alternate="0" /> | ||
| 43 | <pin3 | ||
| 44 | ID="" | ||
| 45 | Type="PushPull" | ||
| 46 | Speed="Minimum" | ||
| 47 | Resistor="PullUp" | ||
| 48 | Level="High" | ||
| 49 | Mode="Input" | ||
| 50 | Alternate="0" /> | ||
| 51 | <pin4 | ||
| 52 | ID="" | ||
| 53 | Type="PushPull" | ||
| 54 | Speed="Minimum" | ||
| 55 | Resistor="PullUp" | ||
| 56 | Level="High" | ||
| 57 | Mode="Input" | ||
| 58 | Alternate="0" /> | ||
| 59 | <pin5 | ||
| 60 | ID="" | ||
| 61 | Type="PushPull" | ||
| 62 | Speed="Minimum" | ||
| 63 | Resistor="PullUp" | ||
| 64 | Level="High" | ||
| 65 | Mode="Input" | ||
| 66 | Alternate="0" /> | ||
| 67 | <pin6 | ||
| 68 | ID="" | ||
| 69 | Type="PushPull" | ||
| 70 | Speed="Minimum" | ||
| 71 | Resistor="PullUp" | ||
| 72 | Level="High" | ||
| 73 | Mode="Input" | ||
| 74 | Alternate="0" /> | ||
| 75 | <pin7 | ||
| 76 | ID="" | ||
| 77 | Type="PushPull" | ||
| 78 | Speed="Minimum" | ||
| 79 | Resistor="PullUp" | ||
| 80 | Level="High" | ||
| 81 | Mode="Input" | ||
| 82 | Alternate="0" /> | ||
| 83 | <pin8 | ||
| 84 | ID="" | ||
| 85 | Type="PushPull" | ||
| 86 | Speed="Minimum" | ||
| 87 | Resistor="PullUp" | ||
| 88 | Level="High" | ||
| 89 | Mode="Input" | ||
| 90 | Alternate="0" /> | ||
| 91 | <pin9 | ||
| 92 | ID="" | ||
| 93 | Type="PushPull" | ||
| 94 | Speed="Minimum" | ||
| 95 | Resistor="PullUp" | ||
| 96 | Level="High" | ||
| 97 | Mode="Input" | ||
| 98 | Alternate="0" /> | ||
| 99 | <pin10 | ||
| 100 | ID="" | ||
| 101 | Type="PushPull" | ||
| 102 | Speed="Minimum" | ||
| 103 | Resistor="PullUp" | ||
| 104 | Level="High" | ||
| 105 | Mode="Input" | ||
| 106 | Alternate="0" /> | ||
| 107 | <pin11 | ||
| 108 | ID="USB_DM" | ||
| 109 | Type="PushPull" | ||
| 110 | Speed="Minimum" | ||
| 111 | Resistor="Floating" | ||
| 112 | Level="High" | ||
| 113 | Mode="Input" | ||
| 114 | Alternate="0" /> | ||
| 115 | <pin12 | ||
| 116 | ID="USB_DP" | ||
| 117 | Type="PushPull" | ||
| 118 | Speed="Minimum" | ||
| 119 | Resistor="Floating" | ||
| 120 | Level="High" | ||
| 121 | Mode="Input" | ||
| 122 | Alternate="0" /> | ||
| 123 | <pin13 | ||
| 124 | ID="SWDIO" | ||
| 125 | Type="PushPull" | ||
| 126 | Speed="Maximum" | ||
| 127 | Resistor="PullUp" | ||
| 128 | Level="High" | ||
| 129 | Mode="Alternate" | ||
| 130 | Alternate="0" /> | ||
| 131 | <pin14 | ||
| 132 | ID="SWCLK" | ||
| 133 | Type="PushPull" | ||
| 134 | Speed="Maximum" | ||
| 135 | Resistor="PullDown" | ||
| 136 | Level="High" | ||
| 137 | Mode="Alternate" | ||
| 138 | Alternate="0" /> | ||
| 139 | <pin15 | ||
| 140 | ID="" | ||
| 141 | Type="PushPull" | ||
| 142 | Speed="Maximum" | ||
| 143 | Resistor="PullUp" | ||
| 144 | Level="High" | ||
| 145 | Mode="Input" | ||
| 146 | Alternate="0" /> | ||
| 147 | </GPIOA> | ||
| 148 | <GPIOB> | ||
| 149 | <pin0 | ||
| 150 | ID="" | ||
| 151 | Type="PushPull" | ||
| 152 | Speed="Minimum" | ||
| 153 | Resistor="PullUp" | ||
| 154 | Level="High" | ||
| 155 | Mode="Input" | ||
| 156 | Alternate="0" /> | ||
| 157 | <pin1 | ||
| 158 | ID="" | ||
| 159 | Type="PushPull" | ||
| 160 | Speed="Minimum" | ||
| 161 | Resistor="PullUp" | ||
| 162 | Level="High" | ||
| 163 | Mode="Input" | ||
| 164 | Alternate="0" /> | ||
| 165 | <pin2 | ||
| 166 | ID="" | ||
| 167 | Type="PushPull" | ||
| 168 | Speed="Maximum" | ||
| 169 | Resistor="PullUp" | ||
| 170 | Level="High" | ||
| 171 | Mode="Input" | ||
| 172 | Alternate="0" /> | ||
| 173 | <pin3 | ||
| 174 | ID="" | ||
| 175 | Type="PushPull" | ||
| 176 | Speed="Maximum" | ||
| 177 | Resistor="PullUp" | ||
| 178 | Level="High" | ||
| 179 | Mode="Input" | ||
| 180 | Alternate="0" /> | ||
| 181 | <pin4 | ||
| 182 | ID="" | ||
| 183 | Type="PushPull" | ||
| 184 | Speed="Maximum" | ||
| 185 | Resistor="PullUp" | ||
| 186 | Level="High" | ||
| 187 | Mode="Input" | ||
| 188 | Alternate="0" /> | ||
| 189 | <pin5 | ||
| 190 | ID="" | ||
| 191 | Type="PushPull" | ||
| 192 | Speed="Minimum" | ||
| 193 | Resistor="PullUp" | ||
| 194 | Level="High" | ||
| 195 | Mode="Input" | ||
| 196 | Alternate="0" /> | ||
| 197 | <pin6 | ||
| 198 | ID="" | ||
| 199 | Type="PushPull" | ||
| 200 | Speed="Minimum" | ||
| 201 | Resistor="PullUp" | ||
| 202 | Level="High" | ||
| 203 | Mode="Input" | ||
| 204 | Alternate="0" /> | ||
| 205 | <pin7 | ||
| 206 | ID="" | ||
| 207 | Type="PushPull" | ||
| 208 | Speed="Minimum" | ||
| 209 | Resistor="PullUp" | ||
| 210 | Level="High" | ||
| 211 | Mode="Input" | ||
| 212 | Alternate="0" /> | ||
| 213 | <pin8 | ||
| 214 | ID="" | ||
| 215 | Type="PushPull" | ||
| 216 | Speed="Minimum" | ||
| 217 | Resistor="PullUp" | ||
| 218 | Level="High" | ||
| 219 | Mode="Input" | ||
| 220 | Alternate="0" /> | ||
| 221 | <pin9 | ||
| 222 | ID="" | ||
| 223 | Type="PushPull" | ||
| 224 | Speed="Minimum" | ||
| 225 | Resistor="PullUp" | ||
| 226 | Level="High" | ||
| 227 | Mode="Input" | ||
| 228 | Alternate="0" /> | ||
| 229 | <pin10 | ||
| 230 | ID="" | ||
| 231 | Type="PushPull" | ||
| 232 | Speed="Minimum" | ||
| 233 | Resistor="PullUp" | ||
| 234 | Level="High" | ||
| 235 | Mode="Input" | ||
| 236 | Alternate="0" /> | ||
| 237 | <pin11 | ||
| 238 | ID="" | ||
| 239 | Type="PushPull" | ||
| 240 | Speed="Minimum" | ||
| 241 | Resistor="PullUp" | ||
| 242 | Level="High" | ||
| 243 | Mode="Input" | ||
| 244 | Alternate="0" /> | ||
| 245 | <pin12 | ||
| 246 | ID="" | ||
| 247 | Type="PushPull" | ||
| 248 | Speed="Minimum" | ||
| 249 | Resistor="PullUp" | ||
| 250 | Level="High" | ||
| 251 | Mode="Input" | ||
| 252 | Alternate="0" /> | ||
| 253 | <pin13 | ||
| 254 | ID="SPI2_SCK" | ||
| 255 | Type="PushPull" | ||
| 256 | Speed="Minimum" | ||
| 257 | Resistor="Floating" | ||
| 258 | Level="High" | ||
| 259 | Mode="Alternate" | ||
| 260 | Alternate="0" /> | ||
| 261 | <pin14 | ||
| 262 | ID="SPI2_MISO" | ||
| 263 | Type="PushPull" | ||
| 264 | Speed="Minimum" | ||
| 265 | Resistor="Floating" | ||
| 266 | Level="High" | ||
| 267 | Mode="Alternate" | ||
| 268 | Alternate="0" /> | ||
| 269 | <pin15 | ||
| 270 | ID="SPI2_MOSI" | ||
| 271 | Type="PushPull" | ||
| 272 | Speed="Minimum" | ||
| 273 | Resistor="Floating" | ||
| 274 | Level="High" | ||
| 275 | Mode="Alternate" | ||
| 276 | Alternate="0" /> | ||
| 277 | </GPIOB> | ||
| 278 | <GPIOC> | ||
| 279 | <pin0 | ||
| 280 | ID="MEMS_CS" | ||
| 281 | Type="PushPull" | ||
| 282 | Speed="Maximum" | ||
| 283 | Resistor="Floating" | ||
| 284 | Level="High" | ||
| 285 | Mode="Output" | ||
| 286 | Alternate="0" /> | ||
| 287 | <pin1 | ||
| 288 | ID="" | ||
| 289 | Type="PushPull" | ||
| 290 | Speed="Minimum" | ||
| 291 | Resistor="PullUp" | ||
| 292 | Level="High" | ||
| 293 | Mode="Input" | ||
| 294 | Alternate="0" /> | ||
| 295 | <pin2 | ||
| 296 | ID="" | ||
| 297 | Type="PushPull" | ||
| 298 | Speed="Minimum" | ||
| 299 | Resistor="PullUp" | ||
| 300 | Level="High" | ||
| 301 | Mode="Input" | ||
| 302 | Alternate="0" /> | ||
| 303 | <pin3 | ||
| 304 | ID="" | ||
| 305 | Type="PushPull" | ||
| 306 | Speed="Minimum" | ||
| 307 | Resistor="PullUp" | ||
| 308 | Level="High" | ||
| 309 | Mode="Input" | ||
| 310 | Alternate="0" /> | ||
| 311 | <pin4 | ||
| 312 | ID="" | ||
| 313 | Type="PushPull" | ||
| 314 | Speed="Minimum" | ||
| 315 | Resistor="PullUp" | ||
| 316 | Level="High" | ||
| 317 | Mode="Input" | ||
| 318 | Alternate="0" /> | ||
| 319 | <pin5 | ||
| 320 | ID="" | ||
| 321 | Type="PushPull" | ||
| 322 | Speed="Minimum" | ||
| 323 | Resistor="PullUp" | ||
| 324 | Level="High" | ||
| 325 | Mode="Input" | ||
| 326 | Alternate="0" /> | ||
| 327 | <pin6 | ||
| 328 | ID="LED_RED" | ||
| 329 | Type="PushPull" | ||
| 330 | Speed="Maximum" | ||
| 331 | Resistor="Floating" | ||
| 332 | Level="Low" | ||
| 333 | Mode="Output" | ||
| 334 | Alternate="0" /> | ||
| 335 | <pin7 | ||
| 336 | ID="LED_BLUE" | ||
| 337 | Type="PushPull" | ||
| 338 | Speed="Maximum" | ||
| 339 | Resistor="Floating" | ||
| 340 | Level="Low" | ||
| 341 | Mode="Output" | ||
| 342 | Alternate="0" /> | ||
| 343 | <pin8 | ||
| 344 | ID="LED_ORANGE" | ||
| 345 | Type="PushPull" | ||
| 346 | Speed="Maximum" | ||
| 347 | Resistor="Floating" | ||
| 348 | Level="Low" | ||
| 349 | Mode="Output" | ||
| 350 | Alternate="0" ></pin8> | ||
| 351 | <pin9 | ||
| 352 | ID="LED_GREEN" | ||
| 353 | Type="PushPull" | ||
| 354 | Speed="Maximum" | ||
| 355 | Resistor="Floating" | ||
| 356 | Level="Low" | ||
| 357 | Mode="Output" | ||
| 358 | Alternate="0" /> | ||
| 359 | <pin10 | ||
| 360 | ID="" | ||
| 361 | Type="PushPull" | ||
| 362 | Speed="Minimum" | ||
| 363 | Resistor="PullUp" | ||
| 364 | Level="High" | ||
| 365 | Mode="Input" | ||
| 366 | Alternate="0" /> | ||
| 367 | <pin11 | ||
| 368 | ID="" | ||
| 369 | Type="PushPull" | ||
| 370 | Speed="Minimum" | ||
| 371 | Resistor="PullUp" | ||
| 372 | Level="High" | ||
| 373 | Mode="Input" | ||
| 374 | Alternate="0" /> | ||
| 375 | <pin12 | ||
| 376 | ID="" | ||
| 377 | Type="PushPull" | ||
| 378 | Speed="Minimum" | ||
| 379 | Resistor="PullUp" | ||
| 380 | Level="High" | ||
| 381 | Mode="Input" | ||
| 382 | Alternate="0" /> | ||
| 383 | <pin13 | ||
| 384 | ID="" | ||
| 385 | Type="PushPull" | ||
| 386 | Speed="Minimum" | ||
| 387 | Resistor="PullUp" | ||
| 388 | Level="High" | ||
| 389 | Mode="Input" | ||
| 390 | Alternate="0" /> | ||
| 391 | <pin14 | ||
| 392 | ID="OSC32_IN" | ||
| 393 | Type="PushPull" | ||
| 394 | Speed="Maximum" | ||
| 395 | Resistor="Floating" | ||
| 396 | Level="High" | ||
| 397 | Mode="Input" | ||
| 398 | Alternate="0" /> | ||
| 399 | <pin15 | ||
| 400 | ID="OSC32_OUT" | ||
| 401 | Type="PushPull" | ||
| 402 | Speed="Maximum" | ||
| 403 | Resistor="Floating" | ||
| 404 | Level="High" | ||
| 405 | Mode="Input" | ||
| 406 | Alternate="0" /> | ||
| 407 | </GPIOC> | ||
| 408 | <GPIOD> | ||
| 409 | <pin0 | ||
| 410 | ID="" | ||
| 411 | Type="PushPull" | ||
| 412 | Speed="Minimum" | ||
| 413 | Resistor="PullUp" | ||
| 414 | Level="High" | ||
| 415 | Mode="Input" | ||
| 416 | Alternate="0" /> | ||
| 417 | <pin1 | ||
| 418 | ID="" | ||
| 419 | Type="PushPull" | ||
| 420 | Speed="Minimum" | ||
| 421 | Resistor="PullUp" | ||
| 422 | Level="High" | ||
| 423 | Mode="Input" | ||
| 424 | Alternate="0" /> | ||
| 425 | <pin2 | ||
| 426 | ID="" | ||
| 427 | Type="PushPull" | ||
| 428 | Speed="Minimum" | ||
| 429 | Resistor="PullUp" | ||
| 430 | Level="High" | ||
| 431 | Mode="Input" | ||
| 432 | Alternate="0" /> | ||
| 433 | <pin3 | ||
| 434 | ID="" | ||
| 435 | Type="PushPull" | ||
| 436 | Speed="Minimum" | ||
| 437 | Resistor="PullUp" | ||
| 438 | Level="High" | ||
| 439 | Mode="Input" | ||
| 440 | Alternate="0" /> | ||
| 441 | <pin4 | ||
| 442 | ID="" | ||
| 443 | Type="PushPull" | ||
| 444 | Speed="Minimum" | ||
| 445 | Resistor="PullUp" | ||
| 446 | Level="High" | ||
| 447 | Mode="Input" | ||
| 448 | Alternate="0" /> | ||
| 449 | <pin5 | ||
| 450 | ID="" | ||
| 451 | Type="PushPull" | ||
| 452 | Speed="Minimum" | ||
| 453 | Resistor="PullUp" | ||
| 454 | Level="High" | ||
| 455 | Mode="Input" | ||
| 456 | Alternate="0" /> | ||
| 457 | <pin6 | ||
| 458 | ID="" | ||
| 459 | Type="PushPull" | ||
| 460 | Speed="Minimum" | ||
| 461 | Resistor="PullUp" | ||
| 462 | Level="High" | ||
| 463 | Mode="Input" | ||
| 464 | Alternate="0" /> | ||
| 465 | <pin7 | ||
| 466 | ID="" | ||
| 467 | Type="PushPull" | ||
| 468 | Speed="Minimum" | ||
| 469 | Resistor="PullUp" | ||
| 470 | Level="High" | ||
| 471 | Mode="Input" | ||
| 472 | Alternate="0" /> | ||
| 473 | <pin8 | ||
| 474 | ID="" | ||
| 475 | Type="PushPull" | ||
| 476 | Speed="Minimum" | ||
| 477 | Resistor="PullUp" | ||
| 478 | Level="High" | ||
| 479 | Mode="Input" | ||
| 480 | Alternate="0" /> | ||
| 481 | <pin9 | ||
| 482 | ID="" | ||
| 483 | Type="PushPull" | ||
| 484 | Speed="Minimum" | ||
| 485 | Resistor="PullUp" | ||
| 486 | Level="High" | ||
| 487 | Mode="Input" | ||
| 488 | Alternate="0" /> | ||
| 489 | <pin10 | ||
| 490 | ID="" | ||
| 491 | Type="PushPull" | ||
| 492 | Speed="Minimum" | ||
| 493 | Resistor="PullUp" | ||
| 494 | Level="High" | ||
| 495 | Mode="Input" | ||
| 496 | Alternate="0" /> | ||
| 497 | <pin11 | ||
| 498 | ID="" | ||
| 499 | Type="PushPull" | ||
| 500 | Speed="Minimum" | ||
| 501 | Resistor="PullUp" | ||
| 502 | Level="High" | ||
| 503 | Mode="Input" | ||
| 504 | Alternate="0" /> | ||
| 505 | <pin12 | ||
| 506 | ID="" | ||
| 507 | Type="PushPull" | ||
| 508 | Speed="Minimum" | ||
| 509 | Resistor="PullUp" | ||
| 510 | Level="High" | ||
| 511 | Mode="Input" | ||
| 512 | Alternate="0" /> | ||
| 513 | <pin13 | ||
| 514 | ID="" | ||
| 515 | Type="PushPull" | ||
| 516 | Speed="Minimum" | ||
| 517 | Resistor="PullUp" | ||
| 518 | Level="High" | ||
| 519 | Mode="Input" | ||
| 520 | Alternate="0" /> | ||
| 521 | <pin14 | ||
| 522 | ID="" | ||
| 523 | Type="PushPull" | ||
| 524 | Speed="Minimum" | ||
| 525 | Resistor="PullUp" | ||
| 526 | Level="High" | ||
| 527 | Mode="Input" | ||
| 528 | Alternate="0" /> | ||
| 529 | <pin15 | ||
| 530 | ID="" | ||
| 531 | Type="PushPull" | ||
| 532 | Speed="Minimum" | ||
| 533 | Resistor="PullUp" | ||
| 534 | Level="High" | ||
| 535 | Mode="Input" | ||
| 536 | Alternate="0" /> | ||
| 537 | </GPIOD> | ||
| 538 | <GPIOE> | ||
| 539 | <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 540 | Level="High" Mode="Input" Alternate="0" /> | ||
| 541 | <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 542 | Level="High" Mode="Input" Alternate="0" /> | ||
| 543 | <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 544 | Level="High" Mode="Input" Alternate="0" /> | ||
| 545 | <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 546 | Level="High" Mode="Input" Alternate="0" /> | ||
| 547 | <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 548 | Level="High" Mode="Input" Alternate="0" /> | ||
| 549 | <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 550 | Level="High" Mode="Input" Alternate="0" /> | ||
| 551 | <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 552 | Level="High" Mode="Input" Alternate="0" /> | ||
| 553 | <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 554 | Level="High" Mode="Input" Alternate="0" /> | ||
| 555 | <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 556 | Level="High" Mode="Input" Alternate="0" /> | ||
| 557 | <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 558 | Level="High" Mode="Input" Alternate="0" /> | ||
| 559 | <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 560 | Level="High" Mode="Input" Alternate="0" /> | ||
| 561 | <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 562 | Level="High" Mode="Input" Alternate="0" /> | ||
| 563 | <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 564 | Level="High" Mode="Input" Alternate="0" /> | ||
| 565 | <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 566 | Level="High" Mode="Input" Alternate="0" /> | ||
| 567 | <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 568 | Level="High" Mode="Input" Alternate="0" /> | ||
| 569 | <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 570 | Level="High" Mode="Input" Alternate="0" /> | ||
| 571 | </GPIOE> | ||
| 572 | <GPIOF> | ||
| 573 | <pin0 | ||
| 574 | ID="OSC_IN" | ||
| 575 | Type="PushPull" | ||
| 576 | Speed="Minimum" | ||
| 577 | Resistor="Floating" | ||
| 578 | Level="High" | ||
| 579 | Mode="Input" | ||
| 580 | Alternate="0" /> | ||
| 581 | <pin1 | ||
| 582 | ID="OSC_OUT" | ||
| 583 | Type="PushPull" | ||
| 584 | Speed="Minimum" | ||
| 585 | Resistor="Floating" | ||
| 586 | Level="High" | ||
| 587 | Mode="Input" | ||
| 588 | Alternate="0" /> | ||
| 589 | <pin2 | ||
| 590 | ID="" | ||
| 591 | Type="PushPull" | ||
| 592 | Speed="Minimum" | ||
| 593 | Resistor="PullUp" | ||
| 594 | Level="High" | ||
| 595 | Mode="Input" | ||
| 596 | Alternate="0" /> | ||
| 597 | <pin3 | ||
| 598 | ID="" | ||
| 599 | Type="PushPull" | ||
| 600 | Speed="Minimum" | ||
| 601 | Resistor="PullUp" | ||
| 602 | Level="High" | ||
| 603 | Mode="Input" | ||
| 604 | Alternate="0" /> | ||
| 605 | <pin4 | ||
| 606 | ID="" | ||
| 607 | Type="PushPull" | ||
| 608 | Speed="Minimum" | ||
| 609 | Resistor="PullUp" | ||
| 610 | Level="High" | ||
| 611 | Mode="Input" | ||
| 612 | Alternate="0" /> | ||
| 613 | <pin5 | ||
| 614 | ID="" | ||
| 615 | Type="PushPull" | ||
| 616 | Speed="Minimum" | ||
| 617 | Resistor="PullUp" | ||
| 618 | Level="High" | ||
| 619 | Mode="Input" | ||
| 620 | Alternate="0" /> | ||
| 621 | <pin6 | ||
| 622 | ID="" | ||
| 623 | Type="PushPull" | ||
| 624 | Speed="Minimum" | ||
| 625 | Resistor="PullUp" | ||
| 626 | Level="High" | ||
| 627 | Mode="Input" | ||
| 628 | Alternate="0" /> | ||
| 629 | <pin7 | ||
| 630 | ID="" | ||
| 631 | Type="PushPull" | ||
| 632 | Speed="Minimum" | ||
| 633 | Resistor="PullUp" | ||
| 634 | Level="High" | ||
| 635 | Mode="Input" | ||
| 636 | Alternate="0" /> | ||
| 637 | <pin8 | ||
| 638 | ID="" | ||
| 639 | Type="PushPull" | ||
| 640 | Speed="Minimum" | ||
| 641 | Resistor="PullUp" | ||
| 642 | Level="High" | ||
| 643 | Mode="Input" | ||
| 644 | Alternate="0" /> | ||
| 645 | <pin9 | ||
| 646 | ID="" | ||
| 647 | Type="PushPull" | ||
| 648 | Speed="Minimum" | ||
| 649 | Resistor="PullUp" | ||
| 650 | Level="High" | ||
| 651 | Mode="Input" | ||
| 652 | Alternate="0" /> | ||
| 653 | <pin10 | ||
| 654 | ID="" | ||
| 655 | Type="PushPull" | ||
| 656 | Speed="Minimum" | ||
| 657 | Resistor="PullUp" | ||
| 658 | Level="High" | ||
| 659 | Mode="Input" | ||
| 660 | Alternate="0" /> | ||
| 661 | <pin11 | ||
| 662 | ID="" | ||
| 663 | Type="PushPull" | ||
| 664 | Speed="Minimum" | ||
| 665 | Resistor="PullUp" | ||
| 666 | Level="High" | ||
| 667 | Mode="Input" | ||
| 668 | Alternate="0" /> | ||
| 669 | <pin12 | ||
| 670 | ID="" | ||
| 671 | Type="PushPull" | ||
| 672 | Speed="Minimum" | ||
| 673 | Resistor="PullUp" | ||
| 674 | Level="High" | ||
| 675 | Mode="Input" | ||
| 676 | Alternate="0" /> | ||
| 677 | <pin13 | ||
| 678 | ID="" | ||
| 679 | Type="PushPull" | ||
| 680 | Speed="Minimum" | ||
| 681 | Resistor="PullUp" | ||
| 682 | Level="High" | ||
| 683 | Mode="Input" | ||
| 684 | Alternate="0" /> | ||
| 685 | <pin14 | ||
| 686 | ID="" | ||
| 687 | Type="PushPull" | ||
| 688 | Speed="Minimum" | ||
| 689 | Resistor="PullUp" | ||
| 690 | Level="High" | ||
| 691 | Mode="Input" | ||
| 692 | Alternate="0" /> | ||
| 693 | <pin15 | ||
| 694 | ID="" | ||
| 695 | Type="PushPull" | ||
| 696 | Speed="Minimum" | ||
| 697 | Resistor="PullUp" | ||
| 698 | Level="High" | ||
| 699 | Mode="Input" | ||
| 700 | Alternate="0" /> | ||
| 701 | </GPIOF> | ||
| 702 | </ports> | ||
| 703 | </board> | ||
diff --git a/keyboards/cannonkeys/savage65/config.h b/keyboards/cannonkeys/savage65/config.h index 9c4dbdec4..79931cdde 100644 --- a/keyboards/cannonkeys/savage65/config.h +++ b/keyboards/cannonkeys/savage65/config.h | |||
| @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 33 | #define MATRIX_ROW_PINS { B12, B11, B14, A8, A1 } | 33 | #define MATRIX_ROW_PINS { B12, B11, B14, A8, A1 } |
| 34 | #define DIODE_DIRECTION COL2ROW | 34 | #define DIODE_DIRECTION COL2ROW |
| 35 | 35 | ||
| 36 | #define BACKLIGHT_PIN A6 | ||
| 37 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 38 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 39 | #define BACKLIGHT_PAL_MODE 1 | ||
| 36 | #define BACKLIGHT_LEVELS 6 | 40 | #define BACKLIGHT_LEVELS 6 |
| 37 | #define BACKLIGHT_BREATHING | 41 | #define BACKLIGHT_BREATHING |
| 38 | #define BREATHING_PERIOD 6 | 42 | #define BREATHING_PERIOD 6 |
| @@ -52,16 +56,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 52 | #define RGB_DI_PIN B15 | 56 | #define RGB_DI_PIN B15 |
| 53 | #define RGBLED_NUM 20 | 57 | #define RGBLED_NUM 20 |
| 54 | #define WS2812_SPI SPID2 | 58 | #define WS2812_SPI SPID2 |
| 59 | #define WS2812_SPI_MOSI_PAL_MODE 0 | ||
| 55 | 60 | ||
| 56 | // Backlight config starts after VIA's EEPROM usage, | ||
| 57 | // dynamic keymaps start after this. | ||
| 58 | #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 1 | ||
| 59 | |||
| 60 | // VIA lighting is handled by the keyboard-level code | ||
| 61 | #define VIA_CUSTOM_LIGHTING_ENABLE | ||
| 62 | |||
| 63 | // Let VIA handle the QMK RGBLIGHT | ||
| 64 | #define VIA_QMK_RGBLIGHT_ENABLE | ||
| 65 | 61 | ||
| 66 | /* | 62 | /* |
| 67 | * Feature disable options | 63 | * Feature disable options |
diff --git a/keyboards/cannonkeys/savage65/rules.mk b/keyboards/cannonkeys/savage65/rules.mk index 86f6b4e0f..dc7f59ae4 100644 --- a/keyboards/cannonkeys/savage65/rules.mk +++ b/keyboards/cannonkeys/savage65/rules.mk | |||
| @@ -1,15 +1,10 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = STM32F072 | 2 | MCU = STM32F072 |
| 3 | BOARD = ST_STM32F072B_DISCOVERY | ||
| 4 | 3 | ||
| 5 | # Build Options | 4 | # Build Options |
| 6 | # comment out to disable the options. | 5 | # comment out to disable the options. |
| 7 | # | 6 | # |
| 8 | 7 | ||
| 9 | # project specific files | ||
| 10 | VPATH += keyboards/cannonkeys/stm32f072 | ||
| 11 | SRC = keyboard.c \ | ||
| 12 | led.c | ||
| 13 | 8 | ||
| 14 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | 9 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 15 | MOUSEKEY_ENABLE = yes # Mouse keys | 10 | MOUSEKEY_ENABLE = yes # Mouse keys |
| @@ -19,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 19 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 20 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 21 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
| 22 | # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason | 17 | BACKLIGHT_ENABLE = yes |
| 23 | RGBLIGHT_ENABLE = yes | 18 | RGBLIGHT_ENABLE = yes |
| 24 | WS2812_DRIVER = spi | 19 | WS2812_DRIVER = spi |
| 25 | 20 | ||
diff --git a/keyboards/cannonkeys/stm32f072/keyboard.c b/keyboards/cannonkeys/stm32f072/keyboard.c deleted file mode 100644 index 39f912506..000000000 --- a/keyboards/cannonkeys/stm32f072/keyboard.c +++ /dev/null | |||
| @@ -1,241 +0,0 @@ | |||
| 1 | #include "keyboard.h" | ||
| 2 | #include "ch.h" | ||
| 3 | #include "hal.h" | ||
| 4 | #include "led_custom.h" | ||
| 5 | #include "util.h" | ||
| 6 | #include "quantum.h" | ||
| 7 | |||
| 8 | #include "raw_hid.h" | ||
| 9 | #include "dynamic_keymap.h" | ||
| 10 | #include "tmk_core/common/eeprom.h" | ||
| 11 | #include "version.h" // for QMK_BUILDDATE used in EEPROM magic | ||
| 12 | |||
| 13 | #include "via.h" | ||
| 14 | #define EEPROM_CUSTOM_BACKLIGHT (VIA_EEPROM_CUSTOM_CONFIG_ADDR) | ||
| 15 | |||
| 16 | backlight_config_t kb_backlight_config = { | ||
| 17 | .enable = true, | ||
| 18 | .breathing = true, | ||
| 19 | .level = BACKLIGHT_LEVELS | ||
| 20 | }; | ||
| 21 | |||
| 22 | void backlight_config_save(){ | ||
| 23 | eeprom_update_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT, kb_backlight_config.raw); | ||
| 24 | } | ||
| 25 | |||
| 26 | void backlight_config_load(){ | ||
| 27 | kb_backlight_config.raw = eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_BACKLIGHT); | ||
| 28 | } | ||
| 29 | |||
| 30 | // Called from via_init() if VIA_ENABLE | ||
| 31 | // Called from matrix_init_kb() if not VIA_ENABLE | ||
| 32 | void via_init_kb(void) | ||
| 33 | { | ||
| 34 | // If the EEPROM has the magic, the data is good. | ||
| 35 | // OK to load from EEPROM. | ||
| 36 | if (via_eeprom_is_valid()) { | ||
| 37 | backlight_config_load(); | ||
| 38 | } else { | ||
| 39 | // If the EEPROM has not been saved before, or is out of date, | ||
| 40 | // save the default values to the EEPROM. Default values | ||
| 41 | // come from construction of the backlight_config instance. | ||
| 42 | backlight_config_save(); | ||
| 43 | |||
| 44 | // DO NOT set EEPROM valid here, let caller do this | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | __attribute__ ((weak)) | ||
| 49 | void matrix_init_board(void); | ||
| 50 | |||
| 51 | void matrix_init_kb(void){ | ||
| 52 | // If VIA is disabled, we still need to load backlight settings. | ||
| 53 | // Call via_init_kb() the same way as via_init(), with setting | ||
| 54 | // EEPROM valid afterwards. | ||
| 55 | #ifndef VIA_ENABLE | ||
| 56 | via_init_kb(); | ||
| 57 | via_eeprom_set_valid(true); | ||
| 58 | #endif // VIA_ENABLE | ||
| 59 | backlight_init_ports(); | ||
| 60 | |||
| 61 | matrix_init_board(); | ||
| 62 | } | ||
| 63 | |||
| 64 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 65 | switch (keycode) { | ||
| 66 | case BL_INC: | ||
| 67 | if (record->event.pressed) { | ||
| 68 | kb_backlight_config.level = kb_backlight_config.level + 1; | ||
| 69 | if(kb_backlight_config.level > BACKLIGHT_LEVELS){ | ||
| 70 | kb_backlight_config.level = BACKLIGHT_LEVELS; | ||
| 71 | } | ||
| 72 | backlight_set(kb_backlight_config.level); | ||
| 73 | backlight_config_save(); | ||
| 74 | } | ||
| 75 | return false; | ||
| 76 | case BL_TOGG: | ||
| 77 | if (record->event.pressed) { | ||
| 78 | kb_backlight_config.enable = !kb_backlight_config.enable; | ||
| 79 | if(kb_backlight_config.enable){ | ||
| 80 | backlight_set(kb_backlight_config.level); | ||
| 81 | } else { | ||
| 82 | backlight_set(0); | ||
| 83 | } | ||
| 84 | backlight_config_save(); | ||
| 85 | } | ||
| 86 | return false; | ||
| 87 | |||
| 88 | case BL_DEC: | ||
| 89 | if (record->event.pressed) { | ||
| 90 | if(kb_backlight_config.level <= 1){ | ||
| 91 | kb_backlight_config.level = 0; | ||
| 92 | } else { | ||
| 93 | kb_backlight_config.level = kb_backlight_config.level - 1; | ||
| 94 | } | ||
| 95 | backlight_set(kb_backlight_config.level); | ||
| 96 | backlight_config_save(); | ||
| 97 | } | ||
| 98 | return false; | ||
| 99 | case BL_BRTG: | ||
| 100 | if (record->event.pressed) { | ||
| 101 | kb_backlight_config.breathing = !kb_backlight_config.breathing; | ||
| 102 | breathing_toggle(); | ||
| 103 | backlight_config_save(); | ||
| 104 | } | ||
| 105 | return false; | ||
| 106 | default: | ||
| 107 | break; | ||
| 108 | } | ||
| 109 | |||
| 110 | return process_record_user(keycode, record);; | ||
| 111 | } | ||
| 112 | |||
| 113 | #ifdef VIA_ENABLE | ||
| 114 | |||
| 115 | void backlight_get_value( uint8_t *data ) | ||
| 116 | { | ||
| 117 | uint8_t *value_id = &(data[0]); | ||
| 118 | uint8_t *value_data = &(data[1]); | ||
| 119 | switch (*value_id) | ||
| 120 | { | ||
| 121 | case id_qmk_backlight_brightness: | ||
| 122 | { | ||
| 123 | // level / BACKLIGHT_LEVELS * 255 | ||
| 124 | value_data[0] = ((uint16_t)kb_backlight_config.level) * 255 / BACKLIGHT_LEVELS; | ||
| 125 | break; | ||
| 126 | } | ||
| 127 | case id_qmk_backlight_effect: | ||
| 128 | { | ||
| 129 | value_data[0] = kb_backlight_config.breathing ? 1 : 0; | ||
| 130 | break; | ||
| 131 | } | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 135 | void backlight_set_value( uint8_t *data ) | ||
| 136 | { | ||
| 137 | uint8_t *value_id = &(data[0]); | ||
| 138 | uint8_t *value_data = &(data[1]); | ||
| 139 | switch (*value_id) | ||
| 140 | { | ||
| 141 | case id_qmk_backlight_brightness: | ||
| 142 | { | ||
| 143 | // level / 255 * BACKLIGHT_LEVELS | ||
| 144 | kb_backlight_config.level = ((uint16_t)value_data[0]) * BACKLIGHT_LEVELS / 255; | ||
| 145 | backlight_set(kb_backlight_config.level); | ||
| 146 | break; | ||
| 147 | } | ||
| 148 | case id_qmk_backlight_effect: | ||
| 149 | { | ||
| 150 | if ( value_data[0] == 0 ) { | ||
| 151 | kb_backlight_config.breathing = false; | ||
| 152 | breathing_disable(); | ||
| 153 | } else { | ||
| 154 | kb_backlight_config.breathing = true; | ||
| 155 | breathing_enable(); | ||
| 156 | } | ||
| 157 | break; | ||
| 158 | } | ||
| 159 | } | ||
| 160 | } | ||
| 161 | |||
| 162 | void raw_hid_receive_kb( uint8_t *data, uint8_t length ) | ||
| 163 | { | ||
| 164 | uint8_t *command_id = &(data[0]); | ||
| 165 | uint8_t *command_data = &(data[1]); | ||
| 166 | switch ( *command_id ) | ||
| 167 | { | ||
| 168 | case id_lighting_set_value: | ||
| 169 | { | ||
| 170 | backlight_set_value(command_data); | ||
| 171 | break; | ||
| 172 | } | ||
| 173 | case id_lighting_get_value: | ||
| 174 | { | ||
| 175 | backlight_get_value(command_data); | ||
| 176 | break; | ||
| 177 | } | ||
| 178 | case id_lighting_save: | ||
| 179 | { | ||
| 180 | backlight_config_save(); | ||
| 181 | break; | ||
| 182 | } | ||
| 183 | default: | ||
| 184 | { | ||
| 185 | // Unhandled message. | ||
| 186 | *command_id = id_unhandled; | ||
| 187 | break; | ||
| 188 | } | ||
| 189 | } | ||
| 190 | // DO NOT call raw_hid_send(data,length) here, let caller do this | ||
| 191 | } | ||
| 192 | #endif | ||
| 193 | |||
| 194 | // | ||
| 195 | // In the case of VIA being disabled, we still need to check if | ||
| 196 | // keyboard level EEPROM memory is valid before loading. | ||
| 197 | // Thus these are copies of the same functions in VIA, since | ||
| 198 | // the backlight settings reuse VIA's EEPROM magic/version, | ||
| 199 | // and the ones in via.c won't be compiled in. | ||
| 200 | // | ||
| 201 | // Yes, this is sub-optimal, and is only here for completeness | ||
| 202 | // (i.e. catering to the 1% of people that want wilba.tech LED bling | ||
| 203 | // AND want persistent settings BUT DON'T want to use dynamic keymaps/VIA). | ||
| 204 | // | ||
| 205 | #ifndef VIA_ENABLE | ||
| 206 | |||
| 207 | bool via_eeprom_is_valid(void) | ||
| 208 | { | ||
| 209 | char *p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" | ||
| 210 | uint8_t magic0 = ( ( p[2] & 0x0F ) << 4 ) | ( p[3] & 0x0F ); | ||
| 211 | uint8_t magic1 = ( ( p[5] & 0x0F ) << 4 ) | ( p[6] & 0x0F ); | ||
| 212 | uint8_t magic2 = ( ( p[8] & 0x0F ) << 4 ) | ( p[9] & 0x0F ); | ||
| 213 | |||
| 214 | return (eeprom_read_byte( (void*)VIA_EEPROM_MAGIC_ADDR+0 ) == magic0 && | ||
| 215 | eeprom_read_byte( (void*)VIA_EEPROM_MAGIC_ADDR+1 ) == magic1 && | ||
| 216 | eeprom_read_byte( (void*)VIA_EEPROM_MAGIC_ADDR+2 ) == magic2 ); | ||
| 217 | } | ||
| 218 | |||
| 219 | // Sets VIA/keyboard level usage of EEPROM to valid/invalid | ||
| 220 | // Keyboard level code (eg. via_init_kb()) should not call this | ||
| 221 | void via_eeprom_set_valid(bool valid) | ||
| 222 | { | ||
| 223 | char *p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" | ||
| 224 | uint8_t magic0 = ( ( p[2] & 0x0F ) << 4 ) | ( p[3] & 0x0F ); | ||
| 225 | uint8_t magic1 = ( ( p[5] & 0x0F ) << 4 ) | ( p[6] & 0x0F ); | ||
| 226 | uint8_t magic2 = ( ( p[8] & 0x0F ) << 4 ) | ( p[9] & 0x0F ); | ||
| 227 | |||
| 228 | eeprom_update_byte( (void*)VIA_EEPROM_MAGIC_ADDR+0, valid ? magic0 : 0xFF); | ||
| 229 | eeprom_update_byte( (void*)VIA_EEPROM_MAGIC_ADDR+1, valid ? magic1 : 0xFF); | ||
| 230 | eeprom_update_byte( (void*)VIA_EEPROM_MAGIC_ADDR+2, valid ? magic2 : 0xFF); | ||
| 231 | } | ||
| 232 | |||
| 233 | void via_eeprom_reset(void) | ||
| 234 | { | ||
| 235 | // Set the VIA specific EEPROM state as invalid. | ||
| 236 | via_eeprom_set_valid(false); | ||
| 237 | // Set the TMK/QMK EEPROM state as invalid. | ||
| 238 | eeconfig_disable(); | ||
| 239 | } | ||
| 240 | |||
| 241 | #endif // VIA_ENABLE | ||
diff --git a/keyboards/cannonkeys/stm32f072/keyboard.h b/keyboards/cannonkeys/stm32f072/keyboard.h deleted file mode 100644 index 81dd1b704..000000000 --- a/keyboards/cannonkeys/stm32f072/keyboard.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "quantum.h" | ||
| 4 | |||
| 5 | typedef union { | ||
| 6 | uint8_t raw; | ||
| 7 | struct { | ||
| 8 | bool enable :1; | ||
| 9 | bool breathing : 1; | ||
| 10 | uint8_t level :6; | ||
| 11 | }; | ||
| 12 | } backlight_config_t; | ||
| 13 | |||
| 14 | // Backlighting | ||
| 15 | extern backlight_config_t kb_backlight_config; | ||
| 16 | extern bool kb_backlight_breathing; | ||
| 17 | void backlight_init_ports(void); | ||
| 18 | void backlight_set(uint8_t level); | ||
| 19 | bool is_breathing(void); | ||
| 20 | void breathing_enable(void); | ||
| 21 | void breathing_disable(void); | ||
| 22 | void backlight_config_load(void); | ||
| 23 | void backlight_config_save(void); | ||
diff --git a/keyboards/cannonkeys/stm32f072/led.c b/keyboards/cannonkeys/stm32f072/led.c deleted file mode 100644 index 5c7df47da..000000000 --- a/keyboards/cannonkeys/stm32f072/led.c +++ /dev/null | |||
| @@ -1,251 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include "hal.h" | ||
| 19 | #include "led_custom.h" | ||
| 20 | #include "keyboard.h" | ||
| 21 | #include "printf.h" | ||
| 22 | |||
| 23 | static void breathing_callback(PWMDriver *pwmp); | ||
| 24 | |||
| 25 | static PWMConfig pwmCFG = { | ||
| 26 | 0xFFFF, /* PWM clock frequency */ | ||
| 27 | 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ | ||
| 28 | NULL, /* No Callback */ | ||
| 29 | { | ||
| 30 | {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ | ||
| 31 | {PWM_OUTPUT_DISABLED, NULL}, | ||
| 32 | {PWM_OUTPUT_DISABLED, NULL}, | ||
| 33 | {PWM_OUTPUT_DISABLED, NULL} | ||
| 34 | }, | ||
| 35 | 0, /* HW dependent part.*/ | ||
| 36 | 0 | ||
| 37 | }; | ||
| 38 | |||
| 39 | static PWMConfig pwmCFG_breathing = { | ||
| 40 | 0xFFFF, /* 10kHz PWM clock frequency */ | ||
| 41 | 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ | ||
| 42 | breathing_callback, /* Breathing Callback */ | ||
| 43 | { | ||
| 44 | {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */ | ||
| 45 | {PWM_OUTPUT_DISABLED, NULL}, | ||
| 46 | {PWM_OUTPUT_DISABLED, NULL}, | ||
| 47 | {PWM_OUTPUT_DISABLED, NULL} | ||
| 48 | }, | ||
| 49 | 0, /* HW dependent part.*/ | ||
| 50 | 0 | ||
| 51 | }; | ||
| 52 | |||
| 53 | // See http://jared.geek.nz/2013/feb/linear-led-pwm | ||
| 54 | static uint16_t cie_lightness(uint16_t v) { | ||
| 55 | if (v <= 5243) // if below 8% of max | ||
| 56 | return v / 9; // same as dividing by 900% | ||
| 57 | else { | ||
| 58 | uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare | ||
| 59 | // to get a useful result with integer division, we shift left in the expression above | ||
| 60 | // and revert what we've done again after squaring. | ||
| 61 | y = y * y * y >> 8; | ||
| 62 | if (y > 0xFFFFUL) // prevent overflow | ||
| 63 | return 0xFFFFU; | ||
| 64 | else | ||
| 65 | return (uint16_t) y; | ||
| 66 | } | ||
| 67 | } | ||
| 68 | |||
| 69 | |||
| 70 | uint8_t get_backlight_level(void){ | ||
| 71 | return kb_backlight_config.level; | ||
| 72 | } | ||
| 73 | |||
| 74 | void backlight_init_ports(void) { | ||
| 75 | printf("backlight_init_ports()\n"); | ||
| 76 | palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1)); | ||
| 77 | pwmStart(&PWMD3, &pwmCFG); | ||
| 78 | // pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3, 0xFFFF,cie_lightness(0xFFFF))); | ||
| 79 | if(kb_backlight_config.enable){ | ||
| 80 | backlight_set(kb_backlight_config.level); | ||
| 81 | if(kb_backlight_config.breathing){ | ||
| 82 | breathing_enable(); | ||
| 83 | } | ||
| 84 | } else { | ||
| 85 | backlight_set(0); | ||
| 86 | } | ||
| 87 | |||
| 88 | } | ||
| 89 | |||
| 90 | void backlight_set(uint8_t level) { | ||
| 91 | printf("backlight_set(%d)\n", level); | ||
| 92 | uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS)); | ||
| 93 | printf("duty: (%d)\n", duty); | ||
| 94 | if (level == 0) { | ||
| 95 | // Turn backlight off | ||
| 96 | pwmDisableChannel(&PWMD3, 0); | ||
| 97 | } else { | ||
| 98 | // Turn backlight on | ||
| 99 | if(!is_breathing()){ | ||
| 100 | pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3,0xFFFF,duty)); | ||
| 101 | } | ||
| 102 | } | ||
| 103 | } | ||
| 104 | |||
| 105 | |||
| 106 | uint8_t backlight_tick = 0; | ||
| 107 | |||
| 108 | void backlight_task(void) { | ||
| 109 | } | ||
| 110 | |||
| 111 | #define BREATHING_NO_HALT 0 | ||
| 112 | #define BREATHING_HALT_OFF 1 | ||
| 113 | #define BREATHING_HALT_ON 2 | ||
| 114 | #define BREATHING_STEPS 128 | ||
| 115 | |||
| 116 | static uint8_t breathing_period = BREATHING_PERIOD; | ||
| 117 | static uint8_t breathing_halt = BREATHING_NO_HALT; | ||
| 118 | static uint16_t breathing_counter = 0; | ||
| 119 | |||
| 120 | bool is_breathing(void) { | ||
| 121 | return PWMD3.config == &pwmCFG_breathing; | ||
| 122 | } | ||
| 123 | |||
| 124 | #define breathing_min() do {breathing_counter = 0;} while (0) | ||
| 125 | #define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0) | ||
| 126 | |||
| 127 | |||
| 128 | void breathing_interrupt_enable(void){ | ||
| 129 | pwmStop(&PWMD3); | ||
| 130 | pwmStart(&PWMD3, &pwmCFG_breathing); | ||
| 131 | chSysLockFromISR(); | ||
| 132 | pwmEnablePeriodicNotification(&PWMD3); | ||
| 133 | pwmEnableChannelI( | ||
| 134 | &PWMD3, | ||
| 135 | 0, | ||
| 136 | PWM_FRACTION_TO_WIDTH( | ||
| 137 | &PWMD3, | ||
| 138 | 0xFFFF, | ||
| 139 | 0xFFFF | ||
| 140 | ) | ||
| 141 | ); | ||
| 142 | chSysUnlockFromISR(); | ||
| 143 | } | ||
| 144 | |||
| 145 | void breathing_interrupt_disable(void){ | ||
| 146 | pwmStop(&PWMD3); | ||
| 147 | pwmStart(&PWMD3, &pwmCFG); | ||
| 148 | } | ||
| 149 | |||
| 150 | void breathing_enable(void) | ||
| 151 | { | ||
| 152 | breathing_counter = 0; | ||
| 153 | breathing_halt = BREATHING_NO_HALT; | ||
| 154 | breathing_interrupt_enable(); | ||
| 155 | } | ||
| 156 | |||
| 157 | void breathing_pulse(void) | ||
| 158 | { | ||
| 159 | if (get_backlight_level() == 0) | ||
| 160 | breathing_min(); | ||
| 161 | else | ||
| 162 | breathing_max(); | ||
| 163 | breathing_halt = BREATHING_HALT_ON; | ||
| 164 | breathing_interrupt_enable(); | ||
| 165 | } | ||
| 166 | |||
| 167 | void breathing_disable(void) | ||
| 168 | { | ||
| 169 | printf("breathing_disable()\n"); | ||
| 170 | breathing_interrupt_disable(); | ||
| 171 | // Restore backlight level | ||
| 172 | backlight_set(get_backlight_level()); | ||
| 173 | } | ||
| 174 | |||
| 175 | void breathing_self_disable(void) | ||
| 176 | { | ||
| 177 | if (get_backlight_level() == 0) | ||
| 178 | breathing_halt = BREATHING_HALT_OFF; | ||
| 179 | else | ||
| 180 | breathing_halt = BREATHING_HALT_ON; | ||
| 181 | } | ||
| 182 | |||
| 183 | void breathing_toggle(void) { | ||
| 184 | if (is_breathing()){ | ||
| 185 | printf("disable breathing\n"); | ||
| 186 | breathing_disable(); | ||
| 187 | } else { | ||
| 188 | printf("enable breathing\n"); | ||
| 189 | breathing_enable(); | ||
| 190 | } | ||
| 191 | } | ||
| 192 | |||
| 193 | void breathing_period_set(uint8_t value) | ||
| 194 | { | ||
| 195 | if (!value) | ||
| 196 | value = 1; | ||
| 197 | breathing_period = value; | ||
| 198 | } | ||
| 199 | |||
| 200 | void breathing_period_default(void) { | ||
| 201 | breathing_period_set(BREATHING_PERIOD); | ||
| 202 | } | ||
| 203 | |||
| 204 | void breathing_period_inc(void) | ||
| 205 | { | ||
| 206 | breathing_period_set(breathing_period+1); | ||
| 207 | } | ||
| 208 | |||
| 209 | void breathing_period_dec(void) | ||
| 210 | { | ||
| 211 | breathing_period_set(breathing_period-1); | ||
| 212 | } | ||
| 213 | |||
| 214 | /* To generate breathing curve in python: | ||
| 215 | * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] | ||
| 216 | */ | ||
| 217 | static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | ||
| 218 | |||
| 219 | // Use this before the cie_lightness function. | ||
| 220 | static inline uint16_t scale_backlight(uint16_t v) { | ||
| 221 | return v / BACKLIGHT_LEVELS * get_backlight_level(); | ||
| 222 | } | ||
| 223 | |||
| 224 | static void breathing_callback(PWMDriver *pwmp) | ||
| 225 | { | ||
| 226 | (void)pwmp; | ||
| 227 | uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS; | ||
| 228 | // resetting after one period to prevent ugly reset at overflow. | ||
| 229 | breathing_counter = (breathing_counter + 1) % (breathing_period * 256); | ||
| 230 | uint8_t index = breathing_counter / interval % BREATHING_STEPS; | ||
| 231 | |||
| 232 | if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || | ||
| 233 | ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) | ||
| 234 | { | ||
| 235 | breathing_interrupt_disable(); | ||
| 236 | } | ||
| 237 | |||
| 238 | uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256)); | ||
| 239 | |||
| 240 | chSysLockFromISR(); | ||
| 241 | pwmEnableChannelI( | ||
| 242 | &PWMD3, | ||
| 243 | 0, | ||
| 244 | PWM_FRACTION_TO_WIDTH( | ||
| 245 | &PWMD3, | ||
| 246 | 0xFFFF, | ||
| 247 | duty | ||
| 248 | ) | ||
| 249 | ); | ||
| 250 | chSysUnlockFromISR(); | ||
| 251 | } | ||
diff --git a/keyboards/cannonkeys/stm32f072/led_custom.h b/keyboards/cannonkeys/stm32f072/led_custom.h deleted file mode 100644 index 550d5b84c..000000000 --- a/keyboards/cannonkeys/stm32f072/led_custom.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | void backlight_task(void); | ||
| 4 | void breathing_interrupt_disable(void); | ||
| 5 | void breathing_interrupt_enable(void); | ||
| 6 | void breathing_toggle(void); | ||
| 7 | void breathing_enable(void); | ||
| 8 | void breathing_disable(void); | ||
diff --git a/keyboards/cannonkeys/stm32f072/ws2812.c b/keyboards/cannonkeys/stm32f072/ws2812.c deleted file mode 100644 index b2f2384f2..000000000 --- a/keyboards/cannonkeys/stm32f072/ws2812.c +++ /dev/null | |||
| @@ -1,151 +0,0 @@ | |||
| 1 | #include "ch.h" | ||
| 2 | #include "hal.h" | ||
| 3 | |||
| 4 | #include "ws2812.h" | ||
| 5 | |||
| 6 | #define BYTES_FOR_LED_BYTE 4 | ||
| 7 | #define NB_COLORS 3 | ||
| 8 | #define BYTES_FOR_LED BYTES_FOR_LED_BYTE*NB_COLORS | ||
| 9 | #define DATA_SIZE BYTES_FOR_LED*NB_LEDS | ||
| 10 | #define RESET_SIZE 200 | ||
| 11 | |||
| 12 | // Define the spi your LEDs are plugged to here | ||
| 13 | #define LEDS_SPI WS2812_SPI | ||
| 14 | // Define the number of LEDs you wish to control in your LED strip | ||
| 15 | #define NB_LEDS RGBLED_NUM | ||
| 16 | |||
| 17 | #define LED_SPIRAL 0 | ||
| 18 | |||
| 19 | static uint8_t txbuf[DATA_SIZE + RESET_SIZE]; | ||
| 20 | static uint8_t get_protocol_eq(uint8_t data, int pos); | ||
| 21 | |||
| 22 | /* | ||
| 23 | * This lib is meant to be used asynchronously, thus the colors contained in | ||
| 24 | * the txbuf will be sent in loop, so that the colors are always the ones you | ||
| 25 | * put in the table (the user thus have less to worry about) | ||
| 26 | * | ||
| 27 | * Since the data are sent via DMA, and the call to spiSend is a blocking one, | ||
| 28 | * the processor ressources are not used to much, if you see your program being | ||
| 29 | * too slow, simply add a: | ||
| 30 | * chThdSleepMilliseconds(x); | ||
| 31 | * after the spiSend, where you increment x untill you are satisfied with your | ||
| 32 | * program speed, another trick may be to lower this thread priority : your call | ||
| 33 | */ | ||
| 34 | static THD_WORKING_AREA(LEDS_THREAD_WA, 128); | ||
| 35 | static THD_FUNCTION(ledsThread, arg) { | ||
| 36 | (void) arg; | ||
| 37 | while(1){ | ||
| 38 | spiSend(&LEDS_SPI, DATA_SIZE + RESET_SIZE, txbuf); | ||
| 39 | } | ||
| 40 | } | ||
| 41 | |||
| 42 | #if LED_SPIRAL | ||
| 43 | /* | ||
| 44 | * 'Led spiral' is a simple demo in which we put all the leds to the same | ||
| 45 | * color, where this color does all the hsv circle in loop. | ||
| 46 | * If you want to launch the thread that will chage the led colors to the | ||
| 47 | * appropriate value, simply set LED_SPIRAL to 1. | ||
| 48 | */ | ||
| 49 | |||
| 50 | static THD_WORKING_AREA(HSVTRANS_WA, 128); | ||
| 51 | static THD_FUNCTION(hsv_transThread, arg) { | ||
| 52 | (void) arg; | ||
| 53 | hsv_color color = {0, 255, 255}; | ||
| 54 | while(1){ | ||
| 55 | color.h += 1; | ||
| 56 | color.h %= 256; | ||
| 57 | set_leds_color_hsv(color); | ||
| 58 | chThdSleepMilliseconds(50); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | #endif | ||
| 62 | |||
| 63 | static const SPIConfig spicfg = { | ||
| 64 | false, | ||
| 65 | NULL, | ||
| 66 | GPIOB, | ||
| 67 | 15, | ||
| 68 | SPI_CR1_BR_1|SPI_CR1_BR_0 // baudrate : fpclk / 8 => 1tick is 0.32us | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Function used to initialize the driver. | ||
| 73 | * | ||
| 74 | * Starts by shutting off all the LEDs. | ||
| 75 | * Then gets access on the LED_SPI driver. | ||
| 76 | * May eventually launch an animation on the LEDs (e.g. a thread setting the | ||
| 77 | * txbuff values) | ||
| 78 | */ | ||
| 79 | void leds_init(void){ | ||
| 80 | for(int i = 0; i < RESET_SIZE; i++) | ||
| 81 | txbuf[DATA_SIZE+i] = 0x00; | ||
| 82 | spiAcquireBus(&LEDS_SPI); /* Acquire ownership of the bus. */ | ||
| 83 | spiStart(&LEDS_SPI, &spicfg); /* Setup transfer parameters. */ | ||
| 84 | spiSelect(&LEDS_SPI); /* Slave Select assertion. */ | ||
| 85 | chThdCreateStatic(LEDS_THREAD_WA, sizeof(LEDS_THREAD_WA),NORMALPRIO, ledsThread, NULL); | ||
| 86 | #if LED_SPIRAL | ||
| 87 | chThdCreateStatic(HSVTRANS_WA, sizeof(HSVTRANS_WA), | ||
| 88 | NORMALPRIO, hsv_transThread, NULL); | ||
| 89 | #endif | ||
| 90 | } | ||
| 91 | |||
| 92 | /* | ||
| 93 | * As the trick here is to use the SPI to send a huge pattern of 0 and 1 to | ||
| 94 | * the ws2812b protocol, we use this helper function to translate bytes into | ||
| 95 | * 0s and 1s for the LED (with the appropriate timing). | ||
| 96 | */ | ||
| 97 | static uint8_t get_protocol_eq(uint8_t data, int pos){ | ||
| 98 | uint8_t eq = 0; | ||
| 99 | if (data & (1 << (2*(3-pos)))) | ||
| 100 | eq = 0b1110; | ||
| 101 | else | ||
| 102 | eq = 0b1000; | ||
| 103 | if (data & (2 << (2*(3-pos)))) | ||
| 104 | eq += 0b11100000; | ||
| 105 | else | ||
| 106 | eq += 0b10000000; | ||
| 107 | return eq; | ||
| 108 | } | ||
| 109 | |||
| 110 | // | ||
| 111 | ///* | ||
| 112 | // * If you want to set a LED's color in the RGB color space, simply call this | ||
| 113 | // * function with a hsv_color containing the desired color and the index of the | ||
| 114 | // * led on the LED strip (starting from 0, the first one being the closest the | ||
| 115 | // * first plugged to the board) | ||
| 116 | // * | ||
| 117 | // * Only set the color of the LEDs through the functions given by this API | ||
| 118 | // * (unless you really know what you are doing) | ||
| 119 | // */ | ||
| 120 | void set_led_color_rgb(LED_TYPE color, int pos){ | ||
| 121 | for(int j = 0; j < 4; j++) | ||
| 122 | txbuf[BYTES_FOR_LED*pos + j] = get_protocol_eq(color.g, j); | ||
| 123 | for(int j = 0; j < 4; j++) | ||
| 124 | txbuf[BYTES_FOR_LED*pos + BYTES_FOR_LED_BYTE+j] = get_protocol_eq(color.r, j); | ||
| 125 | for(int j = 0; j < 4; j++) | ||
| 126 | txbuf[BYTES_FOR_LED*pos + BYTES_FOR_LED_BYTE*2+j] = get_protocol_eq(color.b, j); | ||
| 127 | } | ||
| 128 | |||
| 129 | |||
| 130 | void WS2812_init(void) { | ||
| 131 | leds_init(); | ||
| 132 | } | ||
| 133 | |||
| 134 | void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) { | ||
| 135 | uint8_t i = 0; | ||
| 136 | while (i < number_of_leds) { | ||
| 137 | set_led_color_rgb(ledarray[i], i); | ||
| 138 | i++; | ||
| 139 | } | ||
| 140 | } | ||
| 141 | |||
| 142 | |||
| 143 | void set_leds_color_rgb(LED_TYPE color){ | ||
| 144 | for(int i = 0; i < NB_LEDS; i++) | ||
| 145 | set_led_color_rgb(color, i); | ||
| 146 | } | ||
| 147 | |||
| 148 | |||
| 149 | void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds) { | ||
| 150 | |||
| 151 | } | ||
diff --git a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null | |||
| @@ -1,268 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "hal.h" | ||
| 23 | #include "stm32_gpio.h" | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver local definitions. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /*===========================================================================*/ | ||
| 30 | /* Driver exported variables. */ | ||
| 31 | /*===========================================================================*/ | ||
| 32 | |||
| 33 | /*===========================================================================*/ | ||
| 34 | /* Driver local variables and types. */ | ||
| 35 | /*===========================================================================*/ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @brief Type of STM32 GPIO port setup. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | uint32_t moder; | ||
| 42 | uint32_t otyper; | ||
| 43 | uint32_t ospeedr; | ||
| 44 | uint32_t pupdr; | ||
| 45 | uint32_t odr; | ||
| 46 | uint32_t afrl; | ||
| 47 | uint32_t afrh; | ||
| 48 | } gpio_setup_t; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Type of STM32 GPIO initialization data. | ||
| 52 | */ | ||
| 53 | typedef struct { | ||
| 54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
| 55 | gpio_setup_t PAData; | ||
| 56 | #endif | ||
| 57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
| 58 | gpio_setup_t PBData; | ||
| 59 | #endif | ||
| 60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
| 61 | gpio_setup_t PCData; | ||
| 62 | #endif | ||
| 63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
| 64 | gpio_setup_t PDData; | ||
| 65 | #endif | ||
| 66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
| 67 | gpio_setup_t PEData; | ||
| 68 | #endif | ||
| 69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
| 70 | gpio_setup_t PFData; | ||
| 71 | #endif | ||
| 72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
| 73 | gpio_setup_t PGData; | ||
| 74 | #endif | ||
| 75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
| 76 | gpio_setup_t PHData; | ||
| 77 | #endif | ||
| 78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
| 79 | gpio_setup_t PIData; | ||
| 80 | #endif | ||
| 81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
| 82 | gpio_setup_t PJData; | ||
| 83 | #endif | ||
| 84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
| 85 | gpio_setup_t PKData; | ||
| 86 | #endif | ||
| 87 | } gpio_config_t; | ||
| 88 | |||
| 89 | /** | ||
| 90 | * @brief STM32 GPIO static initialization data. | ||
| 91 | */ | ||
| 92 | static const gpio_config_t gpio_default_config = { | ||
| 93 | #if STM32_HAS_GPIOA | ||
| 94 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
| 95 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, | ||
| 96 | #endif | ||
| 97 | #if STM32_HAS_GPIOB | ||
| 98 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
| 99 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, | ||
| 100 | #endif | ||
| 101 | #if STM32_HAS_GPIOC | ||
| 102 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
| 103 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, | ||
| 104 | #endif | ||
| 105 | #if STM32_HAS_GPIOD | ||
| 106 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
| 107 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, | ||
| 108 | #endif | ||
| 109 | #if STM32_HAS_GPIOE | ||
| 110 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
| 111 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, | ||
| 112 | #endif | ||
| 113 | #if STM32_HAS_GPIOF | ||
| 114 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
| 115 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, | ||
| 116 | #endif | ||
| 117 | #if STM32_HAS_GPIOG | ||
| 118 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
| 119 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, | ||
| 120 | #endif | ||
| 121 | #if STM32_HAS_GPIOH | ||
| 122 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
| 123 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, | ||
| 124 | #endif | ||
| 125 | #if STM32_HAS_GPIOI | ||
| 126 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
| 127 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, | ||
| 128 | #endif | ||
| 129 | #if STM32_HAS_GPIOJ | ||
| 130 | {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
| 131 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, | ||
| 132 | #endif | ||
| 133 | #if STM32_HAS_GPIOK | ||
| 134 | {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
| 135 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} | ||
| 136 | #endif | ||
| 137 | }; | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /* Driver local functions. */ | ||
| 141 | /*===========================================================================*/ | ||
| 142 | |||
| 143 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
| 144 | |||
| 145 | gpiop->OTYPER = config->otyper; | ||
| 146 | gpiop->OSPEEDR = config->ospeedr; | ||
| 147 | gpiop->PUPDR = config->pupdr; | ||
| 148 | gpiop->ODR = config->odr; | ||
| 149 | gpiop->AFRL = config->afrl; | ||
| 150 | gpiop->AFRH = config->afrh; | ||
| 151 | gpiop->MODER = config->moder; | ||
| 152 | } | ||
| 153 | |||
| 154 | static void stm32_gpio_init(void) { | ||
| 155 | |||
| 156 | /* Enabling GPIO-related clocks, the mask comes from the | ||
| 157 | registry header file.*/ | ||
| 158 | rccResetAHB(STM32_GPIO_EN_MASK); | ||
| 159 | rccEnableAHB(STM32_GPIO_EN_MASK, true); | ||
| 160 | |||
| 161 | /* Initializing all the defined GPIO ports.*/ | ||
| 162 | #if STM32_HAS_GPIOA | ||
| 163 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
| 164 | #endif | ||
| 165 | #if STM32_HAS_GPIOB | ||
| 166 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
| 167 | #endif | ||
| 168 | #if STM32_HAS_GPIOC | ||
| 169 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
| 170 | #endif | ||
| 171 | #if STM32_HAS_GPIOD | ||
| 172 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
| 173 | #endif | ||
| 174 | #if STM32_HAS_GPIOE | ||
| 175 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
| 176 | #endif | ||
| 177 | #if STM32_HAS_GPIOF | ||
| 178 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
| 179 | #endif | ||
| 180 | #if STM32_HAS_GPIOG | ||
| 181 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
| 182 | #endif | ||
| 183 | #if STM32_HAS_GPIOH | ||
| 184 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
| 185 | #endif | ||
| 186 | #if STM32_HAS_GPIOI | ||
| 187 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
| 188 | #endif | ||
| 189 | #if STM32_HAS_GPIOJ | ||
| 190 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
| 191 | #endif | ||
| 192 | #if STM32_HAS_GPIOK | ||
| 193 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* Driver interrupt handlers. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /*===========================================================================*/ | ||
| 202 | /* Driver exported functions. */ | ||
| 203 | /*===========================================================================*/ | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @brief Early initialization code. | ||
| 207 | * @details GPIO ports and system clocks are initialized before everything | ||
| 208 | * else. | ||
| 209 | */ | ||
| 210 | void __early_init(void) { | ||
| 211 | extern void enter_bootloader_mode_if_requested(void); | ||
| 212 | enter_bootloader_mode_if_requested(); | ||
| 213 | stm32_gpio_init(); | ||
| 214 | stm32_clock_init(); | ||
| 215 | } | ||
| 216 | |||
| 217 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
| 218 | /** | ||
| 219 | * @brief SDC card detection. | ||
| 220 | */ | ||
| 221 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
| 222 | |||
| 223 | (void)sdcp; | ||
| 224 | /* TODO: Fill the implementation.*/ | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | |||
| 228 | /** | ||
| 229 | * @brief SDC card write protection detection. | ||
| 230 | */ | ||
| 231 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
| 232 | |||
| 233 | (void)sdcp; | ||
| 234 | /* TODO: Fill the implementation.*/ | ||
| 235 | return false; | ||
| 236 | } | ||
| 237 | #endif /* HAL_USE_SDC */ | ||
| 238 | |||
| 239 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
| 240 | /** | ||
| 241 | * @brief MMC_SPI card detection. | ||
| 242 | */ | ||
| 243 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
| 244 | |||
| 245 | (void)mmcp; | ||
| 246 | /* TODO: Fill the implementation.*/ | ||
| 247 | return true; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @brief MMC_SPI card write protection detection. | ||
| 252 | */ | ||
| 253 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
| 254 | |||
| 255 | (void)mmcp; | ||
| 256 | /* TODO: Fill the implementation.*/ | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif | ||
| 260 | |||
| 261 | /** | ||
| 262 | * @brief Board-specific initialization code. | ||
| 263 | * @todo Add your board-specific code, if any. | ||
| 264 | */ | ||
| 265 | void boardInit(void) { | ||
| 266 | SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; | ||
| 267 | SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); | ||
| 268 | } | ||
diff --git a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 57636d1f1..000000000 --- a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,940 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef BOARD_H | ||
| 23 | #define BOARD_H | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver constants. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Setup for ST STM32F072B-Discovery board. | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Board identifier. | ||
| 35 | */ | ||
| 36 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 37 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Board oscillators-related settings. | ||
| 41 | * NOTE: HSE not fitted. | ||
| 42 | */ | ||
| 43 | #if !defined(STM32_LSECLK) | ||
| 44 | #define STM32_LSECLK 32768 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define STM32_LSEDRV (3U << 3U) | ||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK) | ||
| 50 | #define STM32_HSECLK 0U | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define STM32_HSE_BYPASS | ||
| 54 | |||
| 55 | /* | ||
| 56 | * MCU type as defined in the ST header. | ||
| 57 | */ | ||
| 58 | #define STM32F072xB | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IO pins assignments. | ||
| 62 | */ | ||
| 63 | #define GPIOA_BUTTON 0U | ||
| 64 | #define GPIOA_PIN1 1U | ||
| 65 | #define GPIOA_PIN2 2U | ||
| 66 | #define GPIOA_PIN3 3U | ||
| 67 | #define GPIOA_PIN4 4U | ||
| 68 | #define GPIOA_PIN5 5U | ||
| 69 | #define GPIOA_PIN6 6U | ||
| 70 | #define GPIOA_PIN7 7U | ||
| 71 | #define GPIOA_PIN8 8U | ||
| 72 | #define GPIOA_PIN9 9U | ||
| 73 | #define GPIOA_PIN10 10U | ||
| 74 | #define GPIOA_USB_DM 11U | ||
| 75 | #define GPIOA_USB_DP 12U | ||
| 76 | #define GPIOA_SWDIO 13U | ||
| 77 | #define GPIOA_SWCLK 14U | ||
| 78 | #define GPIOA_PIN15 15U | ||
| 79 | |||
| 80 | #define GPIOB_PIN0 0U | ||
| 81 | #define GPIOB_PIN1 1U | ||
| 82 | #define GPIOB_PIN2 2U | ||
| 83 | #define GPIOB_PIN3 3U | ||
| 84 | #define GPIOB_PIN4 4U | ||
| 85 | #define GPIOB_PIN5 5U | ||
| 86 | #define GPIOB_PIN6 6U | ||
| 87 | #define GPIOB_PIN7 7U | ||
| 88 | #define GPIOB_PIN8 8U | ||
| 89 | #define GPIOB_PIN9 9U | ||
| 90 | #define GPIOB_PIN10 10U | ||
| 91 | #define GPIOB_PIN11 11U | ||
| 92 | #define GPIOB_PIN12 12U | ||
| 93 | #define GPIOB_SPI2_SCK 13U | ||
| 94 | #define GPIOB_SPI2_MISO 14U | ||
| 95 | #define GPIOB_SPI2_MOSI 15U | ||
| 96 | |||
| 97 | #define GPIOC_MEMS_CS 0U | ||
| 98 | #define GPIOC_PIN1 1U | ||
| 99 | #define GPIOC_PIN2 2U | ||
| 100 | #define GPIOC_PIN3 3U | ||
| 101 | #define GPIOC_PIN4 4U | ||
| 102 | #define GPIOC_PIN5 5U | ||
| 103 | #define GPIOC_LED_RED 6U | ||
| 104 | #define GPIOC_LED_BLUE 7U | ||
| 105 | #define GPIOC_LED_ORANGE 8U | ||
| 106 | #define GPIOC_LED_GREEN 9U | ||
| 107 | #define GPIOC_PIN10 10U | ||
| 108 | #define GPIOC_PIN11 11U | ||
| 109 | #define GPIOC_PIN12 12U | ||
| 110 | #define GPIOC_PIN13 13U | ||
| 111 | #define GPIOC_OSC32_IN 14U | ||
| 112 | #define GPIOC_OSC32_OUT 15U | ||
| 113 | |||
| 114 | #define GPIOD_PIN0 0U | ||
| 115 | #define GPIOD_PIN1 1U | ||
| 116 | #define GPIOD_PIN2 2U | ||
| 117 | #define GPIOD_PIN3 3U | ||
| 118 | #define GPIOD_PIN4 4U | ||
| 119 | #define GPIOD_PIN5 5U | ||
| 120 | #define GPIOD_PIN6 6U | ||
| 121 | #define GPIOD_PIN7 7U | ||
| 122 | #define GPIOD_PIN8 8U | ||
| 123 | #define GPIOD_PIN9 9U | ||
| 124 | #define GPIOD_PIN10 10U | ||
| 125 | #define GPIOD_PIN11 11U | ||
| 126 | #define GPIOD_PIN12 12U | ||
| 127 | #define GPIOD_PIN13 13U | ||
| 128 | #define GPIOD_PIN14 14U | ||
| 129 | #define GPIOD_PIN15 15U | ||
| 130 | |||
| 131 | #define GPIOE_PIN0 0U | ||
| 132 | #define GPIOE_PIN1 1U | ||
| 133 | #define GPIOE_PIN2 2U | ||
| 134 | #define GPIOE_PIN3 3U | ||
| 135 | #define GPIOE_PIN4 4U | ||
| 136 | #define GPIOE_PIN5 5U | ||
| 137 | #define GPIOE_PIN6 6U | ||
| 138 | #define GPIOE_PIN7 7U | ||
| 139 | #define GPIOE_PIN8 8U | ||
| 140 | #define GPIOE_PIN9 9U | ||
| 141 | #define GPIOE_PIN10 10U | ||
| 142 | #define GPIOE_PIN11 11U | ||
| 143 | #define GPIOE_PIN12 12U | ||
| 144 | #define GPIOE_PIN13 13U | ||
| 145 | #define GPIOE_PIN14 14U | ||
| 146 | #define GPIOE_PIN15 15U | ||
| 147 | |||
| 148 | #define GPIOF_OSC_IN 0U | ||
| 149 | #define GPIOF_OSC_OUT 1U | ||
| 150 | #define GPIOF_PIN2 2U | ||
| 151 | #define GPIOF_PIN3 3U | ||
| 152 | #define GPIOF_PIN4 4U | ||
| 153 | #define GPIOF_PIN5 5U | ||
| 154 | #define GPIOF_PIN6 6U | ||
| 155 | #define GPIOF_PIN7 7U | ||
| 156 | #define GPIOF_PIN8 8U | ||
| 157 | #define GPIOF_PIN9 9U | ||
| 158 | #define GPIOF_PIN10 10U | ||
| 159 | #define GPIOF_PIN11 11U | ||
| 160 | #define GPIOF_PIN12 12U | ||
| 161 | #define GPIOF_PIN13 13U | ||
| 162 | #define GPIOF_PIN14 14U | ||
| 163 | #define GPIOF_PIN15 15U | ||
| 164 | |||
| 165 | /* | ||
| 166 | * IO lines assignments. | ||
| 167 | */ | ||
| 168 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 169 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 170 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 171 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 172 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 173 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 174 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 175 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 176 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 177 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 178 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 179 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 180 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 181 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 182 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 183 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 184 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 185 | |||
| 186 | /*===========================================================================*/ | ||
| 187 | /* Driver pre-compile time settings. */ | ||
| 188 | /*===========================================================================*/ | ||
| 189 | |||
| 190 | /*===========================================================================*/ | ||
| 191 | /* Derived constants and error checks. */ | ||
| 192 | /*===========================================================================*/ | ||
| 193 | |||
| 194 | /*===========================================================================*/ | ||
| 195 | /* Driver data structures and types. */ | ||
| 196 | /*===========================================================================*/ | ||
| 197 | |||
| 198 | /*===========================================================================*/ | ||
| 199 | /* Driver macros. */ | ||
| 200 | /*===========================================================================*/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 204 | * in the initialization code. | ||
| 205 | * Please refer to the STM32 Reference Manual for details. | ||
| 206 | */ | ||
| 207 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 208 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 209 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 210 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 211 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 212 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 213 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 214 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 215 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 216 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 217 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 218 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 219 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 220 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 221 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 222 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * GPIOA setup: | ||
| 226 | * | ||
| 227 | * PA0 - BUTTON (input floating). | ||
| 228 | * PA1 - PIN1 (input pullup). | ||
| 229 | * PA2 - PIN2 (input pullup). | ||
| 230 | * PA3 - PIN3 (input pullup). | ||
| 231 | * PA4 - PIN4 (input pullup). | ||
| 232 | * PA5 - PIN5 (input pullup). | ||
| 233 | * PA6 - PIN6 (input pullup). | ||
| 234 | * PA7 - PIN7 (input pullup). | ||
| 235 | * PA8 - PIN8 (input pullup). | ||
| 236 | * PA9 - PIN9 (input pullup). | ||
| 237 | * PA10 - PIN10 (input pullup). | ||
| 238 | * PA11 - USB_DM (input floating). | ||
| 239 | * PA12 - USB_DP (input floating). | ||
| 240 | * PA13 - SWDIO (alternate 0). | ||
| 241 | * PA14 - SWCLK (alternate 0). | ||
| 242 | * PA15 - PIN15 (input pullup). | ||
| 243 | */ | ||
| 244 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 246 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 247 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 248 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 249 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 250 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 251 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 252 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 253 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 254 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 255 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 256 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 257 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 258 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 259 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 260 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 265 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 267 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 268 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 269 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 270 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 271 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 272 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 273 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 274 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 275 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 276 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 277 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 278 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 279 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 280 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 281 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 282 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 283 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 284 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 285 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 286 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 287 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 288 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 289 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 290 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 291 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 292 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 294 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 295 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 296 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 297 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 298 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 299 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 300 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 301 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 302 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 303 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 304 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 305 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 306 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 307 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 308 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 310 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 311 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 312 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 313 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 314 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 315 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 316 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 317 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 318 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 319 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 320 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 321 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 322 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 323 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 324 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 326 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 327 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 328 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 329 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 330 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 331 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 332 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 333 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 334 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 335 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 336 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 337 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 338 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 339 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 340 | |||
| 341 | /* | ||
| 342 | * GPIOB setup: | ||
| 343 | * | ||
| 344 | * PB0 - PIN0 (input pullup). | ||
| 345 | * PB1 - PIN1 (input pullup). | ||
| 346 | * PB2 - PIN2 (input pullup). | ||
| 347 | * PB3 - PIN3 (input pullup). | ||
| 348 | * PB4 - PIN4 (input pullup). | ||
| 349 | * PB5 - PIN5 (input pullup). | ||
| 350 | * PB6 - PIN6 (input pullup). | ||
| 351 | * PB7 - PIN7 (input pullup). | ||
| 352 | * PB8 - PIN8 (input pullup). | ||
| 353 | * PB9 - PIN9 (input pullup). | ||
| 354 | * PB10 - PIN10 (input pullup). | ||
| 355 | * PB11 - PIN11 (input pullup). | ||
| 356 | * PB12 - PIN12 (input pullup). | ||
| 357 | * PB13 - SPI2_SCK (alternate 0). | ||
| 358 | * PB14 - SPI2_MISO (alternate 0). | ||
| 359 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 360 | */ | ||
| 361 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 362 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 363 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 364 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 365 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 366 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 367 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 368 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 369 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 370 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 371 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 372 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 373 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 374 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 375 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 376 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 377 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 379 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 380 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 381 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 382 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 383 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 384 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 385 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 386 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 387 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 388 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 389 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 390 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 391 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 392 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 393 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 395 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 396 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 397 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 398 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 399 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 400 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 401 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 402 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 403 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 404 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 405 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 406 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 407 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 408 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 409 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 410 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 411 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 412 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 413 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 414 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 415 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 416 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 417 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 418 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 419 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 420 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 421 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 422 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 423 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 424 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 425 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 427 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 428 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 429 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 430 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 431 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 432 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 433 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 434 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 435 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 436 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 437 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 438 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 439 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 440 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 441 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 443 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 444 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 445 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 446 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 447 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 448 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 449 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 450 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 451 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 452 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 453 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 454 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 455 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 456 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 457 | |||
| 458 | /* | ||
| 459 | * GPIOC setup: | ||
| 460 | * | ||
| 461 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 462 | * PC1 - PIN1 (input pullup). | ||
| 463 | * PC2 - PIN2 (input pullup). | ||
| 464 | * PC3 - PIN3 (input pullup). | ||
| 465 | * PC4 - PIN4 (input pullup). | ||
| 466 | * PC5 - PIN5 (input pullup). | ||
| 467 | * PC6 - LED_RED (output pushpull maximum). | ||
| 468 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 469 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 470 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 471 | * PC10 - PIN10 (input pullup). | ||
| 472 | * PC11 - PIN11 (input pullup). | ||
| 473 | * PC12 - PIN12 (input pullup). | ||
| 474 | * PC13 - PIN13 (input pullup). | ||
| 475 | * PC14 - OSC32_IN (input floating). | ||
| 476 | * PC15 - OSC32_OUT (input floating). | ||
| 477 | */ | ||
| 478 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 480 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 481 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 482 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 483 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 484 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 485 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 486 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 487 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 488 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 489 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 490 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 491 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 492 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 493 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 494 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 496 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 497 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 498 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 499 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 500 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 501 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 502 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 503 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 504 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 505 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 506 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 507 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 508 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 509 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 510 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 511 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 512 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 513 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 514 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 515 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 516 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 517 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 518 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 519 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 520 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 521 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 522 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 523 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 524 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 525 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 526 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 527 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 528 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 529 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 530 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 531 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 532 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 533 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 534 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 535 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 536 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 537 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 538 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 539 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 540 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 541 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 542 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 544 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 545 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 546 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 547 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 548 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 549 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 550 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 551 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 552 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 553 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 554 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 555 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 556 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 557 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 558 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 560 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 561 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 562 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 563 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 564 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 565 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 566 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 567 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 568 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 569 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 570 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 571 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 572 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 573 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 574 | |||
| 575 | /* | ||
| 576 | * GPIOD setup: | ||
| 577 | * | ||
| 578 | * PD0 - PIN0 (input pullup). | ||
| 579 | * PD1 - PIN1 (input pullup). | ||
| 580 | * PD2 - PIN2 (input pullup). | ||
| 581 | * PD3 - PIN3 (input pullup). | ||
| 582 | * PD4 - PIN4 (input pullup). | ||
| 583 | * PD5 - PIN5 (input pullup). | ||
| 584 | * PD6 - PIN6 (input pullup). | ||
| 585 | * PD7 - PIN7 (input pullup). | ||
| 586 | * PD8 - PIN8 (input pullup). | ||
| 587 | * PD9 - PIN9 (input pullup). | ||
| 588 | * PD10 - PIN10 (input pullup). | ||
| 589 | * PD11 - PIN11 (input pullup). | ||
| 590 | * PD12 - PIN12 (input pullup). | ||
| 591 | * PD13 - PIN13 (input pullup). | ||
| 592 | * PD14 - PIN14 (input pullup). | ||
| 593 | * PD15 - PIN15 (input pullup). | ||
| 594 | */ | ||
| 595 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 597 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 598 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 599 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 600 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 601 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 602 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 603 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 604 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 605 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 606 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 607 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 608 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 609 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 610 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 611 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 613 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 614 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 615 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 616 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 617 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 618 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 619 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 620 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 621 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 622 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 623 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 624 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 625 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 626 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 627 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 629 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 630 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 631 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 632 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 633 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 634 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 635 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 636 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 637 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 638 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 639 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 640 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 641 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 642 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 643 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 645 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 646 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 647 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 648 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 649 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 650 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 651 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 652 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 653 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 654 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 655 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 656 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 657 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 658 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 659 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 661 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 662 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 663 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 664 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 665 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 666 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 667 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 668 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 669 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 670 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 671 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 672 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 673 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 674 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 675 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 677 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 678 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 679 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 680 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 681 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 682 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 683 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 684 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 685 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 686 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 687 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 688 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 689 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 690 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 691 | |||
| 692 | /* | ||
| 693 | * GPIOE setup: | ||
| 694 | * | ||
| 695 | * PE0 - PIN0 (input pullup). | ||
| 696 | * PE1 - PIN1 (input pullup). | ||
| 697 | * PE2 - PIN2 (input pullup). | ||
| 698 | * PE3 - PIN3 (input pullup). | ||
| 699 | * PE4 - PIN4 (input pullup). | ||
| 700 | * PE5 - PIN5 (input pullup). | ||
| 701 | * PE6 - PIN6 (input pullup). | ||
| 702 | * PE7 - PIN7 (input pullup). | ||
| 703 | * PE8 - PIN8 (input pullup). | ||
| 704 | * PE9 - PIN9 (input pullup). | ||
| 705 | * PE10 - PIN10 (input pullup). | ||
| 706 | * PE11 - PIN11 (input pullup). | ||
| 707 | * PE12 - PIN12 (input pullup). | ||
| 708 | * PE13 - PIN13 (input pullup). | ||
| 709 | * PE14 - PIN14 (input pullup). | ||
| 710 | * PE15 - PIN15 (input pullup). | ||
| 711 | */ | ||
| 712 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 714 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 715 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 716 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 717 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 718 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 719 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 720 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 721 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 722 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 723 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 724 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 725 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 726 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 727 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 728 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 730 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 731 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 732 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 733 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 734 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 735 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 736 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 737 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 738 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 739 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 740 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 741 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 742 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 743 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 744 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 746 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 747 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 748 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 749 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 750 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 751 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 752 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 753 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 754 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 755 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 756 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 757 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 758 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 759 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 760 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 762 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 763 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 764 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 765 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 766 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 767 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 768 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 769 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 770 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 771 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 772 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 773 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 774 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 775 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 776 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 778 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 779 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 780 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 781 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 782 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 783 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 784 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 785 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 786 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 787 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 788 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 789 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 790 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 791 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 792 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 794 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 795 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 796 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 797 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 798 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 799 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 800 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 801 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 802 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 803 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 804 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 805 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 806 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 807 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 808 | |||
| 809 | /* | ||
| 810 | * GPIOF setup: | ||
| 811 | * | ||
| 812 | * PF0 - OSC_IN (input floating). | ||
| 813 | * PF1 - OSC_OUT (input floating). | ||
| 814 | * PF2 - PIN2 (input pullup). | ||
| 815 | * PF3 - PIN3 (input pullup). | ||
| 816 | * PF4 - PIN4 (input pullup). | ||
| 817 | * PF5 - PIN5 (input pullup). | ||
| 818 | * PF6 - PIN6 (input pullup). | ||
| 819 | * PF7 - PIN7 (input pullup). | ||
| 820 | * PF8 - PIN8 (input pullup). | ||
| 821 | * PF9 - PIN9 (input pullup). | ||
| 822 | * PF10 - PIN10 (input pullup). | ||
| 823 | * PF11 - PIN11 (input pullup). | ||
| 824 | * PF12 - PIN12 (input pullup). | ||
| 825 | * PF13 - PIN13 (input pullup). | ||
| 826 | * PF14 - PIN14 (input pullup). | ||
| 827 | * PF15 - PIN15 (input pullup). | ||
| 828 | */ | ||
| 829 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 831 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 832 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 833 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 834 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 835 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 836 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 837 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 838 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 839 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 840 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 841 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 842 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 843 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 844 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 845 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 847 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 848 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 849 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 850 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 851 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 852 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 853 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 854 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 855 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 856 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 857 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 858 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 859 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 860 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 861 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 863 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 864 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 865 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 866 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 867 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 868 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 869 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 870 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 871 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 872 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 873 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 874 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 875 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 876 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 877 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 878 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 879 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 880 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 881 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 882 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 883 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 884 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 885 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 886 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 887 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 888 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 889 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 890 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 891 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 892 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 893 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 895 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 896 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 897 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 898 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 899 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 900 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 901 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 902 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 903 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 904 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 905 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 906 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 907 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 908 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 909 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 911 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 912 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 913 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 914 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 915 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 916 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 917 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 918 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 919 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 920 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 921 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 922 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 923 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 924 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 925 | |||
| 926 | /*===========================================================================*/ | ||
| 927 | /* External declarations. */ | ||
| 928 | /*===========================================================================*/ | ||
| 929 | |||
| 930 | #if !defined(_FROM_ASM_) | ||
| 931 | #ifdef __cplusplus | ||
| 932 | extern "C" { | ||
| 933 | #endif | ||
| 934 | void boardInit(void); | ||
| 935 | #ifdef __cplusplus | ||
| 936 | } | ||
| 937 | #endif | ||
| 938 | #endif /* _FROM_ASM_ */ | ||
| 939 | |||
| 940 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # List of all the board related files. | ||
| 2 | BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c | ||
| 3 | |||
| 4 | # Required include directories | ||
| 5 | BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY | ||
diff --git a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg deleted file mode 100644 index 9c7cf4fd7..000000000 --- a/keyboards/cannonkeys/tmov2/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg +++ /dev/null | |||
| @@ -1,703 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!-- STM32F0xx board Template --> | ||
| 3 | <board | ||
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 5 | xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> | ||
| 6 | <configuration_settings> | ||
| 7 | <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> | ||
| 8 | <output_path>..</output_path> | ||
| 9 | <hal_version>3.0.x</hal_version> | ||
| 10 | </configuration_settings> | ||
| 11 | <board_name>ST STM32F072B-Discovery</board_name> | ||
| 12 | <board_id>ST_STM32F072B_DISCOVERY</board_id> | ||
| 13 | <board_functions></board_functions> | ||
| 14 | <subtype>STM32F072xB</subtype> | ||
| 15 | <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" | ||
| 16 | LSEBypass="false" LSEDrive="3 High Drive (default)" /> | ||
| 17 | <ports> | ||
| 18 | <GPIOA> | ||
| 19 | <pin0 | ||
| 20 | ID="BUTTON" | ||
| 21 | Type="PushPull" | ||
| 22 | Speed="Minimum" | ||
| 23 | Resistor="Floating" | ||
| 24 | Level="High" | ||
| 25 | Mode="Input" | ||
| 26 | Alternate="0" /> | ||
| 27 | <pin1 | ||
| 28 | ID="" | ||
| 29 | Type="PushPull" | ||
| 30 | Speed="Minimum" | ||
| 31 | Resistor="PullUp" | ||
| 32 | Level="High" | ||
| 33 | Mode="Input" | ||
| 34 | Alternate="0" /> | ||
| 35 | <pin2 | ||
| 36 | ID="" | ||
| 37 | Type="PushPull" | ||
| 38 | Speed="Minimum" | ||
| 39 | Resistor="PullUp" | ||
| 40 | Level="High" | ||
| 41 | Mode="Input" | ||
| 42 | Alternate="0" /> | ||
| 43 | <pin3 | ||
| 44 | ID="" | ||
| 45 | Type="PushPull" | ||
| 46 | Speed="Minimum" | ||
| 47 | Resistor="PullUp" | ||
| 48 | Level="High" | ||
| 49 | Mode="Input" | ||
| 50 | Alternate="0" /> | ||
| 51 | <pin4 | ||
| 52 | ID="" | ||
| 53 | Type="PushPull" | ||
| 54 | Speed="Minimum" | ||
| 55 | Resistor="PullUp" | ||
| 56 | Level="High" | ||
| 57 | Mode="Input" | ||
| 58 | Alternate="0" /> | ||
| 59 | <pin5 | ||
| 60 | ID="" | ||
| 61 | Type="PushPull" | ||
| 62 | Speed="Minimum" | ||
| 63 | Resistor="PullUp" | ||
| 64 | Level="High" | ||
| 65 | Mode="Input" | ||
| 66 | Alternate="0" /> | ||
| 67 | <pin6 | ||
| 68 | ID="" | ||
| 69 | Type="PushPull" | ||
| 70 | Speed="Minimum" | ||
| 71 | Resistor="PullUp" | ||
| 72 | Level="High" | ||
| 73 | Mode="Input" | ||
| 74 | Alternate="0" /> | ||
| 75 | <pin7 | ||
| 76 | ID="" | ||
| 77 | Type="PushPull" | ||
| 78 | Speed="Minimum" | ||
| 79 | Resistor="PullUp" | ||
| 80 | Level="High" | ||
| 81 | Mode="Input" | ||
| 82 | Alternate="0" /> | ||
| 83 | <pin8 | ||
| 84 | ID="" | ||
| 85 | Type="PushPull" | ||
| 86 | Speed="Minimum" | ||
| 87 | Resistor="PullUp" | ||
| 88 | Level="High" | ||
| 89 | Mode="Input" | ||
| 90 | Alternate="0" /> | ||
| 91 | <pin9 | ||
| 92 | ID="" | ||
| 93 | Type="PushPull" | ||
| 94 | Speed="Minimum" | ||
| 95 | Resistor="PullUp" | ||
| 96 | Level="High" | ||
| 97 | Mode="Input" | ||
| 98 | Alternate="0" /> | ||
| 99 | <pin10 | ||
| 100 | ID="" | ||
| 101 | Type="PushPull" | ||
| 102 | Speed="Minimum" | ||
| 103 | Resistor="PullUp" | ||
| 104 | Level="High" | ||
| 105 | Mode="Input" | ||
| 106 | Alternate="0" /> | ||
| 107 | <pin11 | ||
| 108 | ID="USB_DM" | ||
| 109 | Type="PushPull" | ||
| 110 | Speed="Minimum" | ||
| 111 | Resistor="Floating" | ||
| 112 | Level="High" | ||
| 113 | Mode="Input" | ||
| 114 | Alternate="0" /> | ||
| 115 | <pin12 | ||
| 116 | ID="USB_DP" | ||
| 117 | Type="PushPull" | ||
| 118 | Speed="Minimum" | ||
| 119 | Resistor="Floating" | ||
| 120 | Level="High" | ||
| 121 | Mode="Input" | ||
| 122 | Alternate="0" /> | ||
| 123 | <pin13 | ||
| 124 | ID="SWDIO" | ||
| 125 | Type="PushPull" | ||
| 126 | Speed="Maximum" | ||
| 127 | Resistor="PullUp" | ||
| 128 | Level="High" | ||
| 129 | Mode="Alternate" | ||
| 130 | Alternate="0" /> | ||
| 131 | <pin14 | ||
| 132 | ID="SWCLK" | ||
| 133 | Type="PushPull" | ||
| 134 | Speed="Maximum" | ||
| 135 | Resistor="PullDown" | ||
| 136 | Level="High" | ||
| 137 | Mode="Alternate" | ||
| 138 | Alternate="0" /> | ||
| 139 | <pin15 | ||
| 140 | ID="" | ||
| 141 | Type="PushPull" | ||
| 142 | Speed="Maximum" | ||
| 143 | Resistor="PullUp" | ||
| 144 | Level="High" | ||
| 145 | Mode="Input" | ||
| 146 | Alternate="0" /> | ||
| 147 | </GPIOA> | ||
| 148 | <GPIOB> | ||
| 149 | <pin0 | ||
| 150 | ID="" | ||
| 151 | Type="PushPull" | ||
| 152 | Speed="Minimum" | ||
| 153 | Resistor="PullUp" | ||
| 154 | Level="High" | ||
| 155 | Mode="Input" | ||
| 156 | Alternate="0" /> | ||
| 157 | <pin1 | ||
| 158 | ID="" | ||
| 159 | Type="PushPull" | ||
| 160 | Speed="Minimum" | ||
| 161 | Resistor="PullUp" | ||
| 162 | Level="High" | ||
| 163 | Mode="Input" | ||
| 164 | Alternate="0" /> | ||
| 165 | <pin2 | ||
| 166 | ID="" | ||
| 167 | Type="PushPull" | ||
| 168 | Speed="Maximum" | ||
| 169 | Resistor="PullUp" | ||
| 170 | Level="High" | ||
| 171 | Mode="Input" | ||
| 172 | Alternate="0" /> | ||
| 173 | <pin3 | ||
| 174 | ID="" | ||
| 175 | Type="PushPull" | ||
| 176 | Speed="Maximum" | ||
| 177 | Resistor="PullUp" | ||
| 178 | Level="High" | ||
| 179 | Mode="Input" | ||
| 180 | Alternate="0" /> | ||
| 181 | <pin4 | ||
| 182 | ID="" | ||
| 183 | Type="PushPull" | ||
| 184 | Speed="Maximum" | ||
| 185 | Resistor="PullUp" | ||
| 186 | Level="High" | ||
| 187 | Mode="Input" | ||
| 188 | Alternate="0" /> | ||
| 189 | <pin5 | ||
| 190 | ID="" | ||
| 191 | Type="PushPull" | ||
| 192 | Speed="Minimum" | ||
| 193 | Resistor="PullUp" | ||
| 194 | Level="High" | ||
| 195 | Mode="Input" | ||
| 196 | Alternate="0" /> | ||
| 197 | <pin6 | ||
| 198 | ID="" | ||
| 199 | Type="PushPull" | ||
| 200 | Speed="Minimum" | ||
| 201 | Resistor="PullUp" | ||
| 202 | Level="High" | ||
| 203 | Mode="Input" | ||
| 204 | Alternate="0" /> | ||
| 205 | <pin7 | ||
| 206 | ID="" | ||
| 207 | Type="PushPull" | ||
| 208 | Speed="Minimum" | ||
| 209 | Resistor="PullUp" | ||
| 210 | Level="High" | ||
| 211 | Mode="Input" | ||
| 212 | Alternate="0" /> | ||
| 213 | <pin8 | ||
| 214 | ID="" | ||
| 215 | Type="PushPull" | ||
| 216 | Speed="Minimum" | ||
| 217 | Resistor="PullUp" | ||
| 218 | Level="High" | ||
| 219 | Mode="Input" | ||
| 220 | Alternate="0" /> | ||
| 221 | <pin9 | ||
| 222 | ID="" | ||
| 223 | Type="PushPull" | ||
| 224 | Speed="Minimum" | ||
| 225 | Resistor="PullUp" | ||
| 226 | Level="High" | ||
| 227 | Mode="Input" | ||
| 228 | Alternate="0" /> | ||
| 229 | <pin10 | ||
| 230 | ID="" | ||
| 231 | Type="PushPull" | ||
| 232 | Speed="Minimum" | ||
| 233 | Resistor="PullUp" | ||
| 234 | Level="High" | ||
| 235 | Mode="Input" | ||
| 236 | Alternate="0" /> | ||
| 237 | <pin11 | ||
| 238 | ID="" | ||
| 239 | Type="PushPull" | ||
| 240 | Speed="Minimum" | ||
| 241 | Resistor="PullUp" | ||
| 242 | Level="High" | ||
| 243 | Mode="Input" | ||
| 244 | Alternate="0" /> | ||
| 245 | <pin12 | ||
| 246 | ID="" | ||
| 247 | Type="PushPull" | ||
| 248 | Speed="Minimum" | ||
| 249 | Resistor="PullUp" | ||
| 250 | Level="High" | ||
| 251 | Mode="Input" | ||
| 252 | Alternate="0" /> | ||
| 253 | <pin13 | ||
| 254 | ID="SPI2_SCK" | ||
| 255 | Type="PushPull" | ||
| 256 | Speed="Minimum" | ||
| 257 | Resistor="Floating" | ||
| 258 | Level="High" | ||
| 259 | Mode="Alternate" | ||
| 260 | Alternate="0" /> | ||
| 261 | <pin14 | ||
| 262 | ID="SPI2_MISO" | ||
| 263 | Type="PushPull" | ||
| 264 | Speed="Minimum" | ||
| 265 | Resistor="Floating" | ||
| 266 | Level="High" | ||
| 267 | Mode="Alternate" | ||
| 268 | Alternate="0" /> | ||
| 269 | <pin15 | ||
| 270 | ID="SPI2_MOSI" | ||
| 271 | Type="PushPull" | ||
| 272 | Speed="Minimum" | ||
| 273 | Resistor="Floating" | ||
| 274 | Level="High" | ||
| 275 | Mode="Alternate" | ||
| 276 | Alternate="0" /> | ||
| 277 | </GPIOB> | ||
| 278 | <GPIOC> | ||
| 279 | <pin0 | ||
| 280 | ID="MEMS_CS" | ||
| 281 | Type="PushPull" | ||
| 282 | Speed="Maximum" | ||
| 283 | Resistor="Floating" | ||
| 284 | Level="High" | ||
| 285 | Mode="Output" | ||
| 286 | Alternate="0" /> | ||
| 287 | <pin1 | ||
| 288 | ID="" | ||
| 289 | Type="PushPull" | ||
| 290 | Speed="Minimum" | ||
| 291 | Resistor="PullUp" | ||
| 292 | Level="High" | ||
| 293 | Mode="Input" | ||
| 294 | Alternate="0" /> | ||
| 295 | <pin2 | ||
| 296 | ID="" | ||
| 297 | Type="PushPull" | ||
| 298 | Speed="Minimum" | ||
| 299 | Resistor="PullUp" | ||
| 300 | Level="High" | ||
| 301 | Mode="Input" | ||
| 302 | Alternate="0" /> | ||
| 303 | <pin3 | ||
| 304 | ID="" | ||
| 305 | Type="PushPull" | ||
| 306 | Speed="Minimum" | ||
| 307 | Resistor="PullUp" | ||
| 308 | Level="High" | ||
| 309 | Mode="Input" | ||
| 310 | Alternate="0" /> | ||
| 311 | <pin4 | ||
| 312 | ID="" | ||
| 313 | Type="PushPull" | ||
| 314 | Speed="Minimum" | ||
| 315 | Resistor="PullUp" | ||
| 316 | Level="High" | ||
| 317 | Mode="Input" | ||
| 318 | Alternate="0" /> | ||
| 319 | <pin5 | ||
| 320 | ID="" | ||
| 321 | Type="PushPull" | ||
| 322 | Speed="Minimum" | ||
| 323 | Resistor="PullUp" | ||
| 324 | Level="High" | ||
| 325 | Mode="Input" | ||
| 326 | Alternate="0" /> | ||
| 327 | <pin6 | ||
| 328 | ID="LED_RED" | ||
| 329 | Type="PushPull" | ||
| 330 | Speed="Maximum" | ||
| 331 | Resistor="Floating" | ||
| 332 | Level="Low" | ||
| 333 | Mode="Output" | ||
| 334 | Alternate="0" /> | ||
| 335 | <pin7 | ||
| 336 | ID="LED_BLUE" | ||
| 337 | Type="PushPull" | ||
| 338 | Speed="Maximum" | ||
| 339 | Resistor="Floating" | ||
| 340 | Level="Low" | ||
| 341 | Mode="Output" | ||
| 342 | Alternate="0" /> | ||
| 343 | <pin8 | ||
| 344 | ID="LED_ORANGE" | ||
| 345 | Type="PushPull" | ||
| 346 | Speed="Maximum" | ||
| 347 | Resistor="Floating" | ||
| 348 | Level="Low" | ||
| 349 | Mode="Output" | ||
| 350 | Alternate="0" ></pin8> | ||
| 351 | <pin9 | ||
| 352 | ID="LED_GREEN" | ||
| 353 | Type="PushPull" | ||
| 354 | Speed="Maximum" | ||
| 355 | Resistor="Floating" | ||
| 356 | Level="Low" | ||
| 357 | Mode="Output" | ||
| 358 | Alternate="0" /> | ||
| 359 | <pin10 | ||
| 360 | ID="" | ||
| 361 | Type="PushPull" | ||
| 362 | Speed="Minimum" | ||
| 363 | Resistor="PullUp" | ||
| 364 | Level="High" | ||
| 365 | Mode="Input" | ||
| 366 | Alternate="0" /> | ||
| 367 | <pin11 | ||
| 368 | ID="" | ||
| 369 | Type="PushPull" | ||
| 370 | Speed="Minimum" | ||
| 371 | Resistor="PullUp" | ||
| 372 | Level="High" | ||
| 373 | Mode="Input" | ||
| 374 | Alternate="0" /> | ||
| 375 | <pin12 | ||
| 376 | ID="" | ||
| 377 | Type="PushPull" | ||
| 378 | Speed="Minimum" | ||
| 379 | Resistor="PullUp" | ||
| 380 | Level="High" | ||
| 381 | Mode="Input" | ||
| 382 | Alternate="0" /> | ||
| 383 | <pin13 | ||
| 384 | ID="" | ||
| 385 | Type="PushPull" | ||
| 386 | Speed="Minimum" | ||
| 387 | Resistor="PullUp" | ||
| 388 | Level="High" | ||
| 389 | Mode="Input" | ||
| 390 | Alternate="0" /> | ||
| 391 | <pin14 | ||
| 392 | ID="OSC32_IN" | ||
| 393 | Type="PushPull" | ||
| 394 | Speed="Maximum" | ||
| 395 | Resistor="Floating" | ||
| 396 | Level="High" | ||
| 397 | Mode="Input" | ||
| 398 | Alternate="0" /> | ||
| 399 | <pin15 | ||
| 400 | ID="OSC32_OUT" | ||
| 401 | Type="PushPull" | ||
| 402 | Speed="Maximum" | ||
| 403 | Resistor="Floating" | ||
| 404 | Level="High" | ||
| 405 | Mode="Input" | ||
| 406 | Alternate="0" /> | ||
| 407 | </GPIOC> | ||
| 408 | <GPIOD> | ||
| 409 | <pin0 | ||
| 410 | ID="" | ||
| 411 | Type="PushPull" | ||
| 412 | Speed="Minimum" | ||
| 413 | Resistor="PullUp" | ||
| 414 | Level="High" | ||
| 415 | Mode="Input" | ||
| 416 | Alternate="0" /> | ||
| 417 | <pin1 | ||
| 418 | ID="" | ||
| 419 | Type="PushPull" | ||
| 420 | Speed="Minimum" | ||
| 421 | Resistor="PullUp" | ||
| 422 | Level="High" | ||
| 423 | Mode="Input" | ||
| 424 | Alternate="0" /> | ||
| 425 | <pin2 | ||
| 426 | ID="" | ||
| 427 | Type="PushPull" | ||
| 428 | Speed="Minimum" | ||
| 429 | Resistor="PullUp" | ||
| 430 | Level="High" | ||
| 431 | Mode="Input" | ||
| 432 | Alternate="0" /> | ||
| 433 | <pin3 | ||
| 434 | ID="" | ||
| 435 | Type="PushPull" | ||
| 436 | Speed="Minimum" | ||
| 437 | Resistor="PullUp" | ||
| 438 | Level="High" | ||
| 439 | Mode="Input" | ||
| 440 | Alternate="0" /> | ||
| 441 | <pin4 | ||
| 442 | ID="" | ||
| 443 | Type="PushPull" | ||
| 444 | Speed="Minimum" | ||
| 445 | Resistor="PullUp" | ||
| 446 | Level="High" | ||
| 447 | Mode="Input" | ||
| 448 | Alternate="0" /> | ||
| 449 | <pin5 | ||
| 450 | ID="" | ||
| 451 | Type="PushPull" | ||
| 452 | Speed="Minimum" | ||
| 453 | Resistor="PullUp" | ||
| 454 | Level="High" | ||
| 455 | Mode="Input" | ||
| 456 | Alternate="0" /> | ||
| 457 | <pin6 | ||
| 458 | ID="" | ||
| 459 | Type="PushPull" | ||
| 460 | Speed="Minimum" | ||
| 461 | Resistor="PullUp" | ||
| 462 | Level="High" | ||
| 463 | Mode="Input" | ||
| 464 | Alternate="0" /> | ||
| 465 | <pin7 | ||
| 466 | ID="" | ||
| 467 | Type="PushPull" | ||
| 468 | Speed="Minimum" | ||
| 469 | Resistor="PullUp" | ||
| 470 | Level="High" | ||
| 471 | Mode="Input" | ||
| 472 | Alternate="0" /> | ||
| 473 | <pin8 | ||
| 474 | ID="" | ||
| 475 | Type="PushPull" | ||
| 476 | Speed="Minimum" | ||
| 477 | Resistor="PullUp" | ||
| 478 | Level="High" | ||
| 479 | Mode="Input" | ||
| 480 | Alternate="0" /> | ||
| 481 | <pin9 | ||
| 482 | ID="" | ||
| 483 | Type="PushPull" | ||
| 484 | Speed="Minimum" | ||
| 485 | Resistor="PullUp" | ||
| 486 | Level="High" | ||
| 487 | Mode="Input" | ||
| 488 | Alternate="0" /> | ||
| 489 | <pin10 | ||
| 490 | ID="" | ||
| 491 | Type="PushPull" | ||
| 492 | Speed="Minimum" | ||
| 493 | Resistor="PullUp" | ||
| 494 | Level="High" | ||
| 495 | Mode="Input" | ||
| 496 | Alternate="0" /> | ||
| 497 | <pin11 | ||
| 498 | ID="" | ||
| 499 | Type="PushPull" | ||
| 500 | Speed="Minimum" | ||
| 501 | Resistor="PullUp" | ||
| 502 | Level="High" | ||
| 503 | Mode="Input" | ||
| 504 | Alternate="0" /> | ||
| 505 | <pin12 | ||
| 506 | ID="" | ||
| 507 | Type="PushPull" | ||
| 508 | Speed="Minimum" | ||
| 509 | Resistor="PullUp" | ||
| 510 | Level="High" | ||
| 511 | Mode="Input" | ||
| 512 | Alternate="0" /> | ||
| 513 | <pin13 | ||
| 514 | ID="" | ||
| 515 | Type="PushPull" | ||
| 516 | Speed="Minimum" | ||
| 517 | Resistor="PullUp" | ||
| 518 | Level="High" | ||
| 519 | Mode="Input" | ||
| 520 | Alternate="0" /> | ||
| 521 | <pin14 | ||
| 522 | ID="" | ||
| 523 | Type="PushPull" | ||
| 524 | Speed="Minimum" | ||
| 525 | Resistor="PullUp" | ||
| 526 | Level="High" | ||
| 527 | Mode="Input" | ||
| 528 | Alternate="0" /> | ||
| 529 | <pin15 | ||
| 530 | ID="" | ||
| 531 | Type="PushPull" | ||
| 532 | Speed="Minimum" | ||
| 533 | Resistor="PullUp" | ||
| 534 | Level="High" | ||
| 535 | Mode="Input" | ||
| 536 | Alternate="0" /> | ||
| 537 | </GPIOD> | ||
| 538 | <GPIOE> | ||
| 539 | <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 540 | Level="High" Mode="Input" Alternate="0" /> | ||
| 541 | <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 542 | Level="High" Mode="Input" Alternate="0" /> | ||
| 543 | <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 544 | Level="High" Mode="Input" Alternate="0" /> | ||
| 545 | <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 546 | Level="High" Mode="Input" Alternate="0" /> | ||
| 547 | <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 548 | Level="High" Mode="Input" Alternate="0" /> | ||
| 549 | <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 550 | Level="High" Mode="Input" Alternate="0" /> | ||
| 551 | <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 552 | Level="High" Mode="Input" Alternate="0" /> | ||
| 553 | <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 554 | Level="High" Mode="Input" Alternate="0" /> | ||
| 555 | <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 556 | Level="High" Mode="Input" Alternate="0" /> | ||
| 557 | <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 558 | Level="High" Mode="Input" Alternate="0" /> | ||
| 559 | <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 560 | Level="High" Mode="Input" Alternate="0" /> | ||
| 561 | <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 562 | Level="High" Mode="Input" Alternate="0" /> | ||
| 563 | <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 564 | Level="High" Mode="Input" Alternate="0" /> | ||
| 565 | <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 566 | Level="High" Mode="Input" Alternate="0" /> | ||
| 567 | <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 568 | Level="High" Mode="Input" Alternate="0" /> | ||
| 569 | <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 570 | Level="High" Mode="Input" Alternate="0" /> | ||
| 571 | </GPIOE> | ||
| 572 | <GPIOF> | ||
| 573 | <pin0 | ||
| 574 | ID="OSC_IN" | ||
| 575 | Type="PushPull" | ||
| 576 | Speed="Minimum" | ||
| 577 | Resistor="Floating" | ||
| 578 | Level="High" | ||
| 579 | Mode="Input" | ||
| 580 | Alternate="0" /> | ||
| 581 | <pin1 | ||
| 582 | ID="OSC_OUT" | ||
| 583 | Type="PushPull" | ||
| 584 | Speed="Minimum" | ||
| 585 | Resistor="Floating" | ||
| 586 | Level="High" | ||
| 587 | Mode="Input" | ||
| 588 | Alternate="0" /> | ||
| 589 | <pin2 | ||
| 590 | ID="" | ||
| 591 | Type="PushPull" | ||
| 592 | Speed="Minimum" | ||
| 593 | Resistor="PullUp" | ||
| 594 | Level="High" | ||
| 595 | Mode="Input" | ||
| 596 | Alternate="0" /> | ||
| 597 | <pin3 | ||
| 598 | ID="" | ||
| 599 | Type="PushPull" | ||
| 600 | Speed="Minimum" | ||
| 601 | Resistor="PullUp" | ||
| 602 | Level="High" | ||
| 603 | Mode="Input" | ||
| 604 | Alternate="0" /> | ||
| 605 | <pin4 | ||
| 606 | ID="" | ||
| 607 | Type="PushPull" | ||
| 608 | Speed="Minimum" | ||
| 609 | Resistor="PullUp" | ||
| 610 | Level="High" | ||
| 611 | Mode="Input" | ||
| 612 | Alternate="0" /> | ||
| 613 | <pin5 | ||
| 614 | ID="" | ||
| 615 | Type="PushPull" | ||
| 616 | Speed="Minimum" | ||
| 617 | Resistor="PullUp" | ||
| 618 | Level="High" | ||
| 619 | Mode="Input" | ||
| 620 | Alternate="0" /> | ||
| 621 | <pin6 | ||
| 622 | ID="" | ||
| 623 | Type="PushPull" | ||
| 624 | Speed="Minimum" | ||
| 625 | Resistor="PullUp" | ||
| 626 | Level="High" | ||
| 627 | Mode="Input" | ||
| 628 | Alternate="0" /> | ||
| 629 | <pin7 | ||
| 630 | ID="" | ||
| 631 | Type="PushPull" | ||
| 632 | Speed="Minimum" | ||
| 633 | Resistor="PullUp" | ||
| 634 | Level="High" | ||
| 635 | Mode="Input" | ||
| 636 | Alternate="0" /> | ||
| 637 | <pin8 | ||
| 638 | ID="" | ||
| 639 | Type="PushPull" | ||
| 640 | Speed="Minimum" | ||
| 641 | Resistor="PullUp" | ||
| 642 | Level="High" | ||
| 643 | Mode="Input" | ||
| 644 | Alternate="0" /> | ||
| 645 | <pin9 | ||
| 646 | ID="" | ||
| 647 | Type="PushPull" | ||
| 648 | Speed="Minimum" | ||
| 649 | Resistor="PullUp" | ||
| 650 | Level="High" | ||
| 651 | Mode="Input" | ||
| 652 | Alternate="0" /> | ||
| 653 | <pin10 | ||
| 654 | ID="" | ||
| 655 | Type="PushPull" | ||
| 656 | Speed="Minimum" | ||
| 657 | Resistor="PullUp" | ||
| 658 | Level="High" | ||
| 659 | Mode="Input" | ||
| 660 | Alternate="0" /> | ||
| 661 | <pin11 | ||
| 662 | ID="" | ||
| 663 | Type="PushPull" | ||
| 664 | Speed="Minimum" | ||
| 665 | Resistor="PullUp" | ||
| 666 | Level="High" | ||
| 667 | Mode="Input" | ||
| 668 | Alternate="0" /> | ||
| 669 | <pin12 | ||
| 670 | ID="" | ||
| 671 | Type="PushPull" | ||
| 672 | Speed="Minimum" | ||
| 673 | Resistor="PullUp" | ||
| 674 | Level="High" | ||
| 675 | Mode="Input" | ||
| 676 | Alternate="0" /> | ||
| 677 | <pin13 | ||
| 678 | ID="" | ||
| 679 | Type="PushPull" | ||
| 680 | Speed="Minimum" | ||
| 681 | Resistor="PullUp" | ||
| 682 | Level="High" | ||
| 683 | Mode="Input" | ||
| 684 | Alternate="0" /> | ||
| 685 | <pin14 | ||
| 686 | ID="" | ||
| 687 | Type="PushPull" | ||
| 688 | Speed="Minimum" | ||
| 689 | Resistor="PullUp" | ||
| 690 | Level="High" | ||
| 691 | Mode="Input" | ||
| 692 | Alternate="0" /> | ||
| 693 | <pin15 | ||
| 694 | ID="" | ||
| 695 | Type="PushPull" | ||
| 696 | Speed="Minimum" | ||
| 697 | Resistor="PullUp" | ||
| 698 | Level="High" | ||
| 699 | Mode="Input" | ||
| 700 | Alternate="0" /> | ||
| 701 | </GPIOF> | ||
| 702 | </ports> | ||
| 703 | </board> | ||
diff --git a/keyboards/cannonkeys/tmov2/config.h b/keyboards/cannonkeys/tmov2/config.h index ef8d768f6..c3c07bea1 100644 --- a/keyboards/cannonkeys/tmov2/config.h +++ b/keyboards/cannonkeys/tmov2/config.h | |||
| @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 33 | #define MATRIX_ROW_PINS { A10, A9, A8, B12 } | 33 | #define MATRIX_ROW_PINS { A10, A9, A8, B12 } |
| 34 | #define DIODE_DIRECTION COL2ROW | 34 | #define DIODE_DIRECTION COL2ROW |
| 35 | 35 | ||
| 36 | #define BACKLIGHT_PIN A6 | ||
| 37 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 38 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 39 | #define BACKLIGHT_PAL_MODE 1 | ||
| 36 | #define BACKLIGHT_LEVELS 6 | 40 | #define BACKLIGHT_LEVELS 6 |
| 37 | #define BACKLIGHT_BREATHING | 41 | #define BACKLIGHT_BREATHING |
| 38 | #define BREATHING_PERIOD 6 | 42 | #define BREATHING_PERIOD 6 |
| @@ -54,16 +58,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 54 | #define WS2812_SPI SPID2 | 58 | #define WS2812_SPI SPID2 |
| 55 | #define WS2812_SPI_MOSI_PAL_MODE 0 | 59 | #define WS2812_SPI_MOSI_PAL_MODE 0 |
| 56 | 60 | ||
| 57 | // Backlight config starts after VIA's EEPROM usage, | ||
| 58 | // dynamic keymaps start after this. | ||
| 59 | #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 1 | ||
| 60 | |||
| 61 | // VIA lighting is handled by the keyboard-level code | ||
| 62 | #define VIA_CUSTOM_LIGHTING_ENABLE | ||
| 63 | |||
| 64 | // Let VIA handle the QMK RGBLIGHT | ||
| 65 | #define VIA_QMK_RGBLIGHT_ENABLE | ||
| 66 | |||
| 67 | /* | 61 | /* |
| 68 | * Feature disable options | 62 | * Feature disable options |
| 69 | * These options are also useful to firmware size reduction. | 63 | * These options are also useful to firmware size reduction. |
diff --git a/keyboards/cannonkeys/tmov2/rules.mk b/keyboards/cannonkeys/tmov2/rules.mk index 686970ef8..dc7f59ae4 100644 --- a/keyboards/cannonkeys/tmov2/rules.mk +++ b/keyboards/cannonkeys/tmov2/rules.mk | |||
| @@ -1,15 +1,10 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = STM32F072 | 2 | MCU = STM32F072 |
| 3 | BOARD = ST_STM32F072B_DISCOVERY | ||
| 4 | 3 | ||
| 5 | # Build Options | 4 | # Build Options |
| 6 | # comment out to disable the options. | 5 | # comment out to disable the options. |
| 7 | # | 6 | # |
| 8 | 7 | ||
| 9 | # project specific files | ||
| 10 | VPATH += keyboards/cannonkeys/stm32f072 | ||
| 11 | SRC = keyboard.c \ | ||
| 12 | led.c | ||
| 13 | 8 | ||
| 14 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | 9 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 15 | MOUSEKEY_ENABLE = yes # Mouse keys | 10 | MOUSEKEY_ENABLE = yes # Mouse keys |
| @@ -19,7 +14,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 19 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 20 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 21 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
| 22 | # BACKLIGHT_ENABLE = yes # This is broken on 072 right now | 17 | BACKLIGHT_ENABLE = yes |
| 23 | RGBLIGHT_ENABLE = yes | 18 | RGBLIGHT_ENABLE = yes |
| 24 | WS2812_DRIVER = spi | 19 | WS2812_DRIVER = spi |
| 25 | 20 | ||
diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null | |||
| @@ -1,268 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "hal.h" | ||
| 23 | #include "stm32_gpio.h" | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver local definitions. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /*===========================================================================*/ | ||
| 30 | /* Driver exported variables. */ | ||
| 31 | /*===========================================================================*/ | ||
| 32 | |||
| 33 | /*===========================================================================*/ | ||
| 34 | /* Driver local variables and types. */ | ||
| 35 | /*===========================================================================*/ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @brief Type of STM32 GPIO port setup. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | uint32_t moder; | ||
| 42 | uint32_t otyper; | ||
| 43 | uint32_t ospeedr; | ||
| 44 | uint32_t pupdr; | ||
| 45 | uint32_t odr; | ||
| 46 | uint32_t afrl; | ||
| 47 | uint32_t afrh; | ||
| 48 | } gpio_setup_t; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @brief Type of STM32 GPIO initialization data. | ||
| 52 | */ | ||
| 53 | typedef struct { | ||
| 54 | #if STM32_HAS_GPIOA || defined(__DOXYGEN__) | ||
| 55 | gpio_setup_t PAData; | ||
| 56 | #endif | ||
| 57 | #if STM32_HAS_GPIOB || defined(__DOXYGEN__) | ||
| 58 | gpio_setup_t PBData; | ||
| 59 | #endif | ||
| 60 | #if STM32_HAS_GPIOC || defined(__DOXYGEN__) | ||
| 61 | gpio_setup_t PCData; | ||
| 62 | #endif | ||
| 63 | #if STM32_HAS_GPIOD || defined(__DOXYGEN__) | ||
| 64 | gpio_setup_t PDData; | ||
| 65 | #endif | ||
| 66 | #if STM32_HAS_GPIOE || defined(__DOXYGEN__) | ||
| 67 | gpio_setup_t PEData; | ||
| 68 | #endif | ||
| 69 | #if STM32_HAS_GPIOF || defined(__DOXYGEN__) | ||
| 70 | gpio_setup_t PFData; | ||
| 71 | #endif | ||
| 72 | #if STM32_HAS_GPIOG || defined(__DOXYGEN__) | ||
| 73 | gpio_setup_t PGData; | ||
| 74 | #endif | ||
| 75 | #if STM32_HAS_GPIOH || defined(__DOXYGEN__) | ||
| 76 | gpio_setup_t PHData; | ||
| 77 | #endif | ||
| 78 | #if STM32_HAS_GPIOI || defined(__DOXYGEN__) | ||
| 79 | gpio_setup_t PIData; | ||
| 80 | #endif | ||
| 81 | #if STM32_HAS_GPIOJ || defined(__DOXYGEN__) | ||
| 82 | gpio_setup_t PJData; | ||
| 83 | #endif | ||
| 84 | #if STM32_HAS_GPIOK || defined(__DOXYGEN__) | ||
| 85 | gpio_setup_t PKData; | ||
| 86 | #endif | ||
| 87 | } gpio_config_t; | ||
| 88 | |||
| 89 | /** | ||
| 90 | * @brief STM32 GPIO static initialization data. | ||
| 91 | */ | ||
| 92 | static const gpio_config_t gpio_default_config = { | ||
| 93 | #if STM32_HAS_GPIOA | ||
| 94 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, | ||
| 95 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, | ||
| 96 | #endif | ||
| 97 | #if STM32_HAS_GPIOB | ||
| 98 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, | ||
| 99 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, | ||
| 100 | #endif | ||
| 101 | #if STM32_HAS_GPIOC | ||
| 102 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, | ||
| 103 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, | ||
| 104 | #endif | ||
| 105 | #if STM32_HAS_GPIOD | ||
| 106 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, | ||
| 107 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, | ||
| 108 | #endif | ||
| 109 | #if STM32_HAS_GPIOE | ||
| 110 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, | ||
| 111 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, | ||
| 112 | #endif | ||
| 113 | #if STM32_HAS_GPIOF | ||
| 114 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, | ||
| 115 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, | ||
| 116 | #endif | ||
| 117 | #if STM32_HAS_GPIOG | ||
| 118 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, | ||
| 119 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, | ||
| 120 | #endif | ||
| 121 | #if STM32_HAS_GPIOH | ||
| 122 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, | ||
| 123 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, | ||
| 124 | #endif | ||
| 125 | #if STM32_HAS_GPIOI | ||
| 126 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, | ||
| 127 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, | ||
| 128 | #endif | ||
| 129 | #if STM32_HAS_GPIOJ | ||
| 130 | {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, | ||
| 131 | VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, | ||
| 132 | #endif | ||
| 133 | #if STM32_HAS_GPIOK | ||
| 134 | {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, | ||
| 135 | VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} | ||
| 136 | #endif | ||
| 137 | }; | ||
| 138 | |||
| 139 | /*===========================================================================*/ | ||
| 140 | /* Driver local functions. */ | ||
| 141 | /*===========================================================================*/ | ||
| 142 | |||
| 143 | static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { | ||
| 144 | |||
| 145 | gpiop->OTYPER = config->otyper; | ||
| 146 | gpiop->OSPEEDR = config->ospeedr; | ||
| 147 | gpiop->PUPDR = config->pupdr; | ||
| 148 | gpiop->ODR = config->odr; | ||
| 149 | gpiop->AFRL = config->afrl; | ||
| 150 | gpiop->AFRH = config->afrh; | ||
| 151 | gpiop->MODER = config->moder; | ||
| 152 | } | ||
| 153 | |||
| 154 | static void stm32_gpio_init(void) { | ||
| 155 | |||
| 156 | /* Enabling GPIO-related clocks, the mask comes from the | ||
| 157 | registry header file.*/ | ||
| 158 | rccResetAHB(STM32_GPIO_EN_MASK); | ||
| 159 | rccEnableAHB(STM32_GPIO_EN_MASK, true); | ||
| 160 | |||
| 161 | /* Initializing all the defined GPIO ports.*/ | ||
| 162 | #if STM32_HAS_GPIOA | ||
| 163 | gpio_init(GPIOA, &gpio_default_config.PAData); | ||
| 164 | #endif | ||
| 165 | #if STM32_HAS_GPIOB | ||
| 166 | gpio_init(GPIOB, &gpio_default_config.PBData); | ||
| 167 | #endif | ||
| 168 | #if STM32_HAS_GPIOC | ||
| 169 | gpio_init(GPIOC, &gpio_default_config.PCData); | ||
| 170 | #endif | ||
| 171 | #if STM32_HAS_GPIOD | ||
| 172 | gpio_init(GPIOD, &gpio_default_config.PDData); | ||
| 173 | #endif | ||
| 174 | #if STM32_HAS_GPIOE | ||
| 175 | gpio_init(GPIOE, &gpio_default_config.PEData); | ||
| 176 | #endif | ||
| 177 | #if STM32_HAS_GPIOF | ||
| 178 | gpio_init(GPIOF, &gpio_default_config.PFData); | ||
| 179 | #endif | ||
| 180 | #if STM32_HAS_GPIOG | ||
| 181 | gpio_init(GPIOG, &gpio_default_config.PGData); | ||
| 182 | #endif | ||
| 183 | #if STM32_HAS_GPIOH | ||
| 184 | gpio_init(GPIOH, &gpio_default_config.PHData); | ||
| 185 | #endif | ||
| 186 | #if STM32_HAS_GPIOI | ||
| 187 | gpio_init(GPIOI, &gpio_default_config.PIData); | ||
| 188 | #endif | ||
| 189 | #if STM32_HAS_GPIOJ | ||
| 190 | gpio_init(GPIOJ, &gpio_default_config.PJData); | ||
| 191 | #endif | ||
| 192 | #if STM32_HAS_GPIOK | ||
| 193 | gpio_init(GPIOK, &gpio_default_config.PKData); | ||
| 194 | #endif | ||
| 195 | } | ||
| 196 | |||
| 197 | /*===========================================================================*/ | ||
| 198 | /* Driver interrupt handlers. */ | ||
| 199 | /*===========================================================================*/ | ||
| 200 | |||
| 201 | /*===========================================================================*/ | ||
| 202 | /* Driver exported functions. */ | ||
| 203 | /*===========================================================================*/ | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @brief Early initialization code. | ||
| 207 | * @details GPIO ports and system clocks are initialized before everything | ||
| 208 | * else. | ||
| 209 | */ | ||
| 210 | void __early_init(void) { | ||
| 211 | extern void enter_bootloader_mode_if_requested(void); | ||
| 212 | enter_bootloader_mode_if_requested(); | ||
| 213 | stm32_gpio_init(); | ||
| 214 | stm32_clock_init(); | ||
| 215 | } | ||
| 216 | |||
| 217 | #if HAL_USE_SDC || defined(__DOXYGEN__) | ||
| 218 | /** | ||
| 219 | * @brief SDC card detection. | ||
| 220 | */ | ||
| 221 | bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { | ||
| 222 | |||
| 223 | (void)sdcp; | ||
| 224 | /* TODO: Fill the implementation.*/ | ||
| 225 | return true; | ||
| 226 | } | ||
| 227 | |||
| 228 | /** | ||
| 229 | * @brief SDC card write protection detection. | ||
| 230 | */ | ||
| 231 | bool sdc_lld_is_write_protected(SDCDriver *sdcp) { | ||
| 232 | |||
| 233 | (void)sdcp; | ||
| 234 | /* TODO: Fill the implementation.*/ | ||
| 235 | return false; | ||
| 236 | } | ||
| 237 | #endif /* HAL_USE_SDC */ | ||
| 238 | |||
| 239 | #if HAL_USE_MMC_SPI || defined(__DOXYGEN__) | ||
| 240 | /** | ||
| 241 | * @brief MMC_SPI card detection. | ||
| 242 | */ | ||
| 243 | bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { | ||
| 244 | |||
| 245 | (void)mmcp; | ||
| 246 | /* TODO: Fill the implementation.*/ | ||
| 247 | return true; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @brief MMC_SPI card write protection detection. | ||
| 252 | */ | ||
| 253 | bool mmc_lld_is_write_protected(MMCDriver *mmcp) { | ||
| 254 | |||
| 255 | (void)mmcp; | ||
| 256 | /* TODO: Fill the implementation.*/ | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif | ||
| 260 | |||
| 261 | /** | ||
| 262 | * @brief Board-specific initialization code. | ||
| 263 | * @todo Add your board-specific code, if any. | ||
| 264 | */ | ||
| 265 | void boardInit(void) { | ||
| 266 | SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; | ||
| 267 | SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); | ||
| 268 | } | ||
diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 57636d1f1..000000000 --- a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,940 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
| 3 | |||
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | you may not use this file except in compliance with the License. | ||
| 6 | You may obtain a copy of the License at | ||
| 7 | |||
| 8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | |||
| 10 | Unless required by applicable law or agreed to in writing, software | ||
| 11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | See the License for the specific language governing permissions and | ||
| 14 | limitations under the License. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * This file has been automatically generated using ChibiStudio board | ||
| 19 | * generator plugin. Do not edit manually. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef BOARD_H | ||
| 23 | #define BOARD_H | ||
| 24 | |||
| 25 | /*===========================================================================*/ | ||
| 26 | /* Driver constants. */ | ||
| 27 | /*===========================================================================*/ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Setup for ST STM32F072B-Discovery board. | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Board identifier. | ||
| 35 | */ | ||
| 36 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 37 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Board oscillators-related settings. | ||
| 41 | * NOTE: HSE not fitted. | ||
| 42 | */ | ||
| 43 | #if !defined(STM32_LSECLK) | ||
| 44 | #define STM32_LSECLK 32768 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define STM32_LSEDRV (3U << 3U) | ||
| 48 | |||
| 49 | #if !defined(STM32_HSECLK) | ||
| 50 | #define STM32_HSECLK 0U | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define STM32_HSE_BYPASS | ||
| 54 | |||
| 55 | /* | ||
| 56 | * MCU type as defined in the ST header. | ||
| 57 | */ | ||
| 58 | #define STM32F072xB | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IO pins assignments. | ||
| 62 | */ | ||
| 63 | #define GPIOA_BUTTON 0U | ||
| 64 | #define GPIOA_PIN1 1U | ||
| 65 | #define GPIOA_PIN2 2U | ||
| 66 | #define GPIOA_PIN3 3U | ||
| 67 | #define GPIOA_PIN4 4U | ||
| 68 | #define GPIOA_PIN5 5U | ||
| 69 | #define GPIOA_PIN6 6U | ||
| 70 | #define GPIOA_PIN7 7U | ||
| 71 | #define GPIOA_PIN8 8U | ||
| 72 | #define GPIOA_PIN9 9U | ||
| 73 | #define GPIOA_PIN10 10U | ||
| 74 | #define GPIOA_USB_DM 11U | ||
| 75 | #define GPIOA_USB_DP 12U | ||
| 76 | #define GPIOA_SWDIO 13U | ||
| 77 | #define GPIOA_SWCLK 14U | ||
| 78 | #define GPIOA_PIN15 15U | ||
| 79 | |||
| 80 | #define GPIOB_PIN0 0U | ||
| 81 | #define GPIOB_PIN1 1U | ||
| 82 | #define GPIOB_PIN2 2U | ||
| 83 | #define GPIOB_PIN3 3U | ||
| 84 | #define GPIOB_PIN4 4U | ||
| 85 | #define GPIOB_PIN5 5U | ||
| 86 | #define GPIOB_PIN6 6U | ||
| 87 | #define GPIOB_PIN7 7U | ||
| 88 | #define GPIOB_PIN8 8U | ||
| 89 | #define GPIOB_PIN9 9U | ||
| 90 | #define GPIOB_PIN10 10U | ||
| 91 | #define GPIOB_PIN11 11U | ||
| 92 | #define GPIOB_PIN12 12U | ||
| 93 | #define GPIOB_SPI2_SCK 13U | ||
| 94 | #define GPIOB_SPI2_MISO 14U | ||
| 95 | #define GPIOB_SPI2_MOSI 15U | ||
| 96 | |||
| 97 | #define GPIOC_MEMS_CS 0U | ||
| 98 | #define GPIOC_PIN1 1U | ||
| 99 | #define GPIOC_PIN2 2U | ||
| 100 | #define GPIOC_PIN3 3U | ||
| 101 | #define GPIOC_PIN4 4U | ||
| 102 | #define GPIOC_PIN5 5U | ||
| 103 | #define GPIOC_LED_RED 6U | ||
| 104 | #define GPIOC_LED_BLUE 7U | ||
| 105 | #define GPIOC_LED_ORANGE 8U | ||
| 106 | #define GPIOC_LED_GREEN 9U | ||
| 107 | #define GPIOC_PIN10 10U | ||
| 108 | #define GPIOC_PIN11 11U | ||
| 109 | #define GPIOC_PIN12 12U | ||
| 110 | #define GPIOC_PIN13 13U | ||
| 111 | #define GPIOC_OSC32_IN 14U | ||
| 112 | #define GPIOC_OSC32_OUT 15U | ||
| 113 | |||
| 114 | #define GPIOD_PIN0 0U | ||
| 115 | #define GPIOD_PIN1 1U | ||
| 116 | #define GPIOD_PIN2 2U | ||
| 117 | #define GPIOD_PIN3 3U | ||
| 118 | #define GPIOD_PIN4 4U | ||
| 119 | #define GPIOD_PIN5 5U | ||
| 120 | #define GPIOD_PIN6 6U | ||
| 121 | #define GPIOD_PIN7 7U | ||
| 122 | #define GPIOD_PIN8 8U | ||
| 123 | #define GPIOD_PIN9 9U | ||
| 124 | #define GPIOD_PIN10 10U | ||
| 125 | #define GPIOD_PIN11 11U | ||
| 126 | #define GPIOD_PIN12 12U | ||
| 127 | #define GPIOD_PIN13 13U | ||
| 128 | #define GPIOD_PIN14 14U | ||
| 129 | #define GPIOD_PIN15 15U | ||
| 130 | |||
| 131 | #define GPIOE_PIN0 0U | ||
| 132 | #define GPIOE_PIN1 1U | ||
| 133 | #define GPIOE_PIN2 2U | ||
| 134 | #define GPIOE_PIN3 3U | ||
| 135 | #define GPIOE_PIN4 4U | ||
| 136 | #define GPIOE_PIN5 5U | ||
| 137 | #define GPIOE_PIN6 6U | ||
| 138 | #define GPIOE_PIN7 7U | ||
| 139 | #define GPIOE_PIN8 8U | ||
| 140 | #define GPIOE_PIN9 9U | ||
| 141 | #define GPIOE_PIN10 10U | ||
| 142 | #define GPIOE_PIN11 11U | ||
| 143 | #define GPIOE_PIN12 12U | ||
| 144 | #define GPIOE_PIN13 13U | ||
| 145 | #define GPIOE_PIN14 14U | ||
| 146 | #define GPIOE_PIN15 15U | ||
| 147 | |||
| 148 | #define GPIOF_OSC_IN 0U | ||
| 149 | #define GPIOF_OSC_OUT 1U | ||
| 150 | #define GPIOF_PIN2 2U | ||
| 151 | #define GPIOF_PIN3 3U | ||
| 152 | #define GPIOF_PIN4 4U | ||
| 153 | #define GPIOF_PIN5 5U | ||
| 154 | #define GPIOF_PIN6 6U | ||
| 155 | #define GPIOF_PIN7 7U | ||
| 156 | #define GPIOF_PIN8 8U | ||
| 157 | #define GPIOF_PIN9 9U | ||
| 158 | #define GPIOF_PIN10 10U | ||
| 159 | #define GPIOF_PIN11 11U | ||
| 160 | #define GPIOF_PIN12 12U | ||
| 161 | #define GPIOF_PIN13 13U | ||
| 162 | #define GPIOF_PIN14 14U | ||
| 163 | #define GPIOF_PIN15 15U | ||
| 164 | |||
| 165 | /* | ||
| 166 | * IO lines assignments. | ||
| 167 | */ | ||
| 168 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 169 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 170 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 171 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 172 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 173 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 174 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 175 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 176 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 177 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 178 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 179 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 180 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 181 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 182 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 183 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 184 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 185 | |||
| 186 | /*===========================================================================*/ | ||
| 187 | /* Driver pre-compile time settings. */ | ||
| 188 | /*===========================================================================*/ | ||
| 189 | |||
| 190 | /*===========================================================================*/ | ||
| 191 | /* Derived constants and error checks. */ | ||
| 192 | /*===========================================================================*/ | ||
| 193 | |||
| 194 | /*===========================================================================*/ | ||
| 195 | /* Driver data structures and types. */ | ||
| 196 | /*===========================================================================*/ | ||
| 197 | |||
| 198 | /*===========================================================================*/ | ||
| 199 | /* Driver macros. */ | ||
| 200 | /*===========================================================================*/ | ||
| 201 | |||
| 202 | /* | ||
| 203 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 204 | * in the initialization code. | ||
| 205 | * Please refer to the STM32 Reference Manual for details. | ||
| 206 | */ | ||
| 207 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 208 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 209 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 210 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 211 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 212 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 213 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 214 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 215 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 216 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 217 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 218 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 219 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 220 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 221 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 222 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 223 | |||
| 224 | /* | ||
| 225 | * GPIOA setup: | ||
| 226 | * | ||
| 227 | * PA0 - BUTTON (input floating). | ||
| 228 | * PA1 - PIN1 (input pullup). | ||
| 229 | * PA2 - PIN2 (input pullup). | ||
| 230 | * PA3 - PIN3 (input pullup). | ||
| 231 | * PA4 - PIN4 (input pullup). | ||
| 232 | * PA5 - PIN5 (input pullup). | ||
| 233 | * PA6 - PIN6 (input pullup). | ||
| 234 | * PA7 - PIN7 (input pullup). | ||
| 235 | * PA8 - PIN8 (input pullup). | ||
| 236 | * PA9 - PIN9 (input pullup). | ||
| 237 | * PA10 - PIN10 (input pullup). | ||
| 238 | * PA11 - USB_DM (input floating). | ||
| 239 | * PA12 - USB_DP (input floating). | ||
| 240 | * PA13 - SWDIO (alternate 0). | ||
| 241 | * PA14 - SWCLK (alternate 0). | ||
| 242 | * PA15 - PIN15 (input pullup). | ||
| 243 | */ | ||
| 244 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 246 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 247 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 248 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 249 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 250 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 251 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 252 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 253 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 254 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 255 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 256 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 257 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 258 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 259 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 260 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 262 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 263 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 264 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 265 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 266 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 267 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 268 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 269 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 270 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 271 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 272 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 273 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 274 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 275 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 276 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 277 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 278 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 279 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 280 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 281 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 282 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 283 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 284 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 285 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 286 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 287 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 288 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 289 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 290 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 291 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 292 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 294 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 295 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 296 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 297 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 298 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 299 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 300 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 301 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 302 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 303 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 304 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 305 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 306 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 307 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 308 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 310 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 311 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 312 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 313 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 314 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 315 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 316 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 317 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 318 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 319 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 320 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 321 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 322 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 323 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 324 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 326 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 327 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 328 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 329 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 330 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 331 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 332 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 333 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 334 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 335 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 336 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 337 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 338 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 339 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 340 | |||
| 341 | /* | ||
| 342 | * GPIOB setup: | ||
| 343 | * | ||
| 344 | * PB0 - PIN0 (input pullup). | ||
| 345 | * PB1 - PIN1 (input pullup). | ||
| 346 | * PB2 - PIN2 (input pullup). | ||
| 347 | * PB3 - PIN3 (input pullup). | ||
| 348 | * PB4 - PIN4 (input pullup). | ||
| 349 | * PB5 - PIN5 (input pullup). | ||
| 350 | * PB6 - PIN6 (input pullup). | ||
| 351 | * PB7 - PIN7 (input pullup). | ||
| 352 | * PB8 - PIN8 (input pullup). | ||
| 353 | * PB9 - PIN9 (input pullup). | ||
| 354 | * PB10 - PIN10 (input pullup). | ||
| 355 | * PB11 - PIN11 (input pullup). | ||
| 356 | * PB12 - PIN12 (input pullup). | ||
| 357 | * PB13 - SPI2_SCK (alternate 0). | ||
| 358 | * PB14 - SPI2_MISO (alternate 0). | ||
| 359 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 360 | */ | ||
| 361 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 362 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 363 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 364 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 365 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 366 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 367 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 368 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 369 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 370 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 371 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 372 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 373 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 374 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 375 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 376 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 377 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 379 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 380 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 381 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 382 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 383 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 384 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 385 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 386 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 387 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 388 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 389 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 390 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 391 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 392 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 393 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 395 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 396 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 397 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 398 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 399 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 400 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 401 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 402 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 403 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 404 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 405 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 406 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 407 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 408 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 409 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 410 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 411 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 412 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 413 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 414 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 415 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 416 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 417 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 418 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 419 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 420 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 421 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 422 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 423 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 424 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 425 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 427 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 428 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 429 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 430 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 431 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 432 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 433 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 434 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 435 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 436 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 437 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 438 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 439 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 440 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 441 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 443 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 444 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 445 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 446 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 447 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 448 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 449 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 450 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 451 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 452 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 453 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 454 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 455 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 456 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 457 | |||
| 458 | /* | ||
| 459 | * GPIOC setup: | ||
| 460 | * | ||
| 461 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 462 | * PC1 - PIN1 (input pullup). | ||
| 463 | * PC2 - PIN2 (input pullup). | ||
| 464 | * PC3 - PIN3 (input pullup). | ||
| 465 | * PC4 - PIN4 (input pullup). | ||
| 466 | * PC5 - PIN5 (input pullup). | ||
| 467 | * PC6 - LED_RED (output pushpull maximum). | ||
| 468 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 469 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 470 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 471 | * PC10 - PIN10 (input pullup). | ||
| 472 | * PC11 - PIN11 (input pullup). | ||
| 473 | * PC12 - PIN12 (input pullup). | ||
| 474 | * PC13 - PIN13 (input pullup). | ||
| 475 | * PC14 - OSC32_IN (input floating). | ||
| 476 | * PC15 - OSC32_OUT (input floating). | ||
| 477 | */ | ||
| 478 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 480 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 481 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 482 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 483 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 484 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 485 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 486 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 487 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 488 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 489 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 490 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 491 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 492 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 493 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 494 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 496 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 497 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 498 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 499 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 500 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 501 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 502 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 503 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 504 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 505 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 506 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 507 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 508 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 509 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 510 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 511 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 512 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 513 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 514 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 515 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 516 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 517 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 518 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 519 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 520 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 521 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 522 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 523 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 524 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 525 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 526 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 527 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 528 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 529 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 530 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 531 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 532 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 533 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 534 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 535 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 536 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 537 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 538 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 539 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 540 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 541 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 542 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 544 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 545 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 546 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 547 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 548 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 549 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 550 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 551 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 552 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 553 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 554 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 555 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 556 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 557 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 558 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 560 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 561 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 562 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 563 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 564 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 565 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 566 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 567 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 568 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 569 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 570 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 571 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 572 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 573 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 574 | |||
| 575 | /* | ||
| 576 | * GPIOD setup: | ||
| 577 | * | ||
| 578 | * PD0 - PIN0 (input pullup). | ||
| 579 | * PD1 - PIN1 (input pullup). | ||
| 580 | * PD2 - PIN2 (input pullup). | ||
| 581 | * PD3 - PIN3 (input pullup). | ||
| 582 | * PD4 - PIN4 (input pullup). | ||
| 583 | * PD5 - PIN5 (input pullup). | ||
| 584 | * PD6 - PIN6 (input pullup). | ||
| 585 | * PD7 - PIN7 (input pullup). | ||
| 586 | * PD8 - PIN8 (input pullup). | ||
| 587 | * PD9 - PIN9 (input pullup). | ||
| 588 | * PD10 - PIN10 (input pullup). | ||
| 589 | * PD11 - PIN11 (input pullup). | ||
| 590 | * PD12 - PIN12 (input pullup). | ||
| 591 | * PD13 - PIN13 (input pullup). | ||
| 592 | * PD14 - PIN14 (input pullup). | ||
| 593 | * PD15 - PIN15 (input pullup). | ||
| 594 | */ | ||
| 595 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 597 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 598 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 599 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 600 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 601 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 602 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 603 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 604 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 605 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 606 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 607 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 608 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 609 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 610 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 611 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 613 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 614 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 615 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 616 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 617 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 618 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 619 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 620 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 621 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 622 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 623 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 624 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 625 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 626 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 627 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 629 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 630 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 631 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 632 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 633 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 634 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 635 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 636 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 637 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 638 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 639 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 640 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 641 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 642 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 643 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 645 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 646 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 647 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 648 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 649 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 650 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 651 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 652 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 653 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 654 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 655 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 656 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 657 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 658 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 659 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 661 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 662 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 663 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 664 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 665 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 666 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 667 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 668 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 669 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 670 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 671 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 672 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 673 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 674 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 675 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 677 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 678 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 679 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 680 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 681 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 682 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 683 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 684 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 685 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 686 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 687 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 688 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 689 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 690 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 691 | |||
| 692 | /* | ||
| 693 | * GPIOE setup: | ||
| 694 | * | ||
| 695 | * PE0 - PIN0 (input pullup). | ||
| 696 | * PE1 - PIN1 (input pullup). | ||
| 697 | * PE2 - PIN2 (input pullup). | ||
| 698 | * PE3 - PIN3 (input pullup). | ||
| 699 | * PE4 - PIN4 (input pullup). | ||
| 700 | * PE5 - PIN5 (input pullup). | ||
| 701 | * PE6 - PIN6 (input pullup). | ||
| 702 | * PE7 - PIN7 (input pullup). | ||
| 703 | * PE8 - PIN8 (input pullup). | ||
| 704 | * PE9 - PIN9 (input pullup). | ||
| 705 | * PE10 - PIN10 (input pullup). | ||
| 706 | * PE11 - PIN11 (input pullup). | ||
| 707 | * PE12 - PIN12 (input pullup). | ||
| 708 | * PE13 - PIN13 (input pullup). | ||
| 709 | * PE14 - PIN14 (input pullup). | ||
| 710 | * PE15 - PIN15 (input pullup). | ||
| 711 | */ | ||
| 712 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 714 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 715 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 716 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 717 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 718 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 719 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 720 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 721 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 722 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 723 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 724 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 725 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 726 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 727 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 728 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 730 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 731 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 732 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 733 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 734 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 735 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 736 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 737 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 738 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 739 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 740 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 741 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 742 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 743 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 744 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 746 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 747 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 748 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 749 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 750 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 751 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 752 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 753 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 754 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 755 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 756 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 757 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 758 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 759 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 760 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 762 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 763 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 764 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 765 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 766 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 767 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 768 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 769 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 770 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 771 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 772 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 773 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 774 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 775 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 776 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 778 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 779 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 780 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 781 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 782 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 783 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 784 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 785 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 786 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 787 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 788 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 789 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 790 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 791 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 792 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 794 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 795 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 796 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 797 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 798 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 799 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 800 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 801 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 802 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 803 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 804 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 805 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 806 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 807 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 808 | |||
| 809 | /* | ||
| 810 | * GPIOF setup: | ||
| 811 | * | ||
| 812 | * PF0 - OSC_IN (input floating). | ||
| 813 | * PF1 - OSC_OUT (input floating). | ||
| 814 | * PF2 - PIN2 (input pullup). | ||
| 815 | * PF3 - PIN3 (input pullup). | ||
| 816 | * PF4 - PIN4 (input pullup). | ||
| 817 | * PF5 - PIN5 (input pullup). | ||
| 818 | * PF6 - PIN6 (input pullup). | ||
| 819 | * PF7 - PIN7 (input pullup). | ||
| 820 | * PF8 - PIN8 (input pullup). | ||
| 821 | * PF9 - PIN9 (input pullup). | ||
| 822 | * PF10 - PIN10 (input pullup). | ||
| 823 | * PF11 - PIN11 (input pullup). | ||
| 824 | * PF12 - PIN12 (input pullup). | ||
| 825 | * PF13 - PIN13 (input pullup). | ||
| 826 | * PF14 - PIN14 (input pullup). | ||
| 827 | * PF15 - PIN15 (input pullup). | ||
| 828 | */ | ||
| 829 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 831 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 832 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 833 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 834 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 835 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 836 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 837 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 838 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 839 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 840 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 841 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 842 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 843 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 844 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 845 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 847 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 848 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 849 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 850 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 851 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 852 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 853 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 854 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 855 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 856 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 857 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 858 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 859 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 860 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 861 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 863 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 864 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 865 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 866 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 867 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 868 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 869 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 870 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 871 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 872 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 873 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 874 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 875 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 876 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 877 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 878 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 879 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 880 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 881 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 882 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 883 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 884 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 885 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 886 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 887 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 888 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 889 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 890 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 891 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 892 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 893 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 895 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 896 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 897 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 898 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 899 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 900 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 901 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 902 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 903 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 904 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 905 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 906 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 907 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 908 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 909 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 911 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 912 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 913 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 914 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 915 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 916 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 917 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 918 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 919 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 920 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 921 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 922 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 923 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 924 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 925 | |||
| 926 | /*===========================================================================*/ | ||
| 927 | /* External declarations. */ | ||
| 928 | /*===========================================================================*/ | ||
| 929 | |||
| 930 | #if !defined(_FROM_ASM_) | ||
| 931 | #ifdef __cplusplus | ||
| 932 | extern "C" { | ||
| 933 | #endif | ||
| 934 | void boardInit(void); | ||
| 935 | #ifdef __cplusplus | ||
| 936 | } | ||
| 937 | #endif | ||
| 938 | #endif /* _FROM_ASM_ */ | ||
| 939 | |||
| 940 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # List of all the board related files. | ||
| 2 | BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c | ||
| 3 | |||
| 4 | # Required include directories | ||
| 5 | BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY | ||
diff --git a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg b/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg deleted file mode 100644 index 9c7cf4fd7..000000000 --- a/keyboards/projectkb/alice/boards/ST_STM32F072B_DISCOVERY/cfg/board.chcfg +++ /dev/null | |||
| @@ -1,703 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!-- STM32F0xx board Template --> | ||
| 3 | <board | ||
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 5 | xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f0xx_board.xsd"> | ||
| 6 | <configuration_settings> | ||
| 7 | <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path> | ||
| 8 | <output_path>..</output_path> | ||
| 9 | <hal_version>3.0.x</hal_version> | ||
| 10 | </configuration_settings> | ||
| 11 | <board_name>ST STM32F072B-Discovery</board_name> | ||
| 12 | <board_id>ST_STM32F072B_DISCOVERY</board_id> | ||
| 13 | <board_functions></board_functions> | ||
| 14 | <subtype>STM32F072xB</subtype> | ||
| 15 | <clocks HSEFrequency="0" HSEBypass="true" LSEFrequency="0" | ||
| 16 | LSEBypass="false" LSEDrive="3 High Drive (default)" /> | ||
| 17 | <ports> | ||
| 18 | <GPIOA> | ||
| 19 | <pin0 | ||
| 20 | ID="BUTTON" | ||
| 21 | Type="PushPull" | ||
| 22 | Speed="Minimum" | ||
| 23 | Resistor="Floating" | ||
| 24 | Level="High" | ||
| 25 | Mode="Input" | ||
| 26 | Alternate="0" /> | ||
| 27 | <pin1 | ||
| 28 | ID="" | ||
| 29 | Type="PushPull" | ||
| 30 | Speed="Minimum" | ||
| 31 | Resistor="PullUp" | ||
| 32 | Level="High" | ||
| 33 | Mode="Input" | ||
| 34 | Alternate="0" /> | ||
| 35 | <pin2 | ||
| 36 | ID="" | ||
| 37 | Type="PushPull" | ||
| 38 | Speed="Minimum" | ||
| 39 | Resistor="PullUp" | ||
| 40 | Level="High" | ||
| 41 | Mode="Input" | ||
| 42 | Alternate="0" /> | ||
| 43 | <pin3 | ||
| 44 | ID="" | ||
| 45 | Type="PushPull" | ||
| 46 | Speed="Minimum" | ||
| 47 | Resistor="PullUp" | ||
| 48 | Level="High" | ||
| 49 | Mode="Input" | ||
| 50 | Alternate="0" /> | ||
| 51 | <pin4 | ||
| 52 | ID="" | ||
| 53 | Type="PushPull" | ||
| 54 | Speed="Minimum" | ||
| 55 | Resistor="PullUp" | ||
| 56 | Level="High" | ||
| 57 | Mode="Input" | ||
| 58 | Alternate="0" /> | ||
| 59 | <pin5 | ||
| 60 | ID="" | ||
| 61 | Type="PushPull" | ||
| 62 | Speed="Minimum" | ||
| 63 | Resistor="PullUp" | ||
| 64 | Level="High" | ||
| 65 | Mode="Input" | ||
| 66 | Alternate="0" /> | ||
| 67 | <pin6 | ||
| 68 | ID="" | ||
| 69 | Type="PushPull" | ||
| 70 | Speed="Minimum" | ||
| 71 | Resistor="PullUp" | ||
| 72 | Level="High" | ||
| 73 | Mode="Input" | ||
| 74 | Alternate="0" /> | ||
| 75 | <pin7 | ||
| 76 | ID="" | ||
| 77 | Type="PushPull" | ||
| 78 | Speed="Minimum" | ||
| 79 | Resistor="PullUp" | ||
| 80 | Level="High" | ||
| 81 | Mode="Input" | ||
| 82 | Alternate="0" /> | ||
| 83 | <pin8 | ||
| 84 | ID="" | ||
| 85 | Type="PushPull" | ||
| 86 | Speed="Minimum" | ||
| 87 | Resistor="PullUp" | ||
| 88 | Level="High" | ||
| 89 | Mode="Input" | ||
| 90 | Alternate="0" /> | ||
| 91 | <pin9 | ||
| 92 | ID="" | ||
| 93 | Type="PushPull" | ||
| 94 | Speed="Minimum" | ||
| 95 | Resistor="PullUp" | ||
| 96 | Level="High" | ||
| 97 | Mode="Input" | ||
| 98 | Alternate="0" /> | ||
| 99 | <pin10 | ||
| 100 | ID="" | ||
| 101 | Type="PushPull" | ||
| 102 | Speed="Minimum" | ||
| 103 | Resistor="PullUp" | ||
| 104 | Level="High" | ||
| 105 | Mode="Input" | ||
| 106 | Alternate="0" /> | ||
| 107 | <pin11 | ||
| 108 | ID="USB_DM" | ||
| 109 | Type="PushPull" | ||
| 110 | Speed="Minimum" | ||
| 111 | Resistor="Floating" | ||
| 112 | Level="High" | ||
| 113 | Mode="Input" | ||
| 114 | Alternate="0" /> | ||
| 115 | <pin12 | ||
| 116 | ID="USB_DP" | ||
| 117 | Type="PushPull" | ||
| 118 | Speed="Minimum" | ||
| 119 | Resistor="Floating" | ||
| 120 | Level="High" | ||
| 121 | Mode="Input" | ||
| 122 | Alternate="0" /> | ||
| 123 | <pin13 | ||
| 124 | ID="SWDIO" | ||
| 125 | Type="PushPull" | ||
| 126 | Speed="Maximum" | ||
| 127 | Resistor="PullUp" | ||
| 128 | Level="High" | ||
| 129 | Mode="Alternate" | ||
| 130 | Alternate="0" /> | ||
| 131 | <pin14 | ||
| 132 | ID="SWCLK" | ||
| 133 | Type="PushPull" | ||
| 134 | Speed="Maximum" | ||
| 135 | Resistor="PullDown" | ||
| 136 | Level="High" | ||
| 137 | Mode="Alternate" | ||
| 138 | Alternate="0" /> | ||
| 139 | <pin15 | ||
| 140 | ID="" | ||
| 141 | Type="PushPull" | ||
| 142 | Speed="Maximum" | ||
| 143 | Resistor="PullUp" | ||
| 144 | Level="High" | ||
| 145 | Mode="Input" | ||
| 146 | Alternate="0" /> | ||
| 147 | </GPIOA> | ||
| 148 | <GPIOB> | ||
| 149 | <pin0 | ||
| 150 | ID="" | ||
| 151 | Type="PushPull" | ||
| 152 | Speed="Minimum" | ||
| 153 | Resistor="PullUp" | ||
| 154 | Level="High" | ||
| 155 | Mode="Input" | ||
| 156 | Alternate="0" /> | ||
| 157 | <pin1 | ||
| 158 | ID="" | ||
| 159 | Type="PushPull" | ||
| 160 | Speed="Minimum" | ||
| 161 | Resistor="PullUp" | ||
| 162 | Level="High" | ||
| 163 | Mode="Input" | ||
| 164 | Alternate="0" /> | ||
| 165 | <pin2 | ||
| 166 | ID="" | ||
| 167 | Type="PushPull" | ||
| 168 | Speed="Maximum" | ||
| 169 | Resistor="PullUp" | ||
| 170 | Level="High" | ||
| 171 | Mode="Input" | ||
| 172 | Alternate="0" /> | ||
| 173 | <pin3 | ||
| 174 | ID="" | ||
| 175 | Type="PushPull" | ||
| 176 | Speed="Maximum" | ||
| 177 | Resistor="PullUp" | ||
| 178 | Level="High" | ||
| 179 | Mode="Input" | ||
| 180 | Alternate="0" /> | ||
| 181 | <pin4 | ||
| 182 | ID="" | ||
| 183 | Type="PushPull" | ||
| 184 | Speed="Maximum" | ||
| 185 | Resistor="PullUp" | ||
| 186 | Level="High" | ||
| 187 | Mode="Input" | ||
| 188 | Alternate="0" /> | ||
| 189 | <pin5 | ||
| 190 | ID="" | ||
| 191 | Type="PushPull" | ||
| 192 | Speed="Minimum" | ||
| 193 | Resistor="PullUp" | ||
| 194 | Level="High" | ||
| 195 | Mode="Input" | ||
| 196 | Alternate="0" /> | ||
| 197 | <pin6 | ||
| 198 | ID="" | ||
| 199 | Type="PushPull" | ||
| 200 | Speed="Minimum" | ||
| 201 | Resistor="PullUp" | ||
| 202 | Level="High" | ||
| 203 | Mode="Input" | ||
| 204 | Alternate="0" /> | ||
| 205 | <pin7 | ||
| 206 | ID="" | ||
| 207 | Type="PushPull" | ||
| 208 | Speed="Minimum" | ||
| 209 | Resistor="PullUp" | ||
| 210 | Level="High" | ||
| 211 | Mode="Input" | ||
| 212 | Alternate="0" /> | ||
| 213 | <pin8 | ||
| 214 | ID="" | ||
| 215 | Type="PushPull" | ||
| 216 | Speed="Minimum" | ||
| 217 | Resistor="PullUp" | ||
| 218 | Level="High" | ||
| 219 | Mode="Input" | ||
| 220 | Alternate="0" /> | ||
| 221 | <pin9 | ||
| 222 | ID="" | ||
| 223 | Type="PushPull" | ||
| 224 | Speed="Minimum" | ||
| 225 | Resistor="PullUp" | ||
| 226 | Level="High" | ||
| 227 | Mode="Input" | ||
| 228 | Alternate="0" /> | ||
| 229 | <pin10 | ||
| 230 | ID="" | ||
| 231 | Type="PushPull" | ||
| 232 | Speed="Minimum" | ||
| 233 | Resistor="PullUp" | ||
| 234 | Level="High" | ||
| 235 | Mode="Input" | ||
| 236 | Alternate="0" /> | ||
| 237 | <pin11 | ||
| 238 | ID="" | ||
| 239 | Type="PushPull" | ||
| 240 | Speed="Minimum" | ||
| 241 | Resistor="PullUp" | ||
| 242 | Level="High" | ||
| 243 | Mode="Input" | ||
| 244 | Alternate="0" /> | ||
| 245 | <pin12 | ||
| 246 | ID="" | ||
| 247 | Type="PushPull" | ||
| 248 | Speed="Minimum" | ||
| 249 | Resistor="PullUp" | ||
| 250 | Level="High" | ||
| 251 | Mode="Input" | ||
| 252 | Alternate="0" /> | ||
| 253 | <pin13 | ||
| 254 | ID="SPI2_SCK" | ||
| 255 | Type="PushPull" | ||
| 256 | Speed="Minimum" | ||
| 257 | Resistor="Floating" | ||
| 258 | Level="High" | ||
| 259 | Mode="Alternate" | ||
| 260 | Alternate="0" /> | ||
| 261 | <pin14 | ||
| 262 | ID="SPI2_MISO" | ||
| 263 | Type="PushPull" | ||
| 264 | Speed="Minimum" | ||
| 265 | Resistor="Floating" | ||
| 266 | Level="High" | ||
| 267 | Mode="Alternate" | ||
| 268 | Alternate="0" /> | ||
| 269 | <pin15 | ||
| 270 | ID="SPI2_MOSI" | ||
| 271 | Type="PushPull" | ||
| 272 | Speed="Minimum" | ||
| 273 | Resistor="Floating" | ||
| 274 | Level="High" | ||
| 275 | Mode="Alternate" | ||
| 276 | Alternate="0" /> | ||
| 277 | </GPIOB> | ||
| 278 | <GPIOC> | ||
| 279 | <pin0 | ||
| 280 | ID="MEMS_CS" | ||
| 281 | Type="PushPull" | ||
| 282 | Speed="Maximum" | ||
| 283 | Resistor="Floating" | ||
| 284 | Level="High" | ||
| 285 | Mode="Output" | ||
| 286 | Alternate="0" /> | ||
| 287 | <pin1 | ||
| 288 | ID="" | ||
| 289 | Type="PushPull" | ||
| 290 | Speed="Minimum" | ||
| 291 | Resistor="PullUp" | ||
| 292 | Level="High" | ||
| 293 | Mode="Input" | ||
| 294 | Alternate="0" /> | ||
| 295 | <pin2 | ||
| 296 | ID="" | ||
| 297 | Type="PushPull" | ||
| 298 | Speed="Minimum" | ||
| 299 | Resistor="PullUp" | ||
| 300 | Level="High" | ||
| 301 | Mode="Input" | ||
| 302 | Alternate="0" /> | ||
| 303 | <pin3 | ||
| 304 | ID="" | ||
| 305 | Type="PushPull" | ||
| 306 | Speed="Minimum" | ||
| 307 | Resistor="PullUp" | ||
| 308 | Level="High" | ||
| 309 | Mode="Input" | ||
| 310 | Alternate="0" /> | ||
| 311 | <pin4 | ||
| 312 | ID="" | ||
| 313 | Type="PushPull" | ||
| 314 | Speed="Minimum" | ||
| 315 | Resistor="PullUp" | ||
| 316 | Level="High" | ||
| 317 | Mode="Input" | ||
| 318 | Alternate="0" /> | ||
| 319 | <pin5 | ||
| 320 | ID="" | ||
| 321 | Type="PushPull" | ||
| 322 | Speed="Minimum" | ||
| 323 | Resistor="PullUp" | ||
| 324 | Level="High" | ||
| 325 | Mode="Input" | ||
| 326 | Alternate="0" /> | ||
| 327 | <pin6 | ||
| 328 | ID="LED_RED" | ||
| 329 | Type="PushPull" | ||
| 330 | Speed="Maximum" | ||
| 331 | Resistor="Floating" | ||
| 332 | Level="Low" | ||
| 333 | Mode="Output" | ||
| 334 | Alternate="0" /> | ||
| 335 | <pin7 | ||
| 336 | ID="LED_BLUE" | ||
| 337 | Type="PushPull" | ||
| 338 | Speed="Maximum" | ||
| 339 | Resistor="Floating" | ||
| 340 | Level="Low" | ||
| 341 | Mode="Output" | ||
| 342 | Alternate="0" /> | ||
| 343 | <pin8 | ||
| 344 | ID="LED_ORANGE" | ||
| 345 | Type="PushPull" | ||
| 346 | Speed="Maximum" | ||
| 347 | Resistor="Floating" | ||
| 348 | Level="Low" | ||
| 349 | Mode="Output" | ||
| 350 | Alternate="0" ></pin8> | ||
| 351 | <pin9 | ||
| 352 | ID="LED_GREEN" | ||
| 353 | Type="PushPull" | ||
| 354 | Speed="Maximum" | ||
| 355 | Resistor="Floating" | ||
| 356 | Level="Low" | ||
| 357 | Mode="Output" | ||
| 358 | Alternate="0" /> | ||
| 359 | <pin10 | ||
| 360 | ID="" | ||
| 361 | Type="PushPull" | ||
| 362 | Speed="Minimum" | ||
| 363 | Resistor="PullUp" | ||
| 364 | Level="High" | ||
| 365 | Mode="Input" | ||
| 366 | Alternate="0" /> | ||
| 367 | <pin11 | ||
| 368 | ID="" | ||
| 369 | Type="PushPull" | ||
| 370 | Speed="Minimum" | ||
| 371 | Resistor="PullUp" | ||
| 372 | Level="High" | ||
| 373 | Mode="Input" | ||
| 374 | Alternate="0" /> | ||
| 375 | <pin12 | ||
| 376 | ID="" | ||
| 377 | Type="PushPull" | ||
| 378 | Speed="Minimum" | ||
| 379 | Resistor="PullUp" | ||
| 380 | Level="High" | ||
| 381 | Mode="Input" | ||
| 382 | Alternate="0" /> | ||
| 383 | <pin13 | ||
| 384 | ID="" | ||
| 385 | Type="PushPull" | ||
| 386 | Speed="Minimum" | ||
| 387 | Resistor="PullUp" | ||
| 388 | Level="High" | ||
| 389 | Mode="Input" | ||
| 390 | Alternate="0" /> | ||
| 391 | <pin14 | ||
| 392 | ID="OSC32_IN" | ||
| 393 | Type="PushPull" | ||
| 394 | Speed="Maximum" | ||
| 395 | Resistor="Floating" | ||
| 396 | Level="High" | ||
| 397 | Mode="Input" | ||
| 398 | Alternate="0" /> | ||
| 399 | <pin15 | ||
| 400 | ID="OSC32_OUT" | ||
| 401 | Type="PushPull" | ||
| 402 | Speed="Maximum" | ||
| 403 | Resistor="Floating" | ||
| 404 | Level="High" | ||
| 405 | Mode="Input" | ||
| 406 | Alternate="0" /> | ||
| 407 | </GPIOC> | ||
| 408 | <GPIOD> | ||
| 409 | <pin0 | ||
| 410 | ID="" | ||
| 411 | Type="PushPull" | ||
| 412 | Speed="Minimum" | ||
| 413 | Resistor="PullUp" | ||
| 414 | Level="High" | ||
| 415 | Mode="Input" | ||
| 416 | Alternate="0" /> | ||
| 417 | <pin1 | ||
| 418 | ID="" | ||
| 419 | Type="PushPull" | ||
| 420 | Speed="Minimum" | ||
| 421 | Resistor="PullUp" | ||
| 422 | Level="High" | ||
| 423 | Mode="Input" | ||
| 424 | Alternate="0" /> | ||
| 425 | <pin2 | ||
| 426 | ID="" | ||
| 427 | Type="PushPull" | ||
| 428 | Speed="Minimum" | ||
| 429 | Resistor="PullUp" | ||
| 430 | Level="High" | ||
| 431 | Mode="Input" | ||
| 432 | Alternate="0" /> | ||
| 433 | <pin3 | ||
| 434 | ID="" | ||
| 435 | Type="PushPull" | ||
| 436 | Speed="Minimum" | ||
| 437 | Resistor="PullUp" | ||
| 438 | Level="High" | ||
| 439 | Mode="Input" | ||
| 440 | Alternate="0" /> | ||
| 441 | <pin4 | ||
| 442 | ID="" | ||
| 443 | Type="PushPull" | ||
| 444 | Speed="Minimum" | ||
| 445 | Resistor="PullUp" | ||
| 446 | Level="High" | ||
| 447 | Mode="Input" | ||
| 448 | Alternate="0" /> | ||
| 449 | <pin5 | ||
| 450 | ID="" | ||
| 451 | Type="PushPull" | ||
| 452 | Speed="Minimum" | ||
| 453 | Resistor="PullUp" | ||
| 454 | Level="High" | ||
| 455 | Mode="Input" | ||
| 456 | Alternate="0" /> | ||
| 457 | <pin6 | ||
| 458 | ID="" | ||
| 459 | Type="PushPull" | ||
| 460 | Speed="Minimum" | ||
| 461 | Resistor="PullUp" | ||
| 462 | Level="High" | ||
| 463 | Mode="Input" | ||
| 464 | Alternate="0" /> | ||
| 465 | <pin7 | ||
| 466 | ID="" | ||
| 467 | Type="PushPull" | ||
| 468 | Speed="Minimum" | ||
| 469 | Resistor="PullUp" | ||
| 470 | Level="High" | ||
| 471 | Mode="Input" | ||
| 472 | Alternate="0" /> | ||
| 473 | <pin8 | ||
| 474 | ID="" | ||
| 475 | Type="PushPull" | ||
| 476 | Speed="Minimum" | ||
| 477 | Resistor="PullUp" | ||
| 478 | Level="High" | ||
| 479 | Mode="Input" | ||
| 480 | Alternate="0" /> | ||
| 481 | <pin9 | ||
| 482 | ID="" | ||
| 483 | Type="PushPull" | ||
| 484 | Speed="Minimum" | ||
| 485 | Resistor="PullUp" | ||
| 486 | Level="High" | ||
| 487 | Mode="Input" | ||
| 488 | Alternate="0" /> | ||
| 489 | <pin10 | ||
| 490 | ID="" | ||
| 491 | Type="PushPull" | ||
| 492 | Speed="Minimum" | ||
| 493 | Resistor="PullUp" | ||
| 494 | Level="High" | ||
| 495 | Mode="Input" | ||
| 496 | Alternate="0" /> | ||
| 497 | <pin11 | ||
| 498 | ID="" | ||
| 499 | Type="PushPull" | ||
| 500 | Speed="Minimum" | ||
| 501 | Resistor="PullUp" | ||
| 502 | Level="High" | ||
| 503 | Mode="Input" | ||
| 504 | Alternate="0" /> | ||
| 505 | <pin12 | ||
| 506 | ID="" | ||
| 507 | Type="PushPull" | ||
| 508 | Speed="Minimum" | ||
| 509 | Resistor="PullUp" | ||
| 510 | Level="High" | ||
| 511 | Mode="Input" | ||
| 512 | Alternate="0" /> | ||
| 513 | <pin13 | ||
| 514 | ID="" | ||
| 515 | Type="PushPull" | ||
| 516 | Speed="Minimum" | ||
| 517 | Resistor="PullUp" | ||
| 518 | Level="High" | ||
| 519 | Mode="Input" | ||
| 520 | Alternate="0" /> | ||
| 521 | <pin14 | ||
| 522 | ID="" | ||
| 523 | Type="PushPull" | ||
| 524 | Speed="Minimum" | ||
| 525 | Resistor="PullUp" | ||
| 526 | Level="High" | ||
| 527 | Mode="Input" | ||
| 528 | Alternate="0" /> | ||
| 529 | <pin15 | ||
| 530 | ID="" | ||
| 531 | Type="PushPull" | ||
| 532 | Speed="Minimum" | ||
| 533 | Resistor="PullUp" | ||
| 534 | Level="High" | ||
| 535 | Mode="Input" | ||
| 536 | Alternate="0" /> | ||
| 537 | </GPIOD> | ||
| 538 | <GPIOE> | ||
| 539 | <pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 540 | Level="High" Mode="Input" Alternate="0" /> | ||
| 541 | <pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 542 | Level="High" Mode="Input" Alternate="0" /> | ||
| 543 | <pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 544 | Level="High" Mode="Input" Alternate="0" /> | ||
| 545 | <pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 546 | Level="High" Mode="Input" Alternate="0" /> | ||
| 547 | <pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 548 | Level="High" Mode="Input" Alternate="0" /> | ||
| 549 | <pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 550 | Level="High" Mode="Input" Alternate="0" /> | ||
| 551 | <pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 552 | Level="High" Mode="Input" Alternate="0" /> | ||
| 553 | <pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 554 | Level="High" Mode="Input" Alternate="0" /> | ||
| 555 | <pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 556 | Level="High" Mode="Input" Alternate="0" /> | ||
| 557 | <pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 558 | Level="High" Mode="Input" Alternate="0" /> | ||
| 559 | <pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 560 | Level="High" Mode="Input" Alternate="0" /> | ||
| 561 | <pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 562 | Level="High" Mode="Input" Alternate="0" /> | ||
| 563 | <pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 564 | Level="High" Mode="Input" Alternate="0" /> | ||
| 565 | <pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 566 | Level="High" Mode="Input" Alternate="0" /> | ||
| 567 | <pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 568 | Level="High" Mode="Input" Alternate="0" /> | ||
| 569 | <pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp" | ||
| 570 | Level="High" Mode="Input" Alternate="0" /> | ||
| 571 | </GPIOE> | ||
| 572 | <GPIOF> | ||
| 573 | <pin0 | ||
| 574 | ID="OSC_IN" | ||
| 575 | Type="PushPull" | ||
| 576 | Speed="Minimum" | ||
| 577 | Resistor="Floating" | ||
| 578 | Level="High" | ||
| 579 | Mode="Input" | ||
| 580 | Alternate="0" /> | ||
| 581 | <pin1 | ||
| 582 | ID="OSC_OUT" | ||
| 583 | Type="PushPull" | ||
| 584 | Speed="Minimum" | ||
| 585 | Resistor="Floating" | ||
| 586 | Level="High" | ||
| 587 | Mode="Input" | ||
| 588 | Alternate="0" /> | ||
| 589 | <pin2 | ||
| 590 | ID="" | ||
| 591 | Type="PushPull" | ||
| 592 | Speed="Minimum" | ||
| 593 | Resistor="PullUp" | ||
| 594 | Level="High" | ||
| 595 | Mode="Input" | ||
| 596 | Alternate="0" /> | ||
| 597 | <pin3 | ||
| 598 | ID="" | ||
| 599 | Type="PushPull" | ||
| 600 | Speed="Minimum" | ||
| 601 | Resistor="PullUp" | ||
| 602 | Level="High" | ||
| 603 | Mode="Input" | ||
| 604 | Alternate="0" /> | ||
| 605 | <pin4 | ||
| 606 | ID="" | ||
| 607 | Type="PushPull" | ||
| 608 | Speed="Minimum" | ||
| 609 | Resistor="PullUp" | ||
| 610 | Level="High" | ||
| 611 | Mode="Input" | ||
| 612 | Alternate="0" /> | ||
| 613 | <pin5 | ||
| 614 | ID="" | ||
| 615 | Type="PushPull" | ||
| 616 | Speed="Minimum" | ||
| 617 | Resistor="PullUp" | ||
| 618 | Level="High" | ||
| 619 | Mode="Input" | ||
| 620 | Alternate="0" /> | ||
| 621 | <pin6 | ||
| 622 | ID="" | ||
| 623 | Type="PushPull" | ||
| 624 | Speed="Minimum" | ||
| 625 | Resistor="PullUp" | ||
| 626 | Level="High" | ||
| 627 | Mode="Input" | ||
| 628 | Alternate="0" /> | ||
| 629 | <pin7 | ||
| 630 | ID="" | ||
| 631 | Type="PushPull" | ||
| 632 | Speed="Minimum" | ||
| 633 | Resistor="PullUp" | ||
| 634 | Level="High" | ||
| 635 | Mode="Input" | ||
| 636 | Alternate="0" /> | ||
| 637 | <pin8 | ||
| 638 | ID="" | ||
| 639 | Type="PushPull" | ||
| 640 | Speed="Minimum" | ||
| 641 | Resistor="PullUp" | ||
| 642 | Level="High" | ||
| 643 | Mode="Input" | ||
| 644 | Alternate="0" /> | ||
| 645 | <pin9 | ||
| 646 | ID="" | ||
| 647 | Type="PushPull" | ||
| 648 | Speed="Minimum" | ||
| 649 | Resistor="PullUp" | ||
| 650 | Level="High" | ||
| 651 | Mode="Input" | ||
| 652 | Alternate="0" /> | ||
| 653 | <pin10 | ||
| 654 | ID="" | ||
| 655 | Type="PushPull" | ||
| 656 | Speed="Minimum" | ||
| 657 | Resistor="PullUp" | ||
| 658 | Level="High" | ||
| 659 | Mode="Input" | ||
| 660 | Alternate="0" /> | ||
| 661 | <pin11 | ||
| 662 | ID="" | ||
| 663 | Type="PushPull" | ||
| 664 | Speed="Minimum" | ||
| 665 | Resistor="PullUp" | ||
| 666 | Level="High" | ||
| 667 | Mode="Input" | ||
| 668 | Alternate="0" /> | ||
| 669 | <pin12 | ||
| 670 | ID="" | ||
| 671 | Type="PushPull" | ||
| 672 | Speed="Minimum" | ||
| 673 | Resistor="PullUp" | ||
| 674 | Level="High" | ||
| 675 | Mode="Input" | ||
| 676 | Alternate="0" /> | ||
| 677 | <pin13 | ||
| 678 | ID="" | ||
| 679 | Type="PushPull" | ||
| 680 | Speed="Minimum" | ||
| 681 | Resistor="PullUp" | ||
| 682 | Level="High" | ||
| 683 | Mode="Input" | ||
| 684 | Alternate="0" /> | ||
| 685 | <pin14 | ||
| 686 | ID="" | ||
| 687 | Type="PushPull" | ||
| 688 | Speed="Minimum" | ||
| 689 | Resistor="PullUp" | ||
| 690 | Level="High" | ||
| 691 | Mode="Input" | ||
| 692 | Alternate="0" /> | ||
| 693 | <pin15 | ||
| 694 | ID="" | ||
| 695 | Type="PushPull" | ||
| 696 | Speed="Minimum" | ||
| 697 | Resistor="PullUp" | ||
| 698 | Level="High" | ||
| 699 | Mode="Input" | ||
| 700 | Alternate="0" /> | ||
| 701 | </GPIOF> | ||
| 702 | </ports> | ||
| 703 | </board> | ||
diff --git a/keyboards/projectkb/alice/bootloader_defs.h b/keyboards/projectkb/alice/bootloader_defs.h deleted file mode 100644 index 02c48c4e6..000000000 --- a/keyboards/projectkb/alice/bootloader_defs.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | /* Address for jumping to bootloader on STM32 chips. */ | ||
| 2 | /* It is chip dependent, the correct number can be looked up here (page 175): | ||
| 3 | * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf | ||
| 4 | * This also requires a patch to chibios: | ||
| 5 | * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch | ||
| 6 | */ | ||
| 7 | #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 | ||
diff --git a/keyboards/projectkb/alice/config.h b/keyboards/projectkb/alice/config.h index 61648dc7d..11863b807 100644 --- a/keyboards/projectkb/alice/config.h +++ b/keyboards/projectkb/alice/config.h | |||
| @@ -33,6 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 33 | #define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } | 33 | #define MATRIX_ROW_PINS { B1, B0, A7, A5, A4 } |
| 34 | #define DIODE_DIRECTION COL2ROW | 34 | #define DIODE_DIRECTION COL2ROW |
| 35 | 35 | ||
| 36 | #define BACKLIGHT_PIN A6 | ||
| 37 | #define BACKLIGHT_PWM_DRIVER PWMD3 | ||
| 38 | #define BACKLIGHT_PWM_CHANNEL 1 | ||
| 39 | #define BACKLIGHT_PAL_MODE 1 | ||
| 36 | #define BACKLIGHT_LEVELS 6 | 40 | #define BACKLIGHT_LEVELS 6 |
| 37 | #define BACKLIGHT_BREATHING | 41 | #define BACKLIGHT_BREATHING |
| 38 | #define BREATHING_PERIOD 6 | 42 | #define BREATHING_PERIOD 6 |
| @@ -52,16 +56,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 52 | #define RGB_DI_PIN B15 | 56 | #define RGB_DI_PIN B15 |
| 53 | #define RGBLED_NUM 14 | 57 | #define RGBLED_NUM 14 |
| 54 | #define WS2812_SPI SPID2 | 58 | #define WS2812_SPI SPID2 |
| 59 | #define WS2812_SPI_MOSI_PAL_MODE 0 | ||
| 55 | 60 | ||
| 56 | // Backlight config starts after VIA's EEPROM usage, | ||
| 57 | // dynamic keymaps start after this. | ||
| 58 | #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 1 | ||
| 59 | |||
| 60 | // VIA lighting is handled by the keyboard-level code | ||
| 61 | #define VIA_CUSTOM_LIGHTING_ENABLE | ||
| 62 | |||
| 63 | // Let VIA handle the QMK RGBLIGHT | ||
| 64 | #define VIA_QMK_RGBLIGHT_ENABLE | ||
| 65 | 61 | ||
| 66 | // 2 bits for 4 layout options | 62 | // 2 bits for 4 layout options |
| 67 | #define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 2 | 63 | #define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 2 |
diff --git a/keyboards/projectkb/alice/keymaps/via/keymap.c b/keyboards/projectkb/alice/keymaps/via/keymap.c index a75bb8d97..ff084d1fc 100644 --- a/keyboards/projectkb/alice/keymaps/via/keymap.c +++ b/keyboards/projectkb/alice/keymaps/via/keymap.c | |||
| @@ -52,5 +52,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 52 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 52 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 53 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | 53 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS |
| 54 | ) | 54 | ) |
| 55 | 55 | ||
| 56 | }; | 56 | }; |
diff --git a/keyboards/projectkb/alice/rules.mk b/keyboards/projectkb/alice/rules.mk index 3bb6531af..0f9d71b89 100644 --- a/keyboards/projectkb/alice/rules.mk +++ b/keyboards/projectkb/alice/rules.mk | |||
| @@ -1,17 +1,11 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = STM32F072 | 2 | MCU = STM32F072 |
| 3 | BOARD = ST_STM32F072B_DISCOVERY | ||
| 4 | 3 | ||
| 5 | # Build Options | 4 | # Build Options |
| 6 | # comment out to disable the options. | 5 | # comment out to disable the options. |
| 7 | # | 6 | # |
| 8 | 7 | ||
| 9 | # project specific files | 8 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
| 10 | VPATH += keyboards/cannonkeys/stm32f072 | ||
| 11 | SRC = keyboard.c \ | ||
| 12 | led.c | ||
| 13 | |||
| 14 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration | ||
| 15 | MOUSEKEY_ENABLE = yes # Mouse keys | 9 | MOUSEKEY_ENABLE = yes # Mouse keys |
| 16 | EXTRAKEY_ENABLE = yes # Audio control and System control | 10 | EXTRAKEY_ENABLE = yes # Audio control and System control |
| 17 | CONSOLE_ENABLE = yes # Console for debug | 11 | CONSOLE_ENABLE = yes # Console for debug |
| @@ -19,13 +13,10 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 19 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 13 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 20 | NKRO_ENABLE = yes # USB Nkey Rollover | 14 | NKRO_ENABLE = yes # USB Nkey Rollover |
| 21 | CUSTOM_MATRIX = no # Custom matrix file | 15 | CUSTOM_MATRIX = no # Custom matrix file |
| 22 | # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason | 16 | BACKLIGHT_ENABLE = yes |
| 23 | RGBLIGHT_ENABLE = yes | 17 | RGBLIGHT_ENABLE = yes |
| 24 | WS2812_DRIVER = spi | 18 | WS2812_DRIVER = spi |
| 25 | 19 | ||
| 26 | # RAW_ENABLE = yes | ||
| 27 | # DYNAMIC_KEYMAP_ENABLE = yes | ||
| 28 | |||
| 29 | 20 | ||
| 30 | # Enter lower-power sleep mode when on the ChibiOS idle thread | 21 | # Enter lower-power sleep mode when on the ChibiOS idle thread |
| 31 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | 22 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE |
