diff --git a/keyboards/handwired/tnx_corne_f401/config.h b/keyboards/handwired/tnx_corne_f401/config.h new file mode 100644 index 00000000000..90d1dd71e1a --- /dev/null +++ b/keyboards/handwired/tnx_corne_f401/config.h @@ -0,0 +1,12 @@ +// Copyright 2026 ToYoNiX +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Split configuration +#define SPLIT_HAND_PIN_LOW_IS_LEFT + +// Enable full duplex operation mode +#define SERIAL_USART_FULL_DUPLEX +#define SERIAL_USART_TX_PIN B6 +#define SERIAL_USART_RX_PIN B7 diff --git a/keyboards/handwired/tnx_corne_f401/halconf.h b/keyboards/handwired/tnx_corne_f401/halconf.h new file mode 100644 index 00000000000..ae24733a80d --- /dev/null +++ b/keyboards/handwired/tnx_corne_f401/halconf.h @@ -0,0 +1,9 @@ +// Copyright 2024 zvecr +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once +#define HAL_USE_SERIAL TRUE + +#define SERIAL_USB_BUFFERS_SIZE 256 + +#include_next diff --git a/keyboards/handwired/tnx_corne_f401/keyboard.json b/keyboards/handwired/tnx_corne_f401/keyboard.json new file mode 100644 index 00000000000..39d5cf84392 --- /dev/null +++ b/keyboards/handwired/tnx_corne_f401/keyboard.json @@ -0,0 +1,102 @@ +{ + "manufacturer": "Assem Mohamed", + "keyboard_name": "handwired/tnx_corne_f401", + "maintainer": "ToYoNiX", + "development_board": "blackpill_f401", + "bootloader": "tinyuf2", + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B9", "pin_b": "B8", "resolution": 2} + ] + }, + "split": { + "enabled": true, + "handedness": { + "pin": "C13" + }, + "serial": { + "driver": "usart" + }, + "transport": { + "watchdog": true + }, + "encoder": { + "right": { + "rotary": [ + {"pin_a": "B9", "pin_b": "B8", "resolution": 2} + ] + } + } + }, + "features": { + "bootmagic": true, + "extrakey": true, + "encoder": true, + "mousekey": true, + "nkro": true + }, + "host": { + "default": { + "nkro": true + } + }, + "matrix_pins": { + "cols": ["A8", "B15", "B14", "B13", "B12"], + "rows": ["B0", "A5", "A4", "A3"] + }, + "usb": { + "device_version": "1.0.0", + "pid": "0x544E", + "vid": "0x4B42" + }, + "layouts": { + "LAYOUT_split_3x5_3": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.3}, + {"matrix": [0, 1], "x": 1, "y": 0.1}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0.1}, + {"matrix": [0, 4], "x": 4, "y": 0.2}, + + {"matrix": [4, 4], "x": 8, "y": 0.2}, + {"matrix": [4, 3], "x": 9, "y": 0.1}, + {"matrix": [4, 2], "x": 10, "y": 0}, + {"matrix": [4, 1], "x": 11, "y": 0.1}, + {"matrix": [4, 0], "x": 12, "y": 0.3}, + + {"matrix": [1, 0], "x": 0, "y": 1.3}, + {"matrix": [1, 1], "x": 1, "y": 1.1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1.1}, + {"matrix": [1, 4], "x": 4, "y": 1.2}, + + {"matrix": [5, 4], "x": 8, "y": 1.2}, + {"matrix": [5, 3], "x": 9, "y": 1.1}, + {"matrix": [5, 2], "x": 10, "y": 1}, + {"matrix": [5, 1], "x": 11, "y": 1.1}, + {"matrix": [5, 0], "x": 12, "y": 1.3}, + + {"matrix": [2, 0], "x": 0, "y": 2.3}, + {"matrix": [2, 1], "x": 1, "y": 2.1}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2.1}, + {"matrix": [2, 4], "x": 4, "y": 2.2}, + + {"matrix": [6, 4], "x": 8, "y": 2.2}, + {"matrix": [6, 3], "x": 9, "y": 2.1}, + {"matrix": [6, 2], "x": 10, "y": 2}, + {"matrix": [6, 1], "x": 11, "y": 2.1}, + {"matrix": [6, 0], "x": 12, "y": 2.3}, + + {"matrix": [3, 2], "x": 3, "y": 3.7}, + {"matrix": [3, 3], "x": 4, "y": 3.7}, + {"matrix": [3, 4], "x": 5, "y": 3.2, "h": 1.5}, + + {"matrix": [7, 4], "x": 7, "y": 3.2, "h": 1.5}, + {"matrix": [7, 3], "x": 8, "y": 3.7}, + {"matrix": [7, 2], "x": 9, "y": 3.7} + ] + } + } +} diff --git a/keyboards/handwired/tnx_corne_f401/keymaps/default/keymap.c b/keyboards/handwired/tnx_corne_f401/keymaps/default/keymap.c new file mode 100644 index 00000000000..c21ecce1724 --- /dev/null +++ b/keyboards/handwired/tnx_corne_f401/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +// Copyright 2026 ToYoNiX +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// Home Row Mods - custom modifier order +#define HM_A LSFT_T(KC_A) // Shift +#define HM_S LCTL_T(KC_S) // Ctrl +#define HM_D LGUI_T(KC_D) // Win/GUI +#define HM_F LALT_T(KC_F) // Alt + +#define HM_J LALT_T(KC_J) // Alt +#define HM_K LGUI_T(KC_K) // Win/GUI +#define HM_L LCTL_T(KC_L) // Ctrl +#define HM_SCLN RSFT_T(KC_SCLN) // Shift + +// Keymap +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* BASE Layer: QWERTY */ + [0] = LAYOUT_split_3x5_3( + //A8 B15 B14 B13 B12 B12 B13 B14 B15 A8 + KC_Q, KC_W, KC_E, KC_R, KC_T, /*B0*/ KC_Y, KC_U, KC_I, KC_O, KC_P, + HM_A, HM_S, HM_D, HM_F, KC_G, /*A5*/ KC_H, HM_J, HM_K, HM_L, HM_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, /*A4*/ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_ESC, KC_SPC, MO(1), /*A3*/ MO(2), KC_BSPC, KC_ENT + ), + [1] = LAYOUT_split_3x5_3( + KC_TAB, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_QUOT, KC_MINS, KC_EQL, KC_NO, + KC_LSFT, KC_4, KC_5, KC_6, KC_PSCR, KC_HOME, KC_LBRC, KC_RBRC, KC_BSLS, KC_RSFT, + KC_LGUI, KC_1, KC_2, KC_3, KC_DEL, KC_END, KC_COMM, KC_DOT, KC_SLSH, KC_NO, + _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT_split_3x5_3( + QK_BOOT, KC_F7, KC_F8, KC_F9, KC_F10, TO(3), KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + QK_RBT, KC_F1, KC_F2, KC_F3, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + _______, _______, _______, _______, _______, _______ + ), + // Gaming Layers + [3] = LAYOUT_split_3x5_3( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, TO(0), KC_NO, KC_NO, KC_NO, KC_NO, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_ESC, KC_SPC, LT(4, KC_LGUI), KC_NO, KC_NO, KC_NO + ), + [4] = LAYOUT_split_3x5_3( + KC_NO, KC_7, KC_8, KC_9, KC_0, TO(0), KC_NO, KC_NO, KC_NO, KC_NO, + KC_M, KC_4, KC_5, KC_6, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_B, KC_1, KC_2, KC_3, KC_F3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + _______, _______, _______, KC_NO, KC_NO, KC_NO + ) +}; + +// Encoders +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(MS_WHLD, MS_WHLU) }, + [1] = { ENCODER_CCW_CW(KC_NO, KC_NO), ENCODER_CCW_CW(KC_BRIU, KC_BRID) }, + [2] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_NO, KC_NO) }, + [3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_NO, KC_NO) }, + [4] = { ENCODER_CCW_CW(KC_NO, KC_NO), ENCODER_CCW_CW(KC_NO, KC_NO) }, + // Encoder 1 Encoder 2 +}; +#endif diff --git a/keyboards/handwired/tnx_corne_f401/keymaps/default/rules.mk b/keyboards/handwired/tnx_corne_f401/keymaps/default/rules.mk new file mode 100644 index 00000000000..ee325681483 --- /dev/null +++ b/keyboards/handwired/tnx_corne_f401/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/handwired/tnx_corne_f401/mcuconf.h b/keyboards/handwired/tnx_corne_f401/mcuconf.h new file mode 100644 index 00000000000..949178684bf --- /dev/null +++ b/keyboards/handwired/tnx_corne_f401/mcuconf.h @@ -0,0 +1,8 @@ +// Copyright 2024 zvecr +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/handwired/tnx_corne_f401/readme.md b/keyboards/handwired/tnx_corne_f401/readme.md new file mode 100644 index 00000000000..e52fde920a0 --- /dev/null +++ b/keyboards/handwired/tnx_corne_f401/readme.md @@ -0,0 +1,26 @@ +# handwired/tnx_corne_f401 + +![handwired/tnx_corne_f401](https://i.imgur.com/rHiwS60.jpeg) + +*A handwired Corne keyboard using STM32 microcontrollers, with encoder support.* + +* Keyboard Maintainer: [Assem Mohamed](https://github.com/ToYoNiX) +* Hardware Supported: STM32F401, STM32F411, or STM32F103 development boards with USB HID support +* Hardware Availability: Commonly available Blackpill F401 and Bluepill F103 boards, plus EC11 encoders and a TRRS cable + +Make example for this keyboard (after setting up your build environment): + + make handwired/tnx_corne_f401:default + +Flashing example for this keyboard: + + make handwired/tnx_corne_f401:default:flash + +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). + +## Bootloader + +Enter the bootloader in 2 ways: + +* **Physical reset button**: Double-press the reset button on the dev board to enter DFU mode +* **Keycode in layout**: Press the key mapped to `QK_BOOT`