diff options
Diffstat (limited to 'keyboards/handwired/onekey')
39 files changed, 473 insertions, 17 deletions
diff --git a/keyboards/handwired/onekey/blackpill_f401/config.h b/keyboards/handwired/onekey/blackpill_f401/config.h index 467a2df729..2554e2207c 100644 --- a/keyboards/handwired/onekey/blackpill_f401/config.h +++ b/keyboards/handwired/onekey/blackpill_f401/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { B0 } #define MATRIX_ROW_PINS { A7 } -#define UNUSED_PINS #define BACKLIGHT_PIN A0 #define BACKLIGHT_PWM_DRIVER PWMD5 diff --git a/keyboards/handwired/onekey/blackpill_f411/config.h b/keyboards/handwired/onekey/blackpill_f411/config.h index 7447ef6e4c..9e9737fbf5 100644 --- a/keyboards/handwired/onekey/blackpill_f411/config.h +++ b/keyboards/handwired/onekey/blackpill_f411/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { B0 } #define MATRIX_ROW_PINS { A7 } -#define UNUSED_PINS #define BACKLIGHT_PIN A0 #define BACKLIGHT_PWM_DRIVER PWMD5 diff --git a/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h b/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h index defc092733..f4b589c6d2 100755 --- a/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h +++ b/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { B0 } #define MATRIX_ROW_PINS { A7 } -#define UNUSED_PINS #define BACKLIGHT_PIN A0 #define BACKLIGHT_PWM_DRIVER PWMD5 diff --git a/keyboards/handwired/onekey/bluepill/config.h b/keyboards/handwired/onekey/bluepill/config.h index ba043fc8c1..0f85ad91c7 100644 --- a/keyboards/handwired/onekey/bluepill/config.h +++ b/keyboards/handwired/onekey/bluepill/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { B0 } #define MATRIX_ROW_PINS { A7 } -#define UNUSED_PINS #define BACKLIGHT_PIN A0 #define BACKLIGHT_PWM_DRIVER PWMD2 diff --git a/keyboards/handwired/onekey/bluepill_f103c6/board.h b/keyboards/handwired/onekey/bluepill_f103c6/board.h new file mode 100644 index 0000000000..4889f351a6 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_f103c6/board.h @@ -0,0 +1,6 @@ +// Copyright 2022 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later +#include_next <board.h> + +#undef STM32F103xB +#define STM32F103x6 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 diff --git a/keyboards/handwired/onekey/bluepill_f103c6/halconf.h b/keyboards/handwired/onekey/bluepill_f103c6/halconf.h new file mode 100644 index 0000000000..923b4e52d2 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_f103c6/halconf.h @@ -0,0 +1,26 @@ +/* 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 <http://www.gnu.org/licenses/>. + */ + +/* + * 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_PWM TRUE + +#include_next <halconf.h> diff --git a/keyboards/handwired/onekey/bluepill_f103c6/mcuconf.h b/keyboards/handwired/onekey/bluepill_f103c6/mcuconf.h new file mode 100644 index 0000000000..5e94a97e21 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_f103c6/mcuconf.h @@ -0,0 +1,30 @@ +/* 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 <http://www.gnu.org/licenses/>. + */ + +/* + * 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 <mcuconf.h> + +#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_f103c6/readme.md b/keyboards/handwired/onekey/bluepill_f103c6/readme.md new file mode 100644 index 0000000000..65ba9b0d4f --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_f103c6/readme.md @@ -0,0 +1,7 @@ +# STM32F103C6xx Bluepill onekey + +* Supported hardware: Bluepill boards with the STM32F103C**6**xx chips + +Note that STM32F103C6xx chips have only 32 KiB of flash and 10 KiB of RAM, and the stm32duino bootloader occupies 8 KiB of flash, leaving only 24 KiB for the firmware, therefore the capabilities of this board are severely restricted in comparison to proper Bluepill boards with STM32F103CBxx or STM32F103C8xx chips (128 or 64 KiB of flash and 20 KiB of RAM). You may need to disable many features in the QMK firmware to bring its compiled size below 24 KiB. Please avoid designing new keyboards with these MCUs unless you are stuck with some hardware that you already have and don't want to just throw away. + +To trigger keypress, short together pins *B0* and *A7*. diff --git a/keyboards/handwired/onekey/bluepill_f103c6/rules.mk b/keyboards/handwired/onekey/bluepill_f103c6/rules.mk new file mode 100644 index 0000000000..f2280a1a59 --- /dev/null +++ b/keyboards/handwired/onekey/bluepill_f103c6/rules.mk @@ -0,0 +1,27 @@ +# MCU name +MCU = STM32F103 + +# Bootloader selection +# Cannot use `BOOTLOADER = stm32duino` due to the need to override +# `MCU_LDSCRIPT`, therefore all parameters need to be specified here manually. +OPT_DEFS += -DBOOTLOADER_STM32DUINO +MCU_LDSCRIPT = STM32F103x6_stm32duino_bootloader +BOARD = STM32_F103_STM32DUINO +BOOTLOADER_TYPE = stm32duino +DFU_ARGS = -d 1EAF:0003 -a 2 -R +DFU_SUFFIX_ARGS = -v 1EAF -p 0003 + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE + +# LTO is required to fit the firmware into the available 24K of flash +LTO_ENABLE = yes + +# Disable some features which still don't fit into flash even with LTO +MOUSEKEY_ENABLE = no +NKRO_ENABLE = no + +# EEPROM emulation not supported yet (need to implement a proper firmware size +# check first, otherwise the chance of the EEPROM backing store overwriting +# some part of the firmware code is really high). +EEPROM_DRIVER = transient diff --git a/keyboards/handwired/onekey/config.h b/keyboards/handwired/onekey/config.h index 26ad3c95e0..f1ce6d9491 100644 --- a/keyboards/handwired/onekey/config.h +++ b/keyboards/handwired/onekey/config.h @@ -36,6 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define LOCKING_RESYNC_ENABLE #define TAPPING_TERM 500 +#define PERMISSIVE_HOLD /* * Feature disable options diff --git a/keyboards/handwired/onekey/elite_c/config.h b/keyboards/handwired/onekey/elite_c/config.h index 02c81ce743..83eded68de 100644 --- a/keyboards/handwired/onekey/elite_c/config.h +++ b/keyboards/handwired/onekey/elite_c/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { F4 } #define MATRIX_ROW_PINS { F5 } -#define UNUSED_PINS #define BACKLIGHT_PIN B6 @@ -28,3 +27,6 @@ #define RGB_CI_PIN B1 #define ADC_PIN F6 + +#define QMK_WAITING_TEST_BUSY_PIN F6 +#define QMK_WAITING_TEST_YIELD_PIN F7 diff --git a/keyboards/handwired/onekey/evb_wb32f3g71/config.h b/keyboards/handwired/onekey/evb_wb32f3g71/config.h index 4668809198..722aa59821 100644 --- a/keyboards/handwired/onekey/evb_wb32f3g71/config.h +++ b/keyboards/handwired/onekey/evb_wb32f3g71/config.h @@ -6,4 +6,3 @@ #define MATRIX_COL_PINS { B12 } #define MATRIX_ROW_PINS { B13 } -#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/evb_wb32fq95/config.h b/keyboards/handwired/onekey/evb_wb32fq95/config.h index 4668809198..722aa59821 100644 --- a/keyboards/handwired/onekey/evb_wb32fq95/config.h +++ b/keyboards/handwired/onekey/evb_wb32fq95/config.h @@ -6,4 +6,3 @@ #define MATRIX_COL_PINS { B12 } #define MATRIX_ROW_PINS { B13 } -#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/kb2040/config.h b/keyboards/handwired/onekey/kb2040/config.h new file mode 100644 index 0000000000..24a7d3a3eb --- /dev/null +++ b/keyboards/handwired/onekey/kb2040/config.h @@ -0,0 +1,29 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +#define PRODUCT Onekey Raspberry Pi RP2040 +#define MATRIX_COL_PINS \ + { GP4 } +#define MATRIX_ROW_PINS \ + { GP5 } +#define DEBUG_MATRIX_SCAN_RATE + +#define QMK_WAITING_TEST_BUSY_PIN GP8 +#define QMK_WAITING_TEST_YIELD_PIN GP9 + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U + +#define RGB_DI_PIN A1 + +// settings for the oled keyboard demo with Adafruit 0.91" OLED display on the Stemma QT port +#define OLED_DISPLAY_128X32 +#define I2C_DRIVER I2CD1 +#define I2C1_SDA_PIN GP12 +#define I2C1_SCL_PIN GP13 + diff --git a/keyboards/handwired/onekey/kb2040/mcuconf.h b/keyboards/handwired/onekey/kb2040/mcuconf.h new file mode 100644 index 0000000000..57e58e14d7 --- /dev/null +++ b/keyboards/handwired/onekey/kb2040/mcuconf.h @@ -0,0 +1,24 @@ +/* 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 <http://www.gnu.org/licenses/>. + */ +#pragma once + +#include_next <mcuconf.h> + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 TRUE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/handwired/onekey/kb2040/readme.md b/keyboards/handwired/onekey/kb2040/readme.md new file mode 100644 index 0000000000..54ea25a6a5 --- /dev/null +++ b/keyboards/handwired/onekey/kb2040/readme.md @@ -0,0 +1,10 @@ +# Adafruit KB2040 onekey with OLED + +To trigger keypress, short together pins *GP4* and *GP5*. + +Double-tap reset to enter bootloader mode. Copy the built uf2 file to the device by dragging the file to the new USB disk. + +## Supported Hardware + +* [Adafruit KB2040 - RP2040 Kee Boar](https://www.adafruit.com/product/5302) +* Optional [128x32 OLED display on the Stemma QT port](https://www.adafruit.com/product/4440) diff --git a/keyboards/handwired/onekey/kb2040/rules.mk b/keyboards/handwired/onekey/kb2040/rules.mk new file mode 100644 index 0000000000..624b331bf8 --- /dev/null +++ b/keyboards/handwired/onekey/kb2040/rules.mk @@ -0,0 +1,9 @@ +# MCU name +MCU = RP2040 +BOOTLOADER = rp2040 + +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 + +OPT_DEFS += -DHAL_USE_I2C=TRUE + diff --git a/keyboards/handwired/onekey/keymaps/chibios_waiting_test/config.h b/keyboards/handwired/onekey/keymaps/chibios_waiting_test/config.h new file mode 100644 index 0000000000..0c75fa3044 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/chibios_waiting_test/config.h @@ -0,0 +1,12 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#if !defined(QMK_WAITING_TEST_BUSY_PIN) +# define QMK_WAITING_TEST_BUSY_PIN A8 +#endif + +#if !defined(QMK_WAITING_TEST_YIELD_PIN) +# define QMK_WAITING_TEST_YIELD_PIN A9 +#endif diff --git a/keyboards/handwired/onekey/keymaps/chibios_waiting_test/keymap.c b/keyboards/handwired/onekey/keymaps/chibios_waiting_test/keymap.c new file mode 100644 index 0000000000..ecf67d3b3c --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/chibios_waiting_test/keymap.c @@ -0,0 +1,47 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {LAYOUT_ortho_1x1(KC_A)}; + +#if defined(__AVR__) +# pragma message "AVR uses polled waiting by default, running theses tests will not show any difference" +static inline void chThdSleepMicroseconds(uint32_t us) { + wait_us(us); +} +#endif + +void keyboard_post_init_user(void) { + setPinOutput(QMK_WAITING_TEST_BUSY_PIN); + setPinOutput(QMK_WAITING_TEST_YIELD_PIN); +} + +static inline void wait_us_polling_with_strobe(uint32_t us) { + writePinHigh(QMK_WAITING_TEST_BUSY_PIN); + wait_us(us); + writePinLow(QMK_WAITING_TEST_BUSY_PIN); +} + +static inline void wait_us_yield_with_strobe(uint32_t us) { + writePinHigh(QMK_WAITING_TEST_YIELD_PIN); + chThdSleepMicroseconds(us); + writePinLow(QMK_WAITING_TEST_YIELD_PIN); +} + +static const uint32_t waiting_values[] = {0, 1, 5, 10, 25, 50, 100, 150, 200, 500, 1000}; + +void housekeeping_task_user(void) { + static uint32_t last_bench = 0; + if (timer_elapsed32(last_bench) > 500) { + for (int i = 0; i < (sizeof(waiting_values) / sizeof(waiting_values[0])); i++) { + wait_us_polling_with_strobe(waiting_values[i]); + wait_us(10); + } + for (int i = 0; i < (sizeof(waiting_values) / sizeof(waiting_values[0])); i++) { + wait_us_yield_with_strobe(waiting_values[i]); + wait_us(10); + } + last_bench = timer_read32(); + } +} diff --git a/keyboards/handwired/onekey/nucleo_l432kc/config.h b/keyboards/handwired/onekey/nucleo_l432kc/config.h index 2deb30c34c..b6b36c4cee 100644 --- a/keyboards/handwired/onekey/nucleo_l432kc/config.h +++ b/keyboards/handwired/onekey/nucleo_l432kc/config.h @@ -6,7 +6,6 @@ #define MATRIX_COL_PINS { A2 } #define MATRIX_ROW_PINS { A1 } -#define UNUSED_PINS #define BACKLIGHT_PIN B8 #define BACKLIGHT_PWM_DRIVER PWMD4 diff --git a/keyboards/handwired/onekey/onekey.c b/keyboards/handwired/onekey/onekey.c index cbd67012ce..a29f9ea6d0 100644 --- a/keyboards/handwired/onekey/onekey.c +++ b/keyboards/handwired/onekey/onekey.c @@ -1 +1,12 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include "onekey.h" + +void keyboard_post_init_kb(void) { + debug_enable = true; + debug_matrix = true; + debug_keyboard = true; + debug_mouse = true; + keyboard_post_init_user(); +} diff --git a/keyboards/handwired/onekey/promicro/config.h b/keyboards/handwired/onekey/promicro/config.h index 02c81ce743..83eded68de 100644 --- a/keyboards/handwired/onekey/promicro/config.h +++ b/keyboards/handwired/onekey/promicro/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { F4 } #define MATRIX_ROW_PINS { F5 } -#define UNUSED_PINS #define BACKLIGHT_PIN B6 @@ -28,3 +27,6 @@ #define RGB_CI_PIN B1 #define ADC_PIN F6 + +#define QMK_WAITING_TEST_BUSY_PIN F6 +#define QMK_WAITING_TEST_YIELD_PIN F7 diff --git a/keyboards/handwired/onekey/proton_c/config.h b/keyboards/handwired/onekey/proton_c/config.h index a42672c616..6e8e28edb4 100644 --- a/keyboards/handwired/onekey/proton_c/config.h +++ b/keyboards/handwired/onekey/proton_c/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { A2 } #define MATRIX_ROW_PINS { A1 } -#define UNUSED_PINS #define BACKLIGHT_PIN B8 #define BACKLIGHT_PWM_DRIVER PWMD4 diff --git a/keyboards/handwired/onekey/rp2040/config.h b/keyboards/handwired/onekey/rp2040/config.h new file mode 100644 index 0000000000..f4e45a8981 --- /dev/null +++ b/keyboards/handwired/onekey/rp2040/config.h @@ -0,0 +1,22 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +#define PRODUCT Onekey Raspberry Pi RP2040 +#define MATRIX_COL_PINS \ + { GP4 } +#define MATRIX_ROW_PINS \ + { GP5 } +#define DEBUG_MATRIX_SCAN_RATE + +#define QMK_WAITING_TEST_BUSY_PIN GP8 +#define QMK_WAITING_TEST_YIELD_PIN GP9 + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U + +#define RGB_DI_PIN A1 diff --git a/keyboards/handwired/onekey/rp2040/readme.md b/keyboards/handwired/onekey/rp2040/readme.md new file mode 100644 index 0000000000..9014479f8d --- /dev/null +++ b/keyboards/handwired/onekey/rp2040/readme.md @@ -0,0 +1,12 @@ +# Raspberry Pi 2040 onekey + +To trigger keypress, short together pins *GP4* and *GP5*. + +Double-tap reset to enter bootloader mode. Copy the built uf2 file to the device by dragging the file to the new USB disk. + +## Supported Hardware + +* Raspberry Pi Pico +* SparkFun Pro Micro - RP2040 +* Adafruit KB2040 - RP2040 Kee Boar +* ...and many more RP2040 based development boards diff --git a/keyboards/handwired/onekey/rp2040/rules.mk b/keyboards/handwired/onekey/rp2040/rules.mk new file mode 100644 index 0000000000..646402d0bb --- /dev/null +++ b/keyboards/handwired/onekey/rp2040/rules.mk @@ -0,0 +1,3 @@ +# MCU name +MCU = RP2040 +BOOTLOADER = rp2040 diff --git a/keyboards/handwired/onekey/sipeed_longan_nano/config.h b/keyboards/handwired/onekey/sipeed_longan_nano/config.h index 1825b936d8..6f97baf57f 100644 --- a/keyboards/handwired/onekey/sipeed_longan_nano/config.h +++ b/keyboards/handwired/onekey/sipeed_longan_nano/config.h @@ -22,7 +22,6 @@ { B0 } #define MATRIX_ROW_PINS \ { A7 } -#define UNUSED_PINS #define BACKLIGHT_PIN A1 /* Green LED. */ #define BACKLIGHT_PWM_DRIVER PWMD5 /* GD32 numbering scheme starts from 0, TIMER4 on GD32 boards is TIMER5 on STM32 boards. */ diff --git a/keyboards/handwired/onekey/stm32f0_disco/config.h b/keyboards/handwired/onekey/stm32f0_disco/config.h index 105a0ea4b1..373f1c943a 100644 --- a/keyboards/handwired/onekey/stm32f0_disco/config.h +++ b/keyboards/handwired/onekey/stm32f0_disco/config.h @@ -20,7 +20,6 @@ #define MATRIX_COL_PINS { B4 } #define MATRIX_ROW_PINS { B5 } -#define UNUSED_PINS #define BACKLIGHT_PIN C8 #define BACKLIGHT_PWM_DRIVER PWMD3 diff --git a/keyboards/handwired/onekey/stm32f405_feather/config.h b/keyboards/handwired/onekey/stm32f405_feather/config.h index 77546e7b41..ea9f409640 100644 --- a/keyboards/handwired/onekey/stm32f405_feather/config.h +++ b/keyboards/handwired/onekey/stm32f405_feather/config.h @@ -20,4 +20,3 @@ #define MATRIX_COL_PINS { C2 } #define MATRIX_ROW_PINS { C3 } -#define UNUSED_PINS diff --git a/keyboards/handwired/onekey/teensy_2/config.h b/keyboards/handwired/onekey/teensy_2/config.h index 167373cd39..fb775a06b0 100644 --- a/keyboards/handwired/onekey/teensy_2/config.h +++ b/keyboards/handwired/onekey/teensy_2/config.h @@ -20,10 +20,12 @@ #define MATRIX_COL_PINS { F4 } #define MATRIX_ROW_PINS { F5 } -#define UNUSED_PINS #define BACKLIGHT_PIN B6 #define RGB_DI_PIN F6 #define ADC_PIN F6 + +#define QMK_WAITING_TEST_BUSY_PIN F6 +#define QMK_WAITING_TEST_YIELD_PIN F7 diff --git a/keyboards/handwired/onekey/teensy_2pp/config.h b/keyboards/handwired/onekey/teensy_2pp/config.h index 167373cd39..fb775a06b0 100644 --- a/keyboards/handwired/onekey/teensy_2pp/config.h +++ b/keyboards/handwired/onekey/teensy_2pp/config.h @@ -20,10 +20,12 @@ #define MATRIX_COL_PINS { F4 } #define MATRIX_ROW_PINS { F5 } -#define UNUSED_PINS #define BACKLIGHT_PIN B6 #define RGB_DI_PIN F6 #define ADC_PIN F6 + +#define QMK_WAITING_TEST_BUSY_PIN F6 +#define QMK_WAITING_TEST_YIELD_PIN F7 diff --git a/keyboards/handwired/onekey/teensy_32/config.h b/keyboards/handwired/onekey/teensy_32/config.h index 1a730a6d46..3444cca67f 100644 --- a/keyboards/handwired/onekey/teensy_32/config.h +++ b/keyboards/handwired/onekey/teensy_32/config.h @@ -21,7 +21,6 @@ #define MATRIX_COL_PINS { D5 } #define MATRIX_ROW_PINS { B2 } -#define UNUSED_PINS // i2c_master defines #define I2C1_SCL_PIN B0 // A2 on pinout = B0 diff --git a/keyboards/handwired/onekey/teensy_35/chconf.h b/keyboards/handwired/onekey/teensy_35/chconf.h new file mode 100644 index 0000000000..ee8312c526 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_35/chconf.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 <http://www.gnu.org/licenses/>. + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/handwired/onekey/teensy_35/chconf.h -r platforms/chibios/common/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_TIMEDELTA 0 + +#define CH_CFG_TIME_QUANTUM 20 + +#include_next <chconf.h> diff --git a/keyboards/handwired/onekey/teensy_35/config.h b/keyboards/handwired/onekey/teensy_35/config.h new file mode 100644 index 0000000000..18eebcaffd --- /dev/null +++ b/keyboards/handwired/onekey/teensy_35/config.h @@ -0,0 +1,31 @@ +/* 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 + +// TODO: including this causes "error: expected identifier before '(' token" errors +//#include "config_common.h" + +#define PRODUCT Onekey Teensy 3.5 + +#define MATRIX_COL_PINS { D5 } // 20/A6 +#define MATRIX_ROW_PINS { B2 } // 19/A5 + +// i2c_master defines +#define I2C1_SCL_PIN B0 // 16/A2 on pinout +#define I2C1_SDA_PIN B1 // 17/A3 on pinout +#define I2C1_SCL_PAL_MODE PAL_MODE_ALTERNATIVE_2 +#define I2C1_SDA_PAL_MODE PAL_MODE_ALTERNATIVE_2 diff --git a/keyboards/handwired/onekey/teensy_35/halconf.h b/keyboards/handwired/onekey/teensy_35/halconf.h new file mode 100644 index 0000000000..6ac756d0f2 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_35/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 <http://www.gnu.org/licenses/>. + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/handwired/onekey/teensy_35/halconf.h -r platforms/chibios/common/configs/halconf.h` + */ + +#pragma once + +#define HAL_USE_SERIAL TRUE + +#define SERIAL_USB_BUFFERS_SIZE 256 + +#include_next <halconf.h> diff --git a/keyboards/handwired/onekey/teensy_35/mcuconf.h b/keyboards/handwired/onekey/teensy_35/mcuconf.h new file mode 100644 index 0000000000..dc508eee7d --- /dev/null +++ b/keyboards/handwired/onekey/teensy_35/mcuconf.h @@ -0,0 +1,50 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define K60x_MCUCONF + +/* + * HAL driver system settings. + */ + +/* Select the MCU clocking mode below by enabling the appropriate block. */ + +/* PEE mode - 120MHz system clock driven by external crystal. */ +#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE +#define KINETIS_PLLCLK_FREQUENCY 120000000UL // 120 MHz (RUN) +#define KINETIS_SYSCLK_FREQUENCY KINETIS_PLLCLK_FREQUENCY +#define KINETIS_BUSCLK_FREQUENCY 60000000UL +#define KINETIS_FLASHCLK_FREQUENCY 24000000UL // 24 MHz (RUN) + +#define KINETIS_CLKDIV1_OUTDIV1 1 // -> 0 +#define KINETIS_CLKDIV1_OUTDIV2 2 // -> 1 +#define KINETIS_CLKDIV1_OUTDIV4 5 // -> 4 + +/* + * SERIAL driver system settings. + */ +#define KINETIS_SERIAL_USE_UART0 TRUE + +/* + * USB driver settings + */ +#define KINETIS_USB_USE_USB0 TRUE +#define KINETIS_USB_USB0_IRQ_PRIORITY 5 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/handwired/onekey/teensy_35/rules.mk b/keyboards/handwired/onekey/teensy_35/rules.mk new file mode 100644 index 0000000000..8ebefd03f5 --- /dev/null +++ b/keyboards/handwired/onekey/teensy_35/rules.mk @@ -0,0 +1,8 @@ +# MCU name +MCU = MK64FX512 + +# Bootloader selection +BOOTLOADER = halfkay + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/handwired/onekey/teensy_lc/config.h b/keyboards/handwired/onekey/teensy_lc/config.h index 1a730a6d46..3444cca67f 100644 --- a/keyboards/handwired/onekey/teensy_lc/config.h +++ b/keyboards/handwired/onekey/teensy_lc/config.h @@ -21,7 +21,6 @@ #define MATRIX_COL_PINS { D5 } #define MATRIX_ROW_PINS { B2 } -#define UNUSED_PINS // i2c_master defines #define I2C1_SCL_PIN B0 // A2 on pinout = B0 |