From eac380926655d59db7471a9085a96b10b7671ce2 Mon Sep 17 00:00:00 2001 From: DOIO2022 <116554792+DOIO2022@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:53:11 +0800 Subject: [PATCH] [Keyboard] Add kb3x keyboard (#23268) Co-authored-by: Drashna Jaelre Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com> --- keyboards/doio/kb3x/info.json | 125 +++++++++++++++++++ keyboards/doio/kb3x/keymaps/default/keymap.c | 51 ++++++++ keyboards/doio/kb3x/keymaps/default/rules.mk | 1 + keyboards/doio/kb3x/keymaps/via/keymap.c | 73 +++++++++++ keyboards/doio/kb3x/keymaps/via/rules.mk | 2 + keyboards/doio/kb3x/readme.md | 26 ++++ keyboards/doio/kb3x/rules.mk | 1 + 7 files changed, 279 insertions(+) create mode 100644 keyboards/doio/kb3x/info.json create mode 100644 keyboards/doio/kb3x/keymaps/default/keymap.c create mode 100644 keyboards/doio/kb3x/keymaps/default/rules.mk create mode 100644 keyboards/doio/kb3x/keymaps/via/keymap.c create mode 100644 keyboards/doio/kb3x/keymaps/via/rules.mk create mode 100644 keyboards/doio/kb3x/readme.md create mode 100644 keyboards/doio/kb3x/rules.mk diff --git a/keyboards/doio/kb3x/info.json b/keyboards/doio/kb3x/info.json new file mode 100644 index 00000000000..be0d1384397 --- /dev/null +++ b/keyboards/doio/kb3x/info.json @@ -0,0 +1,125 @@ +{ + "manufacturer": "DOIO", + "keyboard_name": "KB3x-01", + "maintainer": "DOIO2022", + "bootloader": "stm32duino", + "diode_direction": "COL2ROW", + "dynamic_keymap": { + "layer_count": 6 + }, + "encoder": { + "rotary": [ + {"pin_a": "B5", "pin_b": "B6", "resolution": 2}, + {"pin_a": "A1", "pin_b": "A2", "resolution": 2}, + {"pin_a": "A3", "pin_b": "A4", "resolution": 2} + ] + }, + "features": { + "bootmagic": true, + "encoder": true, + "extrakey": true, + "mousekey": true, + "rgb_matrix": true + }, + "matrix_pins": { + "cols": ["B14", "B13", "B12", "B0", "A7", "A6"], + "rows": ["B3", "B4", "B9", "B8"] + }, + "processor": "STM32F103", + "rgb_matrix": { + "animations": { + "alphas_mods": true, + "band_pinwheel_sat": true, + "band_pinwheel_val": true, + "band_sat": true, + "band_spiral_sat": true, + "band_spiral_val": true, + "band_val": true, + "breathing": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "cycle_up_down": true, + "digital_rain": true, + "dual_beacon": true, + "gradient_left_right": true, + "gradient_up_down": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + "jellybean_raindrops": true, + "multisplash": true, + "pixel_flow": true, + "pixel_fractal": true, + "pixel_rain": true, + "rainbow_beacon": true, + "rainbow_moving_chevron": true, + "rainbow_pinwheels": true, + "raindrops": true, + "solid_multisplash": true, + "solid_reactive": true, + "solid_reactive_cross": true, + "solid_reactive_multicross": true, + "solid_reactive_multinexus": true, + "solid_reactive_multiwide": true, + "solid_reactive_nexus": true, + "solid_reactive_simple": true, + "solid_reactive_wide": true, + "solid_splash": true, + "splash": true, + "typing_heatmap": true + }, + "driver": "ws2812", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 75, "y": 0, "flags": 1}, + {"matrix": [0, 2], "x": 149, "y": 0, "flags": 1}, + {"matrix": [0, 3], "x": 224, "y": 0, "flags": 1}, + {"x": 112, "y": 64, "flags": 1}, + {"x": 112, "y": 64, "flags": 1}, + {"x": 112, "y": 64, "flags": 1}, + {"x": 112, "y": 64, "flags": 1} + ], + "max_brightness": 200, + "sleep": true + }, + "url": "", + "usb": { + "device_version": "0.0.1", + "pid": "0x3F01", + "vid": "0xD010" + }, + "ws2812": { + "pin": "A10" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [3, 0], "x": 0, "y": 0}, + {"matrix": [3, 1], "x": 1, "y": 0}, + {"matrix": [3, 2], "x": 2, "y": 0}, + {"matrix": [3, 3], "x": 6.5, "y": 0}, + {"matrix": [3, 4], "x": 7.5, "y": 0}, + {"matrix": [3, 5], "x": 8.5, "y": 0}, + {"matrix": [0, 0], "x": 1, "y": 1.25}, + {"matrix": [1, 0], "x": 4.25, "y": 1.25}, + {"matrix": [2, 0], "x": 7.5, "y": 1.25}, + {"matrix": [0, 3], "x": 0, "y": 2.25}, + {"matrix": [0, 4], "x": 1, "y": 2.25, "encoder": 0}, + {"matrix": [0, 1], "x": 2, "y": 2.25}, + {"matrix": [1, 3], "x": 3.25, "y": 2.25}, + {"matrix": [1, 4], "x": 4.25, "y": 2.25, "encoder": 1}, + {"matrix": [1, 1], "x": 5.25, "y": 2.25}, + {"matrix": [2, 3], "x": 6.5, "y": 2.25}, + {"matrix": [2, 4], "x": 7.5, "y": 2.25, "encoder": 2}, + {"matrix": [2, 1], "x": 8.5, "y": 2.25}, + {"matrix": [0, 2], "x": 1, "y": 3.25}, + {"matrix": [1, 2], "x": 4.25, "y": 3.25}, + {"matrix": [2, 2], "x": 7.5, "y": 3.25} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/doio/kb3x/keymaps/default/keymap.c b/keyboards/doio/kb3x/keymaps/default/keymap.c new file mode 100644 index 00000000000..934019e8cf5 --- /dev/null +++ b/keyboards/doio/kb3x/keymaps/default/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2022 DOIO + * Copyright 2022 DOIO2022 + * + * 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 . + */ + + #include QMK_KEYBOARD_H + +enum layer_names { + _LAY0, + _LAY1, + _LAY2 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAY0] = LAYOUT( + TO(1), RGB_MOD, RGB_TOG, RGB_HUI, RGB_VAD, RGB_VAI, + KC_MPLY, KC_UP, KC_UP, + KC_MNXT, KC_TRNS, KC_MPRV, A(KC_LEFT), KC_TRNS, A(KC_RIGHT), KC_RIGHT, KC_TRNS, KC_LEFT, + KC_MPLY, KC_DOWN, KC_DOWN), + [_LAY1] = LAYOUT( + TO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_WH_U, S(KC_RBRC), C(KC_L), + C(KC_WH_D), KC_TRNS, C(KC_WH_U), KC_DOT, KC_TRNS, KC_COMM, C(KC_B), KC_TRNS, C(KC_U), + KC_WH_D, S(KC_LBRC), C(KC_M)), + [_LAY2] = LAYOUT( + TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_B, KC_UP, S(KC_I), + KC_P, KC_TRNS, KC_H, KC_RIGHT, KC_TRNS, KC_LEFT, KC_O, KC_TRNS, KC_I, + KC_Y, KC_DOWN, S(KC_O)) +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [_LAY0] = { ENCODER_CCW_CW(C(KC_DOWN), C(KC_UP)), ENCODER_CCW_CW(C(KC_PMNS), C(KC_PPLS)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_LAY1] = { ENCODER_CCW_CW(C(KC_PMNS), C(KC_PPLS)), ENCODER_CCW_CW(KC_LBRC, KC_RBRC), ENCODER_CCW_CW(C(S(KC_U)), C(KC_I)) }, + [_LAY2] = { ENCODER_CCW_CW(KC_C, KC_V), ENCODER_CCW_CW(KC_MINS, KC_EQL), ENCODER_CCW_CW(KC_J, KC_L) } +}; +#endif diff --git a/keyboards/doio/kb3x/keymaps/default/rules.mk b/keyboards/doio/kb3x/keymaps/default/rules.mk new file mode 100644 index 00000000000..ee325681483 --- /dev/null +++ b/keyboards/doio/kb3x/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/doio/kb3x/keymaps/via/keymap.c b/keyboards/doio/kb3x/keymaps/via/keymap.c new file mode 100644 index 00000000000..5ebd1066a9f --- /dev/null +++ b/keyboards/doio/kb3x/keymaps/via/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2022 DOIO + * Copyright 2022 DOIO2022 + * + * 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 . + */ + + #include QMK_KEYBOARD_H + +enum layer_names { + _LAY0, + _LAY1, + _LAY2, + _LAY3, + _LAY4, + _LAY5 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAY0] = LAYOUT( + TO(1), RGB_MOD, RGB_TOG, RGB_HUI, RGB_VAD, RGB_VAI, + KC_MPLY, KC_UP, KC_UP, + KC_MNXT, KC_TRNS, KC_MPRV, A(KC_LEFT), KC_TRNS, A(KC_RIGHT), KC_RIGHT, KC_TRNS, KC_LEFT, + KC_MPLY, KC_DOWN, KC_DOWN), + [_LAY1] = LAYOUT( + TO(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_WH_U, S(KC_RBRC), C(KC_L), + C(KC_WH_D), KC_TRNS, C(KC_WH_U), KC_DOT, KC_TRNS, KC_COMM, C(KC_B), KC_TRNS, C(KC_U), + KC_WH_D, S(KC_LBRC), C(KC_M)), + [_LAY2] = LAYOUT( + TO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_B, KC_UP, S(KC_I), + KC_P, KC_TRNS, KC_H, KC_RIGHT, KC_TRNS, KC_LEFT, KC_O, KC_TRNS, KC_I, + KC_Y, KC_DOWN, S(KC_O)), + [_LAY3] = LAYOUT( + TO(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), + [_LAY4] = LAYOUT( + TO(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), + [_LAY5] = LAYOUT( + TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [_LAY0] = { ENCODER_CCW_CW(C(KC_DOWN), C(KC_UP)), ENCODER_CCW_CW(C(KC_PMNS), C(KC_PPLS)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_LAY1] = { ENCODER_CCW_CW(C(KC_PMNS), C(KC_PPLS)), ENCODER_CCW_CW(KC_LBRC, KC_RBRC), ENCODER_CCW_CW(C(S(KC_U)), C(KC_I)) }, + [_LAY2] = { ENCODER_CCW_CW(KC_C, KC_V), ENCODER_CCW_CW(KC_MINS, KC_EQL), ENCODER_CCW_CW(KC_J, KC_L) }, + [_LAY3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_LAY4] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_LAY5] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, +}; +#endif diff --git a/keyboards/doio/kb3x/keymaps/via/rules.mk b/keyboards/doio/kb3x/keymaps/via/rules.mk new file mode 100644 index 00000000000..f1adcab005e --- /dev/null +++ b/keyboards/doio/kb3x/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/doio/kb3x/readme.md b/keyboards/doio/kb3x/readme.md new file mode 100644 index 00000000000..c27c983d496 --- /dev/null +++ b/keyboards/doio/kb3x/readme.md @@ -0,0 +1,26 @@ +# doio/kb3x + +![kb3x-01](https://i.imgur.com/6DvIu9Mh.png) + +QMK for DOIO Knob keypad . + +* Keyboard Maintainer: DOIO2022 +* Hardware Supported: DOIO Knob keypad + +Make example for this keyboard (after setting up your build environment): + + make doio/kb3x:default + +Flashing example for this keyboard: + + make doio/kb3x: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 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/doio/kb3x/rules.mk b/keyboards/doio/kb3x/rules.mk new file mode 100644 index 00000000000..6e7633bfe01 --- /dev/null +++ b/keyboards/doio/kb3x/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank