diff options
| author | Andrew Kannan <andrew.kannan@klaviyo.com> | 2018-11-12 19:31:22 -0500 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-11-12 16:31:22 -0800 |
| commit | e653cc198e3a535f23ae33d677115f192979ee55 (patch) | |
| tree | 5cfd500f945829e3d8dcfaf687940e15f6a93ec4 /keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c | |
| parent | 599b21b9f4b450392380870675b136449839f6e5 (diff) | |
| download | qmk_firmware-e653cc198e3a535f23ae33d677115f192979ee55.tar.gz qmk_firmware-e653cc198e3a535f23ae33d677115f192979ee55.zip | |
The "Practice60" Board, Blue Pill powered (#4407)
* Starting point for blue pill based practice60
* Changes
* add
* try raw bin no botloader
* swap back to bootloader version
* edit
* Remove debug LED flash
* Disable JTAG to open up B3 and B4
* Add led backlight support (no breathing yet)
* Update matrix for correctness
* RGB Underglow working in a very simple state
* not as bright
* Move to handwired
* revert ChibiOS_Test changes
* Changes based on PR comments
* Address PR comments v2
* Move files
Diffstat (limited to 'keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c')
| -rw-r--r-- | keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 000000000..8c5a87f35 --- /dev/null +++ b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2015 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 | #include "hal.h" | ||
| 18 | |||
| 19 | // Value to place in RTC backup register 10 for persistent bootloader mode | ||
| 20 | #define RTC_BOOTLOADER_FLAG 0x424C | ||
| 21 | |||
| 22 | /** | ||
| 23 | * @brief PAL setup. | ||
| 24 | * @details Digital I/O ports static configuration as defined in @p board.h. | ||
| 25 | * This variable is used by the HAL when initializing the PAL driver. | ||
| 26 | */ | ||
| 27 | #if HAL_USE_PAL || defined(__DOXYGEN__) | ||
| 28 | const PALConfig pal_default_config = | ||
| 29 | { | ||
| 30 | {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, | ||
| 31 | {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, | ||
| 32 | {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, | ||
| 33 | {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, | ||
| 34 | {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, | ||
| 35 | }; | ||
| 36 | #endif | ||
| 37 | |||
| 38 | /* | ||
| 39 | * Early initialization code. | ||
| 40 | * This initialization must be performed just after stack setup and before | ||
| 41 | * any other initialization. | ||
| 42 | */ | ||
| 43 | void __early_init(void) { | ||
| 44 | |||
| 45 | stm32_clock_init(); | ||
| 46 | } | ||
| 47 | |||
| 48 | /* | ||
| 49 | * Board-specific initialization code. | ||
| 50 | */ | ||
| 51 | void boardInit(void) { | ||
| 52 | //JTAG-DP Disabled and SW-DP Enabled | ||
| 53 | AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; | ||
| 54 | //Set backup register DR10 to enter bootloader on reset | ||
| 55 | BKP->DR10 = RTC_BOOTLOADER_FLAG; | ||
| 56 | } | ||
