From f47963efe9026bc82ff28243629094c757d907b6 Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Mon, 3 Jan 2022 01:30:03 +0200 Subject: [PATCH 1/6] Keychron K*: restructure --- bin/build_all.py | 30 +- keyboards/keychron/k14/keymaps/ansi/config.h | 3 + .../k14/{rgb => }/keymaps/ansi/keymap.c | 0 .../k14/rgb/{keymaps/ansi => }/config.h | 9 +- .../k14/rgb/{keymaps/ansi => }/config_led.c | 0 .../k14/rgb/{keymaps/ansi => }/config_led.h | 1 + keyboards/keychron/k14/rgb/optical/readme.md | 11 + .../keychron/{k8 => k14/rgb}/optical/rules.mk | 0 .../keychron/k14/rgb/optical_via/readme.md | 11 + .../{k8 => k14/rgb}/optical_via/rules.mk | 0 keyboards/keychron/k14/rgb/via/readme.md | 2 +- .../keychron/k2/keymaps/default/config.h | 3 + .../keychron/k2/{ => rgb}/bootloader_defs.h | 0 keyboards/keychron/k2/{ => rgb}/chconf.h | 0 keyboards/keychron/k2/{ => rgb}/config.h | 12 +- keyboards/keychron/k2/{ => rgb}/config_led.c | 0 .../keychron/{k3 => k2/rgb}/config_led.h | 1 + keyboards/keychron/k2/{ => rgb}/halconf.h | 0 keyboards/keychron/k2/{ => rgb}/info.json | 0 keyboards/keychron/k2/{ => rgb}/k2.h | 0 keyboards/keychron/k2/{ => rgb}/mcuconf.h | 0 keyboards/keychron/k2/rgb/optical/readme.md | 11 + keyboards/keychron/k2/rgb/optical/rules.mk | 1 + .../keychron/k2/rgb/optical_via/readme.md | 11 + .../keychron/k2/rgb/optical_via/rules.mk | 2 + keyboards/keychron/k2/{ => rgb}/readme.md | 0 keyboards/keychron/k2/rgb/rgb.h | 3 + keyboards/keychron/k2/{ => rgb}/rules.mk | 0 keyboards/keychron/k2/rgb/via/readme.md | 11 + .../keychron/{k8 => k2/rgb}/via/rules.mk | 0 .../keychron/k3/keymaps/default/config.h | 3 + .../keychron/k3/{ => rgb}/bootloader_defs.h | 0 keyboards/keychron/k3/{ => rgb}/chconf.h | 0 keyboards/keychron/k3/{ => rgb}/config.h | 12 +- keyboards/keychron/k3/{ => rgb}/config_led.c | 0 .../keychron/{k2 => k3/rgb}/config_led.h | 1 + keyboards/keychron/k3/{ => rgb}/halconf.h | 0 keyboards/keychron/k3/{ => rgb}/info.json | 0 keyboards/keychron/k3/{ => rgb}/k3.h | 0 keyboards/keychron/k3/{ => rgb}/mcuconf.h | 0 keyboards/keychron/k3/rgb/optical/readme.md | 11 + keyboards/keychron/k3/rgb/optical/rules.mk | 1 + .../keychron/k3/rgb/optical_via/readme.md | 11 + .../keychron/k3/rgb/optical_via/rules.mk | 2 + keyboards/keychron/k3/{ => rgb}/readme.md | 0 keyboards/keychron/k3/rgb/rgb.h | 3 + keyboards/keychron/k3/{ => rgb}/rules.mk | 2 +- keyboards/keychron/k3/rgb/via/readme.md | 11 + keyboards/keychron/k3/rgb/via/rules.mk | 5 + keyboards/keychron/k4/rgb/config.h | 3 +- keyboards/keychron/k4/rgb/config_led.c | 29 +- .../keymaps/default_ansi => }/config_led.h | 5 + keyboards/keychron/k4/rgb/rules.mk | 2 +- keyboards/keychron/k4/rgb/v1/config.h | 9 +- .../k4/rgb/v1/keymaps/default/config.h | 3 + .../keychron/k4/rgb/v1/optical/readme.md | 11 + keyboards/keychron/k4/rgb/v1/optical/rules.mk | 1 + .../keychron/k4/rgb/v1/optical_via/config.h | 3 + .../keychron/k4/rgb/v1/optical_via/readme.md | 11 + .../keychron/k4/rgb/v1/optical_via/rules.mk | 2 + keyboards/keychron/k4/rgb/v1/via/config.h | 3 + keyboards/keychron/k4/rgb/v1/via/readme.md | 11 + keyboards/keychron/k4/rgb/v1/via/rules.mk | 5 + keyboards/keychron/k4/rgb/v2/config.h | 9 +- .../k4/rgb/v2/keymaps/default_ansi/config.h | 3 + .../k4/rgb/v2/keymaps/default_iso/config.h | 5 + .../rgb/v2/keymaps/default_iso/config_led.c | 32 - .../rgb/v2/keymaps/default_iso/config_led.h | 30 - .../keychron/k4/rgb/v2/optical/readme.md | 11 + keyboards/keychron/k4/rgb/v2/optical/rules.mk | 1 + .../keychron/k4/rgb/v2/optical_via/config.h | 3 + .../keychron/k4/rgb/v2/optical_via/readme.md | 11 + .../keychron/k4/rgb/v2/optical_via/rules.mk | 2 + keyboards/keychron/k4/rgb/v2/via/config.h | 3 + keyboards/keychron/k4/rgb/v2/via/readme.md | 11 + keyboards/keychron/k4/rgb/v2/via/rules.mk | 5 + keyboards/keychron/k6/keymaps/ansi/config.h | 3 + .../k6/{rgb => }/keymaps/ansi/keymap.c | 0 keyboards/keychron/k6/keymaps/iso/config.h | 5 + .../k6/{rgb => }/keymaps/iso/keymap.c | 0 keyboards/keychron/k6/keymaps/stdvar/config.h | 23 + .../k6/{rgb => }/keymaps/stdvar/keymap.c | 0 .../k6/{rgb => }/keymaps/stdvar/rules.mk | 0 .../k6/rgb/{keymaps/ansi => }/config.h | 11 +- .../k6/rgb/{keymaps/iso => }/config_led.c | 29 +- .../k6/rgb/{keymaps/iso => }/config_led.h | 8 +- .../keychron/k6/rgb/keymaps/ansi/config_led.c | 30 - .../keychron/k6/rgb/keymaps/ansi/config_led.h | 33 - .../keychron/k6/rgb/keymaps/stdvar/config.h | 49 -- .../k6/rgb/keymaps/stdvar/config_led.c | 30 - .../k6/rgb/keymaps/stdvar/config_led.h | 47 -- keyboards/keychron/k6/rgb/optical/readme.md | 11 + keyboards/keychron/k6/rgb/optical/rules.mk | 1 + .../keychron/k6/rgb/optical_via/readme.md | 11 + .../keychron/k6/rgb/optical_via/rules.mk | 2 + keyboards/keychron/k6/rgb/rules.mk | 2 +- keyboards/keychron/k6/rgb/via/readme.md | 18 +- keyboards/keychron/k6/rgb/via/rules.mk | 4 + keyboards/keychron/k6/white/chconf.h | 17 +- keyboards/keychron/k6/white/config.h | 84 +++ keyboards/keychron/k6/white/config_led.c | 74 +++ .../keychron/k6/white/keymaps/ansi/config.h | 52 -- .../k6/white/keymaps/ansi/config_led.c | 30 - .../k6/white/keymaps/ansi/config_led.h | 35 - .../keychron/k6/white/keymaps/ansi/keymap.c | 75 --- keyboards/keychron/k6/white/matrix.c | 616 ------------------ keyboards/keychron/k6/white/mcuconf.h | 42 +- keyboards/keychron/k6/white/rand.c | 31 + keyboards/keychron/k6/white/rules.mk | 50 +- keyboards/keychron/k6/white/white.c | 33 + keyboards/keychron/k7/keymaps/ansi/config.h | 3 + .../k7/{rgb => }/keymaps/ansi/keymap.c | 0 keyboards/keychron/k7/keymaps/iso/config.h | 5 + .../k7/{rgb => }/keymaps/iso/keymap.c | 0 .../k7/{rgb => }/keymaps/stdvar/config.h | 4 +- .../k7/{rgb => }/keymaps/stdvar/keymap.c | 0 .../k7/{rgb => }/keymaps/stdvar/rules.mk | 0 keyboards/keychron/k7/rgb/config.h | 9 +- .../keychron/k7/rgb/keymaps/iso/config.h | 1 - keyboards/keychron/k7/rgb/optical/readme.md | 14 +- .../keychron/k7/rgb/optical_via/readme.md | 11 + .../keychron/k7/rgb/optical_via/rules.mk | 2 + keyboards/keychron/k7/rgb/via/readme.md | 15 + keyboards/keychron/k7/rgb/via/rules.mk | 5 + keyboards/keychron/k8/keymaps/ansi/config.h | 52 -- keyboards/keychron/k8/keymaps/iso/config.h | 53 +- .../keychron/k8/keymaps/iso/config_led.c | 37 -- .../keychron/k8/keymaps/iso/config_led.h | 33 - keyboards/keychron/k8/keymaps/iso/rules.mk | 14 - .../keychron/k8/{ => rgb}/bootloader_defs.h | 0 keyboards/keychron/k8/{ => rgb}/chconf.h | 0 .../{k6/rgb/keymaps/iso => k8/rgb}/config.h | 25 +- .../k8/{keymaps/ansi => rgb}/config_led.c | 29 +- .../k8/{keymaps/ansi => rgb}/config_led.h | 5 + keyboards/keychron/k8/{ => rgb}/halconf.h | 0 keyboards/keychron/k8/{ => rgb}/info.json | 0 keyboards/keychron/k8/{ => rgb}/k8.h | 0 .../keychron/k8/{ => rgb}/k8_via_ansi.json | 0 .../k8/{ => rgb}/k8_via_ansi_optical.json | 0 .../keychron/k8/{ => rgb}/k8_via_iso.json | 0 keyboards/keychron/k8/{ => rgb}/mcuconf.h | 0 .../keychron/k8/{ => rgb}/optical/readme.md | 4 +- keyboards/keychron/k8/rgb/optical/rules.mk | 1 + .../k8/{ => rgb}/optical_via/readme.md | 2 +- .../keychron/k8/rgb/optical_via/rules.mk | 2 + keyboards/keychron/k8/{ => rgb}/readme.md | 0 keyboards/keychron/k8/rgb/rgb.h | 3 + keyboards/keychron/k8/{ => rgb}/rules.mk | 0 keyboards/keychron/k8/{ => rgb}/via/readme.md | 2 +- keyboards/keychron/k8/rgb/via/rules.mk | 5 + 150 files changed, 778 insertions(+), 1422 deletions(-) create mode 100644 keyboards/keychron/k14/keymaps/ansi/config.h rename keyboards/keychron/k14/{rgb => }/keymaps/ansi/keymap.c (100%) rename keyboards/keychron/k14/rgb/{keymaps/ansi => }/config.h (87%) rename keyboards/keychron/k14/rgb/{keymaps/ansi => }/config_led.c (100%) rename keyboards/keychron/k14/rgb/{keymaps/ansi => }/config_led.h (98%) create mode 100644 keyboards/keychron/k14/rgb/optical/readme.md rename keyboards/keychron/{k8 => k14/rgb}/optical/rules.mk (100%) create mode 100644 keyboards/keychron/k14/rgb/optical_via/readme.md rename keyboards/keychron/{k8 => k14/rgb}/optical_via/rules.mk (100%) create mode 100644 keyboards/keychron/k2/keymaps/default/config.h rename keyboards/keychron/k2/{ => rgb}/bootloader_defs.h (100%) rename keyboards/keychron/k2/{ => rgb}/chconf.h (100%) rename keyboards/keychron/k2/{ => rgb}/config.h (87%) rename keyboards/keychron/k2/{ => rgb}/config_led.c (100%) rename keyboards/keychron/{k3 => k2/rgb}/config_led.h (98%) rename keyboards/keychron/k2/{ => rgb}/halconf.h (100%) rename keyboards/keychron/k2/{ => rgb}/info.json (100%) rename keyboards/keychron/k2/{ => rgb}/k2.h (100%) rename keyboards/keychron/k2/{ => rgb}/mcuconf.h (100%) create mode 100644 keyboards/keychron/k2/rgb/optical/readme.md create mode 100644 keyboards/keychron/k2/rgb/optical/rules.mk create mode 100644 keyboards/keychron/k2/rgb/optical_via/readme.md create mode 100644 keyboards/keychron/k2/rgb/optical_via/rules.mk rename keyboards/keychron/k2/{ => rgb}/readme.md (100%) create mode 100644 keyboards/keychron/k2/rgb/rgb.h rename keyboards/keychron/k2/{ => rgb}/rules.mk (100%) create mode 100644 keyboards/keychron/k2/rgb/via/readme.md rename keyboards/keychron/{k8 => k2/rgb}/via/rules.mk (100%) create mode 100644 keyboards/keychron/k3/keymaps/default/config.h rename keyboards/keychron/k3/{ => rgb}/bootloader_defs.h (100%) rename keyboards/keychron/k3/{ => rgb}/chconf.h (100%) rename keyboards/keychron/k3/{ => rgb}/config.h (86%) rename keyboards/keychron/k3/{ => rgb}/config_led.c (100%) rename keyboards/keychron/{k2 => k3/rgb}/config_led.h (98%) rename keyboards/keychron/k3/{ => rgb}/halconf.h (100%) rename keyboards/keychron/k3/{ => rgb}/info.json (100%) rename keyboards/keychron/k3/{ => rgb}/k3.h (100%) rename keyboards/keychron/k3/{ => rgb}/mcuconf.h (100%) create mode 100644 keyboards/keychron/k3/rgb/optical/readme.md create mode 100644 keyboards/keychron/k3/rgb/optical/rules.mk create mode 100644 keyboards/keychron/k3/rgb/optical_via/readme.md create mode 100644 keyboards/keychron/k3/rgb/optical_via/rules.mk rename keyboards/keychron/k3/{ => rgb}/readme.md (100%) create mode 100644 keyboards/keychron/k3/rgb/rgb.h rename keyboards/keychron/k3/{ => rgb}/rules.mk (97%) create mode 100644 keyboards/keychron/k3/rgb/via/readme.md create mode 100644 keyboards/keychron/k3/rgb/via/rules.mk rename keyboards/keychron/k4/rgb/{v2/keymaps/default_ansi => }/config_led.h (93%) create mode 100644 keyboards/keychron/k4/rgb/v1/keymaps/default/config.h create mode 100644 keyboards/keychron/k4/rgb/v1/optical/readme.md create mode 100644 keyboards/keychron/k4/rgb/v1/optical/rules.mk create mode 100644 keyboards/keychron/k4/rgb/v1/optical_via/config.h create mode 100644 keyboards/keychron/k4/rgb/v1/optical_via/readme.md create mode 100644 keyboards/keychron/k4/rgb/v1/optical_via/rules.mk create mode 100644 keyboards/keychron/k4/rgb/v1/via/config.h create mode 100644 keyboards/keychron/k4/rgb/v1/via/readme.md create mode 100644 keyboards/keychron/k4/rgb/v1/via/rules.mk create mode 100644 keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h create mode 100644 keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h delete mode 100644 keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.c delete mode 100644 keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.h create mode 100644 keyboards/keychron/k4/rgb/v2/optical/readme.md create mode 100644 keyboards/keychron/k4/rgb/v2/optical/rules.mk create mode 100644 keyboards/keychron/k4/rgb/v2/optical_via/config.h create mode 100644 keyboards/keychron/k4/rgb/v2/optical_via/readme.md create mode 100644 keyboards/keychron/k4/rgb/v2/optical_via/rules.mk create mode 100644 keyboards/keychron/k4/rgb/v2/via/config.h create mode 100644 keyboards/keychron/k4/rgb/v2/via/readme.md create mode 100644 keyboards/keychron/k4/rgb/v2/via/rules.mk create mode 100644 keyboards/keychron/k6/keymaps/ansi/config.h rename keyboards/keychron/k6/{rgb => }/keymaps/ansi/keymap.c (100%) create mode 100644 keyboards/keychron/k6/keymaps/iso/config.h rename keyboards/keychron/k6/{rgb => }/keymaps/iso/keymap.c (100%) create mode 100644 keyboards/keychron/k6/keymaps/stdvar/config.h rename keyboards/keychron/k6/{rgb => }/keymaps/stdvar/keymap.c (100%) rename keyboards/keychron/k6/{rgb => }/keymaps/stdvar/rules.mk (100%) rename keyboards/keychron/k6/rgb/{keymaps/ansi => }/config.h (86%) rename keyboards/keychron/k6/rgb/{keymaps/iso => }/config_led.c (62%) rename keyboards/keychron/k6/rgb/{keymaps/iso => }/config_led.h (91%) delete mode 100644 keyboards/keychron/k6/rgb/keymaps/ansi/config_led.c delete mode 100644 keyboards/keychron/k6/rgb/keymaps/ansi/config_led.h delete mode 100644 keyboards/keychron/k6/rgb/keymaps/stdvar/config.h delete mode 100644 keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.c delete mode 100644 keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.h create mode 100644 keyboards/keychron/k6/rgb/optical/readme.md create mode 100644 keyboards/keychron/k6/rgb/optical/rules.mk create mode 100644 keyboards/keychron/k6/rgb/optical_via/readme.md create mode 100644 keyboards/keychron/k6/rgb/optical_via/rules.mk create mode 100644 keyboards/keychron/k6/white/config.h create mode 100644 keyboards/keychron/k6/white/config_led.c delete mode 100644 keyboards/keychron/k6/white/keymaps/ansi/config.h delete mode 100644 keyboards/keychron/k6/white/keymaps/ansi/config_led.c delete mode 100644 keyboards/keychron/k6/white/keymaps/ansi/config_led.h delete mode 100644 keyboards/keychron/k6/white/keymaps/ansi/keymap.c delete mode 100644 keyboards/keychron/k6/white/matrix.c create mode 100644 keyboards/keychron/k6/white/rand.c create mode 100644 keyboards/keychron/k6/white/white.c create mode 100644 keyboards/keychron/k7/keymaps/ansi/config.h rename keyboards/keychron/k7/{rgb => }/keymaps/ansi/keymap.c (100%) create mode 100644 keyboards/keychron/k7/keymaps/iso/config.h rename keyboards/keychron/k7/{rgb => }/keymaps/iso/keymap.c (100%) rename keyboards/keychron/k7/{rgb => }/keymaps/stdvar/config.h (91%) rename keyboards/keychron/k7/{rgb => }/keymaps/stdvar/keymap.c (100%) rename keyboards/keychron/k7/{rgb => }/keymaps/stdvar/rules.mk (100%) delete mode 100644 keyboards/keychron/k7/rgb/keymaps/iso/config.h create mode 100644 keyboards/keychron/k7/rgb/optical_via/readme.md create mode 100644 keyboards/keychron/k7/rgb/optical_via/rules.mk create mode 100644 keyboards/keychron/k7/rgb/via/readme.md create mode 100644 keyboards/keychron/k7/rgb/via/rules.mk delete mode 100644 keyboards/keychron/k8/keymaps/iso/config_led.c delete mode 100644 keyboards/keychron/k8/keymaps/iso/config_led.h delete mode 100644 keyboards/keychron/k8/keymaps/iso/rules.mk rename keyboards/keychron/k8/{ => rgb}/bootloader_defs.h (100%) rename keyboards/keychron/k8/{ => rgb}/chconf.h (100%) rename keyboards/keychron/{k6/rgb/keymaps/iso => k8/rgb}/config.h (77%) rename keyboards/keychron/k8/{keymaps/ansi => rgb}/config_led.c (50%) rename keyboards/keychron/k8/{keymaps/ansi => rgb}/config_led.h (93%) rename keyboards/keychron/k8/{ => rgb}/halconf.h (100%) rename keyboards/keychron/k8/{ => rgb}/info.json (100%) rename keyboards/keychron/k8/{ => rgb}/k8.h (100%) rename keyboards/keychron/k8/{ => rgb}/k8_via_ansi.json (100%) rename keyboards/keychron/k8/{ => rgb}/k8_via_ansi_optical.json (100%) rename keyboards/keychron/k8/{ => rgb}/k8_via_iso.json (100%) rename keyboards/keychron/k8/{ => rgb}/mcuconf.h (100%) rename keyboards/keychron/k8/{ => rgb}/optical/readme.md (89%) create mode 100644 keyboards/keychron/k8/rgb/optical/rules.mk rename keyboards/keychron/k8/{ => rgb}/optical_via/readme.md (92%) create mode 100644 keyboards/keychron/k8/rgb/optical_via/rules.mk rename keyboards/keychron/k8/{ => rgb}/readme.md (100%) create mode 100644 keyboards/keychron/k8/rgb/rgb.h rename keyboards/keychron/k8/{ => rgb}/rules.mk (100%) rename keyboards/keychron/k8/{ => rgb}/via/readme.md (94%) create mode 100644 keyboards/keychron/k8/rgb/via/rules.mk diff --git a/bin/build_all.py b/bin/build_all.py index 99a935bb5c46..e2aeb76a42d5 100755 --- a/bin/build_all.py +++ b/bin/build_all.py @@ -13,21 +13,39 @@ 'keychron/c1/rgb', 'keychron/c1/white', 'keychron/c2/white', - 'keychron/k2', - 'keychron/k3', + 'keychron/k2/rgb', + 'keychron/k2/rgb/via', + 'keychron/k2/rgb/optical', + 'keychron/k2/rgb/optical_via', + 'keychron/k3/rgb', + 'keychron/k3/rgb/via', + 'keychron/k3/rgb/optical', + 'keychron/k3/rgb/optical_via', 'keychron/k4/rgb/v1', + 'keychron/k4/rgb/v1/via', + 'keychron/k4/rgb/v1/optical', + 'keychron/k4/rgb/v1/optical_via', 'keychron/k4/rgb/v2', + 'keychron/k4/rgb/v2/via', + 'keychron/k4/rgb/v2/optical', + 'keychron/k4/rgb/v2/optical_via', 'keychron/k6/rgb', 'keychron/k6/rgb/via', + 'keychron/k6/rgb/optical', + 'keychron/k6/rgb/optical_via', 'keychron/k6/white', 'keychron/k7/rgb', + 'keychron/k7/rgb/via', 'keychron/k7/rgb/optical', - 'keychron/k8', - 'keychron/k8/via', - 'keychron/k8/optical', - 'keychron/k8/optical_via', + 'keychron/k7/rgb/optical_via', + 'keychron/k8/rgb', + 'keychron/k8/rgb/via', + 'keychron/k8/rgb/optical', + 'keychron/k8/rgb/optical_via', 'keychron/k14/rgb', 'keychron/k14/rgb/via', + 'keychron/k14/rgb/optical', + 'keychron/k14/rgb/optical_via', 'ajazz/ak33/rev1', 'ajazz/ak33/rev2', 'smartduck/xs61', diff --git a/keyboards/keychron/k14/keymaps/ansi/config.h b/keyboards/keychron/k14/keymaps/ansi/config.h new file mode 100644 index 000000000000..b5eff6945c34 --- /dev/null +++ b/keyboards/keychron/k14/keymaps/ansi/config.h @@ -0,0 +1,3 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE1A diff --git a/keyboards/keychron/k14/rgb/keymaps/ansi/keymap.c b/keyboards/keychron/k14/keymaps/ansi/keymap.c similarity index 100% rename from keyboards/keychron/k14/rgb/keymaps/ansi/keymap.c rename to keyboards/keychron/k14/keymaps/ansi/keymap.c diff --git a/keyboards/keychron/k14/rgb/keymaps/ansi/config.h b/keyboards/keychron/k14/rgb/config.h similarity index 87% rename from keyboards/keychron/k14/rgb/keymaps/ansi/config.h rename to keyboards/keychron/k14/rgb/config.h index fdd0002a77a9..9c381dc6acde 100644 --- a/keyboards/keychron/k14/rgb/keymaps/ansi/config.h +++ b/keyboards/keychron/k14/rgb/config.h @@ -19,14 +19,9 @@ #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x3434 -#define PRODUCT_ID 0xFE1A -#define DEVICE_VER 0x0001 - #define MANUFACTURER Keychron -#define PRODUCT K14 -#define DESCRIPTION K14 Gateron RGB +#define PRODUCT K14 RGB +#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/keychron/k14/rgb/keymaps/ansi/config_led.c b/keyboards/keychron/k14/rgb/config_led.c similarity index 100% rename from keyboards/keychron/k14/rgb/keymaps/ansi/config_led.c rename to keyboards/keychron/k14/rgb/config_led.c diff --git a/keyboards/keychron/k14/rgb/keymaps/ansi/config_led.h b/keyboards/keychron/k14/rgb/config_led.h similarity index 98% rename from keyboards/keychron/k14/rgb/keymaps/ansi/config_led.h rename to keyboards/keychron/k14/rgb/config_led.h index 744346905837..57fddcfb003b 100644 --- a/keyboards/keychron/k14/rgb/keymaps/ansi/config_led.h +++ b/keyboards/keychron/k14/rgb/config_led.h @@ -17,6 +17,7 @@ along with this program. If not, see . */ #pragma once +#include // Backlight configuration #define BACKLIGHT_LEVELS 8 diff --git a/keyboards/keychron/k14/rgb/optical/readme.md b/keyboards/keychron/k14/rgb/optical/readme.md new file mode 100644 index 000000000000..70771b481d35 --- /dev/null +++ b/keyboards/keychron/k14/rgb/optical/readme.md @@ -0,0 +1,11 @@ +# Keychron K14 + +K14 Optical RGB + +Make example for this keyboard (after setting up your build environment): + + make keychron/k14/rgb/optical:ansi + +* * * + +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). diff --git a/keyboards/keychron/k8/optical/rules.mk b/keyboards/keychron/k14/rgb/optical/rules.mk similarity index 100% rename from keyboards/keychron/k8/optical/rules.mk rename to keyboards/keychron/k14/rgb/optical/rules.mk diff --git a/keyboards/keychron/k14/rgb/optical_via/readme.md b/keyboards/keychron/k14/rgb/optical_via/readme.md new file mode 100644 index 000000000000..c595f6d5df67 --- /dev/null +++ b/keyboards/keychron/k14/rgb/optical_via/readme.md @@ -0,0 +1,11 @@ +# Keychron K14 + +K14 Optical RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k14/rgb/optical_via:ansi + +* * * + +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). diff --git a/keyboards/keychron/k8/optical_via/rules.mk b/keyboards/keychron/k14/rgb/optical_via/rules.mk similarity index 100% rename from keyboards/keychron/k8/optical_via/rules.mk rename to keyboards/keychron/k14/rgb/optical_via/rules.mk diff --git a/keyboards/keychron/k14/rgb/via/readme.md b/keyboards/keychron/k14/rgb/via/readme.md index a27a3e1ebc13..19046f0e0f9a 100644 --- a/keyboards/keychron/k14/rgb/via/readme.md +++ b/keyboards/keychron/k14/rgb/via/readme.md @@ -8,6 +8,6 @@ Hardware Supported: SN32F248BF Make example for this keyboard (after setting up your build environment): - make keychron/k14/rgb/via + make keychron/k14/rgb/via:ansi 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). diff --git a/keyboards/keychron/k2/keymaps/default/config.h b/keyboards/keychron/k2/keymaps/default/config.h new file mode 100644 index 000000000000..c94f3d9f15bf --- /dev/null +++ b/keyboards/keychron/k2/keymaps/default/config.h @@ -0,0 +1,3 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE02 diff --git a/keyboards/keychron/k2/bootloader_defs.h b/keyboards/keychron/k2/rgb/bootloader_defs.h similarity index 100% rename from keyboards/keychron/k2/bootloader_defs.h rename to keyboards/keychron/k2/rgb/bootloader_defs.h diff --git a/keyboards/keychron/k2/chconf.h b/keyboards/keychron/k2/rgb/chconf.h similarity index 100% rename from keyboards/keychron/k2/chconf.h rename to keyboards/keychron/k2/rgb/chconf.h diff --git a/keyboards/keychron/k2/config.h b/keyboards/keychron/k2/rgb/config.h similarity index 87% rename from keyboards/keychron/k2/config.h rename to keyboards/keychron/k2/rgb/config.h index b7d9d57027c2..39b1cb4ff429 100644 --- a/keyboards/keychron/k2/config.h +++ b/keyboards/keychron/k2/rgb/config.h @@ -18,15 +18,11 @@ #pragma once #include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x05AC -#define PRODUCT_ID 0x024F -#define DEVICE_VER 0x0001 +#include "config_led.h" #define MANUFACTURER Keychron -#define PRODUCT K2 -#define DESCRIPTION K2 Gateron RGB v2 +#define PRODUCT K2 RGB +#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 6 @@ -46,5 +42,3 @@ /* LED Status indicators */ #define LED_CAPS_LOCK_PIN B9 #define LED_PIN_ON_STATE 1 - -#include "config_led.h" diff --git a/keyboards/keychron/k2/config_led.c b/keyboards/keychron/k2/rgb/config_led.c similarity index 100% rename from keyboards/keychron/k2/config_led.c rename to keyboards/keychron/k2/rgb/config_led.c diff --git a/keyboards/keychron/k3/config_led.h b/keyboards/keychron/k2/rgb/config_led.h similarity index 98% rename from keyboards/keychron/k3/config_led.h rename to keyboards/keychron/k2/rgb/config_led.h index 9022099287bf..595000372355 100644 --- a/keyboards/keychron/k3/config_led.h +++ b/keyboards/keychron/k2/rgb/config_led.h @@ -17,6 +17,7 @@ along with this program. If not, see . */ #pragma once +#include // Backlight configuration #define BACKLIGHT_LEVELS 8 diff --git a/keyboards/keychron/k2/halconf.h b/keyboards/keychron/k2/rgb/halconf.h similarity index 100% rename from keyboards/keychron/k2/halconf.h rename to keyboards/keychron/k2/rgb/halconf.h diff --git a/keyboards/keychron/k2/info.json b/keyboards/keychron/k2/rgb/info.json similarity index 100% rename from keyboards/keychron/k2/info.json rename to keyboards/keychron/k2/rgb/info.json diff --git a/keyboards/keychron/k2/k2.h b/keyboards/keychron/k2/rgb/k2.h similarity index 100% rename from keyboards/keychron/k2/k2.h rename to keyboards/keychron/k2/rgb/k2.h diff --git a/keyboards/keychron/k2/mcuconf.h b/keyboards/keychron/k2/rgb/mcuconf.h similarity index 100% rename from keyboards/keychron/k2/mcuconf.h rename to keyboards/keychron/k2/rgb/mcuconf.h diff --git a/keyboards/keychron/k2/rgb/optical/readme.md b/keyboards/keychron/k2/rgb/optical/readme.md new file mode 100644 index 000000000000..1b286deef21b --- /dev/null +++ b/keyboards/keychron/k2/rgb/optical/readme.md @@ -0,0 +1,11 @@ +# Keychron K2 + +K2 Optical RGB + +Make example for this keyboard (after setting up your build environment): + + make keychron/k2/rgb/optical:default + +* * * + +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). diff --git a/keyboards/keychron/k2/rgb/optical/rules.mk b/keyboards/keychron/k2/rgb/optical/rules.mk new file mode 100644 index 000000000000..d339526001cb --- /dev/null +++ b/keyboards/keychron/k2/rgb/optical/rules.mk @@ -0,0 +1 @@ +OPT_DEFS += -DOPTICAL_MATRIX diff --git a/keyboards/keychron/k2/rgb/optical_via/readme.md b/keyboards/keychron/k2/rgb/optical_via/readme.md new file mode 100644 index 000000000000..7a06e317e891 --- /dev/null +++ b/keyboards/keychron/k2/rgb/optical_via/readme.md @@ -0,0 +1,11 @@ +# Keychron K2 + +K2 Optical RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k2/rgb/optical_via:default + +* * * + +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). diff --git a/keyboards/keychron/k2/rgb/optical_via/rules.mk b/keyboards/keychron/k2/rgb/optical_via/rules.mk new file mode 100644 index 000000000000..8c67dc02e4e5 --- /dev/null +++ b/keyboards/keychron/k2/rgb/optical_via/rules.mk @@ -0,0 +1,2 @@ +OPT_DEFS += -DOPTICAL_MATRIX +VIA_ENABLE = yes diff --git a/keyboards/keychron/k2/readme.md b/keyboards/keychron/k2/rgb/readme.md similarity index 100% rename from keyboards/keychron/k2/readme.md rename to keyboards/keychron/k2/rgb/readme.md diff --git a/keyboards/keychron/k2/rgb/rgb.h b/keyboards/keychron/k2/rgb/rgb.h new file mode 100644 index 000000000000..ef5b3f3e04d7 --- /dev/null +++ b/keyboards/keychron/k2/rgb/rgb.h @@ -0,0 +1,3 @@ +#pragma once + +#include "quantum.h" diff --git a/keyboards/keychron/k2/rules.mk b/keyboards/keychron/k2/rgb/rules.mk similarity index 100% rename from keyboards/keychron/k2/rules.mk rename to keyboards/keychron/k2/rgb/rules.mk diff --git a/keyboards/keychron/k2/rgb/via/readme.md b/keyboards/keychron/k2/rgb/via/readme.md new file mode 100644 index 000000000000..6d6578eff0e2 --- /dev/null +++ b/keyboards/keychron/k2/rgb/via/readme.md @@ -0,0 +1,11 @@ +# Keychron K2 + +K2 Gateron RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k2/rgb/via:default + +* * * + +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). diff --git a/keyboards/keychron/k8/via/rules.mk b/keyboards/keychron/k2/rgb/via/rules.mk similarity index 100% rename from keyboards/keychron/k8/via/rules.mk rename to keyboards/keychron/k2/rgb/via/rules.mk diff --git a/keyboards/keychron/k3/keymaps/default/config.h b/keyboards/keychron/k3/keymaps/default/config.h new file mode 100644 index 000000000000..676cd10d5745 --- /dev/null +++ b/keyboards/keychron/k3/keymaps/default/config.h @@ -0,0 +1,3 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE04 diff --git a/keyboards/keychron/k3/bootloader_defs.h b/keyboards/keychron/k3/rgb/bootloader_defs.h similarity index 100% rename from keyboards/keychron/k3/bootloader_defs.h rename to keyboards/keychron/k3/rgb/bootloader_defs.h diff --git a/keyboards/keychron/k3/chconf.h b/keyboards/keychron/k3/rgb/chconf.h similarity index 100% rename from keyboards/keychron/k3/chconf.h rename to keyboards/keychron/k3/rgb/chconf.h diff --git a/keyboards/keychron/k3/config.h b/keyboards/keychron/k3/rgb/config.h similarity index 86% rename from keyboards/keychron/k3/config.h rename to keyboards/keychron/k3/rgb/config.h index 4575961fa3ef..1fee07e3ecf1 100644 --- a/keyboards/keychron/k3/config.h +++ b/keyboards/keychron/k3/rgb/config.h @@ -18,15 +18,11 @@ #pragma once #include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x05AC -#define PRODUCT_ID 0x024F -#define DEVICE_VER 0x0001 +#include "config_led.h" #define MANUFACTURER Keychron -#define PRODUCT K3 -#define DESCRIPTION K3 Gateron RGB Non Hotswap +#define PRODUCT K3 RGB +#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 6 @@ -42,5 +38,3 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 0 - -#include "config_led.h" diff --git a/keyboards/keychron/k3/config_led.c b/keyboards/keychron/k3/rgb/config_led.c similarity index 100% rename from keyboards/keychron/k3/config_led.c rename to keyboards/keychron/k3/rgb/config_led.c diff --git a/keyboards/keychron/k2/config_led.h b/keyboards/keychron/k3/rgb/config_led.h similarity index 98% rename from keyboards/keychron/k2/config_led.h rename to keyboards/keychron/k3/rgb/config_led.h index 9022099287bf..595000372355 100644 --- a/keyboards/keychron/k2/config_led.h +++ b/keyboards/keychron/k3/rgb/config_led.h @@ -17,6 +17,7 @@ along with this program. If not, see . */ #pragma once +#include // Backlight configuration #define BACKLIGHT_LEVELS 8 diff --git a/keyboards/keychron/k3/halconf.h b/keyboards/keychron/k3/rgb/halconf.h similarity index 100% rename from keyboards/keychron/k3/halconf.h rename to keyboards/keychron/k3/rgb/halconf.h diff --git a/keyboards/keychron/k3/info.json b/keyboards/keychron/k3/rgb/info.json similarity index 100% rename from keyboards/keychron/k3/info.json rename to keyboards/keychron/k3/rgb/info.json diff --git a/keyboards/keychron/k3/k3.h b/keyboards/keychron/k3/rgb/k3.h similarity index 100% rename from keyboards/keychron/k3/k3.h rename to keyboards/keychron/k3/rgb/k3.h diff --git a/keyboards/keychron/k3/mcuconf.h b/keyboards/keychron/k3/rgb/mcuconf.h similarity index 100% rename from keyboards/keychron/k3/mcuconf.h rename to keyboards/keychron/k3/rgb/mcuconf.h diff --git a/keyboards/keychron/k3/rgb/optical/readme.md b/keyboards/keychron/k3/rgb/optical/readme.md new file mode 100644 index 000000000000..8b8caa54f363 --- /dev/null +++ b/keyboards/keychron/k3/rgb/optical/readme.md @@ -0,0 +1,11 @@ +# Keychron K3 + +K3 Optical RGB + +Make example for this keyboard (after setting up your build environment): + + make keychron/k3/rgb/optical:default + +* * * + +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). diff --git a/keyboards/keychron/k3/rgb/optical/rules.mk b/keyboards/keychron/k3/rgb/optical/rules.mk new file mode 100644 index 000000000000..d339526001cb --- /dev/null +++ b/keyboards/keychron/k3/rgb/optical/rules.mk @@ -0,0 +1 @@ +OPT_DEFS += -DOPTICAL_MATRIX diff --git a/keyboards/keychron/k3/rgb/optical_via/readme.md b/keyboards/keychron/k3/rgb/optical_via/readme.md new file mode 100644 index 000000000000..821c26d73095 --- /dev/null +++ b/keyboards/keychron/k3/rgb/optical_via/readme.md @@ -0,0 +1,11 @@ +# Keychron K3 + +K3 Optical RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k3/rgb/optical_via:default + +* * * + +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). diff --git a/keyboards/keychron/k3/rgb/optical_via/rules.mk b/keyboards/keychron/k3/rgb/optical_via/rules.mk new file mode 100644 index 000000000000..8c67dc02e4e5 --- /dev/null +++ b/keyboards/keychron/k3/rgb/optical_via/rules.mk @@ -0,0 +1,2 @@ +OPT_DEFS += -DOPTICAL_MATRIX +VIA_ENABLE = yes diff --git a/keyboards/keychron/k3/readme.md b/keyboards/keychron/k3/rgb/readme.md similarity index 100% rename from keyboards/keychron/k3/readme.md rename to keyboards/keychron/k3/rgb/readme.md diff --git a/keyboards/keychron/k3/rgb/rgb.h b/keyboards/keychron/k3/rgb/rgb.h new file mode 100644 index 000000000000..ef5b3f3e04d7 --- /dev/null +++ b/keyboards/keychron/k3/rgb/rgb.h @@ -0,0 +1,3 @@ +#pragma once + +#include "quantum.h" diff --git a/keyboards/keychron/k3/rules.mk b/keyboards/keychron/k3/rgb/rules.mk similarity index 97% rename from keyboards/keychron/k3/rules.mk rename to keyboards/keychron/k3/rgb/rules.mk index 4570bd793435..b769d82b4a7c 100644 --- a/keyboards/keychron/k3/rules.mk +++ b/keyboards/keychron/k3/rgb/rules.mk @@ -1,5 +1,5 @@ # project specific files -SRC = ../../../drivers/sn32/matrix_sn32f24xx.c +SRC = ../../../drivers/sn32/matrix_sn32f24xx.c SRC += config_led.c ## chip/board settings diff --git a/keyboards/keychron/k3/rgb/via/readme.md b/keyboards/keychron/k3/rgb/via/readme.md new file mode 100644 index 000000000000..69bbfadcea1e --- /dev/null +++ b/keyboards/keychron/k3/rgb/via/readme.md @@ -0,0 +1,11 @@ +# Keychron K3 + +K3 Gateron RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k3/rgb/via:default + +* * * + +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). diff --git a/keyboards/keychron/k3/rgb/via/rules.mk b/keyboards/keychron/k3/rgb/via/rules.mk new file mode 100644 index 000000000000..3d208e31e343 --- /dev/null +++ b/keyboards/keychron/k3/rgb/via/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes + + + + diff --git a/keyboards/keychron/k4/rgb/config.h b/keyboards/keychron/k4/rgb/config.h index be74ffadb583..0315d19cef38 100644 --- a/keyboards/keychron/k4/rgb/config.h +++ b/keyboards/keychron/k4/rgb/config.h @@ -18,6 +18,7 @@ #pragma once #include "config_common.h" +#include "config_led.h" /* key matrix size */ #define MATRIX_ROWS 6 @@ -33,5 +34,3 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 0 - -#include "config_led.h" diff --git a/keyboards/keychron/k4/rgb/config_led.c b/keyboards/keychron/k4/rgb/config_led.c index 9719248091e0..b59fc10d5d58 100644 --- a/keyboards/keychron/k4/rgb/config_led.c +++ b/keyboards/keychron/k4/rgb/config_led.c @@ -5,7 +5,32 @@ // readability #define NA NO_LED - +#ifdef KEYMAP_ISO +/* ISO keymap LEDs */ +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }, + { 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, NA, 33, 34, 35, 36 }, + { 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, NA, NA, 50, 51, 52, 53 }, + { 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, NA, 68, 69, 70, NA }, + { 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, NA, 83, 84, 85, 86, 87, 88 }, + { 89, 90, 91, NA, NA, NA, 92, NA, NA, NA, 93, 94, 95, 96, 97, 98, 99, 100,NA } +}, { + {0 , 0}, {12 , 0}, {25 , 0}, {37 , 0}, {50 , 0}, {62 , 0}, {75 , 0}, {87 , 0}, {100, 0}, {112, 0}, {124, 0}, {137, 0}, {149, 0}, {162, 0}, {174, 0}, {187, 0}, {199, 0}, {212, 0}, {224, 0}, + {0 , 13}, {12 , 13}, {25 , 13}, {37 , 13}, {50 , 13}, {62 , 13}, {75 , 13}, {87 , 13}, {100, 13}, {112, 13}, {124, 13}, {137, 13}, {149, 13}, {168, 13}, {187, 13}, {199, 13}, {212, 13}, {224, 13}, + {3 , 26}, {19 , 26}, {31 , 26}, {44 , 26}, {56 , 26}, {68 , 26}, {81 , 26}, {93 , 26}, {106, 26}, {118, 26}, {131, 26}, {143, 26}, {156, 26}, {187, 26}, {199, 26}, {212, 26}, {224, 32}, + {5 , 38}, {22 , 38}, {34 , 38}, {47 , 38}, {59 , 38}, {72 , 38}, {84 , 38}, {96 , 38}, {109, 38}, {121, 38}, {134, 38}, {146, 38}, {158, 38}, {173, 32}, {187, 38}, {199, 38}, {212, 38}, + {2 , 51}, {15, 51}, {28 , 51}, {40 , 51}, {53 , 51}, {65 , 51}, {78 , 51}, {90 , 51}, {103, 51}, {115, 51}, {128, 51}, {140, 51}, {157, 51}, {174, 51}, {187, 51}, {199, 51}, {212, 51}, {224, 58}, + {2 , 64}, {17 , 64}, {33 , 64}, {79 , 64}, {124, 64}, {137, 64}, {149, 64}, {162, 64}, {174, 64}, {187, 64}, {199, 64}, {212, 64}, +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +} }; +#else +/* ANSI keymap LEDs */ led_config_t g_led_config = { { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }, { 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, NA, 33, 34, 35, 36 }, @@ -28,5 +53,5 @@ led_config_t g_led_config = { { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, } }; - +#endif #endif diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config_led.h b/keyboards/keychron/k4/rgb/config_led.h similarity index 93% rename from keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config_led.h rename to keyboards/keychron/k4/rgb/config_led.h index 6073aa7b9d1e..a25643b01b7b 100644 --- a/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config_led.h +++ b/keyboards/keychron/k4/rgb/config_led.h @@ -16,6 +16,7 @@ along with this program. If not, see . */ #pragma once +#include // Backlight configuration #define BACKLIGHT_LEVELS 8 @@ -28,4 +29,8 @@ along with this program. If not, see . #define LED_MATRIX_COLS MATRIX_COLS #define LED_MATRIX_COL_PINS MATRIX_COL_PINS +#ifdef KEYMAP_ISO +#define DRIVER_LED_TOTAL (101) +#else #define DRIVER_LED_TOTAL (100) +#endif diff --git a/keyboards/keychron/k4/rgb/rules.mk b/keyboards/keychron/k4/rgb/rules.mk index 41b45e4dbba6..f618167c8ad9 100644 --- a/keyboards/keychron/k4/rgb/rules.mk +++ b/keyboards/keychron/k4/rgb/rules.mk @@ -1,5 +1,5 @@ # project specific files -SRC = ../../../../drivers/sn32/matrix_sn32f24xx.c +SRC = ../../../drivers/sn32/matrix_sn32f24xx.c SRC += config_led.c ## chip/board settings diff --git a/keyboards/keychron/k4/rgb/v1/config.h b/keyboards/keychron/k4/rgb/v1/config.h index 9471cd737b00..9ed8464595c0 100644 --- a/keyboards/keychron/k4/rgb/v1/config.h +++ b/keyboards/keychron/k4/rgb/v1/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x05AC -#define PRODUCT_ID 0x024F -#define DEVICE_VER 0x0001 - #define MANUFACTURER Keychron -#define PRODUCT K4 -#define DESCRIPTION K4 Gateron RGB v1 \ No newline at end of file +#define PRODUCT K4v1 RGB +#define DEVICE_VER 0x0001 diff --git a/keyboards/keychron/k4/rgb/v1/keymaps/default/config.h b/keyboards/keychron/k4/rgb/v1/keymaps/default/config.h new file mode 100644 index 000000000000..0181c35f17b9 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/keymaps/default/config.h @@ -0,0 +1,3 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE06 diff --git a/keyboards/keychron/k4/rgb/v1/optical/readme.md b/keyboards/keychron/k4/rgb/v1/optical/readme.md new file mode 100644 index 000000000000..ad2f5c8358bd --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/optical/readme.md @@ -0,0 +1,11 @@ +# Keychron K4v1 + +K4v1 Optical RGB + +Make example for this keyboard (after setting up your build environment): + + make keychron/k4/rgb/v1/optical:default + +* * * + +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). diff --git a/keyboards/keychron/k4/rgb/v1/optical/rules.mk b/keyboards/keychron/k4/rgb/v1/optical/rules.mk new file mode 100644 index 000000000000..d339526001cb --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/optical/rules.mk @@ -0,0 +1 @@ +OPT_DEFS += -DOPTICAL_MATRIX diff --git a/keyboards/keychron/k4/rgb/v1/optical_via/config.h b/keyboards/keychron/k4/rgb/v1/optical_via/config.h new file mode 100644 index 000000000000..ebcc464304bb --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/optical_via/config.h @@ -0,0 +1,3 @@ +#define LAYER_STATE_8BIT +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1200 diff --git a/keyboards/keychron/k4/rgb/v1/optical_via/readme.md b/keyboards/keychron/k4/rgb/v1/optical_via/readme.md new file mode 100644 index 000000000000..93bd074e2b96 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/optical_via/readme.md @@ -0,0 +1,11 @@ +# Keychron K4v1 + +K4v1 Optical RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k4/rgb/v1/optical_via:default + +* * * + +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). diff --git a/keyboards/keychron/k4/rgb/v1/optical_via/rules.mk b/keyboards/keychron/k4/rgb/v1/optical_via/rules.mk new file mode 100644 index 000000000000..8c67dc02e4e5 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/optical_via/rules.mk @@ -0,0 +1,2 @@ +OPT_DEFS += -DOPTICAL_MATRIX +VIA_ENABLE = yes diff --git a/keyboards/keychron/k4/rgb/v1/via/config.h b/keyboards/keychron/k4/rgb/v1/via/config.h new file mode 100644 index 000000000000..ebcc464304bb --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/via/config.h @@ -0,0 +1,3 @@ +#define LAYER_STATE_8BIT +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1200 diff --git a/keyboards/keychron/k4/rgb/v1/via/readme.md b/keyboards/keychron/k4/rgb/v1/via/readme.md new file mode 100644 index 000000000000..32d08fc2457b --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/via/readme.md @@ -0,0 +1,11 @@ +# Keychron K4v1 + +K4v1 Gateron RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k4/v1/rgb/via:default + +* * * + +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). diff --git a/keyboards/keychron/k4/rgb/v1/via/rules.mk b/keyboards/keychron/k4/rgb/v1/via/rules.mk new file mode 100644 index 000000000000..3d208e31e343 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/via/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes + + + + diff --git a/keyboards/keychron/k4/rgb/v2/config.h b/keyboards/keychron/k4/rgb/v2/config.h index 0139ba2c3ee3..eebe7e70ff46 100644 --- a/keyboards/keychron/k4/rgb/v2/config.h +++ b/keyboards/keychron/k4/rgb/v2/config.h @@ -14,14 +14,9 @@ * along with this program. If not, see . */ -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x05AC -#define PRODUCT_ID 0x024F -#define DEVICE_VER 0x0001 - #define MANUFACTURER Keychron -#define PRODUCT K4 -#define DESCRIPTION K4 Gateron RGB v2 +#define PRODUCT K4v2 RGB +#define DEVICE_VER 0x0001 /* LED Status indicators */ #define LED_CAPS_LOCK_PIN B12 diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h b/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h new file mode 100644 index 000000000000..0181c35f17b9 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h @@ -0,0 +1,3 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE06 diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h new file mode 100644 index 000000000000..c5ffca9f14d7 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h @@ -0,0 +1,5 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE07 + +#define KEYMAP_ISO 1 diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.c b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.c deleted file mode 100644 index ad7c56681eeb..000000000000 --- a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.c +++ /dev/null @@ -1,32 +0,0 @@ -#ifdef RGB_MATRIX_ENABLE - -#include "rgb_matrix.h" -#include "config_led.h" - -// readability -#define NA NO_LED - -led_config_t g_led_config = { { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }, - { 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, NA, 33, 34, 35, 36 }, - { 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, NA, NA, 50, 51, 52, 53 }, - { 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, NA, 68, 69, 70, NA }, - { 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, NA, 83, 84, 85, 86, 87, 88 }, - { 89, 90, 91, NA, NA, NA, 92, NA, NA, NA, 93, 94, 95, 96, 97, 98, 99, 100,NA } -}, { - {0 , 0}, {12 , 0}, {25 , 0}, {37 , 0}, {50 , 0}, {62 , 0}, {75 , 0}, {87 , 0}, {100, 0}, {112, 0}, {124, 0}, {137, 0}, {149, 0}, {162, 0}, {174, 0}, {187, 0}, {199, 0}, {212, 0}, {224, 0}, - {0 , 13}, {12 , 13}, {25 , 13}, {37 , 13}, {50 , 13}, {62 , 13}, {75 , 13}, {87 , 13}, {100, 13}, {112, 13}, {124, 13}, {137, 13}, {149, 13}, {168, 13}, {187, 13}, {199, 13}, {212, 13}, {224, 13}, - {3 , 26}, {19 , 26}, {31 , 26}, {44 , 26}, {56 , 26}, {68 , 26}, {81 , 26}, {93 , 26}, {106, 26}, {118, 26}, {131, 26}, {143, 26}, {156, 26}, {187, 26}, {199, 26}, {212, 26}, {224, 32}, - {5 , 38}, {22 , 38}, {34 , 38}, {47 , 38}, {59 , 38}, {72 , 38}, {84 , 38}, {96 , 38}, {109, 38}, {121, 38}, {134, 38}, {146, 38}, {158, 38}, {173, 32}, {187, 38}, {199, 38}, {212, 38}, - {2 , 51}, {15, 51}, {28 , 51}, {40 , 51}, {53 , 51}, {65 , 51}, {78 , 51}, {90 , 51}, {103, 51}, {115, 51}, {128, 51}, {140, 51}, {157, 51}, {174, 51}, {187, 51}, {199, 51}, {212, 51}, {224, 58}, - {2 , 64}, {17 , 64}, {33 , 64}, {79 , 64}, {124, 64}, {137, 64}, {149, 64}, {162, 64}, {174, 64}, {187, 64}, {199, 64}, {212, 64}, -}, { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -} }; - -#endif diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.h b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.h deleted file mode 100644 index 9fa017229e58..000000000000 --- a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config_led.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2021 Dimitris Mantzouranis - -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 - -// Backlight configuration -#define BACKLIGHT_LEVELS 8 - -#define LED_MATRIX_ROWS MATRIX_ROWS -#define LED_MATRIX_ROW_CHANNELS 3 -#define LED_MATRIX_ROWS_HW (LED_MATRIX_ROWS * LED_MATRIX_ROW_CHANNELS) -#define LED_MATRIX_ROW_PINS { C3, C1, C0, C6, C5, C4, C9, C8, C7, C12, C11, C10, B13, C14, C13, B14, B15, D3 } - -#define LED_MATRIX_COLS MATRIX_COLS -#define LED_MATRIX_COL_PINS MATRIX_COL_PINS -#define DRIVER_LED_TOTAL (101) diff --git a/keyboards/keychron/k4/rgb/v2/optical/readme.md b/keyboards/keychron/k4/rgb/v2/optical/readme.md new file mode 100644 index 000000000000..b6ba0c95eb18 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/optical/readme.md @@ -0,0 +1,11 @@ +# Keychron K4v2 + +K4v2 Optical RGB + +Make example for this keyboard (after setting up your build environment): + + make keychron/k4/rgb/v2/optical:default + +* * * + +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). diff --git a/keyboards/keychron/k4/rgb/v2/optical/rules.mk b/keyboards/keychron/k4/rgb/v2/optical/rules.mk new file mode 100644 index 000000000000..d339526001cb --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/optical/rules.mk @@ -0,0 +1 @@ +OPT_DEFS += -DOPTICAL_MATRIX diff --git a/keyboards/keychron/k4/rgb/v2/optical_via/config.h b/keyboards/keychron/k4/rgb/v2/optical_via/config.h new file mode 100644 index 000000000000..ebcc464304bb --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/optical_via/config.h @@ -0,0 +1,3 @@ +#define LAYER_STATE_8BIT +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1200 diff --git a/keyboards/keychron/k4/rgb/v2/optical_via/readme.md b/keyboards/keychron/k4/rgb/v2/optical_via/readme.md new file mode 100644 index 000000000000..d963d79651c9 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/optical_via/readme.md @@ -0,0 +1,11 @@ +# Keychron K4v2 + +K4v2 Optical RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k4/rgb/v2/optical_via:default + +* * * + +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). diff --git a/keyboards/keychron/k4/rgb/v2/optical_via/rules.mk b/keyboards/keychron/k4/rgb/v2/optical_via/rules.mk new file mode 100644 index 000000000000..8c67dc02e4e5 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/optical_via/rules.mk @@ -0,0 +1,2 @@ +OPT_DEFS += -DOPTICAL_MATRIX +VIA_ENABLE = yes diff --git a/keyboards/keychron/k4/rgb/v2/via/config.h b/keyboards/keychron/k4/rgb/v2/via/config.h new file mode 100644 index 000000000000..ebcc464304bb --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/via/config.h @@ -0,0 +1,3 @@ +#define LAYER_STATE_8BIT +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1200 diff --git a/keyboards/keychron/k4/rgb/v2/via/readme.md b/keyboards/keychron/k4/rgb/v2/via/readme.md new file mode 100644 index 000000000000..79c197f74c81 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/via/readme.md @@ -0,0 +1,11 @@ +# Keychron K4v2 + +K4v2 Gateron RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k4/v2/rgb/via:default + +* * * + +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). diff --git a/keyboards/keychron/k4/rgb/v2/via/rules.mk b/keyboards/keychron/k4/rgb/v2/via/rules.mk new file mode 100644 index 000000000000..3d208e31e343 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/via/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes + + + + diff --git a/keyboards/keychron/k6/keymaps/ansi/config.h b/keyboards/keychron/k6/keymaps/ansi/config.h new file mode 100644 index 000000000000..0f0f9a0d6625 --- /dev/null +++ b/keyboards/keychron/k6/keymaps/ansi/config.h @@ -0,0 +1,3 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE0A diff --git a/keyboards/keychron/k6/rgb/keymaps/ansi/keymap.c b/keyboards/keychron/k6/keymaps/ansi/keymap.c similarity index 100% rename from keyboards/keychron/k6/rgb/keymaps/ansi/keymap.c rename to keyboards/keychron/k6/keymaps/ansi/keymap.c diff --git a/keyboards/keychron/k6/keymaps/iso/config.h b/keyboards/keychron/k6/keymaps/iso/config.h new file mode 100644 index 000000000000..191ae8c80114 --- /dev/null +++ b/keyboards/keychron/k6/keymaps/iso/config.h @@ -0,0 +1,5 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE0B + +#define KEYMAP_ISO 1 diff --git a/keyboards/keychron/k6/rgb/keymaps/iso/keymap.c b/keyboards/keychron/k6/keymaps/iso/keymap.c similarity index 100% rename from keyboards/keychron/k6/rgb/keymaps/iso/keymap.c rename to keyboards/keychron/k6/keymaps/iso/keymap.c diff --git a/keyboards/keychron/k6/keymaps/stdvar/config.h b/keyboards/keychron/k6/keymaps/stdvar/config.h new file mode 100644 index 000000000000..fd83b364f116 --- /dev/null +++ b/keyboards/keychron/k6/keymaps/stdvar/config.h @@ -0,0 +1,23 @@ +//#define RGB_MATRIX_ENABLE 1 +//#define RGB_MATRIX_KEYPRESSES +//#define RGB_MATRIX_LED_PROCESS_LIMIT 0 +//#define RGB_MATRIX_LED_FLUSH_LIMIT 0 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +//#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 +#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR +#define RGB_MATRIX_STARTUP_HUE 127 // Sets the default hue value, if none has been set +#define RGB_MATRIX_STARTUP_SAT 0 // Sets the default saturation value, if none has been set +#define RGB_MATRIX_STARTUP_VAL 255 // Sets the default brightness value, if none has been set +#define RGB_MATRIX_STARTUP_SPD 63 +#define RGB_MATRIX_SPD_STEP 16 + +#define SLEEP_LED_MODE_ANIMATION RGB_MATRIX_BREATHING +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE0B + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define TAPPING_TERM 200 +#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped once again. */ +#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ + +#define FORCE_NKRO diff --git a/keyboards/keychron/k6/rgb/keymaps/stdvar/keymap.c b/keyboards/keychron/k6/keymaps/stdvar/keymap.c similarity index 100% rename from keyboards/keychron/k6/rgb/keymaps/stdvar/keymap.c rename to keyboards/keychron/k6/keymaps/stdvar/keymap.c diff --git a/keyboards/keychron/k6/rgb/keymaps/stdvar/rules.mk b/keyboards/keychron/k6/keymaps/stdvar/rules.mk similarity index 100% rename from keyboards/keychron/k6/rgb/keymaps/stdvar/rules.mk rename to keyboards/keychron/k6/keymaps/stdvar/rules.mk diff --git a/keyboards/keychron/k6/rgb/keymaps/ansi/config.h b/keyboards/keychron/k6/rgb/config.h similarity index 86% rename from keyboards/keychron/k6/rgb/keymaps/ansi/config.h rename to keyboards/keychron/k6/rgb/config.h index ac5186589a20..60101808244e 100644 --- a/keyboards/keychron/k6/rgb/keymaps/ansi/config.h +++ b/keyboards/keychron/k6/rgb/config.h @@ -20,14 +20,9 @@ #include "config_common.h" #include "config_led.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x0C45 -#define PRODUCT_ID 0x5004 -#define DEVICE_VER 0x0001 - #define MANUFACTURER Keychron -#define PRODUCT K6 -#define DESCRIPTION K6 RGB ANSI +#define PRODUCT K6 RGB +#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 5 @@ -46,4 +41,4 @@ #define LED_PIN_ON_STATE 1 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 10 +#define DEBOUNCE 5 diff --git a/keyboards/keychron/k6/rgb/keymaps/iso/config_led.c b/keyboards/keychron/k6/rgb/config_led.c similarity index 62% rename from keyboards/keychron/k6/rgb/keymaps/iso/config_led.c rename to keyboards/keychron/k6/rgb/config_led.c index 4ff66a18caac..449c53a9879f 100644 --- a/keyboards/keychron/k6/rgb/keymaps/iso/config_led.c +++ b/keyboards/keychron/k6/rgb/config_led.c @@ -2,8 +2,10 @@ #include "rgb_matrix.h" #include "config_led.h" +#ifdef KEYMAP_ISO // readability #define NA NO_LED +/* ISO keymap LEDs */ /* Screenprint on the back of the pcb * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ * │ 1 │ 6 │10 │15 │19 │23 │27 │32 │36 │40 │44 │49 │54 │  57   │64 │ @@ -36,5 +38,30 @@ led_config_t g_led_config = { { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } }; - +#else +/* ANSI keymap LEDs */ +led_config_t g_led_config = { + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, NO_LED, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, NO_LED, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, NO_LED, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED, 55, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66, 67 } + }, + { + {8, 6}, {22, 6}, {35, 6}, {49, 6}, {63, 6}, {77, 6}, {91, 6}, {105, 6}, {119, 6}, {133, 6}, {146, 6}, {160, 6}, {174, 6}, {195, 6}, {216, 6}, + {11, 19}, {29, 19}, {43, 19}, {56, 19}, {70, 19}, {84, 19}, {98, 19}, {112, 19}, {126, 19}, {140, 19}, {154, 19}, {168, 19}, {181, 19}, {199, 19}, {216, 19}, + {13, 31}, {32, 31}, {46, 31}, {60, 31}, {73, 31}, {87, 31}, {101, 31}, {115, 31}, {129, 31}, {143, 31}, {157, 31}, {171, 31}, {194, 31}, {216, 31}, + {17, 44}, {39, 44}, {53, 44}, {67, 44}, {81, 44}, {95, 44}, {108, 44}, {122, 44}, {136, 44}, {150, 44}, {164, 44}, {184, 44}, {202, 44}, {216, 44}, + {9, 56}, {27, 56}, {44, 56}, {95, 56}, {147, 56}, {161, 56}, {175, 56}, {189, 56}, {202, 56}, {216, 56} + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + } +}; +#endif #endif diff --git a/keyboards/keychron/k6/rgb/keymaps/iso/config_led.h b/keyboards/keychron/k6/rgb/config_led.h similarity index 91% rename from keyboards/keychron/k6/rgb/keymaps/iso/config_led.h rename to keyboards/keychron/k6/rgb/config_led.h index 9052da58cbe5..c83914df41c3 100644 --- a/keyboards/keychron/k6/rgb/keymaps/iso/config_led.h +++ b/keyboards/keychron/k6/rgb/config_led.h @@ -17,6 +17,7 @@ along with this program. If not, see . */ #pragma once +#include // Backlight configuration #define BACKLIGHT_LEVELS 8 @@ -30,4 +31,9 @@ along with this program. If not, see . #define LED_MATRIX_COLS MATRIX_COLS #define LED_MATRIX_COL_PINS MATRIX_COL_PINS -#define DRIVER_LED_TOTAL (69) +#ifdef KEYMAP_ISO + #define DRIVER_LED_TOTAL (69) +#else + #define DRIVER_LED_TOTAL (68) +#endif + diff --git a/keyboards/keychron/k6/rgb/keymaps/ansi/config_led.c b/keyboards/keychron/k6/rgb/keymaps/ansi/config_led.c deleted file mode 100644 index fc39061c381e..000000000000 --- a/keyboards/keychron/k6/rgb/keymaps/ansi/config_led.c +++ /dev/null @@ -1,30 +0,0 @@ -#ifdef RGB_MATRIX_ENABLE - -#include "rgb_matrix.h" -#include "config_led.h" - -led_config_t g_led_config = { - { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, NO_LED, 14 }, - { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, NO_LED, 29 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, NO_LED, 43 }, - { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED, 55, 56, 57 }, - { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66, 67 } - }, - { - {8, 6}, {22, 6}, {35, 6}, {49, 6}, {63, 6}, {77, 6}, {91, 6}, {105, 6}, {119, 6}, {133, 6}, {146, 6}, {160, 6}, {174, 6}, {195, 6}, {216, 6}, - {11, 19}, {29, 19}, {43, 19}, {56, 19}, {70, 19}, {84, 19}, {98, 19}, {112, 19}, {126, 19}, {140, 19}, {154, 19}, {168, 19}, {181, 19}, {199, 19}, {216, 19}, - {13, 31}, {32, 31}, {46, 31}, {60, 31}, {73, 31}, {87, 31}, {101, 31}, {115, 31}, {129, 31}, {143, 31}, {157, 31}, {171, 31}, {194, 31}, {216, 31}, - {17, 44}, {39, 44}, {53, 44}, {67, 44}, {81, 44}, {95, 44}, {108, 44}, {122, 44}, {136, 44}, {150, 44}, {164, 44}, {184, 44}, {202, 44}, {216, 44}, - {9, 56}, {27, 56}, {44, 56}, {95, 56}, {147, 56}, {161, 56}, {175, 56}, {189, 56}, {202, 56}, {216, 56} - }, - { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 - } -}; - -#endif diff --git a/keyboards/keychron/k6/rgb/keymaps/ansi/config_led.h b/keyboards/keychron/k6/rgb/keymaps/ansi/config_led.h deleted file mode 100644 index 55956dc4e819..000000000000 --- a/keyboards/keychron/k6/rgb/keymaps/ansi/config_led.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2020 Adam Honse -Copyright 2020 Dimitris Mantzouranis - -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 - -// Backlight configuration -#define BACKLIGHT_LEVELS 8 - -#define LED_MATRIX_ROWS MATRIX_ROWS -#define LED_MATRIX_ROW_CHANNELS 3 -#define LED_MATRIX_ROWS_HW (LED_MATRIX_ROWS * LED_MATRIX_ROW_CHANNELS) -//note how ROW pins are assined in the following sequence top down row1 RBG, row2 RBG and so on -#define LED_MATRIX_ROW_PINS { C6, C5, C4, C9, C8, C7, C12, C11, C10, B13, C14, C13, B14, B15, D3 } - -#define LED_MATRIX_COLS MATRIX_COLS -#define LED_MATRIX_COL_PINS MATRIX_COL_PINS - -#define DRIVER_LED_TOTAL (68) diff --git a/keyboards/keychron/k6/rgb/keymaps/stdvar/config.h b/keyboards/keychron/k6/rgb/keymaps/stdvar/config.h deleted file mode 100644 index ab514e567922..000000000000 --- a/keyboards/keychron/k6/rgb/keymaps/stdvar/config.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2020 Adam Honse - * Copyright 2020 Dimitris Mantzouranis - * - * 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" -#include "config_led.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x0C45 -#define PRODUCT_ID 0x5004 -#define DEVICE_VER 0x0001 - -#define MANUFACTURER Keychron -#define PRODUCT K6 -#define DESCRIPTION K6RGB - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 16 - -#define DIODE_DIRECTION COL2ROW -#define MATRIX_COL_PINS { A8, A9, A10, A11, A12, A13, A14, A15, B0, B1, B2, B3, B4, B5, B6, B7 } -#define MATRIX_ROW_PINS { D11, D10, D9, D8, D7 } - -// Connects each switch in the dip switch to the GPIO pin of the MCU -#define DIP_SWITCH_PINS { D4 } - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5 -#define TAPPING_TERM 200 -#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped once again. */ -#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ - -#define FORCE_NKRO diff --git a/keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.c b/keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.c deleted file mode 100644 index fc39061c381e..000000000000 --- a/keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.c +++ /dev/null @@ -1,30 +0,0 @@ -#ifdef RGB_MATRIX_ENABLE - -#include "rgb_matrix.h" -#include "config_led.h" - -led_config_t g_led_config = { - { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, NO_LED, 14 }, - { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, NO_LED, 29 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, NO_LED, 43 }, - { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED, 55, 56, 57 }, - { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66, 67 } - }, - { - {8, 6}, {22, 6}, {35, 6}, {49, 6}, {63, 6}, {77, 6}, {91, 6}, {105, 6}, {119, 6}, {133, 6}, {146, 6}, {160, 6}, {174, 6}, {195, 6}, {216, 6}, - {11, 19}, {29, 19}, {43, 19}, {56, 19}, {70, 19}, {84, 19}, {98, 19}, {112, 19}, {126, 19}, {140, 19}, {154, 19}, {168, 19}, {181, 19}, {199, 19}, {216, 19}, - {13, 31}, {32, 31}, {46, 31}, {60, 31}, {73, 31}, {87, 31}, {101, 31}, {115, 31}, {129, 31}, {143, 31}, {157, 31}, {171, 31}, {194, 31}, {216, 31}, - {17, 44}, {39, 44}, {53, 44}, {67, 44}, {81, 44}, {95, 44}, {108, 44}, {122, 44}, {136, 44}, {150, 44}, {164, 44}, {184, 44}, {202, 44}, {216, 44}, - {9, 56}, {27, 56}, {44, 56}, {95, 56}, {147, 56}, {161, 56}, {175, 56}, {189, 56}, {202, 56}, {216, 56} - }, - { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 - } -}; - -#endif diff --git a/keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.h b/keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.h deleted file mode 100644 index bc7df297be85..000000000000 --- a/keyboards/keychron/k6/rgb/keymaps/stdvar/config_led.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2020 Adam Honse -Copyright 2020 Dimitris Mantzouranis - -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 - -// Backlight configuration -#define BACKLIGHT_LEVELS 8 - -#define LED_MATRIX_ROWS MATRIX_ROWS -#define LED_MATRIX_ROW_CHANNELS 3 -#define LED_MATRIX_ROWS_HW (LED_MATRIX_ROWS * LED_MATRIX_ROW_CHANNELS) -//note how ROW pins are assined in the following sequence top down row1 RBG, row2 RBG and so on -#define LED_MATRIX_ROW_PINS { C6, C5, C4, C9, C8, C7, C12, C11, C10, B13, C14, C13, B14, B15, D3 } - -#define LED_MATRIX_COLS MATRIX_COLS -#define LED_MATRIX_COL_PINS MATRIX_COL_PINS - -#define DRIVER_LED_TOTAL (68) - -//#define RGB_MATRIX_ENABLE 1 -//#define RGB_MATRIX_KEYPRESSES -//#define RGB_MATRIX_LED_PROCESS_LIMIT 0 -//#define RGB_MATRIX_LED_FLUSH_LIMIT 0 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) -//#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 -#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR -#define RGB_MATRIX_STARTUP_HUE 127 // Sets the default hue value, if none has been set -#define RGB_MATRIX_STARTUP_SAT 0 // Sets the default saturation value, if none has been set -#define RGB_MATRIX_STARTUP_VAL 255 // Sets the default brightness value, if none has been set -#define RGB_MATRIX_STARTUP_SPD 63 -#define RGB_MATRIX_SPD_STEP 16 - -#define SLEEP_LED_MODE_ANIMATION RGB_MATRIX_BREATHING diff --git a/keyboards/keychron/k6/rgb/optical/readme.md b/keyboards/keychron/k6/rgb/optical/readme.md new file mode 100644 index 000000000000..b86c2da00821 --- /dev/null +++ b/keyboards/keychron/k6/rgb/optical/readme.md @@ -0,0 +1,11 @@ +# Keychron K6 + +K6 Optical RGB + +Make example for this keyboard (after setting up your build environment): + + make keychron/k6/rgb/optical:ansi + +* * * + +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). diff --git a/keyboards/keychron/k6/rgb/optical/rules.mk b/keyboards/keychron/k6/rgb/optical/rules.mk new file mode 100644 index 000000000000..d339526001cb --- /dev/null +++ b/keyboards/keychron/k6/rgb/optical/rules.mk @@ -0,0 +1 @@ +OPT_DEFS += -DOPTICAL_MATRIX diff --git a/keyboards/keychron/k6/rgb/optical_via/readme.md b/keyboards/keychron/k6/rgb/optical_via/readme.md new file mode 100644 index 000000000000..82a46f645729 --- /dev/null +++ b/keyboards/keychron/k6/rgb/optical_via/readme.md @@ -0,0 +1,11 @@ +# Keychron K6 + +K6 Optical Hotswap RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k6/rgb/optical_via:ansi + +* * * + +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). diff --git a/keyboards/keychron/k6/rgb/optical_via/rules.mk b/keyboards/keychron/k6/rgb/optical_via/rules.mk new file mode 100644 index 000000000000..8c67dc02e4e5 --- /dev/null +++ b/keyboards/keychron/k6/rgb/optical_via/rules.mk @@ -0,0 +1,2 @@ +OPT_DEFS += -DOPTICAL_MATRIX +VIA_ENABLE = yes diff --git a/keyboards/keychron/k6/rgb/rules.mk b/keyboards/keychron/k6/rgb/rules.mk index dc025eafe6cd..43ccc09b9a9c 100644 --- a/keyboards/keychron/k6/rgb/rules.mk +++ b/keyboards/keychron/k6/rgb/rules.mk @@ -1,5 +1,5 @@ # project specific files -SRC = ../../../drivers/sn32/matrix_sn32f24xx.c +SRC = ../../../../drivers/sn32/matrix_sn32f24xx.c SRC += config_led.c ## chip/board settings diff --git a/keyboards/keychron/k6/rgb/via/readme.md b/keyboards/keychron/k6/rgb/via/readme.md index 4704f83e9115..4dea24e49aef 100644 --- a/keyboards/keychron/k6/rgb/via/readme.md +++ b/keyboards/keychron/k6/rgb/via/readme.md @@ -1,17 +1,15 @@ -## Keychron K6 +# Keychron K6 -Keychron K6 RGB (Sonix SN32F248B) +K6 Gateron RGB with VIA support -Layout by: -[ISO] [Alexander Frank](https://github.com/jedifindtrick) -[ANSI] [rus] (https://github.com/stdvar) +Make example for this keyboard (after setting up your build environment): -Based on Redragon K566 by: [Adam Honse](https://github.com/CalcProgrammer1), Kemove DK63 by: [Stephen Peery](https://github.com/smp4488) and Keychron K4 by: [Dimitris Mantzouranis](https://github.com/dexter93) -Hardware Supported: SN32F248BF + make keychron/k6/rgb/via:ansi -Make example for this keyboard (after setting up your build environment): +For default ISO: - make keychron/k6:iso - make keychron/k6:ansi + make keychron/k6/rgb/via:iso + +* * * 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). diff --git a/keyboards/keychron/k6/rgb/via/rules.mk b/keyboards/keychron/k6/rgb/via/rules.mk index 1e5b99807cb7..3d208e31e343 100644 --- a/keyboards/keychron/k6/rgb/via/rules.mk +++ b/keyboards/keychron/k6/rgb/via/rules.mk @@ -1 +1,5 @@ VIA_ENABLE = yes + + + + diff --git a/keyboards/keychron/k6/white/chconf.h b/keyboards/keychron/k6/white/chconf.h index a35871c2db50..5091408d0240 100644 --- a/keyboards/keychron/k6/white/chconf.h +++ b/keyboards/keychron/k6/white/chconf.h @@ -43,7 +43,7 @@ * @note Allowed values are 16 or 32 bits. */ # if !defined(CH_CFG_ST_RESOLUTION) -# define CH_CFG_ST_RESOLUTION 16 +# define CH_CFG_ST_RESOLUTION 32 # endif /** @@ -695,6 +695,21 @@ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ +// Size optimizations to fit VIA support +// +// These optimizations are pretty intrusive because they remove the idle thread. +// Without idle thread some sleep related functions no longer function. +// These broken functions are overwritten with patched variants. +// +// These optimization are copied from: +// https://github.com/gloryhzw/qmk_firmware/blob/sn32/keyboards/gmmk/full +// +// Make the broken functions weak so they can be overwritten with fixed variants +#if CH_CFG_NO_IDLE_THREAD == TRUE + #pragma weak chThdSleep + #pragma weak chThdSuspendTimeoutS +#endif + #endif /* CHCONF_H */ /** @} */ diff --git a/keyboards/keychron/k6/white/config.h b/keyboards/keychron/k6/white/config.h new file mode 100644 index 000000000000..99a67bd32e51 --- /dev/null +++ b/keyboards/keychron/k6/white/config.h @@ -0,0 +1,84 @@ +/* Copyright 2020 Adam Honse + * Copyright 2020 Dimitris Mantzouranis + * + * 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" +#include + +#define MANUFACTURER Keychron +#define PRODUCT Keychron K6 White +#define DEVICE_VER 0x0001 + +#define WAIT_FOR_USB +#define USB_MAX_POWER_CONSUMPTION 100 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +#define DIODE_DIRECTION COL2ROW + +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15 } +#define MATRIX_ROW_PINS { C4, C5, C6, C7, C8 } + +/* LED matrix */ +#define LED_MATRIX_ROWS MATRIX_ROWS +#define LED_MATRIX_ROW_CHANNELS 1 +#define LED_MATRIX_ROWS_HW (LED_MATRIX_ROWS * LED_MATRIX_ROW_CHANNELS) +#define LED_MATRIX_ROW_PINS { C0, C1, C2, D4, C9 } + +#define LED_MATRIX_COLS MATRIX_COLS +#define LED_MATRIX_COL_PINS MATRIX_COL_PINS + +#ifdef KEYMAP_ISO + #define DRIVER_LED_TOTAL (69) +#else + #define DRIVER_LED_TOTAL (68) +#endif + +/* Backlight configuration */ +#define RGB_MATRIX_VAL_STEP 32 +#define RGB_DISABLE_WHEN_USB_SUSPENDED true + +/* Connects each switch in the dip switch to the GPIO pin of the MCU */ +#define DIP_SWITCH_PINS { D5, D6 } + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* LED Status indicators */ +#define LED_CAPS_LOCK_PIN B3 +#define LED_PIN_ON_STATE 1 + +/* Enable NKRO by default */ +#define FORCE_NKRO + +/* Disable the following animation because they are not interesting in monochrome */ +#define DISABLE_RGB_MATRIX_ALPHAS_MODS +#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define DISABLE_RGB_MATRIX_BAND_SAT +#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define DISABLE_RGB_MATRIX_CYCLE_ALL +#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define DISABLE_RGB_MATRIX_DUAL_BEACON + +/* TODO: Disabled the following animation because they crash the keyboard. Probably due to a too small stack */ +#define DISABLE_RGB_MATRIX_RAINDROPS +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS diff --git a/keyboards/keychron/k6/white/config_led.c b/keyboards/keychron/k6/white/config_led.c new file mode 100644 index 000000000000..7f4906b18470 --- /dev/null +++ b/keyboards/keychron/k6/white/config_led.c @@ -0,0 +1,74 @@ +#ifdef RGB_MATRIX_ENABLE + +#include "rgb_matrix.h" +#ifdef KEYMAP_ISO +// readability +#define NA NO_LED +/* ISO keymap LEDs */ +/* Screenprint on the back of the pcb + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ 1 │ 6 │10 │15 │19 │23 │27 │32 │36 │40 │44 │49 │54 │  57   │64 │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │  2  │ 7 │11 │16 │20 │24 │28 │33 │37 │41 │45 │50 │55 │     │65 │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐59  ├───┤ + * │  3   │ 8 │12 │17 │21 │25 │29 │34 │38 │42 │46 │51 │58 │    │66 │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┼───┤ + * │ 4  │69 │13 │18 │22 │26 │30 │35 │39 │43 │47 │52 │  60  │62 │67 │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ 5 │ 9 │ 14 │           31           │48 │53 │56 │61 │63 │68 │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ +/// Force g_led_config into flash, because there is no space in RAM. +/// This should be safe because g_led_config should never be written to. +/// We cannot make g_led_config const, because rgb_matrix.h, exports it as mutable. +__attribute__(( section(".rodata.g_led_config") )) +led_config_t g_led_config = { { +{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, NA, 14 }, +{ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, NA, NA, 28 }, +{ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, NA, 43 }, +{ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, NA, 56, 57, 58 }, +{ 59, 60, 61, NA, NA, NA, 62, NA, NA, NA, 63, 64, 65, 66, 67, 68 } +}, { + {1 , 0}, {14 , 0}, {29 , 0}, {44 , 0}, {59 , 0}, {74 , 0}, {89 , 0}, {104, 0}, {119, 0}, {134, 0}, {149, 0}, {164, 0}, {179, 0}, {194, 0}, {224, 0}, + {3 , 16}, {16 , 16}, {32 , 16}, {32 , 16}, {48 , 16}, {64 , 16}, {80 , 16}, {96 , 16}, {112, 16}, {128, 16}, {144, 16}, {160, 16}, {176, 16}, {224, 16}, + {5 , 32}, {19 , 48}, {34 , 48}, {48 , 48}, {63 , 48}, {78 , 48}, {92 , 48}, {107, 48}, {121, 48}, {136, 48}, {151, 48}, {165, 48}, {179, 32}, {194, 32}, {224, 32}, + {2 , 48}, {17 , 32}, {32 , 32}, {47 , 32}, {61 , 32}, {76 , 32}, {91 , 32}, {106, 32}, {120, 32}, {135, 32}, {150, 32}, {165, 32}, {194, 48}, {209, 48}, {224, 48}, + {2 , 64}, {16 , 64}, {29 , 64}, {80 , 64}, {149, 64}, {164, 64}, {179, 64}, {194, 64}, {209, 64}, {224, 64}, +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 +} }; +#else +/* ANSI keymap LEDs */ +/// Force g_led_config into flash, because there is no space in RAM. +/// This should be safe because g_led_config should never be written to. +/// We cannot make g_led_config const, because rgb_matrix.h, exports it as mutable. +__attribute__(( section(".rodata.g_led_config") )) +led_config_t g_led_config = { + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, NO_LED, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, NO_LED, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, NO_LED, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED, 55, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66, 67 } + }, + { + {8, 6}, {22, 6}, {35, 6}, {49, 6}, {63, 6}, {77, 6}, {91, 6}, {105, 6}, {119, 6}, {133, 6}, {146, 6}, {160, 6}, {174, 6}, {195, 6}, {216, 6}, + {11, 19}, {29, 19}, {43, 19}, {56, 19}, {70, 19}, {84, 19}, {98, 19}, {112, 19}, {126, 19}, {140, 19}, {154, 19}, {168, 19}, {181, 19}, {199, 19}, {216, 19}, + {13, 31}, {32, 31}, {46, 31}, {60, 31}, {73, 31}, {87, 31}, {101, 31}, {115, 31}, {129, 31}, {143, 31}, {157, 31}, {171, 31}, {194, 31}, {216, 31}, + {17, 44}, {39, 44}, {53, 44}, {67, 44}, {81, 44}, {95, 44}, {108, 44}, {122, 44}, {136, 44}, {150, 44}, {164, 44}, {184, 44}, {202, 44}, {216, 44}, + {9, 56}, {27, 56}, {44, 56}, {95, 56}, {147, 56}, {161, 56}, {175, 56}, {189, 56}, {202, 56}, {216, 56} + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + } +}; +#endif +#endif diff --git a/keyboards/keychron/k6/white/keymaps/ansi/config.h b/keyboards/keychron/k6/white/keymaps/ansi/config.h deleted file mode 100644 index 8db497efcce3..000000000000 --- a/keyboards/keychron/k6/white/keymaps/ansi/config.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2020 Adam Honse - * Copyright 2020 Dimitris Mantzouranis - * - * 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" -#include "config_led.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x05ac -#define PRODUCT_ID 0x5004 -#define DEVICE_VER 0x0001 - -#define MANUFACTURER Keychron -#define PRODUCT K6 -#define DESCRIPTION K6 White Backlight ANSI - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 16 - -#define DIODE_DIRECTION COL2ROW - -#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15 } -#define MATRIX_ROW_PINS { C4, C5, C6, C7, C8 } - -// Connects each switch in the dip switch to the GPIO pin of the MCU - -#define DIP_SWITCH_PINS { D5, D6 } - -/* LED Status indicators */ - -#define LED_CAPS_LOCK_PIN B3 - -// #define LED_PIN_ON_STATE 1 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 10 \ No newline at end of file diff --git a/keyboards/keychron/k6/white/keymaps/ansi/config_led.c b/keyboards/keychron/k6/white/keymaps/ansi/config_led.c deleted file mode 100644 index fb1e4f8acf27..000000000000 --- a/keyboards/keychron/k6/white/keymaps/ansi/config_led.c +++ /dev/null @@ -1,30 +0,0 @@ -#ifdef RGB_MATRIX_ENABLE - -#include "led_matrix.h" -#include "config_led.h" - -led_config_t g_led_config = { - { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, NO_LED, 14 }, - { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, NO_LED, 29 }, - { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, NO_LED, 43 }, - { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED, 55, 56, 57 }, - { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66, 67 } - }, - { - {8, 6}, {22, 6}, {35, 6}, {49, 6}, {63, 6}, {77, 6}, {91, 6}, {105, 6}, {119, 6}, {133, 6}, {146, 6}, {160, 6}, {174, 6}, {195, 6}, {216, 6}, - {11, 19}, {29, 19}, {43, 19}, {56, 19}, {70, 19}, {84, 19}, {98, 19}, {112, 19}, {126, 19}, {140, 19}, {154, 19}, {168, 19}, {181, 19}, {199, 19}, {216, 19}, - {13, 31}, {32, 31}, {46, 31}, {60, 31}, {73, 31}, {87, 31}, {101, 31}, {115, 31}, {129, 31}, {143, 31}, {157, 31}, {171, 31}, {194, 31}, {216, 31}, - {17, 44}, {39, 44}, {53, 44}, {67, 44}, {81, 44}, {95, 44}, {108, 44}, {122, 44}, {136, 44}, {150, 44}, {164, 44}, {184, 44}, {202, 44}, {216, 44}, - {9, 56}, {27, 56}, {44, 56}, {95, 56}, {147, 56}, {161, 56}, {175, 56}, {189, 56}, {202, 56}, {216, 56} - }, - { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 - } -}; - -#endif \ No newline at end of file diff --git a/keyboards/keychron/k6/white/keymaps/ansi/config_led.h b/keyboards/keychron/k6/white/keymaps/ansi/config_led.h deleted file mode 100644 index d89db40811fe..000000000000 --- a/keyboards/keychron/k6/white/keymaps/ansi/config_led.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2020 Adam Honse -Copyright 2020 Dimitris Mantzouranis -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 - -// Backlight configuration -#define BACKLIGHT_PINS { C0, C1, C2, D4, C9 } -#define BACKLIGHT_ON_STATE 1 - - -// LED matrix configuration -// #define LED_MATRIX_ROWS 5 -// #define LED_MATRIX_ROW_CHANNELS 1 -// #define LED_MATRIX_ROWS_HW (LED_MATRIX_ROWS * LED_MATRIX_ROW_CHANNELS) -// #define LED_MATRIX_ROW_PINS { B0, B1, B2, C4, B9 } - -// #define LED_MATRIX_COLS 16 -// #define LED_MATRIX_COLUMNS LED_MATRIX_COLS -// #define LED_MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15 } - -// #define DRIVER_LED_TOTAL (68) - - diff --git a/keyboards/keychron/k6/white/keymaps/ansi/keymap.c b/keyboards/keychron/k6/white/keymaps/ansi/keymap.c deleted file mode 100644 index f32857734593..000000000000 --- a/keyboards/keychron/k6/white/keymaps/ansi/keymap.c +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2020 Dimitris Mantzouranis -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 - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -enum layer_names { - _BASE, - _FN1, - _FN2, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ - [_BASE] = { { KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, RGB_MOD }, - { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, KC_NO, KC_HOME }, - { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, KC_NO, KC_PGUP }, - { KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, KC_UP, KC_PGDOWN }, - { KC_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_NO, KC_NO, KC_SPC, KC_NO, KC_NO, KC_NO, KC_RCTRL, MO(_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT } - }, - [_FN1] = { { KC_GESC, KC_SLCK, KC_PAUS, KC_APP, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_PGUP }, - { KC_NO, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_T, RGB_SPD, RGB_SPI, KC_NO, KC_NO, KC_INS, KC_DEL, KC_END, KC_NO, KC_NO, KC_PGDOWN }, - { KC_NO, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_SAD, RGB_SAI, KC_NO, KC_NO, KC_NO, KC_PGUP }, - { KC_NO, KC_NO, KC_NO, RGB_TOG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_RMOD, RGB_MOD, KC_NO, KC_NO, KC_NO, RGB_VAI, KC_PGDOWN }, - { KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUD, RGB_VAD, RGB_HUI } - }, - [_FN2] = { { KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_PGUP }, - { KC_NO, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_T, RGB_SPD, RGB_SPI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDOWN }, - { KC_NO, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_SAD, RGB_SAI, KC_NO, KC_NO, KC_NO, KC_PGUP }, - { KC_NO, KC_NO, KC_NO, RGB_TOG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_RMOD, RGB_MOD, KC_NO, KC_NO, KC_NO, RGB_VAI, KC_PGDOWN }, - { KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUD, RGB_VAD, RGB_HUI } - } -}; - -void dip_switch_update_user(uint8_t index, bool active){ - switch(index){ - case 0: - if(active){ //BT mode -// do stuff - } - else{ //Cable mode -// do stuff - } - break; - case 1: - if(active){ // Win/Android mode -// do stuff - } - else{ // Mac/iOS mode -// do stuff - } - break; - } -} -void keyboard_post_init_user(void) { - // Customise these values to desired behaviour - debug_enable=true; - debug_matrix=true; - debug_keyboard=true; - //debug_mouse=true; -} \ No newline at end of file diff --git a/keyboards/keychron/k6/white/matrix.c b/keyboards/keychron/k6/white/matrix.c deleted file mode 100644 index 30ffd419e821..000000000000 --- a/keyboards/keychron/k6/white/matrix.c +++ /dev/null @@ -1,616 +0,0 @@ -/* -Copyright 2021 Adam Honse -Copyright 2011 Jun Wako - -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 . - -Ported to QMK by Stephen Peery -*/ - -#include -#include -#include -#include "ch.h" -#include "hal.h" -#include "CT16.h" - -#include "color.h" -#include "wait.h" -#include "util.h" -#include "matrix.h" -#include "debounce.h" -#include "quantum.h" - -static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -static const pin_t led_row_pins[LED_MATRIX_ROWS_HW] = LED_MATRIX_ROW_PINS; -static const pin_t led_col_pins[LED_MATRIX_COLS] = LED_MATRIX_COL_PINS; -static uint16_t row_ofsts[LED_MATRIX_ROWS]; -static uint8_t mr_offset[24] = {0}; -static uint32_t pwm_en_msk = 0; - -matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values -matrix_row_t last_matrix[MATRIX_ROWS] = {0}; // raw values -matrix_row_t matrix[MATRIX_ROWS]; //debounced values - -static bool matrix_changed = false; -static uint8_t current_row = 0; -extern volatile LED_TYPE led_state[LED_MATRIX_ROWS * LED_MATRIX_COLS]; - -__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } - -__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } - -__attribute__((weak)) void matrix_init_user(void) {} - -__attribute__((weak)) void matrix_scan_user(void) {} - -inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } - -void matrix_print(void) {} - -static void init_pins(void) { -#if(DIODE_DIRECTION == ROW2COL) - // Unselect ROWs - for (uint8_t x = 0; x < MATRIX_ROWS; x++) { - setPinInput(row_pins[x]); - writePinHigh(row_pins[x]); - } -#elif(DIODE_DIRECTION == COL2ROW) - // Unselect ROWs - for (uint8_t x = 0; x < MATRIX_ROWS; x++) { - setPinOutput(row_pins[x]); - writePinHigh(row_pins[x]); - } -#else -#error DIODE_DIRECTION must be one of COL2ROW or ROW2COL! -#endif - - // Unselect COLs - for (uint8_t x = 0; x < MATRIX_COLS; x++) { - setPinOutput(col_pins[x]); - writePinHigh(col_pins[x]); - } - - for (uint8_t x = 0; x < LED_MATRIX_ROWS_HW; x++) { - setPinOutput(led_row_pins[x]); - writePinHigh(led_row_pins[x]); - } -} - -void matrix_init(void) { - // initialize key pins - init_pins(); - - // initialize matrix state: all keys off - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - raw_matrix[i] = 0; - matrix[i] = 0; - } - - for (uint8_t i = 0; i < LED_MATRIX_ROWS; i++) { - row_ofsts[i] = i * LED_MATRIX_COLS; - } - - debounce_init(MATRIX_ROWS); - - matrix_init_quantum(); - - // Enable Timer Clock - SN_SYS1->AHBCLKEN_b.CT16B1CLKEN = 1; - - // PFPA - Map all PWM outputs to their PWM A pins - // Pins will be remapped to their PWM B pins if present in the LED column pin list - SN_PFPA->CT16B1 = 0x00000000; - - pwm_en_msk = 0; - - // Enable PWM function, IOs and select the PWM modes for the LED column pins - for(uint8_t i = 0; i < LED_MATRIX_COLS; i++) { - switch(led_col_pins[i]) { - // Intentional fall-through for the PWM B-pin mapping - case B8: - SN_PFPA->CT16B1 |= mskCT16_PWM0EN_EN; - case A0: - pwm_en_msk |= mskCT16_PWM0EN_EN; - mr_offset[0] = i; - break; - - case B9: - SN_PFPA->CT16B1 |= mskCT16_PWM1EN_EN; - case A1: - pwm_en_msk |= mskCT16_PWM1EN_EN; - mr_offset[1] = i; - break; - - case B10: - SN_PFPA->CT16B1 |= mskCT16_PWM2EN_EN; - case A2: - pwm_en_msk |= mskCT16_PWM2EN_EN; - mr_offset[2] = i; - break; - - case B11: - SN_PFPA->CT16B1 |= mskCT16_PWM3EN_EN; - case A3: - pwm_en_msk |= mskCT16_PWM3EN_EN; - mr_offset[3] = i; - break; - - case B12: - SN_PFPA->CT16B1 |= mskCT16_PWM4EN_EN; - case A4: - pwm_en_msk |= mskCT16_PWM4EN_EN; - mr_offset[4] = i; - break; - - case B13: - SN_PFPA->CT16B1 |= mskCT16_PWM5EN_EN; - case A5: - pwm_en_msk |= mskCT16_PWM5EN_EN; - mr_offset[5] = i; - break; - - case B14: - SN_PFPA->CT16B1 |= mskCT16_PWM6EN_EN; - case A6: - pwm_en_msk |= mskCT16_PWM6EN_EN; - mr_offset[6] = i; - break; - - case B15: - SN_PFPA->CT16B1 |= mskCT16_PWM7EN_EN; - case A7: - pwm_en_msk |= mskCT16_PWM7EN_EN; - mr_offset[7] = i; - break; - - case C0: - SN_PFPA->CT16B1 |= mskCT16_PWM8EN_EN; - case A8: - pwm_en_msk |= mskCT16_PWM8EN_EN; - mr_offset[8] = i; - break; - - case C1: - SN_PFPA->CT16B1 |= mskCT16_PWM9EN_EN; - case A9: - pwm_en_msk |= mskCT16_PWM9EN_EN; - mr_offset[9] = i; - break; - - case C2: - SN_PFPA->CT16B1 |= mskCT16_PWM10EN_EN; - case A10: - pwm_en_msk |= mskCT16_PWM10EN_EN; - mr_offset[10] = i; - break; - - case C3: - SN_PFPA->CT16B1 |= mskCT16_PWM11EN_EN; - case A11: - pwm_en_msk |= mskCT16_PWM11EN_EN; - mr_offset[11] = i; - break; - - case C4: - SN_PFPA->CT16B1 |= mskCT16_PWM12EN_EN; - case A12: - pwm_en_msk |= mskCT16_PWM12EN_EN; - mr_offset[12] = i; - break; - - case C5: - SN_PFPA->CT16B1 |= mskCT16_PWM13EN_EN; - case A13: - pwm_en_msk |= mskCT16_PWM13EN_EN; - mr_offset[13] = i; - break; - - case C6: - SN_PFPA->CT16B1 |= mskCT16_PWM14EN_EN; - case A14: - pwm_en_msk |= mskCT16_PWM14EN_EN; - mr_offset[14] = i; - break; - - case C7: - SN_PFPA->CT16B1 |= mskCT16_PWM15EN_EN; - case A15: - pwm_en_msk |= mskCT16_PWM15EN_EN; - mr_offset[15] = i; - break; - - case C8: - SN_PFPA->CT16B1 |= mskCT16_PWM16EN_EN; - case B0: - pwm_en_msk |= mskCT16_PWM16EN_EN; - mr_offset[16] = i; - break; - - case C9: - SN_PFPA->CT16B1 |= mskCT16_PWM17EN_EN; - case B1: - pwm_en_msk |= mskCT16_PWM17EN_EN; - mr_offset[17] = i; - break; - - case C10: - SN_PFPA->CT16B1 |= mskCT16_PWM18EN_EN; - case B2: - pwm_en_msk |= mskCT16_PWM18EN_EN; - mr_offset[18] = i; - break; - - case C11: - SN_PFPA->CT16B1 |= mskCT16_PWM19EN_EN; - case B3: - pwm_en_msk |= mskCT16_PWM19EN_EN; - mr_offset[19] = i; - break; - - case C12: - SN_PFPA->CT16B1 |= mskCT16_PWM20EN_EN; - case B4: - pwm_en_msk |= mskCT16_PWM20EN_EN; - mr_offset[20] = i; - break; - - case C13: - SN_PFPA->CT16B1 |= mskCT16_PWM21EN_EN; - case B5: - pwm_en_msk |= mskCT16_PWM21EN_EN; - mr_offset[21] = i; - break; - - case C14: - SN_PFPA->CT16B1 |= mskCT16_PWM22EN_EN; - case B6: - pwm_en_msk |= mskCT16_PWM22EN_EN; - mr_offset[22] = i; - break; - - case C15: - SN_PFPA->CT16B1 |= mskCT16_PWM23EN_EN; - case B7: - pwm_en_msk |= mskCT16_PWM23EN_EN; - mr_offset[23] = i; - break; - } - } - - SN_CT16B1->PWMENB |= pwm_en_msk; - SN_CT16B1->PWMIOENB |= pwm_en_msk; - - // Set match interrupts and TC rest - SN_CT16B1->MCTRL3 = (mskCT16_MR24IE_EN | mskCT16_MR24STOP_EN); - - // COL match register - SN_CT16B1->MR24 = 0xFF; - - // Set prescale value - SN_CT16B1->PRE = 0x02; - - //Set CT16B1 as the up-counting mode. - SN_CT16B1->TMRCTRL = (mskCT16_CRST); - - // Wait until timer reset done. - while (SN_CT16B1->TMRCTRL & mskCT16_CRST); - - // Let TC start counting. - SN_CT16B1->TMRCTRL |= mskCT16_CEN_EN; - - NVIC_ClearPendingIRQ(CT16B1_IRQn); - nvicEnableVector(CT16B1_IRQn, 0); -} - -uint8_t matrix_scan(void) { - matrix_changed = false; - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { - for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { - // Determine if the matrix changed state - if ((last_matrix[row_index] != raw_matrix[row_index])) { - matrix_changed = true; - last_matrix[row_index] = raw_matrix[row_index]; - } - } - } - - debounce(raw_matrix, matrix, MATRIX_ROWS, matrix_changed); - - matrix_scan_quantum(); - - return matrix_changed; -} - -/** - * @brief CT16B1 interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(SN32_CT16B1_HANDLER) { - - chSysDisable(); - - OSAL_IRQ_PROLOGUE(); - - // Disable PWM outputs on column pins - SN_CT16B1->PWMIOENB = 0; - - SN_CT16B1->IC = mskCT16_MR24IC; // Clear match interrupt status - - // Turn the selected row off - writePinLow(led_row_pins[current_row]); - - // Turn the next row on - current_row = (current_row + 1) % LED_MATRIX_ROWS_HW; - -#if(DIODE_DIRECTION == ROW2COL) - if(current_row == 0) - { - // Read the key matrix - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - // Enable the column - writePinLow(col_pins[col_index]); - - for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { - // Check row pin state - if (readPin(row_pins[row_index]) == 0) { - // Pin LO, set col bit - raw_matrix[row_index] |= (MATRIX_ROW_SHIFTER << col_index); - } else { - // Pin HI, clear col bit - raw_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << col_index); - } - } - - // Disable the column - writePinHigh(col_pins[col_index]); - } - } -#elif(DIODE_DIRECTION == COL2ROW) - if(current_row == 0) - { - // Set all column pins input high - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - setPinInputHigh(col_pins[col_index]); - } - - // Read the key matrix - for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { - // Enable the row - writePinLow(row_pins[row_index]); - - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - // Check row pin state - if (readPin(col_pins[col_index]) == 0) { - // Pin LO, set col bit - raw_matrix[row_index] |= (MATRIX_ROW_SHIFTER << col_index); - } else { - // Pin HI, clear col bit - raw_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << col_index); - } - } - - // Disable the row - writePinHigh(row_pins[row_index]); - } - } -#endif - - uint8_t row_idx = ( current_row / 3 ); - uint16_t row_ofst = row_ofsts[row_idx]; - - //Set CT16B1 as the up-counting mode. - SN_CT16B1->TMRCTRL = (mskCT16_CRST); - - // Wait until timer reset done. - while (SN_CT16B1->TMRCTRL & mskCT16_CRST); - - if(current_row % 3 == 0) - { - SN_CT16B1->MR0 = led_state[row_ofst + mr_offset[0] ].r; - SN_CT16B1->MR1 = led_state[row_ofst + mr_offset[1] ].r; - SN_CT16B1->MR2 = led_state[row_ofst + mr_offset[2] ].r; - SN_CT16B1->MR3 = led_state[row_ofst + mr_offset[3] ].r; - SN_CT16B1->MR4 = led_state[row_ofst + mr_offset[4] ].r; - SN_CT16B1->MR5 = led_state[row_ofst + mr_offset[5] ].r; - SN_CT16B1->MR6 = led_state[row_ofst + mr_offset[6] ].r; - SN_CT16B1->MR7 = led_state[row_ofst + mr_offset[7] ].r; - SN_CT16B1->MR8 = led_state[row_ofst + mr_offset[8] ].r; - SN_CT16B1->MR9 = led_state[row_ofst + mr_offset[9] ].r; - SN_CT16B1->MR10 = led_state[row_ofst + mr_offset[10]].r; - SN_CT16B1->MR11 = led_state[row_ofst + mr_offset[11]].r; - SN_CT16B1->MR12 = led_state[row_ofst + mr_offset[12]].r; - SN_CT16B1->MR13 = led_state[row_ofst + mr_offset[13]].r; - SN_CT16B1->MR14 = led_state[row_ofst + mr_offset[14]].r; - SN_CT16B1->MR15 = led_state[row_ofst + mr_offset[15]].r; - SN_CT16B1->MR16 = led_state[row_ofst + mr_offset[16]].r; - SN_CT16B1->MR17 = led_state[row_ofst + mr_offset[17]].r; - SN_CT16B1->MR18 = led_state[row_ofst + mr_offset[18]].r; - SN_CT16B1->MR19 = led_state[row_ofst + mr_offset[19]].r; - SN_CT16B1->MR20 = led_state[row_ofst + mr_offset[20]].r; - SN_CT16B1->MR21 = led_state[row_ofst + mr_offset[21]].r; - SN_CT16B1->MR22 = led_state[row_ofst + mr_offset[22]].r; - SN_CT16B1->MR23 = led_state[row_ofst + mr_offset[23]].r; - } - - if(current_row % 3 == 1) - { - SN_CT16B1->MR0 = led_state[row_ofst + mr_offset[0] ].b; - SN_CT16B1->MR1 = led_state[row_ofst + mr_offset[1] ].b; - SN_CT16B1->MR2 = led_state[row_ofst + mr_offset[2] ].b; - SN_CT16B1->MR3 = led_state[row_ofst + mr_offset[3] ].b; - SN_CT16B1->MR4 = led_state[row_ofst + mr_offset[4] ].b; - SN_CT16B1->MR5 = led_state[row_ofst + mr_offset[5] ].b; - SN_CT16B1->MR6 = led_state[row_ofst + mr_offset[6] ].b; - SN_CT16B1->MR7 = led_state[row_ofst + mr_offset[7] ].b; - SN_CT16B1->MR8 = led_state[row_ofst + mr_offset[8] ].b; - SN_CT16B1->MR9 = led_state[row_ofst + mr_offset[9] ].b; - SN_CT16B1->MR10 = led_state[row_ofst + mr_offset[10]].b; - SN_CT16B1->MR11 = led_state[row_ofst + mr_offset[11]].b; - SN_CT16B1->MR12 = led_state[row_ofst + mr_offset[12]].b; - SN_CT16B1->MR13 = led_state[row_ofst + mr_offset[13]].b; - SN_CT16B1->MR14 = led_state[row_ofst + mr_offset[14]].b; - SN_CT16B1->MR15 = led_state[row_ofst + mr_offset[15]].b; - SN_CT16B1->MR16 = led_state[row_ofst + mr_offset[16]].b; - SN_CT16B1->MR17 = led_state[row_ofst + mr_offset[17]].b; - SN_CT16B1->MR18 = led_state[row_ofst + mr_offset[18]].b; - SN_CT16B1->MR19 = led_state[row_ofst + mr_offset[19]].b; - SN_CT16B1->MR20 = led_state[row_ofst + mr_offset[20]].b; - SN_CT16B1->MR21 = led_state[row_ofst + mr_offset[21]].b; - SN_CT16B1->MR22 = led_state[row_ofst + mr_offset[22]].b; - SN_CT16B1->MR23 = led_state[row_ofst + mr_offset[23]].b; - } - - if(current_row % 3 == 2) - { - SN_CT16B1->MR0 = led_state[row_ofst + mr_offset[0] ].g; - SN_CT16B1->MR1 = led_state[row_ofst + mr_offset[1] ].g; - SN_CT16B1->MR2 = led_state[row_ofst + mr_offset[2] ].g; - SN_CT16B1->MR3 = led_state[row_ofst + mr_offset[3] ].g; - SN_CT16B1->MR4 = led_state[row_ofst + mr_offset[4] ].g; - SN_CT16B1->MR5 = led_state[row_ofst + mr_offset[5] ].g; - SN_CT16B1->MR6 = led_state[row_ofst + mr_offset[6] ].g; - SN_CT16B1->MR7 = led_state[row_ofst + mr_offset[7] ].g; - SN_CT16B1->MR8 = led_state[row_ofst + mr_offset[8] ].g; - SN_CT16B1->MR9 = led_state[row_ofst + mr_offset[9] ].g; - SN_CT16B1->MR10 = led_state[row_ofst + mr_offset[10]].g; - SN_CT16B1->MR11 = led_state[row_ofst + mr_offset[11]].g; - SN_CT16B1->MR12 = led_state[row_ofst + mr_offset[12]].g; - SN_CT16B1->MR13 = led_state[row_ofst + mr_offset[13]].g; - SN_CT16B1->MR14 = led_state[row_ofst + mr_offset[14]].g; - SN_CT16B1->MR15 = led_state[row_ofst + mr_offset[15]].g; - SN_CT16B1->MR16 = led_state[row_ofst + mr_offset[16]].g; - SN_CT16B1->MR17 = led_state[row_ofst + mr_offset[17]].g; - SN_CT16B1->MR18 = led_state[row_ofst + mr_offset[18]].g; - SN_CT16B1->MR19 = led_state[row_ofst + mr_offset[19]].g; - SN_CT16B1->MR20 = led_state[row_ofst + mr_offset[20]].g; - SN_CT16B1->MR21 = led_state[row_ofst + mr_offset[21]].g; - SN_CT16B1->MR22 = led_state[row_ofst + mr_offset[22]].g; - SN_CT16B1->MR23 = led_state[row_ofst + mr_offset[23]].g; - } - - uint32_t new_pwm_en = 0; - if(SN_CT16B1->MR0 > 0) - { - new_pwm_en |= mskCT16_PWM0EN_EN; - } - if(SN_CT16B1->MR1 > 0) - { - new_pwm_en |= mskCT16_PWM1EN_EN; - } - if(SN_CT16B1->MR2 > 0) - { - new_pwm_en |= mskCT16_PWM2EN_EN; - } - if(SN_CT16B1->MR3 > 0) - { - new_pwm_en |= mskCT16_PWM3EN_EN; - } - if(SN_CT16B1->MR4 > 0) - { - new_pwm_en |= mskCT16_PWM4EN_EN; - } - if(SN_CT16B1->MR5 > 0) - { - new_pwm_en |= mskCT16_PWM5EN_EN; - } - if(SN_CT16B1->MR6 > 0) - { - new_pwm_en |= mskCT16_PWM6EN_EN; - } - if(SN_CT16B1->MR7 > 0) - { - new_pwm_en |= mskCT16_PWM7EN_EN; - } - if(SN_CT16B1->MR8 > 0) - { - new_pwm_en |= mskCT16_PWM8EN_EN; - } - if(SN_CT16B1->MR9 > 0) - { - new_pwm_en |= mskCT16_PWM9EN_EN; - } - if(SN_CT16B1->MR10 > 0) - { - new_pwm_en |= mskCT16_PWM10EN_EN; - } - if(SN_CT16B1->MR11 > 0) - { - new_pwm_en |= mskCT16_PWM11EN_EN; - } - if(SN_CT16B1->MR12 > 0) - { - new_pwm_en |= mskCT16_PWM12EN_EN; - } - if(SN_CT16B1->MR13 > 0) - { - new_pwm_en |= mskCT16_PWM13EN_EN; - } - if(SN_CT16B1->MR14 > 0) - { - new_pwm_en |= mskCT16_PWM14EN_EN; - } - if(SN_CT16B1->MR15 > 0) - { - new_pwm_en |= mskCT16_PWM15EN_EN; - } - if(SN_CT16B1->MR16 > 0) - { - new_pwm_en |= mskCT16_PWM16EN_EN; - } - if(SN_CT16B1->MR17 > 0) - { - new_pwm_en |= mskCT16_PWM17EN_EN; - } - if(SN_CT16B1->MR18 > 0) - { - new_pwm_en |= mskCT16_PWM18EN_EN; - } - if(SN_CT16B1->MR19 > 0) - { - new_pwm_en |= mskCT16_PWM19EN_EN; - } - if(SN_CT16B1->MR20 > 0) - { - new_pwm_en |= mskCT16_PWM20EN_EN; - } - if(SN_CT16B1->MR21 > 0) - { - new_pwm_en |= mskCT16_PWM21EN_EN; - } - if(SN_CT16B1->MR22 > 0) - { - new_pwm_en |= mskCT16_PWM22EN_EN; - } - if(SN_CT16B1->MR23 > 0) - { - new_pwm_en |= mskCT16_PWM23EN_EN; - } - - SN_CT16B1->PWMIOENB = pwm_en_msk & new_pwm_en; - - // Set match interrupts and TC rest - SN_CT16B1->MCTRL3 = (mskCT16_MR24IE_EN | mskCT16_MR24STOP_EN); - - writePinHigh(led_row_pins[current_row]); - - // Let TC start counting. - SN_CT16B1->TMRCTRL |= mskCT16_CEN_EN; - - chSysEnable(); - - OSAL_IRQ_EPILOGUE(); -} \ No newline at end of file diff --git a/keyboards/keychron/k6/white/mcuconf.h b/keyboards/keychron/k6/white/mcuconf.h index 458530fbed05..ffabfb84620b 100644 --- a/keyboards/keychron/k6/white/mcuconf.h +++ b/keyboards/keychron/k6/white/mcuconf.h @@ -18,7 +18,7 @@ #define MCUCONF_H /* - * STM32F0xx drivers configuration. + * SN32F26x drivers configuration. * The following settings override the default settings present in * the various device driver implementation headers. * Note that the settings for each driver only have effect if the whole @@ -31,7 +31,8 @@ * 0...3 Lowest...Highest. */ -#define STM32F0xx_MCUCONF +#define SN32F26x_MCUCONF +#define PLATFORM_MCUCONF /* * HAL driver system settings. @@ -40,9 +41,6 @@ /* * SN driver system settings. */ -#define SN32_CT_IRQ_PRIORITY 2 -#define SN32_CT_USE_TIMER 2 - #define SN32_HAS_GPIOA TRUE #define SN32_HAS_GPIOB TRUE #define SN32_HAS_GPIOC TRUE @@ -51,43 +49,13 @@ /* * USB driver system settings. */ -#define SN32_USB_USE_USB1 TRUE -#define SN32_USB_LOW_POWER_ON_SUSPEND TRUE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 -#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 - #define CRT1_AREAS_NUMBER 1 - #define PLATFORM_USB_USE_USB1 TRUE /* - * Timer driver system settings. + * System Clock settings. */ -#define SN32_PWM_USE_TIM1 FALSE -#define SN32_PWM_USE_TIM2 TRUE -#define SN32_PWM_TIM1_IRQ_PRIORITY 3 -#define SN32_PWM_TIM2_IRQ_PRIORITY 3 - -#define SYS_CLOCK_SETUP 1 -#define SYS0_CLKCFG_VAL 0 -#define AHB_PRESCALAR 0x2 -#define CLKOUT_SEL_VAL 0x0 -#define CLKOUT_PRESCALAR 0x0 +// Defaults are correct -/*---------------------------------------------------------------------------- - DEFINES - *----------------------------------------------------------------------------*/ -#define IHRC48 0 -#define ILRC 1 - -/*---------------------------------------------------------------------------- - Define clocks - *----------------------------------------------------------------------------*/ -#define __IHRC48_FREQ (48000000UL) -#define __ILRC_FREQ (32000UL) - -// #endif /* _MCUCONF_H_ */ - -#define PLATFORM_MCUCONF #endif /* MCUCONF_H */ diff --git a/keyboards/keychron/k6/white/rand.c b/keyboards/keychron/k6/white/rand.c new file mode 100644 index 000000000000..a1096bbe2b58 --- /dev/null +++ b/keyboards/keychron/k6/white/rand.c @@ -0,0 +1,31 @@ +// Small rand() implementation +// +// The libc rand implementation takes to much flash space, so an smaller rand() function is used. +#include "quantum.h" + +int rand(void) +{ + // static unsigned int z4; + unsigned int z1, z2, z3, z4; + int r; + unsigned int b; + + z1 = timer_read32(); + z2 = 12345; + z3 = 12345; + z4 = z1 << 8; + + b = ((z1 << 6) ^ z1) >> 13; + z1 = ((z1 & 4294967294U) << 18) ^ b; + b = ((z2 << 2) ^ z2) >> 27; + z2 = ((z2 & 4294967288U) << 2) ^ b; + b = ((z3 << 13) ^ z3) >> 21; + z3 = ((z3 & 4294967280U) << 7) ^ b; + b = ((z4 << 3) ^ z4) >> 12; + z4 = ((z4 & 4294967168U) << 13) ^ b; + + r = z1 ^ z2 ^ z3 ^ z4; + // z4 = r; + + return r; +} diff --git a/keyboards/keychron/k6/white/rules.mk b/keyboards/keychron/k6/white/rules.mk index 57cec9b8a29d..e85c64a26f46 100644 --- a/keyboards/keychron/k6/white/rules.mk +++ b/keyboards/keychron/k6/white/rules.mk @@ -1,4 +1,6 @@ # project specific files +SRC += rand.c +SRC += config_led.c ## chip/board settings # - the next two should match the directories in @@ -26,38 +28,32 @@ MCU = cortex-m0 ARMV = 6 # BOOTLOADER = flash -# SN32_BOOTLOADER_ADDRESS = 0x1FFF0009 +SN32_BOOTLOADER_ADDRESS = 0x1FFF0009 -OPT_DEFS = -O2 - -# Options to pass to dfu-util when flashing -# DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave -# DFU_SUFFIX_ARGS = -p DF11 -v 0483 +# Optimize for size +OPT_DEFS = -Os # Build Options # comment out to disable the options. # -LTO_ENABLE = no # linker optimization - -BACKLIGHT_ENABLE = yes -BACKLIGHT_DRIVER = software - MAGIC_ENABLE = yes -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = no # Audio control and System control -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover -SERIAL_LINK_ENABLE = no -WAIT_FOR_USB = no -CUSTOM_MATRIX = no - -# some options to reduce ram usage +MAGIC_KEYCODE_ENABLE = yes +BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration +EXTRAKEY_ENABLE = yes # Audio control and System control +NKRO_ENABLE = yes # USB Nkey Rollover +DIP_SWITCH_ENABLE = yes + +# Custom Key and LED matrix handling +CUSTOM_MATRIX = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = SN32F26x + +# Some options to reduce RAM usage LDFLAGS += --specs=nano.specs -# process stack size of 0x1c0 crashes during SEND_STRING -USE_EXCEPTIONS_STACKSIZE = 0x180 -USE_PROCESS_STACKSIZE = 0x210 - +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE +USE_LINK_GC = yes +LTO_ENABLE = yes -# LED_MATRIX_ENABLE = yes -# LED_MATRIX_DRIVER = SN32F260 \ No newline at end of file +# Reduce code size +USE_PROCESS_STACKSIZE = 0x1E0 +USE_EXCEPTIONS_STACKSIZE = 0xF0 \ No newline at end of file diff --git a/keyboards/keychron/k6/white/white.c b/keyboards/keychron/k6/white/white.c new file mode 100644 index 000000000000..648e7c57cb23 --- /dev/null +++ b/keyboards/keychron/k6/white/white.c @@ -0,0 +1,33 @@ +/* Copyright 2021 IsaacDynamo + * + * 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 "white.h" + +void suspend_power_down_kb(void) { + // Suspend backlight + rgb_matrix_set_suspend_state(true); + + suspend_power_down_user(); +} + +/// TODO: Clean-up workaround +/// Currently the suspend_wakeup_init_kb() has issues. See https://github.com/SonixQMK/qmk_firmware/issues/80 +/// A workaround is to use housekeeping_task_kb() instead. +void housekeeping_task_kb(void) { + // Restore backlight + rgb_matrix_set_suspend_state(false); + + housekeeping_task_user(); +} diff --git a/keyboards/keychron/k7/keymaps/ansi/config.h b/keyboards/keychron/k7/keymaps/ansi/config.h new file mode 100644 index 000000000000..f9b2b17935f0 --- /dev/null +++ b/keyboards/keychron/k7/keymaps/ansi/config.h @@ -0,0 +1,3 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE0C diff --git a/keyboards/keychron/k7/rgb/keymaps/ansi/keymap.c b/keyboards/keychron/k7/keymaps/ansi/keymap.c similarity index 100% rename from keyboards/keychron/k7/rgb/keymaps/ansi/keymap.c rename to keyboards/keychron/k7/keymaps/ansi/keymap.c diff --git a/keyboards/keychron/k7/keymaps/iso/config.h b/keyboards/keychron/k7/keymaps/iso/config.h new file mode 100644 index 000000000000..f4dbafe99158 --- /dev/null +++ b/keyboards/keychron/k7/keymaps/iso/config.h @@ -0,0 +1,5 @@ +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE0D + +#define KEYMAP_ISO 1 diff --git a/keyboards/keychron/k7/rgb/keymaps/iso/keymap.c b/keyboards/keychron/k7/keymaps/iso/keymap.c similarity index 100% rename from keyboards/keychron/k7/rgb/keymaps/iso/keymap.c rename to keyboards/keychron/k7/keymaps/iso/keymap.c diff --git a/keyboards/keychron/k7/rgb/keymaps/stdvar/config.h b/keyboards/keychron/k7/keymaps/stdvar/config.h similarity index 91% rename from keyboards/keychron/k7/rgb/keymaps/stdvar/config.h rename to keyboards/keychron/k7/keymaps/stdvar/config.h index 349e9aaea6c1..66375e6df97b 100644 --- a/keyboards/keychron/k7/rgb/keymaps/stdvar/config.h +++ b/keyboards/keychron/k7/keymaps/stdvar/config.h @@ -12,7 +12,9 @@ #define SLEEP_LED_MODE_ANIMATION RGB_MATRIX_BREATHING - +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define PRODUCT_ID 0xFE0C #define TAPPING_TERM 200 #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped once again. */ diff --git a/keyboards/keychron/k7/rgb/keymaps/stdvar/keymap.c b/keyboards/keychron/k7/keymaps/stdvar/keymap.c similarity index 100% rename from keyboards/keychron/k7/rgb/keymaps/stdvar/keymap.c rename to keyboards/keychron/k7/keymaps/stdvar/keymap.c diff --git a/keyboards/keychron/k7/rgb/keymaps/stdvar/rules.mk b/keyboards/keychron/k7/keymaps/stdvar/rules.mk similarity index 100% rename from keyboards/keychron/k7/rgb/keymaps/stdvar/rules.mk rename to keyboards/keychron/k7/keymaps/stdvar/rules.mk diff --git a/keyboards/keychron/k7/rgb/config.h b/keyboards/keychron/k7/rgb/config.h index 7cbc00781822..5462ea6dc0d7 100644 --- a/keyboards/keychron/k7/rgb/config.h +++ b/keyboards/keychron/k7/rgb/config.h @@ -20,14 +20,9 @@ #include "config_common.h" #include "config_led.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x0C45 -#define PRODUCT_ID 0x5004 -#define DEVICE_VER 0x0001 - #define MANUFACTURER Keychron -#define PRODUCT K7 -#define DESCRIPTION K7RGB +#define PRODUCT K7 RGB +#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/keychron/k7/rgb/keymaps/iso/config.h b/keyboards/keychron/k7/rgb/keymaps/iso/config.h deleted file mode 100644 index 39c8b6b58d56..000000000000 --- a/keyboards/keychron/k7/rgb/keymaps/iso/config.h +++ /dev/null @@ -1 +0,0 @@ -#define KEYMAP_ISO 1 diff --git a/keyboards/keychron/k7/rgb/optical/readme.md b/keyboards/keychron/k7/rgb/optical/readme.md index 09011bd22b24..c0545f03e7e3 100644 --- a/keyboards/keychron/k7/rgb/optical/readme.md +++ b/keyboards/keychron/k7/rgb/optical/readme.md @@ -1,17 +1,11 @@ -## Keychron K7 +# Keychron K7 -Keychron K7 RGB Optical (Sonix SN32F248B) - -Layout by: -[ISO] [Alexander Frank](https://github.com/jedifindtrick) -[ANSI] [rus] (https://github.com/stdvar) - -Based on Redragon K566 by: [Adam Honse](https://github.com/CalcProgrammer1), Kemove DK63 by: [Stephen Peery](https://github.com/smp4488) and Keychron K4 by: [Dimitris Mantzouranis](https://github.com/dexter93) -Hardware Supported: SN32F248BF +K7 Optical RGB Make example for this keyboard (after setting up your build environment): - make keychron/k7/rgb/optical:iso make keychron/k7/rgb/optical:ansi +* * * + 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). diff --git a/keyboards/keychron/k7/rgb/optical_via/readme.md b/keyboards/keychron/k7/rgb/optical_via/readme.md new file mode 100644 index 000000000000..4d2daaee2bc4 --- /dev/null +++ b/keyboards/keychron/k7/rgb/optical_via/readme.md @@ -0,0 +1,11 @@ +# Keychron K7 + +K7 Optical RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k7/rgb/optical_via:ansi + +* * * + +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). diff --git a/keyboards/keychron/k7/rgb/optical_via/rules.mk b/keyboards/keychron/k7/rgb/optical_via/rules.mk new file mode 100644 index 000000000000..8c67dc02e4e5 --- /dev/null +++ b/keyboards/keychron/k7/rgb/optical_via/rules.mk @@ -0,0 +1,2 @@ +OPT_DEFS += -DOPTICAL_MATRIX +VIA_ENABLE = yes diff --git a/keyboards/keychron/k7/rgb/via/readme.md b/keyboards/keychron/k7/rgb/via/readme.md new file mode 100644 index 000000000000..8c6883066b30 --- /dev/null +++ b/keyboards/keychron/k7/rgb/via/readme.md @@ -0,0 +1,15 @@ +# Keychron K7 + +K7 Gateron RGB with VIA support + +Make example for this keyboard (after setting up your build environment): + + make keychron/k7/rgb/via:ansi + +For default ISO: + + make keychron/k7/rgb/via:iso + +* * * + +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). diff --git a/keyboards/keychron/k7/rgb/via/rules.mk b/keyboards/keychron/k7/rgb/via/rules.mk new file mode 100644 index 000000000000..3d208e31e343 --- /dev/null +++ b/keyboards/keychron/k7/rgb/via/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes + + + + diff --git a/keyboards/keychron/k8/keymaps/ansi/config.h b/keyboards/keychron/k8/keymaps/ansi/config.h index 802b60ed14a5..f87c5027d92a 100644 --- a/keyboards/keychron/k8/keymaps/ansi/config.h +++ b/keyboards/keychron/k8/keymaps/ansi/config.h @@ -1,55 +1,3 @@ -/* Copyright 2020 Adam Honse - * Copyright 2020 Dimitris Mantzouranis - * - * 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" - /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0E -#define DEVICE_VER 0x0001 - -#define MANUFACTURER Keychron -#define PRODUCT K8 - -#ifdef OPTICAL_MATRIX -#define DESCRIPTION K8 RGB Hotswap -#else -#define DESCRIPTION K8 RGB Optical -#endif - -#define WAIT_FOR_USB - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 17 - -#define DIODE_DIRECTION COL2ROW - -#define MATRIX_COL_PINS { A8, A9, A10, A11, A12, A13, A14, A15, B0, B1, B2, B3, B4, B5, B6, B7, B8 } -#define MATRIX_ROW_PINS { C15, D11, D10, D9, D8, D7 } - -// Connects each switch in the dip switch to the GPIO pin of the MCU -#define DIP_SWITCH_PINS { D5, D6 } - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 - -//#define FORCE_NKRO - -#include "config_led.h" diff --git a/keyboards/keychron/k8/keymaps/iso/config.h b/keyboards/keychron/k8/keymaps/iso/config.h index 3edb84e04582..d3f5550a4584 100644 --- a/keyboards/keychron/k8/keymaps/iso/config.h +++ b/keyboards/keychron/k8/keymaps/iso/config.h @@ -1,56 +1,5 @@ -/* Copyright 2020 Adam Honse - * Copyright 2020 Dimitris Mantzouranis - * - * 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" - /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0F -#define DEVICE_VER 0x0001 - -#define MANUFACTURER Keychron -#define PRODUCT K8 ISO -#define DESCRIPTION K8 ISO RGB Hotswap - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 17 - -#define DIODE_DIRECTION COL2ROW - -#define MATRIX_COL_PINS { A8, A9, A10, A11, A12, A13, A14, A15, B0, B1, B2, B3, B4, B5, B6, B7, B8 } -#define MATRIX_ROW_PINS { C15, D11, D10, D9, D8, D7 } - -// Connects each switch in the dip switch to the GPIO pin of the MCU -#define DIP_SWITCH_PINS { D5, D6 } - -/* LED Status indicators */ -#define LED_CAPS_LOCK_PIN B12 -#define LED_PIN_ON_STATE 1 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 25 - -//#define FORCE_NKRO - -#define RGB_MATRIX_FRAMEBUFFER_EFFECTS -#define RGB_MATRIX_KEYPRESSES -#define RGB_MATRIX_KEYRELEASES -#include "config_led.h" +#define KEYMAP_ISO 1 diff --git a/keyboards/keychron/k8/keymaps/iso/config_led.c b/keyboards/keychron/k8/keymaps/iso/config_led.c deleted file mode 100644 index 76d41be97174..000000000000 --- a/keyboards/keychron/k8/keymaps/iso/config_led.c +++ /dev/null @@ -1,37 +0,0 @@ -#ifdef RGB_MATRIX_ENABLE - -#include "rgb_matrix.h" -#include "config_led.h" - -#define XX NO_LED - -// typedef struct PACKED { -// uint8_t matrix_co[MATRIX_ROWS][MATRIX_COLS]; -// point_t point[DRIVER_LED_TOTAL]; -// uint8_t flags[DRIVER_LED_TOTAL]; -// } led_config_t; - -led_config_t g_led_config = { { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, XX, 13, 14, 15}, - { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}, - { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49}, - { 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, XX, XX, XX}, - { 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, XX, 76, XX, 77, XX}, - { 78, 79, 80, XX, XX, XX, 81, XX, XX, XX, 82, 83, 84, 85, 86, 87, 88} -}, { - {0 , 0}, {12 , 0}, {25 , 0}, {37 , 0}, {50 , 0}, {62 , 0}, {75 , 0}, {87 , 0}, {100, 0}, {112, 0}, {124, 0}, {137, 0}, {149, 0}, {174, 0}, {187, 0}, {199, 0}, - {0 , 13}, {12 , 13}, {25 , 13}, {37 , 13}, {50 , 13}, {62 , 13}, {75 , 13}, {87 , 13}, {100, 13}, {112, 13}, {124, 13}, {137, 13}, {149, 13}, {168, 13}, {174, 13}, {187, 13}, {199, 13}, - {3 , 26}, {19 , 26}, {31 , 26}, {44 , 26}, {56 , 26}, {68 , 26}, {81 , 26}, {93 , 26}, {106, 26}, {118, 26}, {131, 26}, {143, 26}, {156, 26}, {168, 26}, {174, 26}, {187, 26}, {199, 26}, - {5 , 38}, {22 , 38}, {34 , 38}, {47 , 38}, {59 , 38}, {72 , 38}, {84 , 38}, {96 , 38}, {109, 38}, {121, 38}, {134, 38}, {146, 38}, {159, 38}, {166, 38}, - {8 , 51}, {18 , 51}, {28 , 51}, {40 , 51}, {53 , 51}, {65 , 51}, {78 , 51}, {90 , 51}, {103, 51}, {115, 51}, {128, 51}, {140, 51}, {157, 51}, {187, 51}, - {2 , 64}, {17 , 64}, {33 , 64}, {79 , 64}, {124, 64}, {137, 64}, {149, 64}, {162, 64}, {174, 64}, {187, 64}, {199, 64}, -}, { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 -} }; - -#endif diff --git a/keyboards/keychron/k8/keymaps/iso/config_led.h b/keyboards/keychron/k8/keymaps/iso/config_led.h deleted file mode 100644 index 3e4e12119194..000000000000 --- a/keyboards/keychron/k8/keymaps/iso/config_led.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2020 Adam Honse -Copyright 2020 Dimitris Mantzouranis - -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 - -// Backlight configuration - -//#define BACKLIGHT_LEVELS 17 - -#define LED_MATRIX_ROWS MATRIX_ROWS -#define LED_MATRIX_ROW_CHANNELS 3 -#define LED_MATRIX_ROWS_HW (LED_MATRIX_ROWS * LED_MATRIX_ROW_CHANNELS) -#define LED_MATRIX_ROW_PINS { C3, C1, C0, C6, C5, C4, C9, C8, C7, C12, C11, C10, B13, C14, C13, B14, B15, D3 } - -#define LED_MATRIX_COLS MATRIX_COLS -#define LED_MATRIX_COL_PINS MATRIX_COL_PINS - -#define DRIVER_LED_TOTAL (89) diff --git a/keyboards/keychron/k8/keymaps/iso/rules.mk b/keyboards/keychron/k8/keymaps/iso/rules.mk deleted file mode 100644 index cc1ba15f4af1..000000000000 --- a/keyboards/keychron/k8/keymaps/iso/rules.mk +++ /dev/null @@ -1,14 +0,0 @@ -# https://beta.docs.qmk.fm/developing-qmk/qmk-reference/getting_started_make_guide#rules-mk-options - -# AUTO_SHIFT_ENABLE = yes -# MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes # Audio control and System control -# MAGIC_ENABLE = yes -# MAGIC_KEYCODE_ENABLE = yes - -# BOOTMAGIC_ENABLE = no # https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_bootmagic -# NKRO_ENABLE = no - - - - diff --git a/keyboards/keychron/k8/bootloader_defs.h b/keyboards/keychron/k8/rgb/bootloader_defs.h similarity index 100% rename from keyboards/keychron/k8/bootloader_defs.h rename to keyboards/keychron/k8/rgb/bootloader_defs.h diff --git a/keyboards/keychron/k8/chconf.h b/keyboards/keychron/k8/rgb/chconf.h similarity index 100% rename from keyboards/keychron/k8/chconf.h rename to keyboards/keychron/k8/rgb/chconf.h diff --git a/keyboards/keychron/k6/rgb/keymaps/iso/config.h b/keyboards/keychron/k8/rgb/config.h similarity index 77% rename from keyboards/keychron/k6/rgb/keymaps/iso/config.h rename to keyboards/keychron/k8/rgb/config.h index 7ffa7ece62d7..dcd74ecc89ea 100644 --- a/keyboards/keychron/k6/rgb/keymaps/iso/config.h +++ b/keyboards/keychron/k8/rgb/config.h @@ -20,26 +20,27 @@ #include "config_common.h" #include "config_led.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x0C45 -#define PRODUCT_ID 0x5004 -#define DEVICE_VER 0x0001 - #define MANUFACTURER Keychron -#define PRODUCT K6 -#define DESCRIPTION K6 Gateron RGB ISO Nordic +#define PRODUCT K8 RGB +#define DEVICE_VER 0x0001 /* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 16 +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 #define DIODE_DIRECTION COL2ROW -#define MATRIX_COL_PINS { A8, A9, A10, A11, A12, A13, A14, A15, B0, B1, B2, B3, B4, B5, B6, B7 } -#define MATRIX_ROW_PINS { D11, D10, D9, D8, D7 } +#define MATRIX_COL_PINS { A8, A9, A10, A11, A12, A13, A14, A15, B0, B1, B2, B3, B4, B5, B6, B7, B8 } +#define MATRIX_ROW_PINS { C15, D11, D10, D9, D8, D7 } // Connects each switch in the dip switch to the GPIO pin of the MCU #define DIP_SWITCH_PINS { D5, D6 } +/* LED Status indicators */ +#define LED_CAPS_LOCK_PIN B12 +#define LED_PIN_ON_STATE 1 + /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 10 +#define DEBOUNCE 0 + +//#define FORCE_NKRO diff --git a/keyboards/keychron/k8/keymaps/ansi/config_led.c b/keyboards/keychron/k8/rgb/config_led.c similarity index 50% rename from keyboards/keychron/k8/keymaps/ansi/config_led.c rename to keyboards/keychron/k8/rgb/config_led.c index 47e2bc499340..ea0ab88bb274 100644 --- a/keyboards/keychron/k8/keymaps/ansi/config_led.c +++ b/keyboards/keychron/k8/rgb/config_led.c @@ -4,7 +4,32 @@ #include "config_led.h" #define XX NO_LED - +#ifdef KEYMAP_ISO +/* ISO keymap LEDs */ +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, XX, 13, 14, 15}, + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}, + { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49}, + { 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, XX, XX, XX}, + { 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, XX, 76, XX, 77, XX}, + { 78, 79, 80, XX, XX, XX, 81, XX, XX, XX, 82, 83, 84, 85, 86, 87, 88} +}, { + {0 , 0}, {12 , 0}, {25 , 0}, {37 , 0}, {50 , 0}, {62 , 0}, {75 , 0}, {87 , 0}, {100, 0}, {112, 0}, {124, 0}, {137, 0}, {149, 0}, {174, 0}, {187, 0}, {199, 0}, + {0 , 13}, {12 , 13}, {25 , 13}, {37 , 13}, {50 , 13}, {62 , 13}, {75 , 13}, {87 , 13}, {100, 13}, {112, 13}, {124, 13}, {137, 13}, {149, 13}, {168, 13}, {174, 13}, {187, 13}, {199, 13}, + {3 , 26}, {19 , 26}, {31 , 26}, {44 , 26}, {56 , 26}, {68 , 26}, {81 , 26}, {93 , 26}, {106, 26}, {118, 26}, {131, 26}, {143, 26}, {156, 26}, {168, 26}, {174, 26}, {187, 26}, {199, 26}, + {5 , 38}, {22 , 38}, {34 , 38}, {47 , 38}, {59 , 38}, {72 , 38}, {84 , 38}, {96 , 38}, {109, 38}, {121, 38}, {134, 38}, {146, 38}, {159, 38}, {166, 38}, + {8 , 51}, {18 , 51}, {28 , 51}, {40 , 51}, {53 , 51}, {65 , 51}, {78 , 51}, {90 , 51}, {103, 51}, {115, 51}, {128, 51}, {140, 51}, {157, 51}, {187, 51}, + {2 , 64}, {17 , 64}, {33 , 64}, {79 , 64}, {124, 64}, {137, 64}, {149, 64}, {162, 64}, {174, 64}, {187, 64}, {199, 64}, +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 +} }; +#else +/* ANSI keymap LEDs */ led_config_t g_led_config = { { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, XX, 13, 14, 15}, { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}, @@ -27,5 +52,5 @@ led_config_t g_led_config = { { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } }; - +#endif #endif diff --git a/keyboards/keychron/k8/keymaps/ansi/config_led.h b/keyboards/keychron/k8/rgb/config_led.h similarity index 93% rename from keyboards/keychron/k8/keymaps/ansi/config_led.h rename to keyboards/keychron/k8/rgb/config_led.h index 4b42dea5d012..3c2b5310b792 100644 --- a/keyboards/keychron/k8/keymaps/ansi/config_led.h +++ b/keyboards/keychron/k8/rgb/config_led.h @@ -17,6 +17,7 @@ along with this program. If not, see . */ #pragma once +#include // Backlight configuration @@ -30,4 +31,8 @@ along with this program. If not, see . #define LED_MATRIX_COLS MATRIX_COLS #define LED_MATRIX_COL_PINS MATRIX_COL_PINS +#ifdef KEYMAP_ISO +#define DRIVER_LED_TOTAL (89) +#else #define DRIVER_LED_TOTAL (87) +#endif diff --git a/keyboards/keychron/k8/halconf.h b/keyboards/keychron/k8/rgb/halconf.h similarity index 100% rename from keyboards/keychron/k8/halconf.h rename to keyboards/keychron/k8/rgb/halconf.h diff --git a/keyboards/keychron/k8/info.json b/keyboards/keychron/k8/rgb/info.json similarity index 100% rename from keyboards/keychron/k8/info.json rename to keyboards/keychron/k8/rgb/info.json diff --git a/keyboards/keychron/k8/k8.h b/keyboards/keychron/k8/rgb/k8.h similarity index 100% rename from keyboards/keychron/k8/k8.h rename to keyboards/keychron/k8/rgb/k8.h diff --git a/keyboards/keychron/k8/k8_via_ansi.json b/keyboards/keychron/k8/rgb/k8_via_ansi.json similarity index 100% rename from keyboards/keychron/k8/k8_via_ansi.json rename to keyboards/keychron/k8/rgb/k8_via_ansi.json diff --git a/keyboards/keychron/k8/k8_via_ansi_optical.json b/keyboards/keychron/k8/rgb/k8_via_ansi_optical.json similarity index 100% rename from keyboards/keychron/k8/k8_via_ansi_optical.json rename to keyboards/keychron/k8/rgb/k8_via_ansi_optical.json diff --git a/keyboards/keychron/k8/k8_via_iso.json b/keyboards/keychron/k8/rgb/k8_via_iso.json similarity index 100% rename from keyboards/keychron/k8/k8_via_iso.json rename to keyboards/keychron/k8/rgb/k8_via_iso.json diff --git a/keyboards/keychron/k8/mcuconf.h b/keyboards/keychron/k8/rgb/mcuconf.h similarity index 100% rename from keyboards/keychron/k8/mcuconf.h rename to keyboards/keychron/k8/rgb/mcuconf.h diff --git a/keyboards/keychron/k8/optical/readme.md b/keyboards/keychron/k8/rgb/optical/readme.md similarity index 89% rename from keyboards/keychron/k8/optical/readme.md rename to keyboards/keychron/k8/rgb/optical/readme.md index 646c755f02f7..db02a17cc7cd 100644 --- a/keyboards/keychron/k8/optical/readme.md +++ b/keyboards/keychron/k8/rgb/optical/readme.md @@ -1,10 +1,10 @@ # Keychron K8 -K8 Optical Hotswap RGB +K8 Optical RGB Make example for this keyboard (after setting up your build environment): - make keychron/k8/optical:ansi + make keychron/k8/rgb/optical:ansi * * * For more info and detailed flashing instructions, please visit https://github.com/alex-dinh/keychron-k8 diff --git a/keyboards/keychron/k8/rgb/optical/rules.mk b/keyboards/keychron/k8/rgb/optical/rules.mk new file mode 100644 index 000000000000..d339526001cb --- /dev/null +++ b/keyboards/keychron/k8/rgb/optical/rules.mk @@ -0,0 +1 @@ +OPT_DEFS += -DOPTICAL_MATRIX diff --git a/keyboards/keychron/k8/optical_via/readme.md b/keyboards/keychron/k8/rgb/optical_via/readme.md similarity index 92% rename from keyboards/keychron/k8/optical_via/readme.md rename to keyboards/keychron/k8/rgb/optical_via/readme.md index 7e48c9784ddf..ea8ab5080fed 100644 --- a/keyboards/keychron/k8/optical_via/readme.md +++ b/keyboards/keychron/k8/rgb/optical_via/readme.md @@ -4,7 +4,7 @@ K8 Optical Hotswap RGB with VIA support Make example for this keyboard (after setting up your build environment): - make keychron/k8/optical_via:ansi + make keychron/k8/rgb/optical_via:ansi * * * For more info and detailed flashing instructions, please visit https://github.com/alex-dinh/keychron-k8 diff --git a/keyboards/keychron/k8/rgb/optical_via/rules.mk b/keyboards/keychron/k8/rgb/optical_via/rules.mk new file mode 100644 index 000000000000..8c67dc02e4e5 --- /dev/null +++ b/keyboards/keychron/k8/rgb/optical_via/rules.mk @@ -0,0 +1,2 @@ +OPT_DEFS += -DOPTICAL_MATRIX +VIA_ENABLE = yes diff --git a/keyboards/keychron/k8/readme.md b/keyboards/keychron/k8/rgb/readme.md similarity index 100% rename from keyboards/keychron/k8/readme.md rename to keyboards/keychron/k8/rgb/readme.md diff --git a/keyboards/keychron/k8/rgb/rgb.h b/keyboards/keychron/k8/rgb/rgb.h new file mode 100644 index 000000000000..ef5b3f3e04d7 --- /dev/null +++ b/keyboards/keychron/k8/rgb/rgb.h @@ -0,0 +1,3 @@ +#pragma once + +#include "quantum.h" diff --git a/keyboards/keychron/k8/rules.mk b/keyboards/keychron/k8/rgb/rules.mk similarity index 100% rename from keyboards/keychron/k8/rules.mk rename to keyboards/keychron/k8/rgb/rules.mk diff --git a/keyboards/keychron/k8/via/readme.md b/keyboards/keychron/k8/rgb/via/readme.md similarity index 94% rename from keyboards/keychron/k8/via/readme.md rename to keyboards/keychron/k8/rgb/via/readme.md index 15fe4c1a0119..598e174eca5f 100644 --- a/keyboards/keychron/k8/via/readme.md +++ b/keyboards/keychron/k8/rgb/via/readme.md @@ -8,7 +8,7 @@ Make example for this keyboard (after setting up your build environment): For default ISO: - make keychron/k8/via:iso + make keychron/k8/rgb/via:iso * * * For more info and detailed flashing instructions, please visit https://github.com/alex-dinh/keychron-k8 diff --git a/keyboards/keychron/k8/rgb/via/rules.mk b/keyboards/keychron/k8/rgb/via/rules.mk new file mode 100644 index 000000000000..3d208e31e343 --- /dev/null +++ b/keyboards/keychron/k8/rgb/via/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes + + + + From aeedf7ead31a6622fe982572d1cbecef46ee928f Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Mon, 3 Jan 2022 13:04:21 +0200 Subject: [PATCH 2/6] move usb stuff to usb --- keyboards/keychron/k14/keymaps/ansi/config.h | 1 + keyboards/keychron/k14/rgb/config.h | 6 ++---- keyboards/keychron/k2/keymaps/default/config.h | 1 + keyboards/keychron/k2/rgb/config.h | 1 - keyboards/keychron/k3/keymaps/default/config.h | 1 + keyboards/keychron/k3/rgb/config.h | 1 - keyboards/keychron/k4/rgb/v1/config.h | 1 - keyboards/keychron/k4/rgb/v1/keymaps/default/config.h | 1 + keyboards/keychron/k4/rgb/v2/config.h | 3 +-- keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h | 1 + keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h | 3 ++- keyboards/keychron/k6/keymaps/ansi/config.h | 1 + keyboards/keychron/k6/keymaps/iso/config.h | 3 ++- keyboards/keychron/k6/keymaps/stdvar/config.h | 1 + keyboards/keychron/k6/rgb/config.h | 1 - keyboards/keychron/k6/white/config.h | 1 - keyboards/keychron/k7/keymaps/ansi/config.h | 1 + keyboards/keychron/k7/keymaps/iso/config.h | 3 ++- keyboards/keychron/k7/keymaps/stdvar/config.h | 3 ++- keyboards/keychron/k7/rgb/config.h | 1 - keyboards/keychron/k8/keymaps/ansi/config.h | 1 + keyboards/keychron/k8/keymaps/iso/config.h | 3 ++- keyboards/keychron/k8/rgb/config.h | 3 +-- 23 files changed, 23 insertions(+), 19 deletions(-) diff --git a/keyboards/keychron/k14/keymaps/ansi/config.h b/keyboards/keychron/k14/keymaps/ansi/config.h index b5eff6945c34..dd3097e37edd 100644 --- a/keyboards/keychron/k14/keymaps/ansi/config.h +++ b/keyboards/keychron/k14/keymaps/ansi/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE1A +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k14/rgb/config.h b/keyboards/keychron/k14/rgb/config.h index 9c381dc6acde..17a96bd96343 100644 --- a/keyboards/keychron/k14/rgb/config.h +++ b/keyboards/keychron/k14/rgb/config.h @@ -18,10 +18,10 @@ #pragma once #include "config_common.h" +#include "config_led.h" #define MANUFACTURER Keychron #define PRODUCT K14 RGB -#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 5 @@ -40,6 +40,4 @@ /* LED Status indicators */ #define LED_CAPS_LOCK_PIN B9 -#define LED_PIN_ON_STATE 1 - -#include "config_led.h" +#define LED_PIN_ON_STATE 1 \ No newline at end of file diff --git a/keyboards/keychron/k2/keymaps/default/config.h b/keyboards/keychron/k2/keymaps/default/config.h index c94f3d9f15bf..2008d81c24e2 100644 --- a/keyboards/keychron/k2/keymaps/default/config.h +++ b/keyboards/keychron/k2/keymaps/default/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE02 +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k2/rgb/config.h b/keyboards/keychron/k2/rgb/config.h index 39b1cb4ff429..afc8be9bd066 100644 --- a/keyboards/keychron/k2/rgb/config.h +++ b/keyboards/keychron/k2/rgb/config.h @@ -22,7 +22,6 @@ #define MANUFACTURER Keychron #define PRODUCT K2 RGB -#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 6 diff --git a/keyboards/keychron/k3/keymaps/default/config.h b/keyboards/keychron/k3/keymaps/default/config.h index 676cd10d5745..b0bcda0ec1d1 100644 --- a/keyboards/keychron/k3/keymaps/default/config.h +++ b/keyboards/keychron/k3/keymaps/default/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE04 +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k3/rgb/config.h b/keyboards/keychron/k3/rgb/config.h index 1fee07e3ecf1..b4b26b224550 100644 --- a/keyboards/keychron/k3/rgb/config.h +++ b/keyboards/keychron/k3/rgb/config.h @@ -22,7 +22,6 @@ #define MANUFACTURER Keychron #define PRODUCT K3 RGB -#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 6 diff --git a/keyboards/keychron/k4/rgb/v1/config.h b/keyboards/keychron/k4/rgb/v1/config.h index 9ed8464595c0..8cbcde4db2ac 100644 --- a/keyboards/keychron/k4/rgb/v1/config.h +++ b/keyboards/keychron/k4/rgb/v1/config.h @@ -16,4 +16,3 @@ #define MANUFACTURER Keychron #define PRODUCT K4v1 RGB -#define DEVICE_VER 0x0001 diff --git a/keyboards/keychron/k4/rgb/v1/keymaps/default/config.h b/keyboards/keychron/k4/rgb/v1/keymaps/default/config.h index 0181c35f17b9..a8c399475d03 100644 --- a/keyboards/keychron/k4/rgb/v1/keymaps/default/config.h +++ b/keyboards/keychron/k4/rgb/v1/keymaps/default/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE06 +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k4/rgb/v2/config.h b/keyboards/keychron/k4/rgb/v2/config.h index eebe7e70ff46..204a38716468 100644 --- a/keyboards/keychron/k4/rgb/v2/config.h +++ b/keyboards/keychron/k4/rgb/v2/config.h @@ -16,9 +16,8 @@ #define MANUFACTURER Keychron #define PRODUCT K4v2 RGB -#define DEVICE_VER 0x0001 /* LED Status indicators */ #define LED_CAPS_LOCK_PIN B12 #define LED_NUM_LOCK_PIN D4 -#define LED_PIN_ON_STATE 1 +#define LED_PIN_ON_STATE 1 \ No newline at end of file diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h b/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h index 0181c35f17b9..a8c399475d03 100644 --- a/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h +++ b/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE06 +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h index c5ffca9f14d7..9f087ee12f70 100644 --- a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h +++ b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/config.h @@ -1,5 +1,6 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE07 +#define DEVICE_VER 0x0001 -#define KEYMAP_ISO 1 +#define KEYMAP_ISO 1 \ No newline at end of file diff --git a/keyboards/keychron/k6/keymaps/ansi/config.h b/keyboards/keychron/k6/keymaps/ansi/config.h index 0f0f9a0d6625..06b98996bf44 100644 --- a/keyboards/keychron/k6/keymaps/ansi/config.h +++ b/keyboards/keychron/k6/keymaps/ansi/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0A +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k6/keymaps/iso/config.h b/keyboards/keychron/k6/keymaps/iso/config.h index 191ae8c80114..822b4375778e 100644 --- a/keyboards/keychron/k6/keymaps/iso/config.h +++ b/keyboards/keychron/k6/keymaps/iso/config.h @@ -1,5 +1,6 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0B +#define DEVICE_VER 0x0001 -#define KEYMAP_ISO 1 +#define KEYMAP_ISO 1 \ No newline at end of file diff --git a/keyboards/keychron/k6/keymaps/stdvar/config.h b/keyboards/keychron/k6/keymaps/stdvar/config.h index fd83b364f116..94386a23de69 100644 --- a/keyboards/keychron/k6/keymaps/stdvar/config.h +++ b/keyboards/keychron/k6/keymaps/stdvar/config.h @@ -14,6 +14,7 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0B +#define DEVICE_VER 0x0001 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define TAPPING_TERM 200 diff --git a/keyboards/keychron/k6/rgb/config.h b/keyboards/keychron/k6/rgb/config.h index 60101808244e..c45c71728cb4 100644 --- a/keyboards/keychron/k6/rgb/config.h +++ b/keyboards/keychron/k6/rgb/config.h @@ -22,7 +22,6 @@ #define MANUFACTURER Keychron #define PRODUCT K6 RGB -#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/keychron/k6/white/config.h b/keyboards/keychron/k6/white/config.h index 99a67bd32e51..11502477923f 100644 --- a/keyboards/keychron/k6/white/config.h +++ b/keyboards/keychron/k6/white/config.h @@ -22,7 +22,6 @@ #define MANUFACTURER Keychron #define PRODUCT Keychron K6 White -#define DEVICE_VER 0x0001 #define WAIT_FOR_USB #define USB_MAX_POWER_CONSUMPTION 100 diff --git a/keyboards/keychron/k7/keymaps/ansi/config.h b/keyboards/keychron/k7/keymaps/ansi/config.h index f9b2b17935f0..926692822246 100644 --- a/keyboards/keychron/k7/keymaps/ansi/config.h +++ b/keyboards/keychron/k7/keymaps/ansi/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0C +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k7/keymaps/iso/config.h b/keyboards/keychron/k7/keymaps/iso/config.h index f4dbafe99158..942b3381a7d1 100644 --- a/keyboards/keychron/k7/keymaps/iso/config.h +++ b/keyboards/keychron/k7/keymaps/iso/config.h @@ -1,5 +1,6 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0D +#define DEVICE_VER 0x0001 -#define KEYMAP_ISO 1 +#define KEYMAP_ISO 1 \ No newline at end of file diff --git a/keyboards/keychron/k7/keymaps/stdvar/config.h b/keyboards/keychron/k7/keymaps/stdvar/config.h index 66375e6df97b..b4f083535e06 100644 --- a/keyboards/keychron/k7/keymaps/stdvar/config.h +++ b/keyboards/keychron/k7/keymaps/stdvar/config.h @@ -15,7 +15,8 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0C +#define DEVICE_VER 0x0001 #define TAPPING_TERM 200 #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped once again. */ -#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ +#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ \ No newline at end of file diff --git a/keyboards/keychron/k7/rgb/config.h b/keyboards/keychron/k7/rgb/config.h index 5462ea6dc0d7..68dca1d74e40 100644 --- a/keyboards/keychron/k7/rgb/config.h +++ b/keyboards/keychron/k7/rgb/config.h @@ -22,7 +22,6 @@ #define MANUFACTURER Keychron #define PRODUCT K7 RGB -#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/keychron/k8/keymaps/ansi/config.h b/keyboards/keychron/k8/keymaps/ansi/config.h index f87c5027d92a..7bc88c8f0825 100644 --- a/keyboards/keychron/k8/keymaps/ansi/config.h +++ b/keyboards/keychron/k8/keymaps/ansi/config.h @@ -1,3 +1,4 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0E +#define DEVICE_VER 0x0001 \ No newline at end of file diff --git a/keyboards/keychron/k8/keymaps/iso/config.h b/keyboards/keychron/k8/keymaps/iso/config.h index d3f5550a4584..309d4c325ee2 100644 --- a/keyboards/keychron/k8/keymaps/iso/config.h +++ b/keyboards/keychron/k8/keymaps/iso/config.h @@ -1,5 +1,6 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define PRODUCT_ID 0xFE0F +#define DEVICE_VER 0x0001 -#define KEYMAP_ISO 1 +#define KEYMAP_ISO 1 \ No newline at end of file diff --git a/keyboards/keychron/k8/rgb/config.h b/keyboards/keychron/k8/rgb/config.h index dcd74ecc89ea..51b65aa3fdb2 100644 --- a/keyboards/keychron/k8/rgb/config.h +++ b/keyboards/keychron/k8/rgb/config.h @@ -22,7 +22,6 @@ #define MANUFACTURER Keychron #define PRODUCT K8 RGB -#define DEVICE_VER 0x0001 /* key matrix size */ #define MATRIX_ROWS 6 @@ -43,4 +42,4 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 0 -//#define FORCE_NKRO +//#define FORCE_NKRO \ No newline at end of file From 2072a27446f90607ae9941b38e91271924cecb02 Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Mon, 3 Jan 2022 13:08:14 +0200 Subject: [PATCH 3/6] cleanup whitespaces --- keyboards/keychron/k3/rgb/via/rules.mk | 6 +----- keyboards/keychron/k4/rgb/v1/via/rules.mk | 6 +----- keyboards/keychron/k4/rgb/v2/via/rules.mk | 6 +----- keyboards/keychron/k6/rgb/via/rules.mk | 6 +----- keyboards/keychron/k7/rgb/via/rules.mk | 6 +----- keyboards/keychron/k8/rgb/via/rules.mk | 6 +----- 6 files changed, 6 insertions(+), 30 deletions(-) diff --git a/keyboards/keychron/k3/rgb/via/rules.mk b/keyboards/keychron/k3/rgb/via/rules.mk index 3d208e31e343..036bd6d1c3ec 100644 --- a/keyboards/keychron/k3/rgb/via/rules.mk +++ b/keyboards/keychron/k3/rgb/via/rules.mk @@ -1,5 +1 @@ -VIA_ENABLE = yes - - - - +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/keychron/k4/rgb/v1/via/rules.mk b/keyboards/keychron/k4/rgb/v1/via/rules.mk index 3d208e31e343..036bd6d1c3ec 100644 --- a/keyboards/keychron/k4/rgb/v1/via/rules.mk +++ b/keyboards/keychron/k4/rgb/v1/via/rules.mk @@ -1,5 +1 @@ -VIA_ENABLE = yes - - - - +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/keychron/k4/rgb/v2/via/rules.mk b/keyboards/keychron/k4/rgb/v2/via/rules.mk index 3d208e31e343..036bd6d1c3ec 100644 --- a/keyboards/keychron/k4/rgb/v2/via/rules.mk +++ b/keyboards/keychron/k4/rgb/v2/via/rules.mk @@ -1,5 +1 @@ -VIA_ENABLE = yes - - - - +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/keychron/k6/rgb/via/rules.mk b/keyboards/keychron/k6/rgb/via/rules.mk index 3d208e31e343..036bd6d1c3ec 100644 --- a/keyboards/keychron/k6/rgb/via/rules.mk +++ b/keyboards/keychron/k6/rgb/via/rules.mk @@ -1,5 +1 @@ -VIA_ENABLE = yes - - - - +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/keychron/k7/rgb/via/rules.mk b/keyboards/keychron/k7/rgb/via/rules.mk index 3d208e31e343..036bd6d1c3ec 100644 --- a/keyboards/keychron/k7/rgb/via/rules.mk +++ b/keyboards/keychron/k7/rgb/via/rules.mk @@ -1,5 +1 @@ -VIA_ENABLE = yes - - - - +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/keychron/k8/rgb/via/rules.mk b/keyboards/keychron/k8/rgb/via/rules.mk index 3d208e31e343..036bd6d1c3ec 100644 --- a/keyboards/keychron/k8/rgb/via/rules.mk +++ b/keyboards/keychron/k8/rgb/via/rules.mk @@ -1,5 +1 @@ -VIA_ENABLE = yes - - - - +VIA_ENABLE = yes \ No newline at end of file From 623192cd7abc76345753606b892dfe763ef0329c Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Mon, 3 Jan 2022 13:10:06 +0200 Subject: [PATCH 4/6] bump debounce to 5 on all rgb keychron --- keyboards/keychron/k14/rgb/config.h | 4 ++-- keyboards/keychron/k2/rgb/config.h | 2 +- keyboards/keychron/k3/rgb/config.h | 2 +- keyboards/keychron/k4/rgb/config.h | 2 +- keyboards/keychron/k7/rgb/config.h | 2 +- keyboards/keychron/k8/rgb/config.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/keychron/k14/rgb/config.h b/keyboards/keychron/k14/rgb/config.h index 17a96bd96343..81abfd635c6b 100644 --- a/keyboards/keychron/k14/rgb/config.h +++ b/keyboards/keychron/k14/rgb/config.h @@ -36,8 +36,8 @@ #define DIP_SWITCH_PINS { D4, D5 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 +#define DEBOUNCE 5 /* LED Status indicators */ #define LED_CAPS_LOCK_PIN B9 -#define LED_PIN_ON_STATE 1 \ No newline at end of file +#define LED_PIN_ON_STATE 1 diff --git a/keyboards/keychron/k2/rgb/config.h b/keyboards/keychron/k2/rgb/config.h index afc8be9bd066..b2aa1c3f8ecd 100644 --- a/keyboards/keychron/k2/rgb/config.h +++ b/keyboards/keychron/k2/rgb/config.h @@ -36,7 +36,7 @@ #define DIP_SWITCH_PINS { D4, D5 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 +#define DEBOUNCE 5 /* LED Status indicators */ #define LED_CAPS_LOCK_PIN B9 diff --git a/keyboards/keychron/k3/rgb/config.h b/keyboards/keychron/k3/rgb/config.h index b4b26b224550..e946c2e38147 100644 --- a/keyboards/keychron/k3/rgb/config.h +++ b/keyboards/keychron/k3/rgb/config.h @@ -36,4 +36,4 @@ #define DIP_SWITCH_PINS { D4, D5 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 +#define DEBOUNCE 5 diff --git a/keyboards/keychron/k4/rgb/config.h b/keyboards/keychron/k4/rgb/config.h index 0315d19cef38..1529dba0fd98 100644 --- a/keyboards/keychron/k4/rgb/config.h +++ b/keyboards/keychron/k4/rgb/config.h @@ -33,4 +33,4 @@ #define DIP_SWITCH_PINS { D5, D6 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 +#define DEBOUNCE 5 diff --git a/keyboards/keychron/k7/rgb/config.h b/keyboards/keychron/k7/rgb/config.h index 68dca1d74e40..4478c8f92dc6 100644 --- a/keyboards/keychron/k7/rgb/config.h +++ b/keyboards/keychron/k7/rgb/config.h @@ -40,6 +40,6 @@ #define LED_PIN_ON_STATE 1 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 +#define DEBOUNCE 5 #define FORCE_NKRO diff --git a/keyboards/keychron/k8/rgb/config.h b/keyboards/keychron/k8/rgb/config.h index 51b65aa3fdb2..6ffbd1f7b254 100644 --- a/keyboards/keychron/k8/rgb/config.h +++ b/keyboards/keychron/k8/rgb/config.h @@ -40,6 +40,6 @@ #define LED_PIN_ON_STATE 1 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 0 +#define DEBOUNCE 5 //#define FORCE_NKRO \ No newline at end of file From 8b22223a628ce2b095b36ef95251f186f05c513f Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Mon, 3 Jan 2022 15:12:49 +0200 Subject: [PATCH 5/6] keychron: add via json --- .../k14/{rgb => keymaps/ansi}/via_ansi.json | 2 +- .../keychron/k2/keymaps/default/via_ansi.json | 17 +++++++++++++++++ keyboards/keychron/k3/keymaps/via_ansi.json | 17 +++++++++++++++++ .../k4/rgb/v1/keymaps/default/via_ansi.json | 17 +++++++++++++++++ .../k4/rgb/v2/keymaps/default_iso/via_iso.json | 16 ++++++++++++++++ .../k6/{rgb => keymaps/ansi}/via_ansi.json | 6 +++--- .../k6/{rgb => keymaps/iso}/via_iso.json | 6 +++--- .../k8/{rgb => keymaps/ansi}/k8_via_ansi.json | 2 +- .../ansi}/k8_via_ansi_optical.json | 2 +- .../k8/{rgb => keymaps/iso}/k8_via_iso.json | 2 +- 10 files changed, 77 insertions(+), 10 deletions(-) rename keyboards/keychron/k14/{rgb => keymaps/ansi}/via_ansi.json (97%) create mode 100644 keyboards/keychron/k2/keymaps/default/via_ansi.json create mode 100644 keyboards/keychron/k3/keymaps/via_ansi.json create mode 100644 keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json create mode 100644 keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json rename keyboards/keychron/k6/{rgb => keymaps/ansi}/via_ansi.json (91%) rename keyboards/keychron/k6/{rgb => keymaps/iso}/via_iso.json (92%) rename keyboards/keychron/k8/{rgb => keymaps/ansi}/k8_via_ansi.json (97%) rename keyboards/keychron/k8/{rgb => keymaps/ansi}/k8_via_ansi_optical.json (96%) rename keyboards/keychron/k8/{rgb => keymaps/iso}/k8_via_iso.json (97%) diff --git a/keyboards/keychron/k14/rgb/via_ansi.json b/keyboards/keychron/k14/keymaps/ansi/via_ansi.json similarity index 97% rename from keyboards/keychron/k14/rgb/via_ansi.json rename to keyboards/keychron/k14/keymaps/ansi/via_ansi.json index 78b8e9275ab2..3bfc9951612e 100644 --- a/keyboards/keychron/k14/rgb/via_ansi.json +++ b/keyboards/keychron/k14/keymaps/ansi/via_ansi.json @@ -1,5 +1,5 @@ { - "name": "K14 RGB", + "name": "K14 ANSI", "vendorId": "0x3434", "productId": "0xFE1A", "lighting": "none", diff --git a/keyboards/keychron/k2/keymaps/default/via_ansi.json b/keyboards/keychron/k2/keymaps/default/via_ansi.json new file mode 100644 index 000000000000..5c9a2e1617a5 --- /dev/null +++ b/keyboards/keychron/k2/keymaps/default/via_ansi.json @@ -0,0 +1,17 @@ +{ + "name": "K2 ANSI", + "vendorId": "0x3434", + "productId": "0xFE02", + "lighting": "none", + "matrix": {"rows": 6, "cols": 16}, + "layouts": { + "keymap": [ + [ "0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11","0,12","0,13","0,14","0,15" ], + [ "1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11","1,12",{"w": 2},"1,13","1,15" ], + [{"w": 1.5},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11","2,12",{"w": 1.5},"2,13","2,15" ], + [{"w": 1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11",{"w": 2.25},"3,13","3,15" ], + [{"w": 2.25},"4,0","4,2","4,3","4,4","4,5","4,6","4,7","4,8","4,9","4,10","4,11",{"w": 1.75},"4,13","4,14","4,15" ], + [{"w": 1.25},"5,0",{"w": 1.25},"5,1",{"w": 1.25},"5,2",{"w": 6.25},"5,6","5,10","5,11","5,12","5,13","5,14","5,15" ] + ] + } +} diff --git a/keyboards/keychron/k3/keymaps/via_ansi.json b/keyboards/keychron/k3/keymaps/via_ansi.json new file mode 100644 index 000000000000..b7973088bc78 --- /dev/null +++ b/keyboards/keychron/k3/keymaps/via_ansi.json @@ -0,0 +1,17 @@ +{ + "name": "K3 ANSI", + "vendorId": "0x3434", + "productId": "0xFE04", + "lighting": "none", + "matrix": {"rows": 6, "cols": 16}, + "layouts": { + "keymap": [ + [ "0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11","0,12","0,13","0,14","0,15" ], + [ "1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11","1,12",{"w": 2},"1,13","1,15" ], + [{"w": 1.5},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11","2,12",{"w": 1.5},"2,13","2,15" ], + [{"w": 1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11",{"w": 2.25},"3,13","3,15" ], + [{"w": 2.25},"4,0","4,2","4,3","4,4","4,5","4,6","4,7","4,8","4,9","4,10","4,11",{"w": 1.75},"4,13","4,14","4,15" ], + [{"w": 1.25},"5,0",{"w": 1.25},"5,1",{"w": 1.25},"5,2",{"w": 6.25},"5,6","5,10","5,11","5,12","5,13","5,14","5,15" ] + ] + } +} diff --git a/keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json b/keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json new file mode 100644 index 000000000000..b571d03fcd8b --- /dev/null +++ b/keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json @@ -0,0 +1,17 @@ +{ + "name": "K4 ANSI", + "vendorId": "0x3434", + "productId": "0xFE06", + "lighting": "none", + "matrix": {"rows": 6, "cols": 19}, + "layouts": { + "keymap": [ + [ "0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11","0,12","0,13","0,14","0,15","0,16","0,17","0.18" ], + [ "1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11","1,12",{"w": 2},"1,13","1,15","1,16","1,17","1,18" ], + [{"w": 1.5},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11","2,12",{"w": 1.5},"2,13","2,15","2,16","2,17",{"h":2},"2,18" ], + [{"w": 1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11",{"w": 2.25},"3,13","3,15","3,16","3,17" ], + [{"w": 2.25},"4,0","4,2","4,3","4,4","4,5","4,6","4,7","4,8","4,9","4,10","4,11",{"w": 1.75},"4,13","4,14","4,15","3,16","3,17",{"h":2},"3,18" ], + [{"w": 1.25},"5,0",{"w": 1.25},"5,1",{"w": 1.25},"5,2",{"w": 6.25},"5,6","5,10","5,11","5,12","5,13","5,14","5,15","5,16","5,17" ] + ] + } +} diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json new file mode 100644 index 000000000000..86d82963e935 --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json @@ -0,0 +1,16 @@ +{ + "name": "K4 ISO", + "vendorId": "0x3434", + "productId": "0xFE07", + "lighting": "none", + "matrix": {"rows": 6, "cols": 19}, + "layouts": { + "keymap": [ + ["0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11","0,12","0,13","0,14","0,15","0,16","0,17","0,18"], + ["1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11","1,12",{"w":2},"1,13","1,15","1,16","1,17","1,18"], + [{"w":1.5},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11","2,12",{"x":0.25,"w":1.25,"h":2,"w2":1.5,"h2":1,"x2":-0.25},"3,13","2,15","2,16","2,17",{"h":2},"2,18"], + [{"w":1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11","3,12",{"x":1.25},"3,15","3,16","3,17"], + [{"w":1.25},"4,0","4,1","4,2","4,3","4,4","4,5","4,6","4,7","4,8","4,9","4,10","4,11",{"w":1.75},"4,13","4,14","4,15","4,16","4,17",{"h":2},"4,18"], + [{"w":1.25},"5,0",{"w":1.25},"5,1",{"w":1.25},"5,2",{"w":6.25},"5,6","5,10","5,11","5,12","5,13","5,14","5,15","5,16","5,17"] ] + } +} diff --git a/keyboards/keychron/k6/rgb/via_ansi.json b/keyboards/keychron/k6/keymaps/ansi/via_ansi.json similarity index 91% rename from keyboards/keychron/k6/rgb/via_ansi.json rename to keyboards/keychron/k6/keymaps/ansi/via_ansi.json index d510d0efbd61..b820e85fdcb7 100644 --- a/keyboards/keychron/k6/rgb/via_ansi.json +++ b/keyboards/keychron/k6/keymaps/ansi/via_ansi.json @@ -1,7 +1,7 @@ { - "name": "K6 RGB", - "vendorId": "0x0C45", - "productId": "0x5004", + "name": "K6 ANSI", + "vendorId": "0x3434", + "productId": "0xFE0A", "lighting": "none", "matrix": {"rows": 5, "cols": 16}, "layouts": { diff --git a/keyboards/keychron/k6/rgb/via_iso.json b/keyboards/keychron/k6/keymaps/iso/via_iso.json similarity index 92% rename from keyboards/keychron/k6/rgb/via_iso.json rename to keyboards/keychron/k6/keymaps/iso/via_iso.json index 84facbecd3fc..a7de8895e5a8 100644 --- a/keyboards/keychron/k6/rgb/via_iso.json +++ b/keyboards/keychron/k6/keymaps/iso/via_iso.json @@ -1,7 +1,7 @@ { - "name": "K6 RGB", - "vendorId": "0x0C45", - "productId": "0x5004", + "name": "K6 ISO", + "vendorId": "0x3434", + "productId": "0xFE0B", "lighting": "none", "matrix": {"rows": 5, "cols": 16}, "layouts": { diff --git a/keyboards/keychron/k8/rgb/k8_via_ansi.json b/keyboards/keychron/k8/keymaps/ansi/k8_via_ansi.json similarity index 97% rename from keyboards/keychron/k8/rgb/k8_via_ansi.json rename to keyboards/keychron/k8/keymaps/ansi/k8_via_ansi.json index edbc582b6075..13f5d15c6c4d 100644 --- a/keyboards/keychron/k8/rgb/k8_via_ansi.json +++ b/keyboards/keychron/k8/keymaps/ansi/k8_via_ansi.json @@ -1,5 +1,5 @@ { - "name": "Keychron K8", + "name": "Keychron K8 ANSI", "vendorId": "0x3434", "productId": "0xFE0E", "lighting": "none", diff --git a/keyboards/keychron/k8/rgb/k8_via_ansi_optical.json b/keyboards/keychron/k8/keymaps/ansi/k8_via_ansi_optical.json similarity index 96% rename from keyboards/keychron/k8/rgb/k8_via_ansi_optical.json rename to keyboards/keychron/k8/keymaps/ansi/k8_via_ansi_optical.json index 8a428de45fe3..4df7303ceb2a 100644 --- a/keyboards/keychron/k8/rgb/k8_via_ansi_optical.json +++ b/keyboards/keychron/k8/keymaps/ansi/k8_via_ansi_optical.json @@ -1,5 +1,5 @@ { - "name": "Keychron K8 Optical", + "name": "Keychron K8 Optical ANSI", "vendorId": "0x3434", "productId": "0xFE0E", "lighting": "none", diff --git a/keyboards/keychron/k8/rgb/k8_via_iso.json b/keyboards/keychron/k8/keymaps/iso/k8_via_iso.json similarity index 97% rename from keyboards/keychron/k8/rgb/k8_via_iso.json rename to keyboards/keychron/k8/keymaps/iso/k8_via_iso.json index 8b250702a8be..d0a0e4aef562 100644 --- a/keyboards/keychron/k8/rgb/k8_via_iso.json +++ b/keyboards/keychron/k8/keymaps/iso/k8_via_iso.json @@ -1,5 +1,5 @@ { - "name": "Keychron K8", + "name": "Keychron K8 ISO", "vendorId": "0x3434", "productId": "0xFE0F", "lighting": "none", From 779cad5bd6c57d562da325d89dd661b0291db687 Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Mon, 3 Jan 2022 15:40:48 +0200 Subject: [PATCH 6/6] cleanup via json + add missing --- .../keychron/k14/keymaps/ansi/via_ansi.json | 2 +- .../keychron/k2/keymaps/default/via_ansi.json | 2 +- .../k3/keymaps/{ => default}/via_ansi.json | 2 +- .../k4/rgb/v1/keymaps/default/via_ansi.json | 2 +- .../rgb/v2/keymaps/default_ansi/via_ansi.json | 17 +++++++++++++++++ .../k4/rgb/v2/keymaps/default_iso/via_iso.json | 2 +- .../keychron/k6/keymaps/ansi/via_ansi.json | 2 +- keyboards/keychron/k6/keymaps/iso/via_iso.json | 2 +- .../keychron/k7/keymaps/ansi/via_ansi.json | 16 ++++++++++++++++ keyboards/keychron/k7/keymaps/iso/via_iso.json | 16 ++++++++++++++++ 10 files changed, 56 insertions(+), 7 deletions(-) rename keyboards/keychron/k3/keymaps/{ => default}/via_ansi.json (96%) create mode 100644 keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/via_ansi.json create mode 100644 keyboards/keychron/k7/keymaps/ansi/via_ansi.json create mode 100644 keyboards/keychron/k7/keymaps/iso/via_iso.json diff --git a/keyboards/keychron/k14/keymaps/ansi/via_ansi.json b/keyboards/keychron/k14/keymaps/ansi/via_ansi.json index 3bfc9951612e..e0ef12d90c20 100644 --- a/keyboards/keychron/k14/keymaps/ansi/via_ansi.json +++ b/keyboards/keychron/k14/keymaps/ansi/via_ansi.json @@ -1,5 +1,5 @@ { - "name": "K14 ANSI", + "name": "Keychron K14 ANSI", "vendorId": "0x3434", "productId": "0xFE1A", "lighting": "none", diff --git a/keyboards/keychron/k2/keymaps/default/via_ansi.json b/keyboards/keychron/k2/keymaps/default/via_ansi.json index 5c9a2e1617a5..be392ba2d2b9 100644 --- a/keyboards/keychron/k2/keymaps/default/via_ansi.json +++ b/keyboards/keychron/k2/keymaps/default/via_ansi.json @@ -1,5 +1,5 @@ { - "name": "K2 ANSI", + "name": "Keychron K2 ANSI", "vendorId": "0x3434", "productId": "0xFE02", "lighting": "none", diff --git a/keyboards/keychron/k3/keymaps/via_ansi.json b/keyboards/keychron/k3/keymaps/default/via_ansi.json similarity index 96% rename from keyboards/keychron/k3/keymaps/via_ansi.json rename to keyboards/keychron/k3/keymaps/default/via_ansi.json index b7973088bc78..68da9b9e059f 100644 --- a/keyboards/keychron/k3/keymaps/via_ansi.json +++ b/keyboards/keychron/k3/keymaps/default/via_ansi.json @@ -1,5 +1,5 @@ { - "name": "K3 ANSI", + "name": "Keychron K3 ANSI", "vendorId": "0x3434", "productId": "0xFE04", "lighting": "none", diff --git a/keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json b/keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json index b571d03fcd8b..81287184f34c 100644 --- a/keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json +++ b/keyboards/keychron/k4/rgb/v1/keymaps/default/via_ansi.json @@ -1,5 +1,5 @@ { - "name": "K4 ANSI", + "name": "Keychron K4 ANSI", "vendorId": "0x3434", "productId": "0xFE06", "lighting": "none", diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/via_ansi.json b/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/via_ansi.json new file mode 100644 index 000000000000..81287184f34c --- /dev/null +++ b/keyboards/keychron/k4/rgb/v2/keymaps/default_ansi/via_ansi.json @@ -0,0 +1,17 @@ +{ + "name": "Keychron K4 ANSI", + "vendorId": "0x3434", + "productId": "0xFE06", + "lighting": "none", + "matrix": {"rows": 6, "cols": 19}, + "layouts": { + "keymap": [ + [ "0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11","0,12","0,13","0,14","0,15","0,16","0,17","0.18" ], + [ "1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11","1,12",{"w": 2},"1,13","1,15","1,16","1,17","1,18" ], + [{"w": 1.5},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11","2,12",{"w": 1.5},"2,13","2,15","2,16","2,17",{"h":2},"2,18" ], + [{"w": 1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11",{"w": 2.25},"3,13","3,15","3,16","3,17" ], + [{"w": 2.25},"4,0","4,2","4,3","4,4","4,5","4,6","4,7","4,8","4,9","4,10","4,11",{"w": 1.75},"4,13","4,14","4,15","3,16","3,17",{"h":2},"3,18" ], + [{"w": 1.25},"5,0",{"w": 1.25},"5,1",{"w": 1.25},"5,2",{"w": 6.25},"5,6","5,10","5,11","5,12","5,13","5,14","5,15","5,16","5,17" ] + ] + } +} diff --git a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json index 86d82963e935..71c945fc456d 100644 --- a/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json +++ b/keyboards/keychron/k4/rgb/v2/keymaps/default_iso/via_iso.json @@ -1,5 +1,5 @@ { - "name": "K4 ISO", + "name": "Keychron K4 ISO", "vendorId": "0x3434", "productId": "0xFE07", "lighting": "none", diff --git a/keyboards/keychron/k6/keymaps/ansi/via_ansi.json b/keyboards/keychron/k6/keymaps/ansi/via_ansi.json index b820e85fdcb7..468399ae38d1 100644 --- a/keyboards/keychron/k6/keymaps/ansi/via_ansi.json +++ b/keyboards/keychron/k6/keymaps/ansi/via_ansi.json @@ -1,5 +1,5 @@ { - "name": "K6 ANSI", + "name": "Keychron K6 ANSI", "vendorId": "0x3434", "productId": "0xFE0A", "lighting": "none", diff --git a/keyboards/keychron/k6/keymaps/iso/via_iso.json b/keyboards/keychron/k6/keymaps/iso/via_iso.json index a7de8895e5a8..08594a7bd89f 100644 --- a/keyboards/keychron/k6/keymaps/iso/via_iso.json +++ b/keyboards/keychron/k6/keymaps/iso/via_iso.json @@ -1,5 +1,5 @@ { - "name": "K6 ISO", + "name": "Keychron K6 ISO", "vendorId": "0x3434", "productId": "0xFE0B", "lighting": "none", diff --git a/keyboards/keychron/k7/keymaps/ansi/via_ansi.json b/keyboards/keychron/k7/keymaps/ansi/via_ansi.json new file mode 100644 index 000000000000..5e55906596c7 --- /dev/null +++ b/keyboards/keychron/k7/keymaps/ansi/via_ansi.json @@ -0,0 +1,16 @@ +{ + "name": "Keychron K7 ANSI", + "vendorId": "0x3434", + "productId": "0xFE0C", + "lighting": "none", + "matrix": {"rows": 5, "cols": 16}, + "layouts": { + "keymap": [ + ["0,0", "0,1", "0,2", "0,3", "0,4", "0,5", "0,6", "0,7", "0,8", "0,9", "0,10", "0,11", "0,12", {"w":2}, "0,13", "0,15"], + [{"w":1.5}, "1,0", "1,1", "1,2", "1,3", "1,4", "1,5", "1,6", "1,7", "1,8", "1,9", "1,10", "1,11", "1,12", {"w":1.5}, "1,13", "1,15"], + [{"w":1.75}, "2,0", "2,1", "2,2", "2,3", "2,4", "2,5", "2,6", "2,7", "2,8", "2,9", "2,10", "2,11", {"w":2.25}, "2,13", "2,15"], + [{"w":2.25}, "3,0", "3,2", "3,3", "3,4", "3,5", "3,6", "3,7", "3,8", "3,9", "3,10", "3,11", {"w":1.75}, "3,13", "3,14", "3,15"], + [{"w":1.25}, "4,0", {"w":1.25}, "4,1", {"w":1.25}, "4,2", {"w":6.25}, "4,6", "4,10", "4,11", "4,12", "4,13", "4,14", "4,15"] + ] + } +} diff --git a/keyboards/keychron/k7/keymaps/iso/via_iso.json b/keyboards/keychron/k7/keymaps/iso/via_iso.json new file mode 100644 index 000000000000..9939187f4d34 --- /dev/null +++ b/keyboards/keychron/k7/keymaps/iso/via_iso.json @@ -0,0 +1,16 @@ +{ + "name": "Keychron K7 ISO", + "vendorId": "0x3434", + "productId": "0xFE0D", + "lighting": "none", + "matrix": {"rows": 5, "cols": 16}, + "layouts": { + "keymap": [ + ["0,0", "0,1", "0,2", "0,3", "0,4", "0,5", "0,6", "0,7", "0,8", "0,9", "0,10", "0,11", "0,12", {"w":2}, "0,13", "0,15"], + [{"w":1.5}, "1,0", "1,1", "1,2", "1,3", "1,4", "1,5", "1,6", "1,7", "1,8", "1,9", "1,10", "1,11", "1,12", {"x":0.25,"w":1.25,"h":2,"w2":1.5,"h2":1,"x2":-0.25}, "2,13", "1,15"], + [{"w":1.75}, "2,0", "2,1", "2,2", "2,3", "2,4", "2,5", "2,6", "2,7", "2,8", "2,9", "2,10", "2,11", "2,12", {"x": 1.25 }, "2,15"], + [{"w":1.25}, "3,0", "3,1", "3,2", "3,3", "3,4", "3,5", "3,6", "3,7", "3,8", "3,9", "3,10", "3,11", {"w":1.75}, "3,13", "3,14", "3,15"], + [{"w":1.25}, "4,0", {"w":1.25}, "4,1", {"w":1.25}, "4,2", {"w":6.25}, "4,6", "4,10", "4,11", "4,12", "4,13", "4,14", "4,15"] + ] + } +}