From 0730740add19d3afe3d96ead50ba7d29e5dcb109 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 15 Jan 2023 15:04:32 +0000 Subject: Add mmoskal/uf2-stm32f103 bootloader support (#19594) --- .../handwired/onekey/bluepill_uf2boot/config.h | 26 +++++++++++++++++ .../handwired/onekey/bluepill_uf2boot/halconf.h | 28 ++++++++++++++++++ .../handwired/onekey/bluepill_uf2boot/info.json | 15 ++++++++++ .../handwired/onekey/bluepill_uf2boot/mcuconf.h | 33 ++++++++++++++++++++++ .../handwired/onekey/bluepill_uf2boot/readme.md | 7 +++++ .../handwired/onekey/bluepill_uf2boot/rules.mk | 2 ++ 6 files changed, 111 insertions(+) create mode 100644 keyboards/handwired/onekey/bluepill_uf2boot/config.h create mode 100644 keyboards/handwired/onekey/bluepill_uf2boot/halconf.h create mode 100644 keyboards/handwired/onekey/bluepill_uf2boot/info.json create mode 100644 keyboards/handwired/onekey/bluepill_uf2boot/mcuconf.h create mode 100644 keyboards/handwired/onekey/bluepill_uf2boot/readme.md create mode 100644 keyboards/handwired/onekey/bluepill_uf2boot/rules.mk (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/onekey/bluepill_uf2boot/config.h b/keyboards/handwired/onekey/bluepill_uf2boot/config.h new file mode 100644 index 0000000000..79fa79595a --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_uf2boot/config.h @@ -0,0 +1,26 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +#define BACKLIGHT_PWM_DRIVER PWMD2 +#define BACKLIGHT_PWM_CHANNEL 1 + +#define ADC_PIN A0 + +#define RGB_CI_PIN A2 diff --git a/keyboards/handwired/onekey/bluepill_uf2boot/halconf.h b/keyboards/handwired/onekey/bluepill_uf2boot/halconf.h new file mode 100644 index 0000000000..dbc3e82a79 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_uf2boot/halconf.h @@ -0,0 +1,28 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/handwired/onekey/bluepill/halconf.h -r platforms/chibios/common/configs/halconf.h` + */ + +#pragma once + +#define HAL_USE_ADC TRUE + +#define HAL_USE_PWM TRUE + +#include_next diff --git a/keyboards/handwired/onekey/bluepill_uf2boot/info.json b/keyboards/handwired/onekey/bluepill_uf2boot/info.json new file mode 100644 index 0000000000..1f823ea0d7 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_uf2boot/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Onekey Bluepill STM32F103 uf2boot", + "development_board": "bluepill", + "bootloader": "uf2boot", + "matrix_pins": { + "cols": ["B0"], + "rows": ["A7"] + }, + "backlight": { + "pin": "A0" + }, + "rgblight": { + "pin": "A1" + } +} diff --git a/keyboards/handwired/onekey/bluepill_uf2boot/mcuconf.h b/keyboards/handwired/onekey/bluepill_uf2boot/mcuconf.h new file mode 100644 index 0000000000..39834c135b --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_uf2boot/mcuconf.h @@ -0,0 +1,33 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/handwired/onekey/bluepill/mcuconf.h -r platforms/chibios/STM32_F103_STM32DUINO/configs/mcuconf.h` + */ + +#pragma once + +#include_next + +#undef STM32_ADC_USE_ADC1 +#define STM32_ADC_USE_ADC1 TRUE + +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE + +#undef STM32_SPI_USE_SPI2 +#define STM32_SPI_USE_SPI2 FALSE diff --git a/keyboards/handwired/onekey/bluepill_uf2boot/readme.md b/keyboards/handwired/onekey/bluepill_uf2boot/readme.md new file mode 100644 index 0000000000..7886ed1888 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_uf2boot/readme.md @@ -0,0 +1,7 @@ +# Bluepill onekey + +To trigger keypress, short together pins *B0* and *A7*. + +This variant requires the uf2-stm32f103 bootloader to be installed. This can be downloaded from the [uf2-stm32f103 releases page](https://github.com/mmoskal/uf2-stm32f103/releases). + +Double-tap reset to enter bootloader mode. Copy the built uf2 file to the device by dragging the file to the new USB disk. \ No newline at end of file diff --git a/keyboards/handwired/onekey/bluepill_uf2boot/rules.mk b/keyboards/handwired/onekey/bluepill_uf2boot/rules.mk new file mode 100644 index 0000000000..a92b099328 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_uf2boot/rules.mk @@ -0,0 +1,2 @@ +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE -- cgit v1.2.3