summaryrefslogtreecommitdiff
path: root/keyboards/handwired/onekey/bluepill_f103c6/config.h
diff options
context:
space:
mode:
authorSergey Vlasov <sigprof@gmail.com>2022-08-12 00:37:41 +0300
committerGitHub <noreply@github.com>2022-08-11 22:37:41 +0100
commit9e443621796a150b244d49a784b77c744ea04d94 (patch)
tree3c5c5e1fa1421d2ceaabd375c8b2cba9eab09bc3 /keyboards/handwired/onekey/bluepill_f103c6/config.h
parent8c4269f98e107a9c98127464e6870798b1734a61 (diff)
Add minimal STM32F103C6 support (#17853)
Unfortunately, the crippled versions of “Bluepill” boards with STM32F103C6xx chips instead of STM32F103C8xx are now sold all over the place, sometimes advertised in a confusing way to make the difference not noticeable until too late. Add minimal support for these MCUs in the common “Bluepill with stm32duino” configuration, so that it could be possible to make something useful from those boards (although fitting QMK into the available 24 KiB of flash may be rather hard). (In fact, I'm not sure whether the “STM32” part of the chip name is actually correct for those boards of uncertain origin, so the onekey board name is `bluepill_f103c6`; another reason for that name is to match the existing `blackpill_f401` and `blackpill_f411`.) The EEPROM emulation support is not included on purpose, because enabling it without having a working firmware size check would be irresponsible with such flash size (the chance that someone would build a firmware where the EEPROM backing store ends up overlapping some firmware code is really high). Other than that, enabling the EEPROM emulation code is mostly trivial (the `wear_leveling` driver with the `embedded_flash` backing store even works without any custom configuration, although its code is significantly larger than the `vendor` driver, which may also be important for such flash size).
Diffstat (limited to 'keyboards/handwired/onekey/bluepill_f103c6/config.h')
-rw-r--r--keyboards/handwired/onekey/bluepill_f103c6/config.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/keyboards/handwired/onekey/bluepill_f103c6/config.h b/keyboards/handwired/onekey/bluepill_f103c6/config.h
new file mode 100644
index 0000000000..e53aa63292
--- /dev/null
+++ b/keyboards/handwired/onekey/bluepill_f103c6/config.h
@@ -0,0 +1,40 @@
+/* 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 <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "config_common.h"
+
+#define PRODUCT Onekey Bluepill STM32F103C6
+
+#define MATRIX_COL_PINS { B0 }
+#define MATRIX_ROW_PINS { A7 }
+#define UNUSED_PINS
+
+#define BACKLIGHT_PIN A0
+#define BACKLIGHT_PWM_DRIVER PWMD2
+#define BACKLIGHT_PWM_CHANNEL 1
+
+#define RGB_DI_PIN A1
+
+#define ADC_PIN A0
+
+// This code does not fit into the really small flash of STM32F103x6 together
+// with CONSOLE_ENABLE=yes, and the debugging console is probably more
+// important for the "okeney" testing firmware. In a real firmware you may be
+// able to use these features if you keep the debugging console disabled.
+#define NO_ACTION_LAYER
+#define NO_ACTION_TAPPING