diff options
| author | TerryMathews <terry@terrymathews.net> | 2020-03-12 15:52:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-12 19:52:59 +0000 |
| commit | 18bc5254932a842276627d8f055b6fb1d3345230 (patch) | |
| tree | 0b8d831958384bb146dd0af751806e44cdbd691a | |
| parent | 4edb5a5e8c72e3be7fda20069941ea215cb49916 (diff) | |
| download | qmk_firmware-18bc5254932a842276627d8f055b6fb1d3345230.tar.gz qmk_firmware-18bc5254932a842276627d8f055b6fb1d3345230.zip | |
[Keyboard] Candybar update (#8335)
* Candybar: split lefty and righty into subprojects.
* Update readme.md
* Update readme.md
* Candybar: Moved STM32 library files into project root folder.
* Update keyboards/candybar/righty/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/candybar/righty/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/candybar/righty/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/candybar/righty/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/candybar/righty/righty.c
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Candybar: remove Boards directory so project uses one from drivers
* Update keyboards/candybar/righty/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update readme.md
* Update readme.md
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
18 files changed, 236 insertions, 1239 deletions
diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997..000000000 --- a/keyboards/candybar/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/candybar/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 173f7b605..000000000 --- a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null | |||
| @@ -1,923 +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 | * Setup for ST STM32F072B-Discovery board. | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Board identifier. | ||
| 31 | */ | ||
| 32 | #define BOARD_ST_STM32F072B_DISCOVERY | ||
| 33 | #define BOARD_NAME "ST STM32F072B-Discovery" | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Board oscillators-related settings. | ||
| 37 | * NOTE: LSE not fitted. | ||
| 38 | * NOTE: HSE not fitted. | ||
| 39 | */ | ||
| 40 | #if !defined(STM32_LSECLK) | ||
| 41 | #define STM32_LSECLK 0U | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #define STM32_LSEDRV (3U << 3U) | ||
| 45 | |||
| 46 | #if !defined(STM32_HSECLK) | ||
| 47 | #define STM32_HSECLK 0U | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #define STM32_HSE_BYPASS | ||
| 51 | |||
| 52 | /* | ||
| 53 | * MCU type as defined in the ST header. | ||
| 54 | */ | ||
| 55 | #define STM32F072xB | ||
| 56 | |||
| 57 | /* | ||
| 58 | * IO pins assignments. | ||
| 59 | */ | ||
| 60 | #define GPIOA_BUTTON 0U | ||
| 61 | #define GPIOA_PIN1 1U | ||
| 62 | #define GPIOA_PIN2 2U | ||
| 63 | #define GPIOA_PIN3 3U | ||
| 64 | #define GPIOA_PIN4 4U | ||
| 65 | #define GPIOA_PIN5 5U | ||
| 66 | #define GPIOA_PIN6 6U | ||
| 67 | #define GPIOA_PIN7 7U | ||
| 68 | #define GPIOA_PIN8 8U | ||
| 69 | #define GPIOA_PIN9 9U | ||
| 70 | #define GPIOA_PIN10 10U | ||
| 71 | #define GPIOA_USB_DM 11U | ||
| 72 | #define GPIOA_USB_DP 12U | ||
| 73 | #define GPIOA_SWDIO 13U | ||
| 74 | #define GPIOA_SWCLK 14U | ||
| 75 | #define GPIOA_PIN15 15U | ||
| 76 | |||
| 77 | #define GPIOB_PIN0 0U | ||
| 78 | #define GPIOB_PIN1 1U | ||
| 79 | #define GPIOB_PIN2 2U | ||
| 80 | #define GPIOB_PIN3 3U | ||
| 81 | #define GPIOB_PIN4 4U | ||
| 82 | #define GPIOB_PIN5 5U | ||
| 83 | #define GPIOB_PIN6 6U | ||
| 84 | #define GPIOB_PIN7 7U | ||
| 85 | #define GPIOB_PIN8 8U | ||
| 86 | #define GPIOB_PIN9 9U | ||
| 87 | #define GPIOB_PIN10 10U | ||
| 88 | #define GPIOB_PIN11 11U | ||
| 89 | #define GPIOB_PIN12 12U | ||
| 90 | #define GPIOB_SPI2_SCK 13U | ||
| 91 | #define GPIOB_SPI2_MISO 14U | ||
| 92 | #define GPIOB_SPI2_MOSI 15U | ||
| 93 | |||
| 94 | #define GPIOC_MEMS_CS 0U | ||
| 95 | #define GPIOC_PIN1 1U | ||
| 96 | #define GPIOC_PIN2 2U | ||
| 97 | #define GPIOC_PIN3 3U | ||
| 98 | #define GPIOC_PIN4 4U | ||
| 99 | #define GPIOC_PIN5 5U | ||
| 100 | #define GPIOC_LED_RED 6U | ||
| 101 | #define GPIOC_LED_BLUE 7U | ||
| 102 | #define GPIOC_LED_ORANGE 8U | ||
| 103 | #define GPIOC_LED_GREEN 9U | ||
| 104 | #define GPIOC_PIN10 10U | ||
| 105 | #define GPIOC_PIN11 11U | ||
| 106 | #define GPIOC_PIN12 12U | ||
| 107 | #define GPIOC_PIN13 13U | ||
| 108 | #define GPIOC_OSC32_IN 14U | ||
| 109 | #define GPIOC_OSC32_OUT 15U | ||
| 110 | |||
| 111 | #define GPIOD_PIN0 0U | ||
| 112 | #define GPIOD_PIN1 1U | ||
| 113 | #define GPIOD_PIN2 2U | ||
| 114 | #define GPIOD_PIN3 3U | ||
| 115 | #define GPIOD_PIN4 4U | ||
| 116 | #define GPIOD_PIN5 5U | ||
| 117 | #define GPIOD_PIN6 6U | ||
| 118 | #define GPIOD_PIN7 7U | ||
| 119 | #define GPIOD_PIN8 8U | ||
| 120 | #define GPIOD_PIN9 9U | ||
| 121 | #define GPIOD_PIN10 10U | ||
| 122 | #define GPIOD_PIN11 11U | ||
| 123 | #define GPIOD_PIN12 12U | ||
| 124 | #define GPIOD_PIN13 13U | ||
| 125 | #define GPIOD_PIN14 14U | ||
| 126 | #define GPIOD_PIN15 15U | ||
| 127 | |||
| 128 | #define GPIOE_PIN0 0U | ||
| 129 | #define GPIOE_PIN1 1U | ||
| 130 | #define GPIOE_PIN2 2U | ||
| 131 | #define GPIOE_PIN3 3U | ||
| 132 | #define GPIOE_PIN4 4U | ||
| 133 | #define GPIOE_PIN5 5U | ||
| 134 | #define GPIOE_PIN6 6U | ||
| 135 | #define GPIOE_PIN7 7U | ||
| 136 | #define GPIOE_PIN8 8U | ||
| 137 | #define GPIOE_PIN9 9U | ||
| 138 | #define GPIOE_PIN10 10U | ||
| 139 | #define GPIOE_PIN11 11U | ||
| 140 | #define GPIOE_PIN12 12U | ||
| 141 | #define GPIOE_PIN13 13U | ||
| 142 | #define GPIOE_PIN14 14U | ||
| 143 | #define GPIOE_PIN15 15U | ||
| 144 | |||
| 145 | #define GPIOF_OSC_IN 0U | ||
| 146 | #define GPIOF_OSC_OUT 1U | ||
| 147 | #define GPIOF_PIN2 2U | ||
| 148 | #define GPIOF_PIN3 3U | ||
| 149 | #define GPIOF_PIN4 4U | ||
| 150 | #define GPIOF_PIN5 5U | ||
| 151 | #define GPIOF_PIN6 6U | ||
| 152 | #define GPIOF_PIN7 7U | ||
| 153 | #define GPIOF_PIN8 8U | ||
| 154 | #define GPIOF_PIN9 9U | ||
| 155 | #define GPIOF_PIN10 10U | ||
| 156 | #define GPIOF_PIN11 11U | ||
| 157 | #define GPIOF_PIN12 12U | ||
| 158 | #define GPIOF_PIN13 13U | ||
| 159 | #define GPIOF_PIN14 14U | ||
| 160 | #define GPIOF_PIN15 15U | ||
| 161 | |||
| 162 | /* | ||
| 163 | * IO lines assignments. | ||
| 164 | */ | ||
| 165 | #define LINE_BUTTON PAL_LINE(GPIOA, 0U) | ||
| 166 | #define LINE_USB_DM PAL_LINE(GPIOA, 11U) | ||
| 167 | #define LINE_USB_DP PAL_LINE(GPIOA, 12U) | ||
| 168 | #define LINE_SWDIO PAL_LINE(GPIOA, 13U) | ||
| 169 | #define LINE_SWCLK PAL_LINE(GPIOA, 14U) | ||
| 170 | |||
| 171 | #define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) | ||
| 172 | #define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) | ||
| 173 | #define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) | ||
| 174 | |||
| 175 | #define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) | ||
| 176 | #define LINE_LED_RED PAL_LINE(GPIOC, 6U) | ||
| 177 | #define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) | ||
| 178 | #define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) | ||
| 179 | #define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) | ||
| 180 | #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) | ||
| 181 | #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) | ||
| 182 | |||
| 183 | |||
| 184 | |||
| 185 | #define LINE_OSC_IN PAL_LINE(GPIOF, 0U) | ||
| 186 | #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) | ||
| 187 | |||
| 188 | /* | ||
| 189 | * I/O ports initial setup, this configuration is established soon after reset | ||
| 190 | * in the initialization code. | ||
| 191 | * Please refer to the STM32 Reference Manual for details. | ||
| 192 | */ | ||
| 193 | #define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) | ||
| 194 | #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) | ||
| 195 | #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) | ||
| 196 | #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) | ||
| 197 | #define PIN_ODR_LOW(n) (0U << (n)) | ||
| 198 | #define PIN_ODR_HIGH(n) (1U << (n)) | ||
| 199 | #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) | ||
| 200 | #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) | ||
| 201 | #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) | ||
| 202 | #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) | ||
| 203 | #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) | ||
| 204 | #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) | ||
| 205 | #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) | ||
| 206 | #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) | ||
| 207 | #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) | ||
| 208 | #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) | ||
| 209 | |||
| 210 | /* | ||
| 211 | * GPIOA setup: | ||
| 212 | * | ||
| 213 | * PA0 - BUTTON (input floating). | ||
| 214 | * PA1 - PIN1 (input pullup). | ||
| 215 | * PA2 - PIN2 (input pullup). | ||
| 216 | * PA3 - PIN3 (input pullup). | ||
| 217 | * PA4 - PIN4 (input pullup). | ||
| 218 | * PA5 - PIN5 (input pullup). | ||
| 219 | * PA6 - PIN6 (input pullup). | ||
| 220 | * PA7 - PIN7 (input pullup). | ||
| 221 | * PA8 - PIN8 (input pullup). | ||
| 222 | * PA9 - PIN9 (input pullup). | ||
| 223 | * PA10 - PIN10 (input pullup). | ||
| 224 | * PA11 - USB_DM (input floating). | ||
| 225 | * PA12 - USB_DP (input floating). | ||
| 226 | * PA13 - SWDIO (alternate 0). | ||
| 227 | * PA14 - SWCLK (alternate 0). | ||
| 228 | * PA15 - PIN15 (input pullup). | ||
| 229 | */ | ||
| 230 | #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ | ||
| 231 | PIN_MODE_INPUT(GPIOA_PIN1) | \ | ||
| 232 | PIN_MODE_INPUT(GPIOA_PIN2) | \ | ||
| 233 | PIN_MODE_INPUT(GPIOA_PIN3) | \ | ||
| 234 | PIN_MODE_INPUT(GPIOA_PIN4) | \ | ||
| 235 | PIN_MODE_INPUT(GPIOA_PIN5) | \ | ||
| 236 | PIN_MODE_INPUT(GPIOA_PIN6) | \ | ||
| 237 | PIN_MODE_INPUT(GPIOA_PIN7) | \ | ||
| 238 | PIN_MODE_INPUT(GPIOA_PIN8) | \ | ||
| 239 | PIN_MODE_INPUT(GPIOA_PIN9) | \ | ||
| 240 | PIN_MODE_INPUT(GPIOA_PIN10) | \ | ||
| 241 | PIN_MODE_INPUT(GPIOA_USB_DM) | \ | ||
| 242 | PIN_MODE_INPUT(GPIOA_USB_DP) | \ | ||
| 243 | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ | ||
| 244 | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ | ||
| 245 | PIN_MODE_INPUT(GPIOA_PIN15)) | ||
| 246 | #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ | ||
| 247 | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ | ||
| 248 | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ | ||
| 249 | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ | ||
| 250 | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ | ||
| 251 | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ | ||
| 252 | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ | ||
| 253 | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ | ||
| 254 | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ | ||
| 255 | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ | ||
| 256 | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ | ||
| 257 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ | ||
| 258 | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ | ||
| 259 | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ | ||
| 260 | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ | ||
| 261 | PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) | ||
| 262 | #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ | ||
| 263 | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ | ||
| 264 | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ | ||
| 265 | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ | ||
| 266 | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ | ||
| 267 | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ | ||
| 268 | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ | ||
| 269 | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ | ||
| 270 | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ | ||
| 271 | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ | ||
| 272 | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ | ||
| 273 | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ | ||
| 274 | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ | ||
| 275 | PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ | ||
| 276 | PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ | ||
| 277 | PIN_OSPEED_HIGH(GPIOA_PIN15)) | ||
| 278 | #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ | ||
| 279 | PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ | ||
| 280 | PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ | ||
| 281 | PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ | ||
| 282 | PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ | ||
| 283 | PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ | ||
| 284 | PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ | ||
| 285 | PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ | ||
| 286 | PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ | ||
| 287 | PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ | ||
| 288 | PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ | ||
| 289 | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ | ||
| 290 | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ | ||
| 291 | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ | ||
| 292 | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ | ||
| 293 | PIN_PUPDR_PULLUP(GPIOA_PIN15)) | ||
| 294 | #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ | ||
| 295 | PIN_ODR_HIGH(GPIOA_PIN1) | \ | ||
| 296 | PIN_ODR_HIGH(GPIOA_PIN2) | \ | ||
| 297 | PIN_ODR_HIGH(GPIOA_PIN3) | \ | ||
| 298 | PIN_ODR_HIGH(GPIOA_PIN4) | \ | ||
| 299 | PIN_ODR_HIGH(GPIOA_PIN5) | \ | ||
| 300 | PIN_ODR_HIGH(GPIOA_PIN6) | \ | ||
| 301 | PIN_ODR_HIGH(GPIOA_PIN7) | \ | ||
| 302 | PIN_ODR_HIGH(GPIOA_PIN8) | \ | ||
| 303 | PIN_ODR_HIGH(GPIOA_PIN9) | \ | ||
| 304 | PIN_ODR_HIGH(GPIOA_PIN10) | \ | ||
| 305 | PIN_ODR_HIGH(GPIOA_USB_DM) | \ | ||
| 306 | PIN_ODR_HIGH(GPIOA_USB_DP) | \ | ||
| 307 | PIN_ODR_HIGH(GPIOA_SWDIO) | \ | ||
| 308 | PIN_ODR_HIGH(GPIOA_SWCLK) | \ | ||
| 309 | PIN_ODR_HIGH(GPIOA_PIN15)) | ||
| 310 | #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ | ||
| 311 | PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ | ||
| 312 | PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ | ||
| 313 | PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ | ||
| 314 | PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ | ||
| 315 | PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ | ||
| 316 | PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ | ||
| 317 | PIN_AFIO_AF(GPIOA_PIN7, 0U)) | ||
| 318 | #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ | ||
| 319 | PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ | ||
| 320 | PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ | ||
| 321 | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ | ||
| 322 | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ | ||
| 323 | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ | ||
| 324 | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ | ||
| 325 | PIN_AFIO_AF(GPIOA_PIN15, 0U)) | ||
| 326 | |||
| 327 | /* | ||
| 328 | * GPIOB setup: | ||
| 329 | * | ||
| 330 | * PB0 - PIN0 (input pullup). | ||
| 331 | * PB1 - PIN1 (input pullup). | ||
| 332 | * PB2 - PIN2 (input pullup). | ||
| 333 | * PB3 - PIN3 (input pullup). | ||
| 334 | * PB4 - PIN4 (input pullup). | ||
| 335 | * PB5 - PIN5 (input pullup). | ||
| 336 | * PB6 - PIN6 (input pullup). | ||
| 337 | * PB7 - PIN7 (input pullup). | ||
| 338 | * PB8 - PIN8 (input pullup). | ||
| 339 | * PB9 - PIN9 (input pullup). | ||
| 340 | * PB10 - PIN10 (input pullup). | ||
| 341 | * PB11 - PIN11 (input pullup). | ||
| 342 | * PB12 - PIN12 (input pullup). | ||
| 343 | * PB13 - SPI2_SCK (alternate 0). | ||
| 344 | * PB14 - SPI2_MISO (alternate 0). | ||
| 345 | * PB15 - SPI2_MOSI (alternate 0). | ||
| 346 | */ | ||
| 347 | #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ | ||
| 348 | PIN_MODE_INPUT(GPIOB_PIN1) | \ | ||
| 349 | PIN_MODE_INPUT(GPIOB_PIN2) | \ | ||
| 350 | PIN_MODE_INPUT(GPIOB_PIN3) | \ | ||
| 351 | PIN_MODE_INPUT(GPIOB_PIN4) | \ | ||
| 352 | PIN_MODE_INPUT(GPIOB_PIN5) | \ | ||
| 353 | PIN_MODE_INPUT(GPIOB_PIN6) | \ | ||
| 354 | PIN_MODE_INPUT(GPIOB_PIN7) | \ | ||
| 355 | PIN_MODE_INPUT(GPIOB_PIN8) | \ | ||
| 356 | PIN_MODE_INPUT(GPIOB_PIN9) | \ | ||
| 357 | PIN_MODE_INPUT(GPIOB_PIN10) | \ | ||
| 358 | PIN_MODE_INPUT(GPIOB_PIN11) | \ | ||
| 359 | PIN_MODE_INPUT(GPIOB_PIN12) | \ | ||
| 360 | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ | ||
| 361 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ | ||
| 362 | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) | ||
| 363 | #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ | ||
| 364 | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ | ||
| 365 | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ | ||
| 366 | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ | ||
| 367 | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ | ||
| 368 | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ | ||
| 369 | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ | ||
| 370 | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ | ||
| 371 | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ | ||
| 372 | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ | ||
| 373 | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ | ||
| 374 | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ | ||
| 375 | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ | ||
| 376 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ | ||
| 377 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ | ||
| 378 | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) | ||
| 379 | #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ | ||
| 380 | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ | ||
| 381 | PIN_OSPEED_HIGH(GPIOB_PIN2) | \ | ||
| 382 | PIN_OSPEED_HIGH(GPIOB_PIN3) | \ | ||
| 383 | PIN_OSPEED_HIGH(GPIOB_PIN4) | \ | ||
| 384 | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ | ||
| 385 | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ | ||
| 386 | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ | ||
| 387 | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ | ||
| 388 | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ | ||
| 389 | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ | ||
| 390 | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ | ||
| 391 | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ | ||
| 392 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ | ||
| 393 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ | ||
| 394 | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) | ||
| 395 | #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ | ||
| 396 | PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ | ||
| 397 | PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ | ||
| 398 | PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ | ||
| 399 | PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ | ||
| 400 | PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ | ||
| 401 | PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ | ||
| 402 | PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ | ||
| 403 | PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ | ||
| 404 | PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ | ||
| 405 | PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ | ||
| 406 | PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ | ||
| 407 | PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ | ||
| 408 | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ | ||
| 409 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ | ||
| 410 | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) | ||
| 411 | #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ | ||
| 412 | PIN_ODR_HIGH(GPIOB_PIN1) | \ | ||
| 413 | PIN_ODR_HIGH(GPIOB_PIN2) | \ | ||
| 414 | PIN_ODR_HIGH(GPIOB_PIN3) | \ | ||
| 415 | PIN_ODR_HIGH(GPIOB_PIN4) | \ | ||
| 416 | PIN_ODR_HIGH(GPIOB_PIN5) | \ | ||
| 417 | PIN_ODR_HIGH(GPIOB_PIN6) | \ | ||
| 418 | PIN_ODR_HIGH(GPIOB_PIN7) | \ | ||
| 419 | PIN_ODR_HIGH(GPIOB_PIN8) | \ | ||
| 420 | PIN_ODR_HIGH(GPIOB_PIN9) | \ | ||
| 421 | PIN_ODR_HIGH(GPIOB_PIN10) | \ | ||
| 422 | PIN_ODR_HIGH(GPIOB_PIN11) | \ | ||
| 423 | PIN_ODR_HIGH(GPIOB_PIN12) | \ | ||
| 424 | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ | ||
| 425 | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ | ||
| 426 | PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) | ||
| 427 | #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ | ||
| 428 | PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ | ||
| 429 | PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ | ||
| 430 | PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ | ||
| 431 | PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ | ||
| 432 | PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ | ||
| 433 | PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ | ||
| 434 | PIN_AFIO_AF(GPIOB_PIN7, 0U)) | ||
| 435 | #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ | ||
| 436 | PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ | ||
| 437 | PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ | ||
| 438 | PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ | ||
| 439 | PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ | ||
| 440 | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ | ||
| 441 | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ | ||
| 442 | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) | ||
| 443 | |||
| 444 | /* | ||
| 445 | * GPIOC setup: | ||
| 446 | * | ||
| 447 | * PC0 - MEMS_CS (output pushpull maximum). | ||
| 448 | * PC1 - PIN1 (input pullup). | ||
| 449 | * PC2 - PIN2 (input pullup). | ||
| 450 | * PC3 - PIN3 (input pullup). | ||
| 451 | * PC4 - PIN4 (input pullup). | ||
| 452 | * PC5 - PIN5 (input pullup). | ||
| 453 | * PC6 - LED_RED (output pushpull maximum). | ||
| 454 | * PC7 - LED_BLUE (output pushpull maximum). | ||
| 455 | * PC8 - LED_ORANGE (output pushpull maximum). | ||
| 456 | * PC9 - LED_GREEN (output pushpull maximum). | ||
| 457 | * PC10 - PIN10 (input pullup). | ||
| 458 | * PC11 - PIN11 (input pullup). | ||
| 459 | * PC12 - PIN12 (input pullup). | ||
| 460 | * PC13 - PIN13 (input pullup). | ||
| 461 | * PC14 - OSC32_IN (input floating). | ||
| 462 | * PC15 - OSC32_OUT (input floating). | ||
| 463 | */ | ||
| 464 | #define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ | ||
| 465 | PIN_MODE_INPUT(GPIOC_PIN1) | \ | ||
| 466 | PIN_MODE_INPUT(GPIOC_PIN2) | \ | ||
| 467 | PIN_MODE_INPUT(GPIOC_PIN3) | \ | ||
| 468 | PIN_MODE_INPUT(GPIOC_PIN4) | \ | ||
| 469 | PIN_MODE_INPUT(GPIOC_PIN5) | \ | ||
| 470 | PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ | ||
| 471 | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ | ||
| 472 | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ | ||
| 473 | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ | ||
| 474 | PIN_MODE_INPUT(GPIOC_PIN10) | \ | ||
| 475 | PIN_MODE_INPUT(GPIOC_PIN11) | \ | ||
| 476 | PIN_MODE_INPUT(GPIOC_PIN12) | \ | ||
| 477 | PIN_MODE_INPUT(GPIOC_PIN13) | \ | ||
| 478 | PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ | ||
| 479 | PIN_MODE_INPUT(GPIOC_OSC32_OUT)) | ||
| 480 | #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ | ||
| 481 | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ | ||
| 482 | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ | ||
| 483 | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ | ||
| 484 | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ | ||
| 485 | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ | ||
| 486 | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ | ||
| 487 | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ | ||
| 488 | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ | ||
| 489 | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ | ||
| 490 | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ | ||
| 491 | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ | ||
| 492 | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ | ||
| 493 | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ | ||
| 494 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ | ||
| 495 | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) | ||
| 496 | #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ | ||
| 497 | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ | ||
| 498 | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ | ||
| 499 | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ | ||
| 500 | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ | ||
| 501 | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ | ||
| 502 | PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ | ||
| 503 | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ | ||
| 504 | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ | ||
| 505 | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ | ||
| 506 | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ | ||
| 507 | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ | ||
| 508 | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ | ||
| 509 | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ | ||
| 510 | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ | ||
| 511 | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) | ||
| 512 | #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ | ||
| 513 | PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ | ||
| 514 | PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ | ||
| 515 | PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ | ||
| 516 | PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ | ||
| 517 | PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ | ||
| 518 | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ | ||
| 519 | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ | ||
| 520 | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ | ||
| 521 | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ | ||
| 522 | PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ | ||
| 523 | PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ | ||
| 524 | PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ | ||
| 525 | PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ | ||
| 526 | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ | ||
| 527 | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) | ||
| 528 | #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ | ||
| 529 | PIN_ODR_HIGH(GPIOC_PIN1) | \ | ||
| 530 | PIN_ODR_HIGH(GPIOC_PIN2) | \ | ||
| 531 | PIN_ODR_HIGH(GPIOC_PIN3) | \ | ||
| 532 | PIN_ODR_HIGH(GPIOC_PIN4) | \ | ||
| 533 | PIN_ODR_HIGH(GPIOC_PIN5) | \ | ||
| 534 | PIN_ODR_LOW(GPIOC_LED_RED) | \ | ||
| 535 | PIN_ODR_LOW(GPIOC_LED_BLUE) | \ | ||
| 536 | PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ | ||
| 537 | PIN_ODR_LOW(GPIOC_LED_GREEN) | \ | ||
| 538 | PIN_ODR_HIGH(GPIOC_PIN10) | \ | ||
| 539 | PIN_ODR_HIGH(GPIOC_PIN11) | \ | ||
| 540 | PIN_ODR_HIGH(GPIOC_PIN12) | \ | ||
| 541 | PIN_ODR_HIGH(GPIOC_PIN13) | \ | ||
| 542 | PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ | ||
| 543 | PIN_ODR_HIGH(GPIOC_OSC32_OUT)) | ||
| 544 | #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ | ||
| 545 | PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ | ||
| 546 | PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ | ||
| 547 | PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ | ||
| 548 | PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ | ||
| 549 | PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ | ||
| 550 | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ | ||
| 551 | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) | ||
| 552 | #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ | ||
| 553 | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ | ||
| 554 | PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ | ||
| 555 | PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ | ||
| 556 | PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ | ||
| 557 | PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ | ||
| 558 | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ | ||
| 559 | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) | ||
| 560 | |||
| 561 | /* | ||
| 562 | * GPIOD setup: | ||
| 563 | * | ||
| 564 | * PD0 - PIN0 (input pullup). | ||
| 565 | * PD1 - PIN1 (input pullup). | ||
| 566 | * PD2 - PIN2 (input pullup). | ||
| 567 | * PD3 - PIN3 (input pullup). | ||
| 568 | * PD4 - PIN4 (input pullup). | ||
| 569 | * PD5 - PIN5 (input pullup). | ||
| 570 | * PD6 - PIN6 (input pullup). | ||
| 571 | * PD7 - PIN7 (input pullup). | ||
| 572 | * PD8 - PIN8 (input pullup). | ||
| 573 | * PD9 - PIN9 (input pullup). | ||
| 574 | * PD10 - PIN10 (input pullup). | ||
| 575 | * PD11 - PIN11 (input pullup). | ||
| 576 | * PD12 - PIN12 (input pullup). | ||
| 577 | * PD13 - PIN13 (input pullup). | ||
| 578 | * PD14 - PIN14 (input pullup). | ||
| 579 | * PD15 - PIN15 (input pullup). | ||
| 580 | */ | ||
| 581 | #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ | ||
| 582 | PIN_MODE_INPUT(GPIOD_PIN1) | \ | ||
| 583 | PIN_MODE_INPUT(GPIOD_PIN2) | \ | ||
| 584 | PIN_MODE_INPUT(GPIOD_PIN3) | \ | ||
| 585 | PIN_MODE_INPUT(GPIOD_PIN4) | \ | ||
| 586 | PIN_MODE_INPUT(GPIOD_PIN5) | \ | ||
| 587 | PIN_MODE_INPUT(GPIOD_PIN6) | \ | ||
| 588 | PIN_MODE_INPUT(GPIOD_PIN7) | \ | ||
| 589 | PIN_MODE_INPUT(GPIOD_PIN8) | \ | ||
| 590 | PIN_MODE_INPUT(GPIOD_PIN9) | \ | ||
| 591 | PIN_MODE_INPUT(GPIOD_PIN10) | \ | ||
| 592 | PIN_MODE_INPUT(GPIOD_PIN11) | \ | ||
| 593 | PIN_MODE_INPUT(GPIOD_PIN12) | \ | ||
| 594 | PIN_MODE_INPUT(GPIOD_PIN13) | \ | ||
| 595 | PIN_MODE_INPUT(GPIOD_PIN14) | \ | ||
| 596 | PIN_MODE_INPUT(GPIOD_PIN15)) | ||
| 597 | #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ | ||
| 598 | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ | ||
| 599 | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ | ||
| 600 | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ | ||
| 601 | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ | ||
| 602 | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ | ||
| 603 | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ | ||
| 604 | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ | ||
| 605 | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ | ||
| 606 | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ | ||
| 607 | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ | ||
| 608 | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ | ||
| 609 | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ | ||
| 610 | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ | ||
| 611 | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ | ||
| 612 | PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) | ||
| 613 | #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ | ||
| 614 | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ | ||
| 615 | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ | ||
| 616 | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ | ||
| 617 | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ | ||
| 618 | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ | ||
| 619 | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ | ||
| 620 | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ | ||
| 621 | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ | ||
| 622 | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ | ||
| 623 | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ | ||
| 624 | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ | ||
| 625 | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ | ||
| 626 | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ | ||
| 627 | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ | ||
| 628 | PIN_OSPEED_VERYLOW(GPIOD_PIN15)) | ||
| 629 | #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ | ||
| 630 | PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ | ||
| 631 | PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ | ||
| 632 | PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ | ||
| 633 | PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ | ||
| 634 | PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ | ||
| 635 | PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ | ||
| 636 | PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ | ||
| 637 | PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ | ||
| 638 | PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ | ||
| 639 | PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ | ||
| 640 | PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ | ||
| 641 | PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ | ||
| 642 | PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ | ||
| 643 | PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ | ||
| 644 | PIN_PUPDR_PULLUP(GPIOD_PIN15)) | ||
| 645 | #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ | ||
| 646 | PIN_ODR_HIGH(GPIOD_PIN1) | \ | ||
| 647 | PIN_ODR_HIGH(GPIOD_PIN2) | \ | ||
| 648 | PIN_ODR_HIGH(GPIOD_PIN3) | \ | ||
| 649 | PIN_ODR_HIGH(GPIOD_PIN4) | \ | ||
| 650 | PIN_ODR_HIGH(GPIOD_PIN5) | \ | ||
| 651 | PIN_ODR_HIGH(GPIOD_PIN6) | \ | ||
| 652 | PIN_ODR_HIGH(GPIOD_PIN7) | \ | ||
| 653 | PIN_ODR_HIGH(GPIOD_PIN8) | \ | ||
| 654 | PIN_ODR_HIGH(GPIOD_PIN9) | \ | ||
| 655 | PIN_ODR_HIGH(GPIOD_PIN10) | \ | ||
| 656 | PIN_ODR_HIGH(GPIOD_PIN11) | \ | ||
| 657 | PIN_ODR_HIGH(GPIOD_PIN12) | \ | ||
| 658 | PIN_ODR_HIGH(GPIOD_PIN13) | \ | ||
| 659 | PIN_ODR_HIGH(GPIOD_PIN14) | \ | ||
| 660 | PIN_ODR_HIGH(GPIOD_PIN15)) | ||
| 661 | #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ | ||
| 662 | PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ | ||
| 663 | PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ | ||
| 664 | PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ | ||
| 665 | PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ | ||
| 666 | PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ | ||
| 667 | PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ | ||
| 668 | PIN_AFIO_AF(GPIOD_PIN7, 0U)) | ||
| 669 | #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ | ||
| 670 | PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ | ||
| 671 | PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ | ||
| 672 | PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ | ||
| 673 | PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ | ||
| 674 | PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ | ||
| 675 | PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ | ||
| 676 | PIN_AFIO_AF(GPIOD_PIN15, 0U)) | ||
| 677 | |||
| 678 | /* | ||
| 679 | * GPIOE setup: | ||
| 680 | * | ||
| 681 | * PE0 - PIN0 (input pullup). | ||
| 682 | * PE1 - PIN1 (input pullup). | ||
| 683 | * PE2 - PIN2 (input pullup). | ||
| 684 | * PE3 - PIN3 (input pullup). | ||
| 685 | * PE4 - PIN4 (input pullup). | ||
| 686 | * PE5 - PIN5 (input pullup). | ||
| 687 | * PE6 - PIN6 (input pullup). | ||
| 688 | * PE7 - PIN7 (input pullup). | ||
| 689 | * PE8 - PIN8 (input pullup). | ||
| 690 | * PE9 - PIN9 (input pullup). | ||
| 691 | * PE10 - PIN10 (input pullup). | ||
| 692 | * PE11 - PIN11 (input pullup). | ||
| 693 | * PE12 - PIN12 (input pullup). | ||
| 694 | * PE13 - PIN13 (input pullup). | ||
| 695 | * PE14 - PIN14 (input pullup). | ||
| 696 | * PE15 - PIN15 (input pullup). | ||
| 697 | */ | ||
| 698 | #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ | ||
| 699 | PIN_MODE_INPUT(GPIOE_PIN1) | \ | ||
| 700 | PIN_MODE_INPUT(GPIOE_PIN2) | \ | ||
| 701 | PIN_MODE_INPUT(GPIOE_PIN3) | \ | ||
| 702 | PIN_MODE_INPUT(GPIOE_PIN4) | \ | ||
| 703 | PIN_MODE_INPUT(GPIOE_PIN5) | \ | ||
| 704 | PIN_MODE_INPUT(GPIOE_PIN6) | \ | ||
| 705 | PIN_MODE_INPUT(GPIOE_PIN7) | \ | ||
| 706 | PIN_MODE_INPUT(GPIOE_PIN8) | \ | ||
| 707 | PIN_MODE_INPUT(GPIOE_PIN9) | \ | ||
| 708 | PIN_MODE_INPUT(GPIOE_PIN10) | \ | ||
| 709 | PIN_MODE_INPUT(GPIOE_PIN11) | \ | ||
| 710 | PIN_MODE_INPUT(GPIOE_PIN12) | \ | ||
| 711 | PIN_MODE_INPUT(GPIOE_PIN13) | \ | ||
| 712 | PIN_MODE_INPUT(GPIOE_PIN14) | \ | ||
| 713 | PIN_MODE_INPUT(GPIOE_PIN15)) | ||
| 714 | #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ | ||
| 715 | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ | ||
| 716 | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ | ||
| 717 | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ | ||
| 718 | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ | ||
| 719 | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ | ||
| 720 | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ | ||
| 721 | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ | ||
| 722 | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ | ||
| 723 | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ | ||
| 724 | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ | ||
| 725 | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ | ||
| 726 | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ | ||
| 727 | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ | ||
| 728 | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ | ||
| 729 | PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) | ||
| 730 | #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ | ||
| 731 | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ | ||
| 732 | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ | ||
| 733 | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ | ||
| 734 | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ | ||
| 735 | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ | ||
| 736 | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ | ||
| 737 | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ | ||
| 738 | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ | ||
| 739 | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ | ||
| 740 | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ | ||
| 741 | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ | ||
| 742 | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ | ||
| 743 | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ | ||
| 744 | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ | ||
| 745 | PIN_OSPEED_VERYLOW(GPIOE_PIN15)) | ||
| 746 | #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ | ||
| 747 | PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ | ||
| 748 | PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ | ||
| 749 | PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ | ||
| 750 | PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ | ||
| 751 | PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ | ||
| 752 | PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ | ||
| 753 | PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ | ||
| 754 | PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ | ||
| 755 | PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ | ||
| 756 | PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ | ||
| 757 | PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ | ||
| 758 | PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ | ||
| 759 | PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ | ||
| 760 | PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ | ||
| 761 | PIN_PUPDR_PULLUP(GPIOE_PIN15)) | ||
| 762 | #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ | ||
| 763 | PIN_ODR_HIGH(GPIOE_PIN1) | \ | ||
| 764 | PIN_ODR_HIGH(GPIOE_PIN2) | \ | ||
| 765 | PIN_ODR_HIGH(GPIOE_PIN3) | \ | ||
| 766 | PIN_ODR_HIGH(GPIOE_PIN4) | \ | ||
| 767 | PIN_ODR_HIGH(GPIOE_PIN5) | \ | ||
| 768 | PIN_ODR_HIGH(GPIOE_PIN6) | \ | ||
| 769 | PIN_ODR_HIGH(GPIOE_PIN7) | \ | ||
| 770 | PIN_ODR_HIGH(GPIOE_PIN8) | \ | ||
| 771 | PIN_ODR_HIGH(GPIOE_PIN9) | \ | ||
| 772 | PIN_ODR_HIGH(GPIOE_PIN10) | \ | ||
| 773 | PIN_ODR_HIGH(GPIOE_PIN11) | \ | ||
| 774 | PIN_ODR_HIGH(GPIOE_PIN12) | \ | ||
| 775 | PIN_ODR_HIGH(GPIOE_PIN13) | \ | ||
| 776 | PIN_ODR_HIGH(GPIOE_PIN14) | \ | ||
| 777 | PIN_ODR_HIGH(GPIOE_PIN15)) | ||
| 778 | #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ | ||
| 779 | PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ | ||
| 780 | PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ | ||
| 781 | PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ | ||
| 782 | PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ | ||
| 783 | PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ | ||
| 784 | PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ | ||
| 785 | PIN_AFIO_AF(GPIOE_PIN7, 0U)) | ||
| 786 | #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ | ||
| 787 | PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ | ||
| 788 | PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ | ||
| 789 | PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ | ||
| 790 | PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ | ||
| 791 | PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ | ||
| 792 | PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ | ||
| 793 | PIN_AFIO_AF(GPIOE_PIN15, 0U)) | ||
| 794 | |||
| 795 | /* | ||
| 796 | * GPIOF setup: | ||
| 797 | * | ||
| 798 | * PF0 - OSC_IN (input floating). | ||
| 799 | * PF1 - OSC_OUT (input floating). | ||
| 800 | * PF2 - PIN2 (input pullup). | ||
| 801 | * PF3 - PIN3 (input pullup). | ||
| 802 | * PF4 - PIN4 (input pullup). | ||
| 803 | * PF5 - PIN5 (input pullup). | ||
| 804 | * PF6 - PIN6 (input pullup). | ||
| 805 | * PF7 - PIN7 (input pullup). | ||
| 806 | * PF8 - PIN8 (input pullup). | ||
| 807 | * PF9 - PIN9 (input pullup). | ||
| 808 | * PF10 - PIN10 (input pullup). | ||
| 809 | * PF11 - PIN11 (input pullup). | ||
| 810 | * PF12 - PIN12 (input pullup). | ||
| 811 | * PF13 - PIN13 (input pullup). | ||
| 812 | * PF14 - PIN14 (input pullup). | ||
| 813 | * PF15 - PIN15 (input pullup). | ||
| 814 | */ | ||
| 815 | #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ | ||
| 816 | PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ | ||
| 817 | PIN_MODE_INPUT(GPIOF_PIN2) | \ | ||
| 818 | PIN_MODE_INPUT(GPIOF_PIN3) | \ | ||
| 819 | PIN_MODE_INPUT(GPIOF_PIN4) | \ | ||
| 820 | PIN_MODE_INPUT(GPIOF_PIN5) | \ | ||
| 821 | PIN_MODE_INPUT(GPIOF_PIN6) | \ | ||
| 822 | PIN_MODE_INPUT(GPIOF_PIN7) | \ | ||
| 823 | PIN_MODE_INPUT(GPIOF_PIN8) | \ | ||
| 824 | PIN_MODE_INPUT(GPIOF_PIN9) | \ | ||
| 825 | PIN_MODE_INPUT(GPIOF_PIN10) | \ | ||
| 826 | PIN_MODE_INPUT(GPIOF_PIN11) | \ | ||
| 827 | PIN_MODE_INPUT(GPIOF_PIN12) | \ | ||
| 828 | PIN_MODE_INPUT(GPIOF_PIN13) | \ | ||
| 829 | PIN_MODE_INPUT(GPIOF_PIN14) | \ | ||
| 830 | PIN_MODE_INPUT(GPIOF_PIN15)) | ||
| 831 | #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ | ||
| 832 | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ | ||
| 833 | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ | ||
| 834 | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ | ||
| 835 | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ | ||
| 836 | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ | ||
| 837 | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ | ||
| 838 | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ | ||
| 839 | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ | ||
| 840 | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ | ||
| 841 | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ | ||
| 842 | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ | ||
| 843 | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ | ||
| 844 | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ | ||
| 845 | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ | ||
| 846 | PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) | ||
| 847 | #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ | ||
| 848 | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ | ||
| 849 | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ | ||
| 850 | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ | ||
| 851 | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ | ||
| 852 | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ | ||
| 853 | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ | ||
| 854 | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ | ||
| 855 | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ | ||
| 856 | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ | ||
| 857 | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ | ||
| 858 | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ | ||
| 859 | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ | ||
| 860 | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ | ||
| 861 | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ | ||
| 862 | PIN_OSPEED_VERYLOW(GPIOF_PIN15)) | ||
| 863 | #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ | ||
| 864 | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ | ||
| 865 | PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ | ||
| 866 | PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ | ||
| 867 | PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ | ||
| 868 | PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ | ||
| 869 | PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ | ||
| 870 | PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ | ||
| 871 | PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ | ||
| 872 | PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ | ||
| 873 | PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ | ||
| 874 | PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ | ||
| 875 | PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ | ||
| 876 | PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ | ||
| 877 | PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ | ||
| 878 | PIN_PUPDR_PULLUP(GPIOF_PIN15)) | ||
| 879 | #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ | ||
| 880 | PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ | ||
| 881 | PIN_ODR_HIGH(GPIOF_PIN2) | \ | ||
| 882 | PIN_ODR_HIGH(GPIOF_PIN3) | \ | ||
| 883 | PIN_ODR_HIGH(GPIOF_PIN4) | \ | ||
| 884 | PIN_ODR_HIGH(GPIOF_PIN5) | \ | ||
| 885 | PIN_ODR_HIGH(GPIOF_PIN6) | \ | ||
| 886 | PIN_ODR_HIGH(GPIOF_PIN7) | \ | ||
| 887 | PIN_ODR_HIGH(GPIOF_PIN8) | \ | ||
| 888 | PIN_ODR_HIGH(GPIOF_PIN9) | \ | ||
| 889 | PIN_ODR_HIGH(GPIOF_PIN10) | \ | ||
| 890 | PIN_ODR_HIGH(GPIOF_PIN11) | \ | ||
| 891 | PIN_ODR_HIGH(GPIOF_PIN12) | \ | ||
| 892 | PIN_ODR_HIGH(GPIOF_PIN13) | \ | ||
| 893 | PIN_ODR_HIGH(GPIOF_PIN14) | \ | ||
| 894 | PIN_ODR_HIGH(GPIOF_PIN15)) | ||
| 895 | #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ | ||
| 896 | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ | ||
| 897 | PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ | ||
| 898 | PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ | ||
| 899 | PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ | ||
| 900 | PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ | ||
| 901 | PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ | ||
| 902 | PIN_AFIO_AF(GPIOF_PIN7, 0U)) | ||
| 903 | #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ | ||
| 904 | PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ | ||
| 905 | PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ | ||
| 906 | PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ | ||
| 907 | PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ | ||
| 908 | PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ | ||
| 909 | PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ | ||
| 910 | PIN_AFIO_AF(GPIOF_PIN15, 0U)) | ||
| 911 | |||
| 912 | |||
| 913 | #if !defined(_FROM_ASM_) | ||
| 914 | #ifdef __cplusplus | ||
| 915 | extern "C" { | ||
| 916 | #endif | ||
| 917 | void boardInit(void); | ||
| 918 | #ifdef __cplusplus | ||
| 919 | } | ||
| 920 | #endif | ||
| 921 | #endif /* _FROM_ASM_ */ | ||
| 922 | |||
| 923 | #endif /* BOARD_H */ | ||
diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26..000000000 --- a/keyboards/candybar/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/candybar/config.h b/keyboards/candybar/lefty/config.h index c15396713..c15396713 100644 --- a/keyboards/candybar/config.h +++ b/keyboards/candybar/lefty/config.h | |||
diff --git a/keyboards/candybar/info.json b/keyboards/candybar/lefty/info.json index 9cf4216aa..1ef3dcd54 100644 --- a/keyboards/candybar/info.json +++ b/keyboards/candybar/lefty/info.json | |||
| @@ -7,13 +7,6 @@ | |||
| 7 | "layouts": { | 7 | "layouts": { |
| 8 | "LAYOUT": { | 8 | "LAYOUT": { |
| 9 | "layout": [ | 9 | "layout": [ |
| 10 | {"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Del", "x":11, "y":0}, {"label":"BkSp", "x":12, "y":0}, {"label":"7", "x":13, "y":0}, {"label":"8", "x":14, "y":0}, {"label":"9", "x":15, "y":0}, {"label":"*", "x":16, "y":0}, | ||
| 11 | {"label":"Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"Enter", "x":11.25, "y":1, "w":1.75}, {"label":"4", "x":13, "y":1}, {"label":"5", "x":14, "y":1}, {"label":"6", "x":15, "y":1}, {"label":"-", "x":16, "y":1}, | ||
| 12 | {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"Shift", "x":10.75, "y":2, "w":1.25}, {"label":"↑", "x":12, "y":2}, {"label":"1", "x":13, "y":2}, {"label":"2", "x":14, "y":2}, {"label":"3", "x":15, "y":2}, {"label":"+", "x":16, "y":2}, | ||
| 13 | {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"GUI", "x":1.25, "y":3, "w":1.25}, {"label":"Alt", "x":2.5, "y":3, "w":1.25}, {"x":3.75, "y":3, "w":1.75}, {"x":5.5, "y":3, "w":1}, {"label":"Backspace", "x":6.5, "y":3, "w":2.25}, {"label":"Menu", "x":8.75, "y":3, "w":1.25}, {"label":"Fn", "x":10, "y":3}, {"label":"←", "x":11, "y":3}, {"label":"↓", "x":12, "y":3}, {"label":"→", "x":13, "y":3}, {"label":"0", "x":14, "y":3}, {"label":".", "x":15, "y":3}, {"label":"Enter", "x":16, "y":3}] | ||
| 14 | }, | ||
| 15 | "LAYOUT_lefty": { | ||
| 16 | "layout": [ | ||
| 17 | {"label":"7", "x":0, "y":0}, {"label":"8", "x":1, "y":0}, {"label":"9", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"Esc", "x":4, "y":0}, {"label":"Q", "x":5, "y":0}, {"label":"W", "x":6, "y":0}, {"label":"E", "x":7, "y":0}, {"label":"R", "x":8, "y":0}, {"label":"T", "x":9, "y":0}, {"label":"Y", "x":10, "y":0}, {"label":"U", "x":11, "y":0}, {"label":"I", "x":12, "y":0}, {"label":"O", "x":13, "y":0}, {"label":"P", "x":14, "y":0}, {"label":"{", "x":15, "y":0}, {"label":"}", "x":16, "y":0}, | 10 | {"label":"7", "x":0, "y":0}, {"label":"8", "x":1, "y":0}, {"label":"9", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"Esc", "x":4, "y":0}, {"label":"Q", "x":5, "y":0}, {"label":"W", "x":6, "y":0}, {"label":"E", "x":7, "y":0}, {"label":"R", "x":8, "y":0}, {"label":"T", "x":9, "y":0}, {"label":"Y", "x":10, "y":0}, {"label":"U", "x":11, "y":0}, {"label":"I", "x":12, "y":0}, {"label":"O", "x":13, "y":0}, {"label":"P", "x":14, "y":0}, {"label":"{", "x":15, "y":0}, {"label":"}", "x":16, "y":0}, |
| 18 | {"label":"4", "x":0, "y":1}, {"label":"5", "x":1, "y":1}, {"label":"6", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"Tab", "x":4, "y":1, "w":1.25}, {"label":"A", "x":5.25, "y":1}, {"label":"S", "x":6.25, "y":1}, {"label":"D", "x":7.25, "y":1}, {"label":"F", "x":8.25, "y":1}, {"label":"G", "x":9.25, "y":1}, {"label":"H", "x":10.25, "y":1}, {"label":"J", "x":11.25, "y":1}, {"label":"K", "x":12.25, "y":1}, {"label":"L", "x":13.25, "y":1}, {"label":":", "x":14.25, "y":1}, {"label":"Enter", "x":15.25, "y":1, "w":1.75}, | 11 | {"label":"4", "x":0, "y":1}, {"label":"5", "x":1, "y":1}, {"label":"6", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"Tab", "x":4, "y":1, "w":1.25}, {"label":"A", "x":5.25, "y":1}, {"label":"S", "x":6.25, "y":1}, {"label":"D", "x":7.25, "y":1}, {"label":"F", "x":8.25, "y":1}, {"label":"G", "x":9.25, "y":1}, {"label":"H", "x":10.25, "y":1}, {"label":"J", "x":11.25, "y":1}, {"label":"K", "x":12.25, "y":1}, {"label":"L", "x":13.25, "y":1}, {"label":":", "x":14.25, "y":1}, {"label":"Enter", "x":15.25, "y":1, "w":1.75}, |
| 19 | {"label":"1", "x":0, "y":2}, {"label":"2", "x":1, "y":2}, {"label":"3", "x":2, "y":2}, {"x":3, "y":2}, {"label":"Shift", "x":4, "y":2, "w":1.75}, {"label":"Z", "x":5.75, "y":2}, {"label":"X", "x":6.75, "y":2}, {"label":"C", "x":7.75, "y":2}, {"label":"V", "x":8.75, "y":2}, {"label":"B", "x":9.75, "y":2}, {"label":"N", "x":10.75, "y":2}, {"label":"M", "x":11.75, "y":2}, {"label":"<", "x":12.75, "y":2}, {"label":">", "x":13.75, "y":2}, {"label":"\u2191", "x":14.75, "y":2}, {"label":"Shift", "x":15.75, "y":2, "w":1.25}, | 12 | {"label":"1", "x":0, "y":2}, {"label":"2", "x":1, "y":2}, {"label":"3", "x":2, "y":2}, {"x":3, "y":2}, {"label":"Shift", "x":4, "y":2, "w":1.75}, {"label":"Z", "x":5.75, "y":2}, {"label":"X", "x":6.75, "y":2}, {"label":"C", "x":7.75, "y":2}, {"label":"V", "x":8.75, "y":2}, {"label":"B", "x":9.75, "y":2}, {"label":"N", "x":10.75, "y":2}, {"label":"M", "x":11.75, "y":2}, {"label":"<", "x":12.75, "y":2}, {"label":">", "x":13.75, "y":2}, {"label":"\u2191", "x":14.75, "y":2}, {"label":"Shift", "x":15.75, "y":2, "w":1.25}, |
diff --git a/keyboards/candybar/keymaps/lefty/keymap.c b/keyboards/candybar/lefty/keymaps/default/keymap.c index 34cb55be3..153fd99c5 100644 --- a/keyboards/candybar/keymaps/lefty/keymap.c +++ b/keyboards/candybar/lefty/keymaps/default/keymap.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 22 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 23 | /* Keymap _BL: Base Layer (Default Layer) | 23 | /* Keymap _BL: Base Layer (Default Layer) |
| 24 | */ | 24 | */ |
| 25 | [_BL] = LAYOUT_lefty( | 25 | [_BL] = LAYOUT( |
| 26 | KC_P7 , KC_P8, KC_P9 , KC_PAST, KC_ESC , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_DEL , KC_BSPC , \ | 26 | KC_P7 , KC_P8, KC_P9 , KC_PAST, KC_ESC , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_DEL , KC_BSPC , \ |
| 27 | KC_P4 , KC_P5, KC_P6 , KC_PMNS, KC_TAB , KC_A , KC_S , KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , \ | 27 | KC_P4 , KC_P5, KC_P6 , KC_PMNS, KC_TAB , KC_A , KC_S , KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , \ |
| 28 | KC_P1 , KC_P2, KC_P3 , KC_PPLS, KC_LSFT, KC_Z , KC_X, KC_C , KC_V , KC_B, KC_N , KC_M , KC_COMM, KC_DOT , KC_UP ,KC_RSFT , \ | 28 | KC_P1 , KC_P2, KC_P3 , KC_PPLS, KC_LSFT, KC_Z , KC_X, KC_C , KC_V , KC_B, KC_N , KC_M , KC_COMM, KC_DOT , KC_UP ,KC_RSFT , \ |
| @@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 30 | 30 | ||
| 31 | /* Keymap _FL: Function Layer | 31 | /* Keymap _FL: Function Layer |
| 32 | */ | 32 | */ |
| 33 | [_FL] = LAYOUT_lefty( | 33 | [_FL] = LAYOUT( |
| 34 | KC_P7 , KC_P8, KC_P9 , KC_VOLU, RESET , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_LBRC, KC_RBRC, KC_INS , KC_BSPC , \ | 34 | KC_P7 , KC_P8, KC_P9 , KC_VOLU, RESET , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_LBRC, KC_RBRC, KC_INS , KC_BSPC , \ |
| 35 | KC_P4 , KC_P5, KC_P6 , KC_VOLD, KC_TAB , KC_A , KC_SLCK, KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_QUOT, KC_BSLS , \ | 35 | KC_P4 , KC_P5, KC_P6 , KC_VOLD, KC_TAB , KC_A , KC_SLCK, KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_QUOT, KC_BSLS , \ |
| 36 | KC_P1 , KC_P2, KC_P3 , KC_PEQL, KC_LSFT, KC_Z , KC_X, KC_CAPS, KC_V , KC_B, KC_NLCK, KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_PGUP , \ | 36 | KC_P1 , KC_P2, KC_P3 , KC_PEQL, KC_LSFT, KC_Z , KC_X, KC_CAPS, KC_V , KC_B, KC_NLCK, KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_PGUP , \ |
diff --git a/keyboards/candybar/candybar.c b/keyboards/candybar/lefty/lefty.c index c79e536cc..920811b83 100644 --- a/keyboards/candybar/candybar.c +++ b/keyboards/candybar/lefty/lefty.c | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include "candybar.h" | 17 | #include "lefty.h" |
| 18 | 18 | ||
| 19 | void matrix_init_kb(void) { | 19 | void matrix_init_kb(void) { |
| 20 | matrix_init_user(); | 20 | matrix_init_user(); |
diff --git a/keyboards/candybar/candybar.h b/keyboards/candybar/lefty/lefty.h index b7a9ef456..07af4b31b 100644 --- a/keyboards/candybar/candybar.h +++ b/keyboards/candybar/lefty/lefty.h | |||
| @@ -17,19 +17,8 @@ | |||
| 17 | #pragma once | 17 | #pragma once |
| 18 | #include "quantum.h" | 18 | #include "quantum.h" |
| 19 | 19 | ||
| 20 | #define LAYOUT( \ | ||
| 21 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \ | ||
| 22 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, k1d, k1e, k1f, k1g, \ | ||
| 23 | k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \ | ||
| 24 | k30, k31, k32, k35, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g \ | ||
| 25 | ) { \ | ||
| 26 | { k00, k01 , k02, k03 , k04 , k05, k06 , k07, k08, k09, k0a, k0b , k0c, k0d, k0e, k0f, k0g } , \ | ||
| 27 | { k10, k11 , k12, k13 , k14 , k15, k16 , k17, k18, k19, k1a, KC_NO, k1c, k1d, k1e, k1f, k1g } , \ | ||
| 28 | { k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \ | ||
| 29 | { k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \ | ||
| 30 | } | ||
| 31 | 20 | ||
| 32 | #define LAYOUT_lefty( \ | 21 | #define LAYOUT( \ |
| 33 | k0d, k0e, k0f, k0g, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ | 22 | k0d, k0e, k0f, k0g, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ |
| 34 | k1d, k1e, k1f, k1g, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, \ | 23 | k1d, k1e, k1f, k1g, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, \ |
| 35 | k2d, k2e, k2f, k2g, k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ | 24 | k2d, k2e, k2f, k2g, k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ |
| @@ -40,5 +29,3 @@ | |||
| 40 | { k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \ | 29 | { k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \ |
| 41 | { k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \ | 30 | { k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \ |
| 42 | } | 31 | } |
| 43 | |||
| 44 | #define LAYOUT_righty LAYOUT | ||
diff --git a/keyboards/candybar/lefty/readme.md b/keyboards/candybar/lefty/readme.md new file mode 100644 index 000000000..595472067 --- /dev/null +++ b/keyboards/candybar/lefty/readme.md | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # The Key Company Candybar | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller. | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) | ||
| 8 | * Hardware Supported: TKC Candybar | ||
| 9 | * Hardware Availability: [TheKey.Company](https://thekey.company/collections/candybar) | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make candybar/lefty:default:dfu-util | ||
| 14 | |||
| 15 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
diff --git a/keyboards/candybar/rules.mk b/keyboards/candybar/lefty/rules.mk index 4e89dbf47..cb1b83288 100644 --- a/keyboards/candybar/rules.mk +++ b/keyboards/candybar/lefty/rules.mk | |||
| @@ -1,6 +1,5 @@ | |||
| 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. |
diff --git a/keyboards/candybar/readme.md b/keyboards/candybar/readme.md deleted file mode 100644 index 6e0fa0285..000000000 --- a/keyboards/candybar/readme.md +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | The Key Company Candybar | ||
| 2 | === | ||
| 3 | |||
| 4 |  | ||
| 5 | |||
| 6 | |||
| 7 | The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller. | ||
| 8 | |||
| 9 | Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) | ||
| 10 | Hardware Supported: TKC Candybar | ||
| 11 | Hardware Availability: Via GB | ||
| 12 | |||
| 13 | |||
| 14 | Make example for this keyboard (after setting up your build environment): | ||
| 15 | |||
| 16 | make candybar:default:dfu-util | ||
| 17 | |||
| 18 | See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. | ||
diff --git a/keyboards/candybar/righty/config.h b/keyboards/candybar/righty/config.h new file mode 100644 index 000000000..c15396713 --- /dev/null +++ b/keyboards/candybar/righty/config.h | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | /* Copyright 2018 Jack Humbert | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include "config_common.h" | ||
| 20 | |||
| 21 | /* USB Device descriptor parameter */ | ||
| 22 | #define VENDOR_ID 0xFEED | ||
| 23 | #define PRODUCT_ID 0x6060 | ||
| 24 | #define DEVICE_VER 0x0006 | ||
| 25 | #define MANUFACTURER The Key Company | ||
| 26 | #define PRODUCT Candybar | ||
| 27 | #define DESCRIPTION A compact staggered 40% keyboard with attached numpad | ||
| 28 | |||
| 29 | /* key matrix size */ | ||
| 30 | #define MATRIX_ROWS 4 | ||
| 31 | #define MATRIX_COLS 17 | ||
| 32 | #define DIODE_DIRECTION COL2ROW | ||
| 33 | #define MATRIX_ROW_PINS { A8, A9, A10, A13 } | ||
| 34 | #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B10, B11, B12, B13, B14, B15 } | ||
| 35 | |||
| 36 | |||
| 37 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 38 | #define DEBOUNCE 5 | ||
| 39 | |||
| 40 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 41 | //#define LOCKING_SUPPORT_ENABLE | ||
| 42 | /* Locking resynchronize hack */ | ||
| 43 | //#define LOCKING_RESYNC_ENABLE | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Force NKRO | ||
| 47 | * | ||
| 48 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
| 49 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
| 50 | * makefile for this to work.) | ||
| 51 | * | ||
| 52 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
| 53 | * until the next keyboard reset. | ||
| 54 | * | ||
| 55 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
| 56 | * fully operational during normal computer usage. | ||
| 57 | * | ||
| 58 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
| 59 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
| 60 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
| 61 | * power-up. | ||
| 62 | * | ||
| 63 | */ | ||
| 64 | //#define FORCE_NKRO | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Feature disable options | ||
| 68 | * These options are also useful to firmware size reduction. | ||
| 69 | */ | ||
| 70 | |||
| 71 | /* disable debug print */ | ||
| 72 | //#define NO_DEBUG | ||
| 73 | |||
| 74 | /* disable print */ | ||
| 75 | //#define NO_PRINT | ||
| 76 | |||
| 77 | /* disable action features */ | ||
| 78 | //#define NO_ACTION_LAYER | ||
| 79 | //#define NO_ACTION_TAPPING | ||
| 80 | //#define NO_ACTION_ONESHOT | ||
| 81 | //#define NO_ACTION_MACRO | ||
| 82 | //#define NO_ACTION_FUNCTION | ||
| 83 | |||
| 84 | /* | ||
| 85 | * MIDI options | ||
| 86 | */ | ||
| 87 | |||
| 88 | /* Prevent use of disabled MIDI features in the keymap */ | ||
| 89 | //#define MIDI_ENABLE_STRICT 1 | ||
| 90 | |||
| 91 | /* enable basic MIDI features: | ||
| 92 | - MIDI notes can be sent when in Music mode is on | ||
| 93 | */ | ||
| 94 | //#define MIDI_BASIC | ||
| 95 | |||
| 96 | /* enable advanced MIDI features: | ||
| 97 | - MIDI notes can be added to the keymap | ||
| 98 | - Octave shift and transpose | ||
| 99 | - Virtual sustain, portamento, and modulation wheel | ||
| 100 | - etc. | ||
| 101 | */ | ||
| 102 | //#define MIDI_ADVANCED | ||
| 103 | |||
| 104 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ | ||
| 105 | //#define MIDI_TONE_KEYCODE_OCTAVES 1 | ||
| 106 | |||
| 107 | // #define WS2812_LED_N 2 | ||
| 108 | // #define RGBLED_NUM WS2812_LED_N | ||
| 109 | // #define WS2812_TIM_N 2 | ||
| 110 | // #define WS2812_TIM_CH 2 | ||
| 111 | // #define PORT_WS2812 GPIOA | ||
| 112 | // #define PIN_WS2812 1 | ||
| 113 | // #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) | ||
| 114 | //#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP | ||
| 115 | //#define WS2812_EXTERNAL_PULLUP | ||
diff --git a/keyboards/candybar/righty/info.json b/keyboards/candybar/righty/info.json new file mode 100644 index 000000000..81dc4f8ec --- /dev/null +++ b/keyboards/candybar/righty/info.json | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "TKC Candybar", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "terrymathews", | ||
| 5 | "width": 17, | ||
| 6 | "height": 4, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT": { | ||
| 9 | "layout": [ | ||
| 10 | {"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Del", "x":11, "y":0}, {"label":"BkSp", "x":12, "y":0}, {"label":"7", "x":13, "y":0}, {"label":"8", "x":14, "y":0}, {"label":"9", "x":15, "y":0}, {"label":"*", "x":16, "y":0}, | ||
| 11 | {"label":"Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"Enter", "x":11.25, "y":1, "w":1.75}, {"label":"4", "x":13, "y":1}, {"label":"5", "x":14, "y":1}, {"label":"6", "x":15, "y":1}, {"label":"-", "x":16, "y":1}, | ||
| 12 | {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"Shift", "x":10.75, "y":2, "w":1.25}, {"label":"↑", "x":12, "y":2}, {"label":"1", "x":13, "y":2}, {"label":"2", "x":14, "y":2}, {"label":"3", "x":15, "y":2}, {"label":"+", "x":16, "y":2}, | ||
| 13 | {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"GUI", "x":1.25, "y":3, "w":1.25}, {"label":"Alt", "x":2.5, "y":3, "w":1.25}, {"x":3.75, "y":3, "w":1.75}, {"x":5.5, "y":3, "w":1}, {"label":"Backspace", "x":6.5, "y":3, "w":2.25}, {"label":"Menu", "x":8.75, "y":3, "w":1.25}, {"label":"Fn", "x":10, "y":3}, {"label":"←", "x":11, "y":3}, {"label":"↓", "x":12, "y":3}, {"label":"→", "x":13, "y":3}, {"label":"0", "x":14, "y":3}, {"label":".", "x":15, "y":3}, {"label":"Enter", "x":16, "y":3}] | ||
| 14 | } | ||
| 15 | } | ||
| 16 | } | ||
diff --git a/keyboards/candybar/keymaps/default/keymap.c b/keyboards/candybar/righty/keymaps/default/keymap.c index 8f4cc08c7..8f4cc08c7 100644 --- a/keyboards/candybar/keymaps/default/keymap.c +++ b/keyboards/candybar/righty/keymaps/default/keymap.c | |||
diff --git a/keyboards/candybar/righty/readme.md b/keyboards/candybar/righty/readme.md new file mode 100644 index 000000000..d3aa86730 --- /dev/null +++ b/keyboards/candybar/righty/readme.md | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # The Key Company Candybar | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller. | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) | ||
| 8 | * Hardware Supported: TKC Candybar | ||
| 9 | * Hardware Availability: [TheKey.Company](https://thekey.company/collections/candybar) | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make candybar/righty:default:dfu-util | ||
| 14 | |||
| 15 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
diff --git a/keyboards/candybar/righty/righty.c b/keyboards/candybar/righty/righty.c new file mode 100644 index 000000000..c3b611574 --- /dev/null +++ b/keyboards/candybar/righty/righty.c | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* Copyright 2018 Jack Humbert | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "righty.h" | ||
diff --git a/keyboards/candybar/righty/righty.h b/keyboards/candybar/righty/righty.h new file mode 100644 index 000000000..67e023883 --- /dev/null +++ b/keyboards/candybar/righty/righty.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* Copyright 2018 Jack Humbert | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | #include "quantum.h" | ||
| 19 | |||
| 20 | #define LAYOUT( \ | ||
| 21 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \ | ||
| 22 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, k1d, k1e, k1f, k1g, \ | ||
| 23 | k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \ | ||
| 24 | k30, k31, k32, k35, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g \ | ||
| 25 | ) { \ | ||
| 26 | { k00, k01 , k02, k03 , k04 , k05, k06 , k07, k08, k09, k0a, k0b , k0c, k0d, k0e, k0f, k0g } , \ | ||
| 27 | { k10, k11 , k12, k13 , k14 , k15, k16 , k17, k18, k19, k1a, KC_NO, k1c, k1d, k1e, k1f, k1g } , \ | ||
| 28 | { k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \ | ||
| 29 | { k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \ | ||
| 30 | } | ||
diff --git a/keyboards/candybar/righty/rules.mk b/keyboards/candybar/righty/rules.mk new file mode 100644 index 000000000..cb1b83288 --- /dev/null +++ b/keyboards/candybar/righty/rules.mk | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = STM32F072 | ||
| 3 | |||
| 4 | # Build Options | ||
| 5 | # comment out to disable the options. | ||
| 6 | # | ||
| 7 | # EXTRAFLAGS+=-flto | ||
| 8 | LINK_TIME_OPTIMIZATION_ENABLE = yes | ||
| 9 | BACKLIGHT_ENABLE = no | ||
| 10 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration | ||
| 11 | ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) | ||
| 12 | MOUSEKEY_ENABLE = no # Mouse keys | ||
| 13 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 14 | CONSOLE_ENABLE = no # Console for debug | ||
| 15 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 17 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
| 18 | AUDIO_ENABLE = no | ||
| 19 | RGBLIGHT_ENABLE = no | ||
| 20 | SERIAL_LINK_ENABLE = no | ||
| 21 | |||
| 22 | |||
| 23 | # Enter lower-power sleep mode when on the ChibiOS idle thread | ||
| 24 | OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | ||
