diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/config.h b/keyboards/keychron/k17_pro/ansi_encoder/rgb/config.h new file mode 100644 index 0000000000..4879f8ed8a --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/config.h @@ -0,0 +1,49 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 + +#ifdef RGB_MATRIX_ENABLE +/* RGB Matrix Driver Configuration */ +# define DRIVER_COUNT 2 +# define DRIVER_ADDR_1 0b1110111 +# define DRIVER_ADDR_2 0b1110100 + +/* RGB Matrix Configuration */ +# define RGB_MATRIX_LED_COUNT 103 + +/* Set to infinit, which is use in USB mode by default */ +# define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE + +/* Allow to shutdown driver to save power */ +# define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE + +/* Turn off backllit if brightness value is low */ +# define RGB_MATRIX_BRIGHTNESS_TURN_OFF_VAL 48 + +/* Indication led index */ +# define NUM_LOCK_INDEX 34 +# define DIM_CAPS_LOCK +# define CAPS_LOCK_INDEX 57 +# define LOW_BAT_IND_INDEX 94 + +# define RGB_MATRIX_KEYPRESSES +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS + +/* Set LED driver current */ +# define SNLED27351_CURRENT_TUNE \ + { 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 } +#endif diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/info.json b/keyboards/keychron/k17_pro/ansi_encoder/rgb/info.json new file mode 100644 index 0000000000..e0c1179641 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/info.json @@ -0,0 +1,146 @@ +{ + "usb": { + "pid": "0x0206", + "device_version": "1.0.1" + }, + "features": { + "rgb_matrix": true + }, + "rgb_matrix": { + "driver": "snled27351", + "sleep": true, + "animations": { + "breathing": true, + "band_spiral_val": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_up_down": true, + "rainbow_moving_chevron": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "dual_beacon": true, + "rainbow_beacon": true, + "jellybean_raindrops": true, + "pixel_rain": true, + "typing_heatmap": true, + "digital_rain": true, + "solid_reactive_simple": true, + "solid_reactive_multiwide": true, + "solid_reactive_multinexus": true, + "splash": true, + "solid_splash": true + }, + "layout": [ + {"matrix":[0, 0], "flags":1, "x":0, "y":0}, + {"matrix":[0, 1], "flags":1, "x":12, "y":0}, + {"matrix":[0, 2], "flags":1, "x":23, "y":0}, + {"matrix":[0, 3], "flags":1, "x":35, "y":0}, + {"matrix":[0, 4], "flags":1, "x":47, "y":0}, + {"matrix":[0, 5], "flags":1, "x":58, "y":0}, + {"matrix":[0, 6], "flags":1, "x":70, "y":0}, + {"matrix":[0, 7], "flags":1, "x":82, "y":0}, + {"matrix":[0, 8], "flags":1, "x":93, "y":0}, + {"matrix":[0, 9], "flags":1, "x":105, "y":0}, + {"matrix":[0, 10], "flags":1, "x":117, "y":0}, + {"matrix":[0, 11], "flags":1, "x":128, "y":0}, + {"matrix":[0, 12], "flags":1, "x":140, "y":0}, + {"matrix":[0, 13], "flags":1, "x":152, "y":0}, + {"matrix":[0, 14], "flags":1, "x":163, "y":0}, + {"matrix":[0, 15], "flags":1, "x":176, "y":0}, + {"matrix":[0, 16], "flags":1, "x":189, "y":0}, + {"matrix":[0, 17], "flags":1, "x":201, "y":0}, + {"matrix":[0, 18], "flags":1, "x":212, "y":0}, + + {"matrix":[1, 0], "flags":1, "x":0, "y":14}, + {"matrix":[1, 1], "flags":8, "x":12, "y":14}, + {"matrix":[1, 2], "flags":8, "x":23, "y":14}, + {"matrix":[1, 3], "flags":8, "x":35, "y":14}, + {"matrix":[1, 4], "flags":4, "x":47, "y":14}, + {"matrix":[1, 5], "flags":4, "x":58, "y":14}, + {"matrix":[1, 6], "flags":4, "x":70, "y":14}, + {"matrix":[1, 7], "flags":4, "x":82, "y":14}, + {"matrix":[1, 8], "flags":4, "x":93, "y":14}, + {"matrix":[1, 9], "flags":4, "x":105, "y":14}, + {"matrix":[1, 10], "flags":4, "x":117, "y":14}, + {"matrix":[1, 11], "flags":4, "x":128, "y":14}, + {"matrix":[1, 12], "flags":4, "x":140, "y":14}, + {"matrix":[1, 14], "flags":1, "x":157, "y":14}, + {"matrix":[1, 15], "flags":1, "x":176, "y":14}, + {"matrix":[1, 16], "flags":8, "x":189, "y":14}, + {"matrix":[1, 17], "flags":4, "x":201, "y":14}, + {"matrix":[1, 18], "flags":4, "x":212, "y":14}, + {"matrix":[1, 19], "flags":4, "x":224, "y":14}, + + {"matrix":[2, 0], "flags":1, "x":3, "y":26}, + {"matrix":[2, 1], "flags":4, "x":17, "y":26}, + {"matrix":[2, 2], "flags":4, "x":29, "y":26}, + {"matrix":[2, 3], "flags":4, "x":41, "y":26}, + {"matrix":[2, 4], "flags":4, "x":52, "y":26}, + {"matrix":[2, 5], "flags":4, "x":64, "y":26}, + {"matrix":[2, 6], "flags":4, "x":76, "y":26}, + {"matrix":[2, 7], "flags":4, "x":87, "y":26}, + {"matrix":[2, 8], "flags":4, "x":99, "y":26}, + {"matrix":[2, 9], "flags":4, "x":111, "y":26}, + {"matrix":[2, 10], "flags":4, "x":122, "y":26}, + {"matrix":[2, 11], "flags":4, "x":134, "y":26}, + {"matrix":[2, 12], "flags":4, "x":146, "y":26}, + {"matrix":[2, 14], "flags":1, "x":160, "y":26}, + {"matrix":[2, 15], "flags":1, "x":176, "y":26}, + {"matrix":[2, 16], "flags":4, "x":189, "y":26}, + {"matrix":[2, 17], "flags":4, "x":201, "y":26}, + {"matrix":[2, 18], "flags":4, "x":212, "y":26}, + {"matrix":[2, 19], "flags":4, "x":224, "y":33}, + + {"matrix":[3, 0], "flags":8, "x":4, "y":39}, + {"matrix":[3, 1], "flags":4, "x":20, "y":39}, + {"matrix":[3, 2], "flags":4, "x":32, "y":39}, + {"matrix":[3, 3], "flags":4, "x":43, "y":39}, + {"matrix":[3, 4], "flags":4, "x":55, "y":39}, + {"matrix":[3, 5], "flags":4, "x":67, "y":39}, + {"matrix":[3, 6], "flags":4, "x":79, "y":39}, + {"matrix":[3, 7], "flags":4, "x":90, "y":39}, + {"matrix":[3, 8], "flags":4, "x":102, "y":39}, + {"matrix":[3, 9], "flags":4, "x":114, "y":39}, + {"matrix":[3, 10], "flags":4, "x":125, "y":39}, + {"matrix":[3, 11], "flags":4, "x":137, "y":39}, + {"matrix":[3, 13], "flags":1, "x":156, "y":39}, + {"matrix":[3, 15], "flags":1, "x":176, "y":39}, + {"matrix":[3, 16], "flags":4, "x":189, "y":39}, + {"matrix":[3, 17], "flags":4, "x":201, "y":39}, + {"matrix":[3, 18], "flags":4, "x":212, "y":39}, + + {"matrix":[4, 0], "flags":1, "x":7, "y":51}, + {"matrix":[4, 2], "flags":4, "x":26, "y":51}, + {"matrix":[4, 3], "flags":4, "x":38, "y":51}, + {"matrix":[4, 4], "flags":4, "x":50, "y":51}, + {"matrix":[4, 5], "flags":4, "x":61, "y":51}, + {"matrix":[4, 6], "flags":4, "x":73, "y":51}, + {"matrix":[4, 7], "flags":4, "x":85, "y":51}, + {"matrix":[4, 8], "flags":4, "x":96, "y":51}, + {"matrix":[4, 9], "flags":4, "x":108, "y":51}, + {"matrix":[4, 10], "flags":4, "x":120, "y":51}, + {"matrix":[4, 11], "flags":4, "x":131, "y":51}, + {"matrix":[4, 12], "flags":1, "x":147, "y":51}, + {"matrix":[4, 14], "flags":1, "x":164, "y":51}, + {"matrix":[4, 16], "flags":4, "x":189, "y":51}, + {"matrix":[4, 17], "flags":4, "x":201, "y":51}, + {"matrix":[4, 18], "flags":4, "x":212, "y":51}, + {"matrix":[4, 19], "flags":4, "x":224, "y":58}, + + {"matrix":[5, 0], "flags":1, "x":1, "y":64}, + {"matrix":[5, 1], "flags":1, "x":16, "y":64}, + {"matrix":[5, 2], "flags":1, "x":31, "y":64}, + {"matrix":[5, 6], "flags":4, "x":74, "y":64}, + {"matrix":[5, 10], "flags":1, "x":117, "y":64}, + {"matrix":[5, 11], "flags":1, "x":128, "y":64}, + {"matrix":[5, 12], "flags":1, "x":140, "y":64}, + {"matrix":[5, 13], "flags":1, "x":153, "y":64}, + {"matrix":[5, 14], "flags":1, "x":164, "y":64}, + {"matrix":[5, 15], "flags":1, "x":176, "y":64}, + {"matrix":[5, 16], "flags":4, "x":195, "y":64}, + {"matrix":[5, 18], "flags":4, "x":212, "y":64} + ] + } +} diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/default/keymap.c b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/default/keymap.c new file mode 100644 index 0000000000..74573e8668 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_104_ansi( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_104_ansi( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_104_ansi( + KC_ESC, 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_PSCR, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_104_ansi( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/default/rules.mk b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/via/keymap.c b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/via/keymap.c new file mode 100644 index 0000000000..62b678f50f --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/via/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_104_ansi( + KC_ESC, KC_BRID, KC_BRIU, KC_MICT, KC_LAPA, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_104_ansi( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_104_ansi( + KC_ESC, 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_PSCR, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_104_ansi( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/via/rules.mk b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/rgb.c b/keyboards/keychron/k17_pro/ansi_encoder/rgb/rgb.c new file mode 100644 index 0000000000..5d8ddcb2eb --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/rgb.c @@ -0,0 +1,137 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 "quantum.h" + +// clang-format off +#ifdef RGB_MATRIX_ENABLE +const snled27351_led_t PROGMEM g_snled27351_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to snled27351manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, G_1, I_1, H_1}, + {0, G_2, I_2, H_2}, + {0, G_3, I_3, H_3}, + {0, G_4, I_4, H_4}, + {0, G_5, I_5, H_5}, + {0, G_6, I_6, H_6}, + {0, G_7, I_7, H_7}, + {0, G_8, I_8, H_8}, + {0, G_9, I_9, H_9}, + {0, G_10, I_10, H_10}, + {0, G_11, I_11, H_11}, + {0, G_12, I_12, H_12}, + {0, G_13, I_13, H_13}, + {0, G_14, I_14, H_14}, + {0, G_15, I_15, H_15}, + {0, G_16, I_16, H_16}, + {1, D_8, F_8, E_8}, + {1, D_9, F_9, E_9}, + {1, D_10, F_10, E_10}, + + {0, D_1, F_1, E_1}, + {0, D_2, F_2, E_2}, + {0, D_3, F_3, E_3}, + {0, D_4, F_4, E_4}, + {0, D_5, F_5, E_5}, + {0, D_6, F_6, E_6}, + {0, D_7, F_7, E_7}, + {0, D_8, F_8, E_8}, + {0, D_9, F_9, E_9}, + {0, D_10, F_10, E_10}, + {0, D_11, F_11, E_11}, + {0, D_12, F_12, E_12}, + {0, D_13, F_13, E_13}, + {0, D_15, F_15, E_15}, + {0, D_16, F_16, E_16}, + {0, J_7, L_7, K_7}, + {0, J_8, L_8, K_8}, + {0, J_9, L_9, K_9}, + {0, J_10, L_10, K_10}, + + {0, C_1, A_1, B_1}, + {0, C_2, A_2, B_2}, + {0, C_3, A_3, B_3}, + {0, C_4, A_4, B_4}, + {0, C_5, A_5, B_5}, + {0, C_6, A_6, B_6}, + {0, C_7, A_7, B_7}, + {0, C_8, A_8, B_8}, + {0, C_9, A_9, B_9}, + {0, C_10, A_10, B_10}, + {0, C_11, A_11, B_11}, + {0, C_12, A_12, B_12}, + {0, C_13, A_13, B_13}, + {0, C_15, A_15, B_15}, + {0, C_16, A_16, B_16}, + {0, J_12, L_12, K_12}, + {0, J_13, L_13, K_13}, + {0, J_14, L_14, K_14}, + {0, J_15, L_15, K_15}, + + {1, G_1, I_1, H_1}, + {1, G_2, I_2, H_2}, + {1, G_3, I_3, H_3}, + {1, G_4, I_4, H_4}, + {1, G_5, I_5, H_5}, + {1, G_6, I_6, H_6}, + {1, G_7, I_7, H_7}, + {1, G_8, I_8, H_8}, + {1, G_9, I_9, H_9}, + {1, G_10, I_10, H_10}, + {1, G_11, I_11, H_11}, + {1, G_12, I_12, H_12}, + {1, G_14, I_14, H_14}, + {1, G_16, I_16, H_16}, + {1, J_7, L_7, K_7}, + {1, J_8, L_8, K_8}, + {1, J_9, L_9, K_9}, + + {1, A_1, C_1, B_1}, + {1, A_3, C_3, B_3}, + {1, A_4, C_4, B_4}, + {1, A_5, C_5, B_5}, + {1, A_6, C_6, B_6}, + {1, A_7, C_7, B_7}, + {1, A_8, C_8, B_8}, + {1, A_9, C_9, B_9}, + {1, A_10, C_10, B_10}, + {1, A_11, C_11, B_11}, + {1, A_12, C_12, B_12}, + {1, A_13, C_13, B_13}, + {1, A_15, C_15, B_15}, + {1, J_10, L_10, K_10}, + {1, J_11, L_11, K_11}, + {1, J_12, L_12, K_12}, + {1, J_13, L_13, K_13}, + + {1, D_1, F_1, E_1}, + {1, D_2, F_2, E_2}, + {1, D_3, F_3, E_3}, + {1, D_7, F_7, E_7}, + {1, D_11, F_11, E_11}, + {1, D_12, F_12, E_12}, + {1, D_13, F_13, E_13}, + {1, D_14, F_14, E_14}, + {1, D_15, F_15, E_15}, + {1, D_16, F_16, E_16}, + {1, J_14, L_14, K_14}, + {1, J_16, L_16, K_16} +}; +#endif diff --git a/keyboards/keychron/k17_pro/ansi_encoder/rgb/rules.mk b/keyboards/keychron/k17_pro/ansi_encoder/rgb/rules.mk new file mode 100644 index 0000000000..6e7633bfe0 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/rgb/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/config.h b/keyboards/keychron/k17_pro/ansi_encoder/white/config.h new file mode 100644 index 0000000000..4a1f11ecab --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/config.h @@ -0,0 +1,51 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 + +#ifdef LED_MATRIX_ENABLE +/* LED Matrix Driver Configuration */ +# define DRIVER_COUNT 1 +# define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND + +/* LED Matrix Configuration */ +# define LED_MATRIX_LED_COUNT 103 + +/* Set to infinit, which is use in USB mode by default */ +# define LED_MATRIX_TIMEOUT LED_MATRIX_TIMEOUT_INFINITE + +/* Allow shutdown of led driver to save power */ +# define LED_MATRIX_DRIVER_SHUTDOWN_ENABLE + +/* Turn off backlight on low brightness to save power */ +# define LED_MATRIX_BRIGHTNESS_TURN_OFF_VAL 48 + +/* Indication led index */ +# define NUM_LOCK_INDEX 34 +# define CAPS_LOCK_INDEX 57 +# define DIM_CAPS_LOCK +# define LOW_BAT_IND_INDEX 94 + +# define LED_MATRIX_KEYPRESSES +# define LED_MATRIX_KEYRELEASES + +/* Use first 8 channels of LED driver */ +# define PHASE_CHANNEL MSKPHASE_8CHANNEL + +/* Set LED driver current */ +# define SNLED27351_CURRENT_TUNE \ + { 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28 } +#endif diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/info.json b/keyboards/keychron/k17_pro/ansi_encoder/white/info.json new file mode 100644 index 0000000000..9d26cc5070 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/info.json @@ -0,0 +1,141 @@ +{ + "usb": { + "pid": "0x0209", + "device_version": "1.0.1" + }, + "features": { + "led_matrix": true + }, + "led_matrix": { + "driver": "snled27351", + "sleep": true, + "animations": { + "none": true, + "solid": true, + "breathing": true, + "band_pinwheel": true, + "band_spiral": true, + "cycle_left_right": true, + "cycle_up_down": true, + "cycle_out_in": true, + "dual_beacon": true, + "solid_reactive_simple": true, + "solid_reactive_multiwide": true, + "solid_reactive_multinexus": true, + "solid_splash": true, + "wave_left_right": true, + "wave_up_down": true, + "effect_max": true + }, + "layout": [ + {"matrix":[0, 0], "flags":1, "x":0, "y":0}, + {"matrix":[0, 1], "flags":1, "x":12, "y":0}, + {"matrix":[0, 2], "flags":1, "x":23, "y":0}, + {"matrix":[0, 3], "flags":1, "x":35, "y":0}, + {"matrix":[0, 4], "flags":1, "x":47, "y":0}, + {"matrix":[0, 5], "flags":1, "x":58, "y":0}, + {"matrix":[0, 6], "flags":1, "x":70, "y":0}, + {"matrix":[0, 7], "flags":1, "x":82, "y":0}, + {"matrix":[0, 8], "flags":1, "x":93, "y":0}, + {"matrix":[0, 9], "flags":1, "x":105, "y":0}, + {"matrix":[0, 10], "flags":1, "x":117, "y":0}, + {"matrix":[0, 11], "flags":1, "x":128, "y":0}, + {"matrix":[0, 12], "flags":1, "x":140, "y":0}, + {"matrix":[0, 13], "flags":1, "x":152, "y":0}, + {"matrix":[0, 14], "flags":1, "x":163, "y":0}, + {"matrix":[0, 15], "flags":1, "x":176, "y":0}, + {"matrix":[0, 16], "flags":1, "x":189, "y":0}, + {"matrix":[0, 17], "flags":1, "x":201, "y":0}, + {"matrix":[0, 18], "flags":1, "x":212, "y":0}, + + {"matrix":[1, 0], "flags":1, "x":0, "y":14}, + {"matrix":[1, 1], "flags":8, "x":12, "y":14}, + {"matrix":[1, 2], "flags":8, "x":23, "y":14}, + {"matrix":[1, 3], "flags":8, "x":35, "y":14}, + {"matrix":[1, 4], "flags":4, "x":47, "y":14}, + {"matrix":[1, 5], "flags":4, "x":58, "y":14}, + {"matrix":[1, 6], "flags":4, "x":70, "y":14}, + {"matrix":[1, 7], "flags":4, "x":82, "y":14}, + {"matrix":[1, 8], "flags":4, "x":93, "y":14}, + {"matrix":[1, 9], "flags":4, "x":105, "y":14}, + {"matrix":[1, 10], "flags":4, "x":117, "y":14}, + {"matrix":[1, 11], "flags":4, "x":128, "y":14}, + {"matrix":[1, 12], "flags":4, "x":140, "y":14}, + {"matrix":[1, 14], "flags":1, "x":157, "y":14}, + {"matrix":[1, 15], "flags":1, "x":176, "y":14}, + {"matrix":[1, 16], "flags":8, "x":189, "y":14}, + {"matrix":[1, 17], "flags":4, "x":201, "y":14}, + {"matrix":[1, 18], "flags":4, "x":212, "y":14}, + {"matrix":[1, 19], "flags":4, "x":224, "y":14}, + + {"matrix":[2, 0], "flags":1, "x":3, "y":26}, + {"matrix":[2, 1], "flags":4, "x":17, "y":26}, + {"matrix":[2, 2], "flags":4, "x":29, "y":26}, + {"matrix":[2, 3], "flags":4, "x":41, "y":26}, + {"matrix":[2, 4], "flags":4, "x":52, "y":26}, + {"matrix":[2, 5], "flags":4, "x":64, "y":26}, + {"matrix":[2, 6], "flags":4, "x":76, "y":26}, + {"matrix":[2, 7], "flags":4, "x":87, "y":26}, + {"matrix":[2, 8], "flags":4, "x":99, "y":26}, + {"matrix":[2, 9], "flags":4, "x":111, "y":26}, + {"matrix":[2, 10], "flags":4, "x":122, "y":26}, + {"matrix":[2, 11], "flags":4, "x":134, "y":26}, + {"matrix":[2, 12], "flags":4, "x":146, "y":26}, + {"matrix":[2, 14], "flags":1, "x":160, "y":26}, + {"matrix":[2, 15], "flags":1, "x":176, "y":26}, + {"matrix":[2, 16], "flags":4, "x":189, "y":26}, + {"matrix":[2, 17], "flags":4, "x":201, "y":26}, + {"matrix":[2, 18], "flags":4, "x":212, "y":26}, + {"matrix":[2, 19], "flags":4, "x":224, "y":33}, + + {"matrix":[3, 0], "flags":8, "x":4, "y":39}, + {"matrix":[3, 1], "flags":4, "x":20, "y":39}, + {"matrix":[3, 2], "flags":4, "x":32, "y":39}, + {"matrix":[3, 3], "flags":4, "x":43, "y":39}, + {"matrix":[3, 4], "flags":4, "x":55, "y":39}, + {"matrix":[3, 5], "flags":4, "x":67, "y":39}, + {"matrix":[3, 6], "flags":4, "x":79, "y":39}, + {"matrix":[3, 7], "flags":4, "x":90, "y":39}, + {"matrix":[3, 8], "flags":4, "x":102, "y":39}, + {"matrix":[3, 9], "flags":4, "x":114, "y":39}, + {"matrix":[3, 10], "flags":4, "x":125, "y":39}, + {"matrix":[3, 11], "flags":4, "x":137, "y":39}, + {"matrix":[3, 13], "flags":1, "x":156, "y":39}, + {"matrix":[3, 15], "flags":1, "x":176, "y":39}, + {"matrix":[3, 16], "flags":4, "x":189, "y":39}, + {"matrix":[3, 17], "flags":4, "x":201, "y":39}, + {"matrix":[3, 18], "flags":4, "x":212, "y":39}, + + {"matrix":[4, 0], "flags":1, "x":7, "y":51}, + {"matrix":[4, 2], "flags":4, "x":26, "y":51}, + {"matrix":[4, 3], "flags":4, "x":38, "y":51}, + {"matrix":[4, 4], "flags":4, "x":50, "y":51}, + {"matrix":[4, 5], "flags":4, "x":61, "y":51}, + {"matrix":[4, 6], "flags":4, "x":73, "y":51}, + {"matrix":[4, 7], "flags":4, "x":85, "y":51}, + {"matrix":[4, 8], "flags":4, "x":96, "y":51}, + {"matrix":[4, 9], "flags":4, "x":108, "y":51}, + {"matrix":[4, 10], "flags":4, "x":120, "y":51}, + {"matrix":[4, 11], "flags":4, "x":131, "y":51}, + {"matrix":[4, 12], "flags":1, "x":147, "y":51}, + {"matrix":[4, 14], "flags":1, "x":164, "y":51}, + {"matrix":[4, 16], "flags":4, "x":189, "y":51}, + {"matrix":[4, 17], "flags":4, "x":201, "y":51}, + {"matrix":[4, 18], "flags":4, "x":212, "y":51}, + {"matrix":[4, 19], "flags":4, "x":224, "y":58}, + + {"matrix":[5, 0], "flags":1, "x":1, "y":64}, + {"matrix":[5, 1], "flags":1, "x":16, "y":64}, + {"matrix":[5, 2], "flags":1, "x":31, "y":64}, + {"matrix":[5, 6], "flags":4, "x":74, "y":64}, + {"matrix":[5, 10], "flags":1, "x":117, "y":64}, + {"matrix":[5, 11], "flags":1, "x":128, "y":64}, + {"matrix":[5, 12], "flags":1, "x":140, "y":64}, + {"matrix":[5, 13], "flags":1, "x":153, "y":64}, + {"matrix":[5, 14], "flags":1, "x":164, "y":64}, + {"matrix":[5, 15], "flags":1, "x":176, "y":64}, + {"matrix":[5, 16], "flags":4, "x":195, "y":64}, + {"matrix":[5, 18], "flags":4, "x":212, "y":64} + ] + } +} diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/default/keymap.c b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/default/keymap.c new file mode 100644 index 0000000000..094f96faab --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_104_ansi( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_104_ansi( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_104_ansi( + KC_ESC, 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_PSCR, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_104_ansi( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/default/rules.mk b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/via/keymap.c b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/via/keymap.c new file mode 100644 index 0000000000..499e48c3f9 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/via/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_104_ansi( + KC_ESC, KC_BRID, KC_BRIU, KC_MICT, KC_LAPA, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_104_ansi( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_104_ansi( + KC_ESC, 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_PSCR, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_BSLS, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_104_ansi( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/via/rules.mk b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/rules.mk b/keyboards/keychron/k17_pro/ansi_encoder/white/rules.mk new file mode 100644 index 0000000000..6e7633bfe0 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank diff --git a/keyboards/keychron/k17_pro/ansi_encoder/white/white.c b/keyboards/keychron/k17_pro/ansi_encoder/white/white.c new file mode 100644 index 0000000000..56c07c5f96 --- /dev/null +++ b/keyboards/keychron/k17_pro/ansi_encoder/white/white.c @@ -0,0 +1,135 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 "quantum.h" + +// clang-format off +#ifdef LED_MATRIX_ENABLE +const snled27351_led_t g_snled27351_leds[LED_MATRIX_LED_COUNT] = { +/* Refer to snled27351manual for these locations + * driver + * | LED address + * | | */ + {0, A_1}, + {0, A_2}, + {0, A_3}, + {0, A_4}, + {0, A_5}, + {0, A_6}, + {0, A_7}, + {0, A_8}, + {0, A_9}, + {0, A_10}, + {0, A_11}, + {0, A_12}, + {0, A_13}, + {0, A_14}, + {0, A_15}, + {0, A_16}, + {0, F_8}, + {0, F_9}, + {0, F_10}, + + {0, B_1}, + {0, B_2}, + {0, B_3}, + {0, B_4}, + {0, B_5}, + {0, B_6}, + {0, B_7}, + {0, B_8}, + {0, B_9}, + {0, B_10}, + {0, B_11}, + {0, B_12}, + {0, B_13}, + {0, B_15}, + {0, B_16}, + {0, H_7}, + {0, H_8}, + {0, H_9}, + {0, H_10}, + + {0, C_1}, + {0, C_2}, + {0, C_3}, + {0, C_4}, + {0, C_5}, + {0, C_6}, + {0, C_7}, + {0, C_8}, + {0, C_9}, + {0, C_10}, + {0, C_11}, + {0, C_12}, + {0, C_13}, + {0, C_15}, + {0, C_16}, + {0, H_12}, + {0, H_13}, + {0, H_14}, + {0, H_15}, + + {0, D_1}, + {0, D_2}, + {0, D_3}, + {0, D_4}, + {0, D_5}, + {0, D_6}, + {0, D_7}, + {0, D_8}, + {0, D_9}, + {0, D_10}, + {0, D_11}, + {0, D_12}, + {0, D_14}, + {0, D_16}, + {0, G_7}, + {0, G_8}, + {0, G_9}, + + {0, E_1}, + {0, E_3}, + {0, E_4}, + {0, E_5}, + {0, E_6}, + {0, E_7}, + {0, E_8}, + {0, E_9}, + {0, E_10}, + {0, E_11}, + {0, E_12}, + {0, E_13}, + {0, E_15}, + {0, G_10}, + {0, G_11}, + {0, G_12}, + {0, G_13}, + + {0, F_1}, + {0, F_2}, + {0, F_3}, + {0, F_7}, + {0, F_11}, + {0, F_12}, + {0, F_13}, + {0, F_14}, + {0, F_15}, + {0, F_16}, + {0, G_14}, + {0, G_16}, +}; +#endif diff --git a/keyboards/keychron/k17_pro/config.h b/keyboards/keychron/k17_pro/config.h new file mode 100644 index 0000000000..a933be7b75 --- /dev/null +++ b/keyboards/keychron/k17_pro/config.h @@ -0,0 +1,82 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 + +/* Increase I2C speed to 1000 KHz */ +#define I2C1_TIMINGR_PRESC 0U +#define I2C1_TIMINGR_SCLDEL 3U +#define I2C1_TIMINGR_SDADEL 0U +#define I2C1_TIMINGR_SCLH 15U +#define I2C1_TIMINGR_SCLL 51U + +#ifdef KC_BLUETOOTH_ENABLE +/* Hardware configuration */ +# define USB_BT_MODE_SELECT_PIN C15 + +# define CKBT51_RESET_PIN A9 +# define CKBT51_INT_INPUT_PIN A5 +# define BLUETOOTH_INT_INPUT_PIN A6 + +# define USB_POWER_SENSE_PIN B1 +# define USB_POWER_CONNECTED_LEVEL 0 + +# define BAT_LOW_LED_PIN H3 +# define BAT_LOW_LED_PIN_ON_STATE 1 + +# define HOST_DEVICES_COUNT 3 + +# if defined(RGB_MATRIX_ENABLE) || defined(LED_MATRIX_ENABLE) + +# define LED_DRIVER_SHUTDOWN_PIN C14 + +# define HOST_LED_MATRIX_LIST \ + { 20, 21, 22 } + +# define BAT_LEVEL_LED_LIST \ + { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 } + +/* Backlit disable timeout when keyboard is disconnected(unit: second) */ +# define DISCONNECTED_BACKLIGHT_DISABLE_TIMEOUT 40 + +/* Backlit disable timeout when keyboard is connected(unit: second) */ +# define CONNECTED_BACKLIGHT_DISABLE_TIMEOUT 600 +# endif + +/* Keep USB connection in blueooth mode */ +# define KEEP_USB_CONNECTION_IN_BLUETOOTH_MODE + +/* Enable bluetooth NKRO */ +# define BLUETOOTH_NKRO_ENABLE + +/* Raw hid command for factory test and bluetooth DFU */ +# define RAW_HID_CMD 0xAA ... 0xAB +#else +/* Raw hid command for factory test */ +# define RAW_HID_CMD 0xAB +#endif + +/* Emulated EEPROM configuration */ +#define WEAR_LEVELING_LOGICAL_SIZE 2048 +#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 + +/* Factory test keys */ +#define FN_KEY1 MO(1) +#define FN_KEY2 MO(3) + +/* HC595 driver configure */ +#define HC595_END_INDEX 19 diff --git a/keyboards/keychron/k17_pro/halconf.h b/keyboards/keychron/k17_pro/halconf.h new file mode 100644 index 0000000000..35209171cc --- /dev/null +++ b/keyboards/keychron/k17_pro/halconf.h @@ -0,0 +1,32 @@ +/* Copyright 2023 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define _CHIBIOS_HAL_CONF_VER_8_0_ + +#define HAL_USE_I2C TRUE + +#if defined(ENCODER_ENBALE) || defined(KC_BLUETOOTH_ENABLE) +# define PAL_USE_CALLBACKS TRUE +#endif + +#ifdef KC_BLUETOOTH_ENABLE +# define HAL_USE_SERIAL TRUE +# define HAL_USE_RTC TRUE +#endif + +#include_next diff --git a/keyboards/keychron/k17_pro/info.json b/keyboards/keychron/k17_pro/info.json new file mode 100644 index 0000000000..1dde32e53a --- /dev/null +++ b/keyboards/keychron/k17_pro/info.json @@ -0,0 +1,268 @@ +{ + "keyboard_name": "Keychron K17 Pro", + "manufacturer": "Keychron", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "processor": "STM32L432", + "bootloader": "stm32-dfu", + "usb": { + "vid": "0x3434" + }, + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "dip_switch": true, + "encoder": true, + "raw": true + }, + "matrix_pins": { + "cols": [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], + "rows": ["B5", "B4", "B3", "A15", "A14", "A13"], + "custom": true, + "custom_lite": true + }, + "diode_direction": "ROW2COL", + "dip_switch": { + "pins": ["A8"] + }, + "encoder": { + "rotary": [ + {"pin_a": "A0", "pin_b": "A10"} + ] + }, + "indicators": { + "caps_lock": "A4", + "on_state": 1 + }, + "layouts": { + "LAYOUT_104_ansi": { + "layout": [ + {"matrix":[0,0], "x":0, "y":0}, + {"matrix":[0,1], "x":1, "y":0}, + {"matrix":[0,2], "x":2, "y":0}, + {"matrix":[0,3], "x":3, "y":0}, + {"matrix":[0,4], "x":4, "y":0}, + {"matrix":[0,5], "x":5, "y":0}, + {"matrix":[0,6], "x":6, "y":0}, + {"matrix":[0,7], "x":7, "y":0}, + {"matrix":[0,8], "x":8, "y":0}, + {"matrix":[0,9], "x":9, "y":0}, + {"matrix":[0,10], "x":10, "y":0}, + {"matrix":[0,11], "x":11, "y":0}, + {"matrix":[0,12], "x":12, "y":0}, + {"matrix":[0,13], "x":13, "y":0}, + {"matrix":[0,14], "x":14, "y":0}, + {"matrix":[0,15], "x":15.25, "y":0}, + {"matrix":[0,16], "x":16.5, "y":0}, + {"matrix":[0,17], "x":17.5, "y":0}, + {"matrix":[0,18], "x":18.5, "y":0}, + {"matrix":[0,19], "x":19.5, "y":0}, + + {"matrix":[1,0], "x":0, "y":1.25}, + {"matrix":[1,1], "x":1, "y":1.25}, + {"matrix":[1,2], "x":2, "y":1.25}, + {"matrix":[1,3], "x":3, "y":1.25}, + {"matrix":[1,4], "x":4, "y":1.25}, + {"matrix":[1,5], "x":5, "y":1.25}, + {"matrix":[1,6], "x":6, "y":1.25}, + {"matrix":[1,7], "x":7, "y":1.25}, + {"matrix":[1,8], "x":8, "y":1.25}, + {"matrix":[1,9], "x":9, "y":1.25}, + {"matrix":[1,10], "x":10, "y":1.25}, + {"matrix":[1,11], "x":11, "y":1.25}, + {"matrix":[1,12], "x":12, "y":1.25}, + {"matrix":[1,14], "x":13, "y":1.25, "w":2}, + {"matrix":[1,15], "x":15.25, "y":1.25}, + {"matrix":[1,16], "x":16.5, "y":1.25}, + {"matrix":[1,17], "x":17.5, "y":1.25}, + {"matrix":[1,18], "x":18.5, "y":1.25}, + {"matrix":[1,19], "x":19.5, "y":1.25}, + + {"matrix":[2,0], "x":0, "y":2.25, "w":1.5}, + {"matrix":[2,1], "x":1.5, "y":2.25}, + {"matrix":[2,2], "x":2.5, "y":2.25}, + {"matrix":[2,3], "x":3.5, "y":2.25}, + {"matrix":[2,4], "x":4.5, "y":2.25}, + {"matrix":[2,5], "x":5.5, "y":2.25}, + {"matrix":[2,6], "x":6.5, "y":2.25}, + {"matrix":[2,7], "x":7.5, "y":2.25}, + {"matrix":[2,8], "x":8.5, "y":2.25}, + {"matrix":[2,9], "x":9.5, "y":2.25}, + {"matrix":[2,10], "x":10.5, "y":2.25}, + {"matrix":[2,11], "x":11.5, "y":2.25}, + {"matrix":[2,12], "x":12.5, "y":2.25}, + {"matrix":[2,14], "x":13.5, "y":2.25, "w":1.5}, + {"matrix":[2,15], "x":15.25, "y":2.25}, + {"matrix":[2,16], "x":16.5, "y":2.25}, + {"matrix":[2,17], "x":17.5, "y":2.25}, + {"matrix":[2,18], "x":18.5, "y":2.25}, + {"matrix":[2,19], "x":19.5, "y":2.25, "h":2}, + + {"matrix":[3,0], "x":0, "y":3.25, "w":1.75}, + {"matrix":[3,1], "x":1.75, "y":3.25}, + {"matrix":[3,2], "x":2.75, "y":3.25}, + {"matrix":[3,3], "x":3.75, "y":3.25}, + {"matrix":[3,4], "x":4.75, "y":3.25}, + {"matrix":[3,5], "x":5.75, "y":3.25}, + {"matrix":[3,6], "x":6.75, "y":3.25}, + {"matrix":[3,7], "x":7.75, "y":3.25}, + {"matrix":[3,8], "x":8.75, "y":3.25}, + {"matrix":[3,9], "x":9.75, "y":3.25}, + {"matrix":[3,10], "x":10.75, "y":3.25}, + {"matrix":[3,11], "x":11.75, "y":3.25}, + {"matrix":[3,13], "x":12.75, "y":3.25, "w":2.25}, + {"matrix":[3,15], "x":15.25, "y":3.25}, + {"matrix":[3,16], "x":16.5, "y":3.25}, + {"matrix":[3,17], "x":17.5, "y":3.25}, + {"matrix":[3,18], "x":18.5, "y":3.25}, + + {"matrix":[4,0], "x":0, "y":4.25, "w":2.25}, + {"matrix":[4,2], "x":2.25, "y":4.25}, + {"matrix":[4,3], "x":3.25, "y":4.25}, + {"matrix":[4,4], "x":4.25, "y":4.25}, + {"matrix":[4,5], "x":5.25, "y":4.25}, + {"matrix":[4,6], "x":6.25, "y":4.25}, + {"matrix":[4,7], "x":7.25, "y":4.25}, + {"matrix":[4,8], "x":8.25, "y":4.25}, + {"matrix":[4,9], "x":9.25, "y":4.25}, + {"matrix":[4,10], "x":10.25, "y":4.25}, + {"matrix":[4,11], "x":11.25, "y":4.25}, + {"matrix":[4,12], "x":12.25, "y":4.25, "w":1.75}, + {"matrix":[4,14], "x":14.25, "y":4.25}, + {"matrix":[4,16], "x":16.5, "y":4.25}, + {"matrix":[4,17], "x":17.5, "y":4.25}, + {"matrix":[4,18], "x":18.5, "y":4.25}, + {"matrix":[4,19], "x":19.5, "y":4.25, "h":2}, + + {"matrix":[5,0], "x":0, "y":5.25, "w":1.25}, + {"matrix":[5,1], "x":1.25, "y":5.25, "w":1.25}, + {"matrix":[5,2], "x":2.5, "y":5.25, "w":1.25}, + {"matrix":[5,6], "x":3.75, "y":5.25, "w":6.25}, + {"matrix":[5,10], "x":10, "y":5.25}, + {"matrix":[5,11], "x":11, "y":5.25}, + {"matrix":[5,12], "x":12, "y":5.25}, + {"matrix":[5,13], "x":13.25, "y":5.25}, + {"matrix":[5,14], "x":14.25, "y":5.25}, + {"matrix":[5,15], "x":15.25, "y":5.25}, + {"matrix":[5,16], "x":16.5, "y":5.25, "w":2}, + {"matrix":[5,18], "x":18.5, "y":5.25} + ] + }, + "LAYOUT_105_iso": { + "layout": [ + {"matrix":[0,0], "x":0, "y":0}, + {"matrix":[0,1], "x":1, "y":0}, + {"matrix":[0,2], "x":2, "y":0}, + {"matrix":[0,3], "x":3, "y":0}, + {"matrix":[0,4], "x":4, "y":0}, + {"matrix":[0,5], "x":5, "y":0}, + {"matrix":[0,6], "x":6, "y":0}, + {"matrix":[0,7], "x":7, "y":0}, + {"matrix":[0,8], "x":8, "y":0}, + {"matrix":[0,9], "x":9, "y":0}, + {"matrix":[0,10], "x":10, "y":0}, + {"matrix":[0,11], "x":11, "y":0}, + {"matrix":[0,12], "x":12, "y":0}, + {"matrix":[0,13], "x":13, "y":0}, + {"matrix":[0,14], "x":14, "y":0}, + {"matrix":[0,15], "x":15.25, "y":0}, + {"matrix":[0,16], "x":16.5, "y":0}, + {"matrix":[0,17], "x":17.5, "y":0}, + {"matrix":[0,18], "x":18.5, "y":0}, + {"matrix":[0,19], "x":19.5, "y":0}, + + {"matrix":[1,0], "x":0, "y":1.25}, + {"matrix":[1,1], "x":1, "y":1.25}, + {"matrix":[1,2], "x":2, "y":1.25}, + {"matrix":[1,3], "x":3, "y":1.25}, + {"matrix":[1,4], "x":4, "y":1.25}, + {"matrix":[1,5], "x":5, "y":1.25}, + {"matrix":[1,6], "x":6, "y":1.25}, + {"matrix":[1,7], "x":7, "y":1.25}, + {"matrix":[1,8], "x":8, "y":1.25}, + {"matrix":[1,9], "x":9, "y":1.25}, + {"matrix":[1,10], "x":10, "y":1.25}, + {"matrix":[1,11], "x":11, "y":1.25}, + {"matrix":[1,12], "x":12, "y":1.25}, + {"matrix":[1,14], "x":13, "y":1.25, "w":2}, + {"matrix":[1,15], "x":15.25, "y":1.25}, + {"matrix":[1,16], "x":16.5, "y":1.25}, + {"matrix":[1,17], "x":17.5, "y":1.25}, + {"matrix":[1,18], "x":18.5, "y":1.25}, + {"matrix":[1,19], "x":19.5, "y":1.25}, + + {"matrix":[2,0], "x":0, "y":2.25, "w":1.5}, + {"matrix":[2,1], "x":1.5, "y":2.25}, + {"matrix":[2,2], "x":2.5, "y":2.25}, + {"matrix":[2,3], "x":3.5, "y":2.25}, + {"matrix":[2,4], "x":4.5, "y":2.25}, + {"matrix":[2,5], "x":5.5, "y":2.25}, + {"matrix":[2,6], "x":6.5, "y":2.25}, + {"matrix":[2,7], "x":7.5, "y":2.25}, + {"matrix":[2,8], "x":8.5, "y":2.25}, + {"matrix":[2,9], "x":9.5, "y":2.25}, + {"matrix":[2,10], "x":10.5, "y":2.25}, + {"matrix":[2,11], "x":11.5, "y":2.25}, + {"matrix":[2,12], "x":12.5, "y":2.25}, + {"matrix":[2,15], "x":15.25, "y":2.25}, + {"matrix":[2,16], "x":16.5, "y":2.25}, + {"matrix":[2,17], "x":17.5, "y":2.25}, + {"matrix":[2,18], "x":18.5, "y":2.25}, + {"matrix":[2,19], "x":19.5, "y":2.25, "h":2}, + + {"matrix":[3,0], "x":0, "y":3.25, "w":1.75}, + {"matrix":[3,1], "x":1.75, "y":3.25}, + {"matrix":[3,2], "x":2.75, "y":3.25}, + {"matrix":[3,3], "x":3.75, "y":3.25}, + {"matrix":[3,4], "x":4.75, "y":3.25}, + {"matrix":[3,5], "x":5.75, "y":3.25}, + {"matrix":[3,6], "x":6.75, "y":3.25}, + {"matrix":[3,7], "x":7.75, "y":3.25}, + {"matrix":[3,8], "x":8.75, "y":3.25}, + {"matrix":[3,9], "x":9.75, "y":3.25}, + {"matrix":[3,10], "x":10.75, "y":3.25}, + {"matrix":[3,11], "x":11.75, "y":3.25}, + {"matrix":[3,13], "x":12.75, "y":3.25}, + {"matrix":[2,14], "x":13.75, "y":2.25, "w":1.25, "h":2}, + {"matrix":[3,15], "x":15.25, "y":3.25}, + {"matrix":[3,16], "x":16.5, "y":3.25}, + {"matrix":[3,17], "x":17.5, "y":3.25}, + {"matrix":[3,18], "x":18.5, "y":3.25}, + + {"matrix":[4,0], "x":0, "y":4.25, "w":1.25}, + {"matrix":[4,1], "x":1.25, "y":4.25}, + {"matrix":[4,2], "x":2.25, "y":4.25}, + {"matrix":[4,3], "x":3.25, "y":4.25}, + {"matrix":[4,4], "x":4.25, "y":4.25}, + {"matrix":[4,5], "x":5.25, "y":4.25}, + {"matrix":[4,6], "x":6.25, "y":4.25}, + {"matrix":[4,7], "x":7.25, "y":4.25}, + {"matrix":[4,8], "x":8.25, "y":4.25}, + {"matrix":[4,9], "x":9.25, "y":4.25}, + {"matrix":[4,10], "x":10.25, "y":4.25}, + {"matrix":[4,11], "x":11.25, "y":4.25}, + {"matrix":[4,12], "x":12.25, "y":4.25, "w":1.75}, + {"matrix":[4,14], "x":14.25, "y":4.25}, + {"matrix":[4,16], "x":16.5, "y":4.25}, + {"matrix":[4,17], "x":17.5, "y":4.25}, + {"matrix":[4,18], "x":18.5, "y":4.25}, + {"matrix":[4,19], "x":19.5, "y":4.25, "h":2}, + + {"matrix":[5,0], "x":0, "y":5.25, "w":1.25}, + {"matrix":[5,1], "x":1.25, "y":5.25, "w":1.25}, + {"matrix":[5,2], "x":2.5, "y":5.25, "w":1.25}, + {"matrix":[5,6], "x":3.75, "y":5.25, "w":6.25}, + {"matrix":[5,10], "x":10, "y":5.25}, + {"matrix":[5,11], "x":11, "y":5.25}, + {"matrix":[5,12], "x":12, "y":5.25}, + {"matrix":[5,13], "x":13.25, "y":5.25}, + {"matrix":[5,14], "x":14.25, "y":5.25}, + {"matrix":[5,15], "x":15.25, "y":5.25}, + {"matrix":[5,16], "x":16.5, "y":5.25, "w":2}, + {"matrix":[5,18], "x":18.5, "y":5.25} + ] + } + } +} diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/config.h b/keyboards/keychron/k17_pro/iso_encoder/rgb/config.h new file mode 100644 index 0000000000..0598bbf108 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/config.h @@ -0,0 +1,49 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 + +#ifdef RGB_MATRIX_ENABLE +/* RGB Matrix Driver Configuration */ +# define DRIVER_COUNT 2 +# define DRIVER_ADDR_1 0b1110111 +# define DRIVER_ADDR_2 0b1110100 + +/* RGB Matrix Configuration */ +# define RGB_MATRIX_LED_COUNT 104 + +/* Set to infinit, which is use in USB mode by default */ +# define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE + +/* Allow to shutdown driver to save power */ +# define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE + +/* Turn off backllit if brightness value is low */ +# define RGB_MATRIX_BRIGHTNESS_TURN_OFF_VAL 48 + +/* Indication led index */ +# define NUM_LOCK_INDEX 34 +# define DIM_CAPS_LOCK +# define CAPS_LOCK_INDEX 56 +# define LOW_BAT_IND_INDEX 95 + +# define RGB_MATRIX_KEYPRESSES +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS + +/* Set LED driver current */ +# define SNLED27351_CURRENT_TUNE \ + { 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 } +#endif diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/info.json b/keyboards/keychron/k17_pro/iso_encoder/rgb/info.json new file mode 100644 index 0000000000..1cc263bbb1 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/info.json @@ -0,0 +1,147 @@ +{ + "usb": { + "pid": "0x0207", + "device_version": "1.0.0" + }, + "features": { + "rgb_matrix": true + }, + "rgb_matrix": { + "driver": "snled27351", + "sleep": true, + "animations": { + "breathing": true, + "band_spiral_val": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_up_down": true, + "rainbow_moving_chevron": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "dual_beacon": true, + "rainbow_beacon": true, + "jellybean_raindrops": true, + "pixel_rain": true, + "typing_heatmap": true, + "digital_rain": true, + "solid_reactive_simple": true, + "solid_reactive_multiwide": true, + "solid_reactive_multinexus": true, + "splash": true, + "solid_splash": true + }, + "layout": [ + {"matrix":[0, 0], "flags":1, "x":0, "y":0}, + {"matrix":[0, 1], "flags":1, "x":12, "y":0}, + {"matrix":[0, 2], "flags":1, "x":23, "y":0}, + {"matrix":[0, 3], "flags":1, "x":35, "y":0}, + {"matrix":[0, 4], "flags":1, "x":47, "y":0}, + {"matrix":[0, 5], "flags":1, "x":58, "y":0}, + {"matrix":[0, 6], "flags":1, "x":70, "y":0}, + {"matrix":[0, 7], "flags":1, "x":82, "y":0}, + {"matrix":[0, 8], "flags":1, "x":93, "y":0}, + {"matrix":[0, 9], "flags":1, "x":105, "y":0}, + {"matrix":[0, 10], "flags":1, "x":117, "y":0}, + {"matrix":[0, 11], "flags":1, "x":128, "y":0}, + {"matrix":[0, 12], "flags":1, "x":140, "y":0}, + {"matrix":[0, 13], "flags":1, "x":152, "y":0}, + {"matrix":[0, 14], "flags":1, "x":163, "y":0}, + {"matrix":[0, 15], "flags":1, "x":176, "y":0}, + {"matrix":[0, 16], "flags":1, "x":189, "y":0}, + {"matrix":[0, 17], "flags":1, "x":201, "y":0}, + {"matrix":[0, 18], "flags":1, "x":212, "y":0}, + + {"matrix":[1, 0], "flags":1, "x":0, "y":14}, + {"matrix":[1, 1], "flags":8, "x":12, "y":14}, + {"matrix":[1, 2], "flags":8, "x":23, "y":14}, + {"matrix":[1, 3], "flags":8, "x":35, "y":14}, + {"matrix":[1, 4], "flags":4, "x":47, "y":14}, + {"matrix":[1, 5], "flags":4, "x":58, "y":14}, + {"matrix":[1, 6], "flags":4, "x":70, "y":14}, + {"matrix":[1, 7], "flags":4, "x":82, "y":14}, + {"matrix":[1, 8], "flags":4, "x":93, "y":14}, + {"matrix":[1, 9], "flags":4, "x":105, "y":14}, + {"matrix":[1, 10], "flags":4, "x":117, "y":14}, + {"matrix":[1, 11], "flags":4, "x":128, "y":14}, + {"matrix":[1, 12], "flags":4, "x":140, "y":14}, + {"matrix":[1, 14], "flags":1, "x":157, "y":14}, + {"matrix":[1, 15], "flags":1, "x":176, "y":14}, + {"matrix":[1, 16], "flags":8, "x":189, "y":14}, + {"matrix":[1, 17], "flags":4, "x":201, "y":14}, + {"matrix":[1, 18], "flags":4, "x":212, "y":14}, + {"matrix":[1, 19], "flags":4, "x":224, "y":14}, + + {"matrix":[2, 0], "flags":1, "x":3, "y":26}, + {"matrix":[2, 1], "flags":4, "x":17, "y":26}, + {"matrix":[2, 2], "flags":4, "x":29, "y":26}, + {"matrix":[2, 3], "flags":4, "x":41, "y":26}, + {"matrix":[2, 4], "flags":4, "x":52, "y":26}, + {"matrix":[2, 5], "flags":4, "x":64, "y":26}, + {"matrix":[2, 6], "flags":4, "x":76, "y":26}, + {"matrix":[2, 7], "flags":4, "x":87, "y":26}, + {"matrix":[2, 8], "flags":4, "x":99, "y":26}, + {"matrix":[2, 9], "flags":4, "x":111, "y":26}, + {"matrix":[2, 10], "flags":4, "x":122, "y":26}, + {"matrix":[2, 11], "flags":4, "x":134, "y":26}, + {"matrix":[2, 12], "flags":4, "x":146, "y":26}, + {"matrix":[2, 15], "flags":1, "x":176, "y":26}, + {"matrix":[2, 16], "flags":4, "x":189, "y":26}, + {"matrix":[2, 17], "flags":4, "x":201, "y":26}, + {"matrix":[2, 18], "flags":4, "x":212, "y":26}, + {"matrix":[2, 19], "flags":4, "x":224, "y":33}, + + {"matrix":[3, 0], "flags":1, "x":4, "y":39}, + {"matrix":[3, 1], "flags":4, "x":20, "y":39}, + {"matrix":[3, 2], "flags":4, "x":32, "y":39}, + {"matrix":[3, 3], "flags":4, "x":44, "y":39}, + {"matrix":[3, 4], "flags":4, "x":55, "y":39}, + {"matrix":[3, 5], "flags":4, "x":67, "y":39}, + {"matrix":[3, 6], "flags":4, "x":79, "y":39}, + {"matrix":[3, 7], "flags":4, "x":90, "y":39}, + {"matrix":[3, 8], "flags":4, "x":102, "y":39}, + {"matrix":[3, 9], "flags":4, "x":114, "y":39}, + {"matrix":[3, 10], "flags":4, "x":125, "y":39}, + {"matrix":[3, 11], "flags":4, "x":137, "y":39}, + {"matrix":[3, 13], "flags":1, "x":149, "y":39}, + {"matrix":[2, 14], "flags":1, "x":162, "y":33}, + {"matrix":[3, 15], "flags":1, "x":176, "y":39}, + {"matrix":[3, 16], "flags":4, "x":189, "y":39}, + {"matrix":[3, 17], "flags":4, "x":201, "y":39}, + {"matrix":[3, 18], "flags":4, "x":212, "y":39}, + + {"matrix":[4, 0], "flags":1, "x":1, "y":51}, + {"matrix":[4, 1], "flags":1, "x":15, "y":51}, + {"matrix":[4, 2], "flags":4, "x":26, "y":51}, + {"matrix":[4, 3], "flags":4, "x":38, "y":51}, + {"matrix":[4, 4], "flags":4, "x":50, "y":51}, + {"matrix":[4, 5], "flags":4, "x":61, "y":51}, + {"matrix":[4, 6], "flags":4, "x":73, "y":51}, + {"matrix":[4, 7], "flags":4, "x":85, "y":51}, + {"matrix":[4, 8], "flags":4, "x":96, "y":51}, + {"matrix":[4, 9], "flags":4, "x":108, "y":51}, + {"matrix":[4, 10], "flags":4, "x":120, "y":51}, + {"matrix":[4, 11], "flags":4, "x":131, "y":51}, + {"matrix":[4, 12], "flags":1, "x":147, "y":51}, + {"matrix":[4, 14], "flags":1, "x":164, "y":51}, + {"matrix":[4, 16], "flags":4, "x":189, "y":51}, + {"matrix":[4, 17], "flags":4, "x":201, "y":51}, + {"matrix":[4, 18], "flags":4, "x":212, "y":51}, + {"matrix":[4, 19], "flags":4, "x":224, "y":58}, + + {"matrix":[5, 0], "flags":1, "x":1, "y":64}, + {"matrix":[5, 1], "flags":1, "x":16, "y":64}, + {"matrix":[5, 2], "flags":1, "x":31, "y":64}, + {"matrix":[5, 6], "flags":4, "x":74, "y":64}, + {"matrix":[5, 10], "flags":1, "x":117, "y":64}, + {"matrix":[5, 11], "flags":1, "x":128, "y":64}, + {"matrix":[5, 12], "flags":1, "x":140, "y":64}, + {"matrix":[5, 13], "flags":1, "x":153, "y":64}, + {"matrix":[5, 14], "flags":1, "x":164, "y":64}, + {"matrix":[5, 15], "flags":1, "x":176, "y":64}, + {"matrix":[5, 16], "flags":4, "x":195, "y":64}, + {"matrix":[5, 18], "flags":4, "x":212, "y":64} + ] + } +} diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/default/keymap.c b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/default/keymap.c new file mode 100644 index 0000000000..49eb6652c2 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_105_iso( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_105_iso( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_105_iso( + KC_ESC, 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_PSCR, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_105_iso( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/default/rules.mk b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/via/keymap.c b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/via/keymap.c new file mode 100644 index 0000000000..4e45471281 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/via/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_105_iso( + KC_ESC, KC_BRID, KC_BRIU, KC_MICT, KC_LAPA, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_105_iso( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_105_iso( + KC_ESC, 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_PSCR, RGB_MOD, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_105_iso( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, _______, _______, _______, _______, RGB_TOG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/via/rules.mk b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/rgb.c b/keyboards/keychron/k17_pro/iso_encoder/rgb/rgb.c new file mode 100644 index 0000000000..153df50326 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/rgb.c @@ -0,0 +1,138 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 "quantum.h" + +// clang-format off +#ifdef RGB_MATRIX_ENABLE +const snled27351_led_t PROGMEM g_snled27351_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to snled27351manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, G_1, I_1, H_1}, + {0, G_2, I_2, H_2}, + {0, G_3, I_3, H_3}, + {0, G_4, I_4, H_4}, + {0, G_5, I_5, H_5}, + {0, G_6, I_6, H_6}, + {0, G_7, I_7, H_7}, + {0, G_8, I_8, H_8}, + {0, G_9, I_9, H_9}, + {0, G_10, I_10, H_10}, + {0, G_11, I_11, H_11}, + {0, G_12, I_12, H_12}, + {0, G_13, I_13, H_13}, + {0, G_14, I_14, H_14}, + {0, G_15, I_15, H_15}, + {0, G_16, I_16, H_16}, + {1, D_8, F_8, E_8}, + {1, D_9, F_9, E_9}, + {1, D_10, F_10, E_10}, + + {0, D_1, F_1, E_1}, + {0, D_2, F_2, E_2}, + {0, D_3, F_3, E_3}, + {0, D_4, F_4, E_4}, + {0, D_5, F_5, E_5}, + {0, D_6, F_6, E_6}, + {0, D_7, F_7, E_7}, + {0, D_8, F_8, E_8}, + {0, D_9, F_9, E_9}, + {0, D_10, F_10, E_10}, + {0, D_11, F_11, E_11}, + {0, D_12, F_12, E_12}, + {0, D_13, F_13, E_13}, + {0, D_15, F_15, E_15}, + {0, D_16, F_16, E_16}, + {0, J_7, L_7, K_7}, + {0, J_8, L_8, K_8}, + {0, J_9, L_9, K_9}, + {0, J_10, L_10, K_10}, + + {0, C_1, A_1, B_1}, + {0, C_2, A_2, B_2}, + {0, C_3, A_3, B_3}, + {0, C_4, A_4, B_4}, + {0, C_5, A_5, B_5}, + {0, C_6, A_6, B_6}, + {0, C_7, A_7, B_7}, + {0, C_8, A_8, B_8}, + {0, C_9, A_9, B_9}, + {0, C_10, A_10, B_10}, + {0, C_11, A_11, B_11}, + {0, C_12, A_12, B_12}, + {0, C_13, A_13, B_13}, + {0, C_16, A_16, B_16}, + {0, J_12, L_12, K_12}, + {0, J_13, L_13, K_13}, + {0, J_14, L_14, K_14}, + {0, J_15, L_15, K_15}, + + {1, G_1, I_1, H_1}, + {1, G_2, I_2, H_2}, + {1, G_3, I_3, H_3}, + {1, G_4, I_4, H_4}, + {1, G_5, I_5, H_5}, + {1, G_6, I_6, H_6}, + {1, G_7, I_7, H_7}, + {1, G_8, I_8, H_8}, + {1, G_9, I_9, H_9}, + {1, G_10, I_10, H_10}, + {1, G_11, I_11, H_11}, + {1, G_12, I_12, H_12}, + {1, G_14, I_14, H_14}, + {0, C_15, A_15, B_15}, + {1, G_16, I_16, H_16}, + {1, J_7, L_7, K_7}, + {1, J_8, L_8, K_8}, + {1, J_9, L_9, K_9}, + + {1, A_1, C_1, B_1}, + {1, A_2, C_2, B_2}, + {1, A_3, C_3, B_3}, + {1, A_4, C_4, B_4}, + {1, A_5, C_5, B_5}, + {1, A_6, C_6, B_6}, + {1, A_7, C_7, B_7}, + {1, A_8, C_8, B_8}, + {1, A_9, C_9, B_9}, + {1, A_10, C_10, B_10}, + {1, A_11, C_11, B_11}, + {1, A_12, C_12, B_12}, + {1, A_13, C_13, B_13}, + {1, A_15, C_15, B_15}, + {1, J_10, L_10, K_10}, + {1, J_11, L_11, K_11}, + {1, J_12, L_12, K_12}, + {1, J_13, L_13, K_13}, + + {1, D_1, F_1, E_1}, + {1, D_2, F_2, E_2}, + {1, D_3, F_3, E_3}, + {1, D_7, F_7, E_7}, + {1, D_11, F_11, E_11}, + {1, D_12, F_12, E_12}, + {1, D_13, F_13, E_13}, + {1, D_14, F_14, E_14}, + {1, D_15, F_15, E_15}, + {1, D_16, F_16, E_16}, + {1, J_14, L_14, K_14}, + {1, J_16, L_16, K_16} +}; +#endif diff --git a/keyboards/keychron/k17_pro/iso_encoder/rgb/rules.mk b/keyboards/keychron/k17_pro/iso_encoder/rgb/rules.mk new file mode 100644 index 0000000000..6e7633bfe0 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/rgb/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/config.h b/keyboards/keychron/k17_pro/iso_encoder/white/config.h new file mode 100644 index 0000000000..d34f0107c0 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/config.h @@ -0,0 +1,50 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 + +#ifdef LED_MATRIX_ENABLE +/* LED Matrix Driver Configuration */ +# define DRIVER_COUNT 1 +# define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND + +/* LED Matrix Configuration */ +# define LED_MATRIX_LED_COUNT 104 + +/* Set to infinit, which is use in USB mode by default */ +# define LED_MATRIX_TIMEOUT LED_MATRIX_TIMEOUT_INFINITE + +/* Allow shutdown of led driver to save power */ +# define LED_MATRIX_DRIVER_SHUTDOWN_ENABLE + +/* Turn off backlight on low brightness to save power */ +# define LED_MATRIX_BRIGHTNESS_TURN_OFF_VAL 48 + +/* Indication led index */ +# define NUM_LOCK_INDEX 34 +# define CAPS_LOCK_INDEX 56 +# define DIM_CAPS_LOCK +# define LOW_BAT_IND_INDEX 95 + +# define LED_MATRIX_KEYPRESSES + +/* Use first 8 channels of LED driver */ +# define PHASE_CHANNEL MSKPHASE_8CHANNEL + +/* Set LED driver current */ +# define SNLED27351_CURRENT_TUNE \ + { 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28 } +#endif diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/info.json b/keyboards/keychron/k17_pro/iso_encoder/white/info.json new file mode 100644 index 0000000000..7226a9e670 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/info.json @@ -0,0 +1,142 @@ +{ + "usb": { + "pid": "0x020A", + "device_version": "1.0.0" + }, + "features": { + "led_matrix": true + }, + "led_matrix": { + "driver": "snled27351", + "sleep": true, + "animations": { + "none": true, + "solid": true, + "breathing": true, + "band_pinwheel": true, + "band_spiral": true, + "cycle_left_right": true, + "cycle_up_down": true, + "cycle_out_in": true, + "dual_beacon": true, + "solid_reactive_simple": true, + "solid_reactive_multiwide": true, + "solid_reactive_multinexus": true, + "solid_splash": true, + "wave_left_right": true, + "wave_up_down": true, + "effect_max": true + }, + "layout": [ + {"matrix":[0, 0], "flags":1, "x":0, "y":0}, + {"matrix":[0, 1], "flags":1, "x":12, "y":0}, + {"matrix":[0, 2], "flags":1, "x":23, "y":0}, + {"matrix":[0, 3], "flags":1, "x":35, "y":0}, + {"matrix":[0, 4], "flags":1, "x":47, "y":0}, + {"matrix":[0, 5], "flags":1, "x":58, "y":0}, + {"matrix":[0, 6], "flags":1, "x":70, "y":0}, + {"matrix":[0, 7], "flags":1, "x":82, "y":0}, + {"matrix":[0, 8], "flags":1, "x":93, "y":0}, + {"matrix":[0, 9], "flags":1, "x":105, "y":0}, + {"matrix":[0, 10], "flags":1, "x":117, "y":0}, + {"matrix":[0, 11], "flags":1, "x":128, "y":0}, + {"matrix":[0, 12], "flags":1, "x":140, "y":0}, + {"matrix":[0, 13], "flags":1, "x":152, "y":0}, + {"matrix":[0, 14], "flags":1, "x":163, "y":0}, + {"matrix":[0, 15], "flags":1, "x":176, "y":0}, + {"matrix":[0, 16], "flags":1, "x":189, "y":0}, + {"matrix":[0, 17], "flags":1, "x":201, "y":0}, + {"matrix":[0, 18], "flags":1, "x":212, "y":0}, + + {"matrix":[1, 0], "flags":1, "x":0, "y":14}, + {"matrix":[1, 1], "flags":8, "x":12, "y":14}, + {"matrix":[1, 2], "flags":8, "x":23, "y":14}, + {"matrix":[1, 3], "flags":8, "x":35, "y":14}, + {"matrix":[1, 4], "flags":4, "x":47, "y":14}, + {"matrix":[1, 5], "flags":4, "x":58, "y":14}, + {"matrix":[1, 6], "flags":4, "x":70, "y":14}, + {"matrix":[1, 7], "flags":4, "x":82, "y":14}, + {"matrix":[1, 8], "flags":4, "x":93, "y":14}, + {"matrix":[1, 9], "flags":4, "x":105, "y":14}, + {"matrix":[1, 10], "flags":4, "x":117, "y":14}, + {"matrix":[1, 11], "flags":4, "x":128, "y":14}, + {"matrix":[1, 12], "flags":4, "x":140, "y":14}, + {"matrix":[1, 14], "flags":1, "x":157, "y":14}, + {"matrix":[1, 15], "flags":1, "x":176, "y":14}, + {"matrix":[1, 16], "flags":8, "x":189, "y":14}, + {"matrix":[1, 17], "flags":4, "x":201, "y":14}, + {"matrix":[1, 18], "flags":4, "x":212, "y":14}, + {"matrix":[1, 19], "flags":4, "x":224, "y":14}, + + {"matrix":[2, 0], "flags":1, "x":3, "y":26}, + {"matrix":[2, 1], "flags":4, "x":17, "y":26}, + {"matrix":[2, 2], "flags":4, "x":29, "y":26}, + {"matrix":[2, 3], "flags":4, "x":41, "y":26}, + {"matrix":[2, 4], "flags":4, "x":52, "y":26}, + {"matrix":[2, 5], "flags":4, "x":64, "y":26}, + {"matrix":[2, 6], "flags":4, "x":76, "y":26}, + {"matrix":[2, 7], "flags":4, "x":87, "y":26}, + {"matrix":[2, 8], "flags":4, "x":99, "y":26}, + {"matrix":[2, 9], "flags":4, "x":111, "y":26}, + {"matrix":[2, 10], "flags":4, "x":122, "y":26}, + {"matrix":[2, 11], "flags":4, "x":134, "y":26}, + {"matrix":[2, 12], "flags":4, "x":146, "y":26}, + {"matrix":[2, 15], "flags":1, "x":176, "y":26}, + {"matrix":[2, 16], "flags":4, "x":189, "y":26}, + {"matrix":[2, 17], "flags":4, "x":201, "y":26}, + {"matrix":[2, 18], "flags":4, "x":212, "y":26}, + {"matrix":[2, 19], "flags":4, "x":224, "y":33}, + + {"matrix":[3, 0], "flags":1, "x":4, "y":39}, + {"matrix":[3, 1], "flags":4, "x":20, "y":39}, + {"matrix":[3, 2], "flags":4, "x":32, "y":39}, + {"matrix":[3, 3], "flags":4, "x":44, "y":39}, + {"matrix":[3, 4], "flags":4, "x":55, "y":39}, + {"matrix":[3, 5], "flags":4, "x":67, "y":39}, + {"matrix":[3, 6], "flags":4, "x":79, "y":39}, + {"matrix":[3, 7], "flags":4, "x":90, "y":39}, + {"matrix":[3, 8], "flags":4, "x":102, "y":39}, + {"matrix":[3, 9], "flags":4, "x":114, "y":39}, + {"matrix":[3, 10], "flags":4, "x":125, "y":39}, + {"matrix":[3, 11], "flags":4, "x":137, "y":39}, + {"matrix":[3, 13], "flags":1, "x":149, "y":39}, + {"matrix":[2, 14], "flags":1, "x":162, "y":33}, + {"matrix":[3, 15], "flags":1, "x":176, "y":39}, + {"matrix":[3, 16], "flags":4, "x":189, "y":39}, + {"matrix":[3, 17], "flags":4, "x":201, "y":39}, + {"matrix":[3, 18], "flags":4, "x":212, "y":39}, + + {"matrix":[4, 0], "flags":1, "x":1, "y":51}, + {"matrix":[4, 1], "flags":1, "x":15, "y":51}, + {"matrix":[4, 2], "flags":4, "x":26, "y":51}, + {"matrix":[4, 3], "flags":4, "x":38, "y":51}, + {"matrix":[4, 4], "flags":4, "x":50, "y":51}, + {"matrix":[4, 5], "flags":4, "x":61, "y":51}, + {"matrix":[4, 6], "flags":4, "x":73, "y":51}, + {"matrix":[4, 7], "flags":4, "x":85, "y":51}, + {"matrix":[4, 8], "flags":4, "x":96, "y":51}, + {"matrix":[4, 9], "flags":4, "x":108, "y":51}, + {"matrix":[4, 10], "flags":4, "x":120, "y":51}, + {"matrix":[4, 11], "flags":4, "x":131, "y":51}, + {"matrix":[4, 12], "flags":1, "x":147, "y":51}, + {"matrix":[4, 14], "flags":1, "x":164, "y":51}, + {"matrix":[4, 16], "flags":4, "x":189, "y":51}, + {"matrix":[4, 17], "flags":4, "x":201, "y":51}, + {"matrix":[4, 18], "flags":4, "x":212, "y":51}, + {"matrix":[4, 19], "flags":4, "x":224, "y":58}, + + {"matrix":[5, 0], "flags":1, "x":1, "y":64}, + {"matrix":[5, 1], "flags":1, "x":16, "y":64}, + {"matrix":[5, 2], "flags":1, "x":31, "y":64}, + {"matrix":[5, 6], "flags":4, "x":74, "y":64}, + {"matrix":[5, 10], "flags":1, "x":117, "y":64}, + {"matrix":[5, 11], "flags":1, "x":128, "y":64}, + {"matrix":[5, 12], "flags":1, "x":140, "y":64}, + {"matrix":[5, 13], "flags":1, "x":153, "y":64}, + {"matrix":[5, 14], "flags":1, "x":164, "y":64}, + {"matrix":[5, 15], "flags":1, "x":176, "y":64}, + {"matrix":[5, 16], "flags":4, "x":195, "y":64}, + {"matrix":[5, 18], "flags":4, "x":212, "y":64} + ] + } +} diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/default/keymap.c b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/default/keymap.c new file mode 100644 index 0000000000..c470ee5984 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_105_iso( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_105_iso( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_105_iso( + KC_ESC, 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_PSCR, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_105_iso( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/default/rules.mk b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/via/keymap.c b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/via/keymap.c new file mode 100644 index 0000000000..ad0d23cd53 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/via/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_105_iso( + KC_ESC, KC_BRID, KC_BRIU, KC_MICT, KC_LAPA, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [MAC_FN] = LAYOUT_105_iso( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + [WIN_BASE] = LAYOUT_105_iso( + KC_ESC, 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_PSCR, BL_STEP, KC_DEL, KC_F13, KC_F14, KC_F15, KC_MUTE, + KC_GRV, 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_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + 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_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NUHS, KC_ENT, KC_HOME, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), + [WIN_FN] = LAYOUT_105_iso( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, BL_TOGG, _______, _______, _______, _______, BL_TOGG, + _______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, BL_STEP, BL_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = {ENCODER_CCW_CW(BL_DOWN, BL_UP)}, +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/via/rules.mk b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/rules.mk b/keyboards/keychron/k17_pro/iso_encoder/white/rules.mk new file mode 100644 index 0000000000..6e7633bfe0 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank diff --git a/keyboards/keychron/k17_pro/iso_encoder/white/white.c b/keyboards/keychron/k17_pro/iso_encoder/white/white.c new file mode 100644 index 0000000000..0409bd22d6 --- /dev/null +++ b/keyboards/keychron/k17_pro/iso_encoder/white/white.c @@ -0,0 +1,136 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 "quantum.h" + +// clang-format off +#ifdef LED_MATRIX_ENABLE +const snled27351_led_t g_snled27351_leds[LED_MATRIX_LED_COUNT] = { +/* Refer to snled27351manual for these locations + * driver + * | LED address + * | | */ + {0, A_1}, + {0, A_2}, + {0, A_3}, + {0, A_4}, + {0, A_5}, + {0, A_6}, + {0, A_7}, + {0, A_8}, + {0, A_9}, + {0, A_10}, + {0, A_11}, + {0, A_12}, + {0, A_13}, + {0, A_14}, + {0, A_15}, + {0, A_16}, + {0, F_8}, + {0, F_9}, + {0, F_10}, + + {0, B_1}, + {0, B_2}, + {0, B_3}, + {0, B_4}, + {0, B_5}, + {0, B_6}, + {0, B_7}, + {0, B_8}, + {0, B_9}, + {0, B_10}, + {0, B_11}, + {0, B_12}, + {0, B_13}, + {0, B_15}, + {0, B_16}, + {0, H_7}, + {0, H_8}, + {0, H_9}, + {0, H_10}, + + {0, C_1}, + {0, C_2}, + {0, C_3}, + {0, C_4}, + {0, C_5}, + {0, C_6}, + {0, C_7}, + {0, C_8}, + {0, C_9}, + {0, C_10}, + {0, C_11}, + {0, C_12}, + {0, C_13}, + {0, C_16}, + {0, H_12}, + {0, H_13}, + {0, H_14}, + {0, H_15}, + + {0, D_1}, + {0, D_2}, + {0, D_3}, + {0, D_4}, + {0, D_5}, + {0, D_6}, + {0, D_7}, + {0, D_8}, + {0, D_9}, + {0, D_10}, + {0, D_11}, + {0, D_12}, + {0, D_14}, + {0, C_15}, + {0, D_16}, + {0, G_7}, + {0, G_8}, + {0, G_9}, + + {0, E_1}, + {0, E_2}, + {0, E_3}, + {0, E_4}, + {0, E_5}, + {0, E_6}, + {0, E_7}, + {0, E_8}, + {0, E_9}, + {0, E_10}, + {0, E_11}, + {0, E_12}, + {0, E_13}, + {0, E_15}, + {0, G_10}, + {0, G_11}, + {0, G_12}, + {0, G_13}, + + {0, F_1}, + {0, F_2}, + {0, F_3}, + {0, F_7}, + {0, F_11}, + {0, F_12}, + {0, F_13}, + {0, F_14}, + {0, F_15}, + {0, F_16}, + {0, G_14}, + {0, G_16}, +}; +#endif diff --git a/keyboards/keychron/k17_pro/k17_pro.c b/keyboards/keychron/k17_pro/k17_pro.c new file mode 100644 index 0000000000..de8d67f656 --- /dev/null +++ b/keyboards/keychron/k17_pro/k17_pro.c @@ -0,0 +1,353 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 "k17_pro.h" +#ifdef KC_BLUETOOTH_ENABLE +# include "ckbt51.h" +# include "bluetooth.h" +# include "indicator.h" +# include "transport.h" +# include "battery.h" +# include "bat_level_animation.h" +# include "lpm.h" +#endif + +#define POWER_ON_LED_DURATION 3000 + +#ifdef ENABLE_FACTORY_TEST +# include "factory_test.h" +#endif + +typedef struct PACKED { + uint8_t len; + uint8_t keycode[3]; +} key_combination_t; + +static uint32_t factory_timer_buffer = 0; +static uint32_t power_on_indicator_timer_buffer = 0; +static uint32_t siri_timer_buffer = 0; +static uint8_t mac_keycode[4] = {KC_LOPT, KC_ROPT, KC_LCMD, KC_RCMD}; + +key_combination_t key_comb_list[4] = { + {2, {KC_LWIN, KC_TAB}}, // Task (win) + {2, {KC_LWIN, KC_E}}, // Files (win) + {3, {KC_LSFT, KC_LGUI, KC_4}}, // Snapshot (mac) + {2, {KC_LWIN, KC_C}} // Cortana (win) +}; + +#ifdef KC_BLUETOOTH_ENABLE +bool firstDisconnect = true; +bool bt_factory_reset = false; +static virtual_timer_t pairing_key_timer; +extern uint8_t g_pwm_buffer[DRIVER_COUNT][192]; + +static void pairing_key_timer_cb(void *arg) { + bluetooth_pairing_ex(*(uint8_t *)arg, NULL); +} +#endif + +bool dip_switch_update_kb(uint8_t index, bool active) { + if (index == 0) { +#ifdef INVERT_OS_SWITCH_STATE + default_layer_set(1UL << (!active ? 0 : 2)); +#else + default_layer_set(1UL << (active ? 0 : 2)); +#endif + } + dip_switch_update_user(index, active); + + return true; +} + +#ifdef KC_BLUETOOTH_ENABLE +bool process_record_kb_bt(uint16_t keycode, keyrecord_t *record) { +#else +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { +#endif + static uint8_t host_idx = 0; + + switch (keycode) { + case KC_MICT: + if (record->event.pressed) { + register_code(KC_MISSION_CONTROL); + } else { + unregister_code(KC_MISSION_CONTROL); + } + return false; // Skip all further processing of this key + case KC_LAPA: + if (record->event.pressed) { + register_code(KC_LAUNCHPAD); + } else { + unregister_code(KC_LAUNCHPAD); + } + return false; // Skip all further processing of this key + case KC_LOPTN: + case KC_ROPTN: + case KC_LCMMD: + case KC_RCMMD: + if (record->event.pressed) { + register_code(mac_keycode[keycode - KC_LOPTN]); + } else { + unregister_code(mac_keycode[keycode - KC_LOPTN]); + } + return false; // Skip all further processing of this key) + case KC_TASK: + case KC_FILE: + case KC_SNAP: + case KC_CTANA: + if (record->event.pressed) { + for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) + register_code(key_comb_list[keycode - KC_TASK].keycode[i]); + } else { + for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) + unregister_code(key_comb_list[keycode - KC_TASK].keycode[i]); + } + return false; // Skip all further processing of this key + case KC_SIRI: + if (record->event.pressed && siri_timer_buffer == 0) { + register_code(KC_LGUI); + register_code(KC_SPACE); + siri_timer_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + } + return false; // Skip all further processing of this key +#ifdef KC_BLUETOOTH_ENABLE + case BT_HST1 ... BT_HST3: + if (get_transport() == TRANSPORT_BLUETOOTH) { + if (record->event.pressed) { + host_idx = keycode - BT_HST1 + 1; + chVTSet(&pairing_key_timer, TIME_MS2I(2000), (vtfunc_t)pairing_key_timer_cb, &host_idx); + bluetooth_connect_ex(host_idx, 0); + } else { + host_idx = 0; + chVTReset(&pairing_key_timer); + } + } + break; + case BAT_LVL: + if (get_transport() == TRANSPORT_BLUETOOTH && !usb_power_connected()) { + bat_level_animiation_start(battery_get_percentage()); + } + break; +#endif + default: +#ifdef FACTORY_RESET_CHECK + FACTORY_RESET_CHECK(keycode, record); +#endif + break; + } + return true; +} + +#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENABLE) +static void encoder_pad_cb(void *param) { + encoder_inerrupt_read((uint32_t)param & 0XFF); +} +#endif + +void keyboard_post_init_kb(void) { + /*pin_t encoders_pad_a1[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_A; + pin_t encoders_pad_b1[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_B; + for (uint8_t i = 0; i < NUM_ENCODERS_MAX_PER_SIDE; i++) { + setPinInput(encoders_pad_a1[i]); + setPinInput(encoders_pad_b1[i]); + }*/ + + dip_switch_read(true); + +#ifdef KC_BLUETOOTH_ENABLE + /* Currently we don't use this reset pin */ + palSetLineMode(CKBT51_RESET_PIN, PAL_MODE_OUTPUT_PUSHPULL); + palWriteLine(CKBT51_RESET_PIN, PAL_HIGH); + + /* IMPORTANT: DO NOT enable internal pull-up resistor + * as there is an external pull-down resistor. + */ + palSetLineMode(USB_BT_MODE_SELECT_PIN, PAL_MODE_INPUT); + + ckbt51_init(false); + bluetooth_init(); + + power_on_indicator_timer_buffer = sync_timer_read32() | 1; + writePin(BAT_LOW_LED_PIN, BAT_LOW_LED_PIN_ON_STATE); + //writePin(LED_CAPS_LOCK_PIN, LED_PIN_ON_STATE); + +# ifdef ENCODER_ENABLE + pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A; + pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B; + for (uint32_t i = 0; i < NUM_ENCODERS; i++) { + palEnableLineEvent(encoders_pad_a[i], PAL_EVENT_MODE_BOTH_EDGES); + palEnableLineEvent(encoders_pad_b[i], PAL_EVENT_MODE_BOTH_EDGES); + palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, (void *)i); + palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, (void *)i); + } +# endif +#endif + + keyboard_post_init_user(); +} + +void matrix_scan_kb(void) { + if (power_on_indicator_timer_buffer) { + if (sync_timer_elapsed32(power_on_indicator_timer_buffer) > POWER_ON_LED_DURATION) { + power_on_indicator_timer_buffer = 0; + + writePin(BAT_LOW_LED_PIN, !BAT_LOW_LED_PIN_ON_STATE); + //if (!host_keyboard_led_state().caps_lock) writePin(LED_CAPS_LOCK_PIN, !LED_PIN_ON_STATE); + } else { + writePin(BAT_LOW_LED_PIN, BAT_LOW_LED_PIN_ON_STATE); + //writePin(LED_CAPS_LOCK_PIN, LED_PIN_ON_STATE); + } + } + + if (factory_timer_buffer && timer_elapsed32(factory_timer_buffer) > 2000) { + factory_timer_buffer = 0; + if (bt_factory_reset) { + bt_factory_reset = false; + palWriteLine(CKBT51_RESET_PIN, PAL_LOW); + wait_ms(5); + palWriteLine(CKBT51_RESET_PIN, PAL_HIGH); + } + } + + if (siri_timer_buffer && sync_timer_elapsed32(siri_timer_buffer) > 500) { + siri_timer_buffer = 0; + unregister_code(KC_LGUI); + unregister_code(KC_SPACE); + } + +#ifdef FACTORY_RESET_TASK + FACTORY_RESET_TASK(); +#endif + matrix_scan_user(); +} + +#ifdef KC_BLUETOOTH_ENABLE +static void ckbt51_param_init(void) { + /* Set bluetooth device name */ + ckbt51_set_local_name(PRODUCT); + wait_ms(10); + /* Set bluetooth parameters */ + module_param_t param = {.event_mode = 0x02, + .connected_idle_timeout = 7200, + .pairing_timeout = 180, + .pairing_mode = 0, + .reconnect_timeout = 5, + .report_rate = 90, + .vendor_id_source = 1, + .verndor_id = 0, // Must be 0x3434 + .product_id = PRODUCT_ID}; + ckbt51_set_param(¶m); + wait_ms(10); +} + +void bluetooth_enter_disconnected_kb(uint8_t host_idx) { + if (bt_factory_reset) { + ckbt51_param_init(); + factory_timer_buffer = timer_read32(); + } + /* CKBT51 bluetooth module boot time is slower, it enters disconnected after boot, + so we place initialization here. */ + if (firstDisconnect && sync_timer_read32() < 1000 && get_transport() == TRANSPORT_BLUETOOTH) { + ckbt51_param_init(); + bluetooth_connect(); + firstDisconnect = false; + } +} + +void ckbt51_default_ack_handler(uint8_t *data, uint8_t len) { + if (data[1] == 0x45) { + module_param_t param = {.event_mode = 0x02, + .connected_idle_timeout = 7200, + .pairing_timeout = 180, + .pairing_mode = 0, + .reconnect_timeout = 5, + .report_rate = 90, + .vendor_id_source = 1, + .verndor_id = 0, // Must be 0x3434 + .product_id = PRODUCT_ID}; + ckbt51_set_param(¶m); + } +} + +void bluetooth_pre_task(void) { + static uint8_t mode = 1; + + if (readPin(USB_BT_MODE_SELECT_PIN) != mode) { + if (readPin(USB_BT_MODE_SELECT_PIN) != mode) { + mode = readPin(USB_BT_MODE_SELECT_PIN); + set_transport(mode == 0 ? TRANSPORT_BLUETOOTH : TRANSPORT_USB); + } + } +} +#endif + +void battery_calculte_voltage(uint16_t value) { + uint16_t voltage = ((uint32_t)value) * 2246 / 1000; + +#ifdef LED_MATRIX_ENABLE + if (led_matrix_is_enabled()) { + uint32_t totalBuf = 0; + + for (uint8_t i = 0; i < DRIVER_COUNT; i++) + for (uint8_t j = 0; j < 192; j++) + totalBuf += g_pwm_buffer[i][j]; + /* We assumpt it is linear relationship*/ + voltage += (30 * totalBuf / LED_MATRIX_LED_COUNT / 255); + } +#endif +#ifdef RGB_MATRIX_ENABLE + if (rgb_matrix_is_enabled()) { + uint32_t totalBuf = 0; + + for (uint8_t i = 0; i < DRIVER_COUNT; i++) + for (uint8_t j = 0; j < 192; j++) + totalBuf += g_pwm_buffer[i][j]; + /* We assumpt it is linear relationship*/ + uint32_t compensation = 60 * totalBuf / RGB_MATRIX_LED_COUNT / 255 / 3; + voltage += compensation; + } +#endif + battery_set_voltage(voltage); +} + +bool via_command_kb(uint8_t *data, uint8_t length) { + switch (data[0]) { +#ifdef KC_BLUETOOTH_ENABLE + case 0xAA: + ckbt51_dfu_rx(data, length); + break; +#endif +#ifdef ENABLE_FACTORY_TEST + case 0xAB: + factory_test_rx(data, length); + break; +#endif + default: + return false; + } + + return true; +} + +#if !defined(VIA_ENABLE) +void raw_hid_receive(uint8_t *data, uint8_t length) { + switch (data[0]) { + case RAW_HID_CMD: + via_command_kb(data, length); + break; + } +} +#endif diff --git a/keyboards/keychron/k17_pro/k17_pro.h b/keyboards/keychron/k17_pro/k17_pro.h new file mode 100644 index 0000000000..e3964296d1 --- /dev/null +++ b/keyboards/keychron/k17_pro/k17_pro.h @@ -0,0 +1,57 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 "quantum.h" +#ifdef VIA_ENABLE +# include "via.h" +#endif + +#define ___ KC_NO +#define KC_MICT QK_KB_0 +#define KC_LAPA QK_KB_1 + +#ifdef VIA_ENABLE +# define USER_START QK_KB_2 +#else +# define USER_START SAFE_RANGE +#endif + +// clang-format off +enum { + KC_LOPTN = USER_START, + KC_ROPTN, + KC_LCMMD, + KC_RCMMD, + KC_TASK, + KC_FILE, + KC_SNAP, + KC_CTANA, + KC_SIRI, +#ifdef KC_BLUETOOTH_ENABLE + BT_HST1, + BT_HST2, + BT_HST3, + BAT_LVL, +#else + BT_HST1 = KC_TRNS, + BT_HST2 = KC_TRNS, + BT_HST3 = KC_TRNS, + BAT_LVL = KC_TRNS, +#endif + NEW_SAFE_RANGE +}; diff --git a/keyboards/keychron/k17_pro/matrix.c b/keyboards/keychron/k17_pro/matrix.c new file mode 100644 index 0000000000..dd2c1f2c4c --- /dev/null +++ b/keyboards/keychron/k17_pro/matrix.c @@ -0,0 +1,212 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * 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 "quantum.h" + +#ifndef HC595_STCP +# define HC595_STCP B0 +#endif +#ifndef HC595_SHCP +# define HC595_SHCP A1 +#endif +#ifndef HC595_DS +# define HC595_DS A7 +#endif + +#ifndef HC595_START_INDEX +# define HC595_START_INDEX 0 +#endif +#ifndef HC595_END_INDEX +# define HC595_END_INDEX 15 +#endif +#ifndef HC595_OFFSET_INDEX +# define HC595_OFFSET_INDEX 0 +#endif + +#if defined(HC595_START_INDEX) && defined(HC595_END_INDEX) +# if ((HC595_END_INDEX - HC595_START_INDEX + 1) > 16) +# define SIZE_T uint32_t +# define UNSELECT_ALL_COL 0xFFFFFFFF +# define SELECT_ALL_COL 0x00000000 +# elif ((HC595_END_INDEX - HC595_START_INDEX + 1) > 8) +# define SIZE_T uint16_t +# define UNSELECT_ALL_COL 0xFFFF +# define SELECT_ALL_COL 0x0000 +# else +# define SIZE_T uint8_t +# define UNSELECT_ALL_COL 0xFF +# define SELECT_ALL_COL 0x00 +# endif +#endif + +pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +static inline uint8_t readMatrixPin(pin_t pin) { + if (pin != NO_PIN) { + return readPin(pin); + } else { + return 1; + } +} + +static inline void setPinOutput_writeLow(pin_t pin) { + setPinOutput(pin); + writePinLow(pin); +} + +static inline void setPinOutput_writeHigh(pin_t pin) { + setPinOutput(pin); + writePinHigh(pin); +} + +static inline void HC595_delay(uint16_t n) { + while (n-- > 0) { + asm volatile("nop" ::: "memory"); + } +} + +static void HC595_output(SIZE_T data, bool bit_flag) { + uint8_t n = 1; + + ATOMIC_BLOCK_FORCEON { + for (uint8_t i = 0; i < (HC595_END_INDEX - HC595_START_INDEX + 1); i++) { + if (data & 0x1) { + writePinHigh(HC595_DS); + } else { + writePinLow(HC595_DS); + } + writePinHigh(HC595_SHCP); + HC595_delay(n); + writePinLow(HC595_SHCP); + HC595_delay(n); + if (bit_flag) { + break; + } else { + data = data >> 1; + } + } + writePinHigh(HC595_STCP); + HC595_delay(n); + writePinLow(HC595_STCP); + HC595_delay(n); + } +} + +static void select_col(uint8_t col) { + if (col < HC595_START_INDEX || col > HC595_END_INDEX) { + setPinOutput_writeLow(col_pins[col]); + } else { + if (col == HC595_START_INDEX) { + HC595_output(0x00, true); + if (col < HC595_OFFSET_INDEX) HC595_output(0x01, true); + } + } +} + +static void unselect_col(uint8_t col) { + if (col < HC595_START_INDEX || col > HC595_END_INDEX) { +#ifdef MATRIX_UNSELECT_DRIVE_HIGH + setPinOutput_writeHigh(col_pins[col]); +#else + setPinInputHigh(col_pins[col]); +#endif + } else { + HC595_output(0x01, true); + } +} + +static void unselect_cols(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + if (col < HC595_START_INDEX || col > HC595_END_INDEX) { +#ifdef MATRIX_UNSELECT_DRIVE_HIGH + setPinOutput_writeHigh(col_pins[col]); +#else + setPinInputHigh(col_pins[col]); +#endif + } else { + if (col == HC595_START_INDEX) HC595_output(UNSELECT_ALL_COL, false); + break; + } + } +} + +void select_all_cols(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + if (col < HC595_START_INDEX || col > HC595_END_INDEX) { + setPinOutput_writeLow(col_pins[col]); + } else { + if (col == HC595_START_INDEX) HC595_output(SELECT_ALL_COL, false); + break; + } + } +} + +static void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter) { + // Select col + select_col(current_col); // select col + HC595_delay(200); + + // For each row... + for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { + // Check row pin state + if (readMatrixPin(row_pins[row_index]) == 0) { + // Pin LO, set col bit + current_matrix[row_index] |= row_shifter; + } else { + // Pin HI, clear col bit + current_matrix[row_index] &= ~row_shifter; + } + } + + // Unselect col + unselect_col(current_col); + HC595_delay(200); // wait for all Row signals to go HIGH +} + +void matrix_init_custom(void) { + setPinOutput(HC595_DS); + setPinOutput(HC595_STCP); + setPinOutput(HC595_SHCP); + + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + if (row_pins[x] != NO_PIN) { + setPinInputHigh(row_pins[x]); + } + } + + unselect_cols(); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + matrix_row_t curr_matrix[MATRIX_ROWS] = {0}; + + // Set col, read rows + matrix_row_t row_shifter = MATRIX_ROW_SHIFTER; + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++, row_shifter <<= 1) { + matrix_read_rows_on_col(curr_matrix, current_col, row_shifter); + } + + bool changed = memcmp(current_matrix, curr_matrix, sizeof(curr_matrix)) != 0; + if (changed) memcpy(current_matrix, curr_matrix, sizeof(curr_matrix)); + + return changed; +} + +void suspend_wakeup_init_kb(void) { + // code will run on keyboard wakeup + clear_keyboard(); +} diff --git a/keyboards/keychron/k17_pro/mcuconf.h b/keyboards/keychron/k17_pro/mcuconf.h new file mode 100644 index 0000000000..882d6bd568 --- /dev/null +++ b/keyboards/keychron/k17_pro/mcuconf.h @@ -0,0 +1,36 @@ +/* Copyright 2023 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include_next + +/* Set HCLK to 48 MHz as tradeoff of USB lowest clockand and + * lower power comsumption for bluetooth. Will use dynamic + * clock when STM32L4 is supported in ChibiOS */ +#undef STM32_PLLM_VALUE +#define STM32_PLLM_VALUE 2 + +#undef STM32_PLLN_VALUE +#define STM32_PLLN_VALUE 12 + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + +#ifdef KC_BLUETOOTH_ENABLE +# undef STM32_SERIAL_USE_USART2 +# define STM32_SERIAL_USE_USART2 TRUE +#endif diff --git a/keyboards/keychron/k17_pro/readme.md b/keyboards/keychron/k17_pro/readme.md new file mode 100644 index 0000000000..9ff527c791 --- /dev/null +++ b/keyboards/keychron/k17_pro/readme.md @@ -0,0 +1,28 @@ +# Keychron K17 Pro + +![Keychron K17 Pro](https://i.imgur.com/6dAZOkp.jpg) + +A wireless custom mechanical 96% keyboard. + +* Keyboard Maintainer: [Keychron](https://github.com/keychron) +* Hardware Supported: Keychron K17 Pro +* Hardware Availability: [Keychron](https://www.keychron.com) + +Make example for this keyboard (after setting up your build environment): + + make keychron/k17_pro/ansi_encoder:default + make keychron/k17_pro/iso_encoder:default + +Flashing example for this keyboard: + + make keychron/k17_pro/ansi_encoder:default:flash + make keychron/k17_pro/iso_encoder:default:flash + +## bootloader + +Enter the bootloader in two ways: + +**Reset Key**: Connect the USB cable, toggle mode switch to "Off", hold down the *Esc* key or reset button underneath space bar, then toggle then switch to "Cable". + + +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/k17_pro/rules.mk b/keyboards/keychron/k17_pro/rules.mk new file mode 100644 index 0000000000..1f9fc1ab58 --- /dev/null +++ b/keyboards/keychron/k17_pro/rules.mk @@ -0,0 +1,7 @@ +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE +OPT_DEFS += -DNO_USB_STARTUP_CHECK -DENABLE_FACTORY_TEST + +SRC += matrix.c + +include keyboards/keychron/bluetooth/bluetooth.mk diff --git a/keyboards/keychron/k17_pro/via_json/k17_pro_ansi_encoder_rgb.json b/keyboards/keychron/k17_pro/via_json/k17_pro_ansi_encoder_rgb.json new file mode 100644 index 0000000000..b83a5408aa --- /dev/null +++ b/keyboards/keychron/k17_pro/via_json/k17_pro_ansi_encoder_rgb.json @@ -0,0 +1,335 @@ +{ + "name": "Keychron K17 Pro ANSI Knob RGB", + "vendorId": "0x3434", + "productId": "0x0206", + "keycodes": ["qmk_lighting"], + "menus": [ + { + "label": "Lighting", + "content": [ + { + "label": "Backlight", + "content": [ + { + "label": "Brightness", + "type": "range", + "options": [0, 255], + "content": ["id_qmk_rgb_matrix_brightness", 3, 1] + }, + { + "label": "Effect", + "type": "dropdown", + "content": ["id_qmk_rgb_matrix_effect", 3, 2], + "options": [ + ["None", 0], + ["Solid Color", 1], + ["Breathing", 2], + ["Band Spiral Val", 3], + ["Cycle All", 4], + ["Cycle Left Right", 5], + ["Cycle Up Down", 6], + ["Rainbow Moving Chevron", 7], + ["Cycle Out In", 8], + ["Cycle Out In Dual", 9], + ["Cycle Pinwheel", 10], + ["Cycle Spiral", 11], + ["Dual Beacon", 12], + ["Rainbow Beacon", 13], + ["Jellybean Raindrops", 14], + ["Pixel Rain", 15], + ["Typing Heatmap", 16], + ["Digital Rain", 17], + ["Reactive Simple", 18], + ["Reactive Multiwide", 19], + ["Reactive Multinexus", 20], + ["Splash", 21], + ["Solid Splash", 22] + ] + }, + { + "showIf": "{id_qmk_rgb_matrix_effect} > 1", + "label": "Effect Speed", + "type": "range", + "options": [0, 255], + "content": ["id_qmk_rgb_matrix_effect_speed", 3, 3] + }, + { + "showIf": "{id_qmk_rgb_matrix_effect} != 0 && ( {id_qmk_rgb_matrix_effect} < 4 || {id_qmk_rgb_matrix_effect} == 18 || ({id_qmk_rgb_matrix_effect} > 17 && {id_qmk_rgb_matrix_effect} != 21) ) ", + "label": "Color", + "type": "color", + "content": ["id_qmk_rgb_matrix_color", 3, 4] + } + ] + } + ] + } + ], + "customKeycodes": [ + {"name": "Misson Control", "title": "Misson Control, availabe in macOS", "shortName": "MCtrl"}, + {"name": "Launch pad", "title": "Launch pad, availabe in macOS", "shortName": "LPad"}, + {"name": "Left Option", "title": "Left Option", "shortName": "LOpt"}, + {"name": "Right Option", "title": "Right Option", "shortName": "ROpt"}, + {"name": "Left Cmd", "title": "Left Command", "shortName": "LCmd"}, + {"name": "Right Cmd", "title": "Right Command", "shortName": "RCmd"}, + {"name": "Task View", "title": "Task View in Windows", "shortName": "Task"}, + {"name": "File Explorer", "title": "File Explorer in Windows", "shortName": "File"}, + {"name": "Screen shot", "title": "Screenshot in macOS", "shortName": "SShot"}, + {"name": "Cortana", "title": "Cortana in Windows", "shortName": "Cortana"}, + {"name": "Siri", "title": "Siri in macOS", "shortName": "Siri"}, + {"name": "Bluetooth Host 1", "title": "Bluetooth Host 1", "shortName": "BTH1"}, + {"name": "Bluetooth Host 2", "title": "Bluetooth Host 2", "shortName": "BTH2"}, + {"name": "Bluetooth Host 3", "title": "Bluetooth Host 3", "shortName": "BTH3"}, + {"name": "Battery Level", "title": "Show battery level", "shortName": "Batt"} + ], + "matrix": {"rows": 6, "cols": 20}, + "layouts": { + "keymap": [ + [ + { + "c": "#777777" + }, + "0,0\nESC", + { + "c": "#cccccc" + }, + "0,1", + "0,2", + "0,3", + "0,4", + { + "c": "#aaaaaa" + }, + "0,5", + "0,6", + "0,7", + "0,8", + "0,9", + { + "c": "#cccccc" + }, + "0,10", + "0,11", + "0,12", + { + "c": "#aaaaaa" + }, + "0,13", + "0,14", + { + "x": 0.25 + }, + "0,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "0,16", + "0,17", + "0,18", + { + "c": "#aaaaaa" + }, + "0,19\n\n\n\n\n\n\n\n\ne0" + ], + [ + { + "y": 0.25 + }, + "1,0", + { + "c": "#cccccc" + }, + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11", + "1,12", + { + "c": "#aaaaaa", + "w": 2 + }, + "1,14", + { + "x": 0.25 + }, + "1,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "1,16", + "1,17", + "1,18", + "1,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.5 + }, + "2,0", + { + "c": "#cccccc" + }, + "2,1", + "2,2", + "2,3", + "2,4", + "2,5", + "2,6", + "2,7", + "2,8", + "2,9", + "2,10", + "2,11", + "2,12", + { + "c": "#aaaaaa", + "w": 1.5 + }, + "2,14", + { + "x": 0.25 + }, + "2,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "2,16", + "2,17", + "2,18", + { + "h": 2 + }, + "2,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.75 + }, + "3,0", + { + "c": "#cccccc" + }, + "3,1", + "3,2", + "3,3", + "3,4", + "3,5", + "3,6", + "3,7", + "3,8", + "3,9", + "3,10", + "3,11", + { + "c": "#777777", + "w": 2.25 + }, + "3,13", + { + "x": 0.25, + "c": "#aaaaaa" + }, + "3,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "3,16", + "3,17", + "3,18" + ], + [ + { + "c": "#aaaaaa", + "w": 2.25 + }, + "4,0", + { + "c": "#cccccc" + }, + "4,2", + "4,3", + "4,4", + "4,5", + "4,6", + "4,7", + "4,8", + "4,9", + "4,10", + "4,11", + { + "c": "#aaaaaa", + "w": 1.75 + }, + "4,13", + { + "x": 0.25, + "c": "#777777" + }, + "4,14", + { + "x": 1.25, + "c": "#cccccc" + }, + "4,16", + "4,17", + "4,18", + { + "h": 2 + }, + "4,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.25 + }, + "5,0", + { + "w": 1.25 + }, + "5,1", + { + "w": 1.25 + }, + "5,2", + { + "c": "#cccccc", + "w": 6.25 + }, + "5,6", + { + "c": "#aaaaaa" + }, + "5,10", + "5,11", + "5,12", + { + "x": 0.25, + "c": "#777777" + }, + "5,13", + "5,14", + "5,15", + { + "x": 0.25, + "c": "#cccccc", + "w": 2 + }, + "5,17", + "5,18" + ] + ] + } +} diff --git a/keyboards/keychron/k17_pro/via_json/k17_pro_ansi_encoder_white.json b/keyboards/keychron/k17_pro/via_json/k17_pro_ansi_encoder_white.json new file mode 100644 index 0000000000..4688123f2a --- /dev/null +++ b/keyboards/keychron/k17_pro/via_json/k17_pro_ansi_encoder_white.json @@ -0,0 +1,274 @@ +{ + "name": "Keychron K17 Pro ANSI Knob White", + "vendorId": "0x3434", + "productId": "0x0209", + "keycodes": ["qmk_lighting"], + "customKeycodes": [ + {"name": "Misson Control", "title": "Misson Control, availabe in macOS", "shortName": "MCtrl"}, + {"name": "Launch pad", "title": "Launch pad, availabe in macOS", "shortName": "LPad"}, + {"name": "Left Option", "title": "Left Option", "shortName": "LOpt"}, + {"name": "Right Option", "title": "Right Option", "shortName": "ROpt"}, + {"name": "Left Cmd", "title": "Left Command", "shortName": "LCmd"}, + {"name": "Right Cmd", "title": "Right Command", "shortName": "RCmd"}, + {"name": "Task View", "title": "Task View in Windows", "shortName": "Task"}, + {"name": "File Explorer", "title": "File Explorer in Windows", "shortName": "File"}, + {"name": "Screen shot", "title": "Screenshot in macOS", "shortName": "SShot"}, + {"name": "Cortana", "title": "Cortana in Windows", "shortName": "Cortana"}, + {"name": "Siri", "title": "Siri in macOS", "shortName": "Siri"}, + {"name": "Bluetooth Host 1", "title": "Bluetooth Host 1", "shortName": "BTH1"}, + {"name": "Bluetooth Host 2", "title": "Bluetooth Host 2", "shortName": "BTH2"}, + {"name": "Bluetooth Host 3", "title": "Bluetooth Host 3", "shortName": "BTH3"}, + {"name": "Battery Level", "title": "Show battery level", "shortName": "Batt"} + ], + "matrix": {"rows": 6, "cols": 20}, + "layouts": { + "keymap": [ + [ + { + "c": "#777777" + }, + "0,0\nESC", + { + "c": "#cccccc" + }, + "0,1", + "0,2", + "0,3", + "0,4", + { + "c": "#aaaaaa" + }, + "0,5", + "0,6", + "0,7", + "0,8", + "0,9", + { + "c": "#cccccc" + }, + "0,10", + "0,11", + "0,12", + { + "c": "#aaaaaa" + }, + "0,13", + "0,14", + { + "x": 0.25 + }, + "0,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "0,16", + "0,17", + "0,18", + { + "c": "#aaaaaa" + }, + "0,19\n\n\n\n\n\n\n\n\ne0" + ], + [ + { + "y": 0.25 + }, + "1,0", + { + "c": "#cccccc" + }, + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11", + "1,12", + { + "c": "#aaaaaa", + "w": 2 + }, + "1,14", + { + "x": 0.25 + }, + "1,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "1,16", + "1,17", + "1,18", + "1,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.5 + }, + "2,0", + { + "c": "#cccccc" + }, + "2,1", + "2,2", + "2,3", + "2,4", + "2,5", + "2,6", + "2,7", + "2,8", + "2,9", + "2,10", + "2,11", + "2,12", + { + "c": "#aaaaaa", + "w": 1.5 + }, + "2,14", + { + "x": 0.25 + }, + "2,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "2,16", + "2,17", + "2,18", + { + "h": 2 + }, + "2,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.75 + }, + "3,0", + { + "c": "#cccccc" + }, + "3,1", + "3,2", + "3,3", + "3,4", + "3,5", + "3,6", + "3,7", + "3,8", + "3,9", + "3,10", + "3,11", + { + "c": "#777777", + "w": 2.25 + }, + "3,13", + { + "x": 0.25, + "c": "#aaaaaa" + }, + "3,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "3,16", + "3,17", + "3,18" + ], + [ + { + "c": "#aaaaaa", + "w": 2.25 + }, + "4,0", + { + "c": "#cccccc" + }, + "4,2", + "4,3", + "4,4", + "4,5", + "4,6", + "4,7", + "4,8", + "4,9", + "4,10", + "4,11", + { + "c": "#aaaaaa", + "w": 1.75 + }, + "4,13", + { + "x": 0.25, + "c": "#777777" + }, + "4,14", + { + "x": 1.25, + "c": "#cccccc" + }, + "4,16", + "4,17", + "4,18", + { + "h": 2 + }, + "4,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.25 + }, + "5,0", + { + "w": 1.25 + }, + "5,1", + { + "w": 1.25 + }, + "5,2", + { + "c": "#cccccc", + "w": 6.25 + }, + "5,6", + { + "c": "#aaaaaa" + }, + "5,10", + "5,11", + "5,12", + { + "x": 0.25, + "c": "#777777" + }, + "5,13", + "5,14", + "5,15", + { + "x": 0.25, + "c": "#cccccc", + "w": 2 + }, + "5,17", + "5,18" + ] + ] + } +} diff --git a/keyboards/keychron/k17_pro/via_json/k17_pro_iso_encoder_rgb.json b/keyboards/keychron/k17_pro/via_json/k17_pro_iso_encoder_rgb.json new file mode 100644 index 0000000000..8ee67c8923 --- /dev/null +++ b/keyboards/keychron/k17_pro/via_json/k17_pro_iso_encoder_rgb.json @@ -0,0 +1,340 @@ +{ + "name": "Keychron K17 Pro ISO Knob RGB", + "vendorId": "0x3434", + "productId": "0x0207", + "keycodes": ["qmk_lighting"], + "menus": [ + { + "label": "Lighting", + "content": [ + { + "label": "Backlight", + "content": [ + { + "label": "Brightness", + "type": "range", + "options": [0, 255], + "content": ["id_qmk_rgb_matrix_brightness", 3, 1] + }, + { + "label": "Effect", + "type": "dropdown", + "content": ["id_qmk_rgb_matrix_effect", 3, 2], + "options": [ + ["None", 0], + ["Solid Color", 1], + ["Breathing", 2], + ["Band Spiral Val", 3], + ["Cycle All", 4], + ["Cycle Left Right", 5], + ["Cycle Up Down", 6], + ["Rainbow Moving Chevron", 7], + ["Cycle Out In", 8], + ["Cycle Out In Dual", 9], + ["Cycle Pinwheel", 10], + ["Cycle Spiral", 11], + ["Dual Beacon", 12], + ["Rainbow Beacon", 13], + ["Jellybean Raindrops", 14], + ["Pixel Rain", 15], + ["Typing Heatmap", 16], + ["Digital Rain", 17], + ["Reactive Simple", 18], + ["Reactive Multiwide", 19], + ["Reactive Multinexus", 20], + ["Splash", 21], + ["Solid Splash", 22] + ] + }, + { + "showIf": "{id_qmk_rgb_matrix_effect} > 1", + "label": "Effect Speed", + "type": "range", + "options": [0, 255], + "content": ["id_qmk_rgb_matrix_effect_speed", 3, 3] + }, + { + "showIf": "{id_qmk_rgb_matrix_effect} != 0 && ( {id_qmk_rgb_matrix_effect} < 4 || {id_qmk_rgb_matrix_effect} == 18 || ({id_qmk_rgb_matrix_effect} > 17 && {id_qmk_rgb_matrix_effect} != 21) ) ", + "label": "Color", + "type": "color", + "content": ["id_qmk_rgb_matrix_color", 3, 4] + } + ] + } + ] + } + ], + "customKeycodes": [ + {"name": "Misson Control", "title": "Misson Control, availabe in macOS", "shortName": "MCtrl"}, + {"name": "Launch pad", "title": "Launch pad, availabe in macOS", "shortName": "LPad"}, + {"name": "Left Option", "title": "Left Option", "shortName": "LOpt"}, + {"name": "Right Option", "title": "Right Option", "shortName": "ROpt"}, + {"name": "Left Cmd", "title": "Left Command", "shortName": "LCmd"}, + {"name": "Right Cmd", "title": "Right Command", "shortName": "RCmd"}, + {"name": "Task View", "title": "Task View in Windows", "shortName": "Task"}, + {"name": "File Explorer", "title": "File Explorer in Windows", "shortName": "File"}, + {"name": "Screen shot", "title": "Screenshot in macOS", "shortName": "SShot"}, + {"name": "Cortana", "title": "Cortana in Windows", "shortName": "Cortana"}, + {"name": "Siri", "title": "Siri in macOS", "shortName": "Siri"}, + {"name": "Bluetooth Host 1", "title": "Bluetooth Host 1", "shortName": "BTH1"}, + {"name": "Bluetooth Host 2", "title": "Bluetooth Host 2", "shortName": "BTH2"}, + {"name": "Bluetooth Host 3", "title": "Bluetooth Host 3", "shortName": "BTH3"}, + {"name": "Battery Level", "title": "Show battery level", "shortName": "Batt"} + ], + "matrix": {"rows": 6, "cols": 20}, + "layouts": { + "keymap": [ + [ + { + "c": "#777777" + }, + "0,0\nESC", + { + "c": "#cccccc" + }, + "0,1", + "0,2", + "0,3", + "0,4", + { + "c": "#aaaaaa" + }, + "0,5", + "0,6", + "0,7", + "0,8", + "0,9", + { + "c": "#cccccc" + }, + "0,10", + "0,11", + "0,12", + { + "c": "#aaaaaa" + }, + "0,13", + "0,14", + { + "x": 0.25 + }, + "0,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "0,16", + "0,17", + "0,18", + { + "c": "#aaaaaa" + }, + "0,19\n\n\n\n\n\n\n\n\ne0" + ], + [ + { + "y": 0.25 + }, + "1,0", + { + "c": "#cccccc" + }, + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11", + "1,12", + { + "c": "#aaaaaa", + "w": 2 + }, + "1,14", + { + "x": 0.25 + }, + "1,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "1,16", + "1,17", + "1,18", + "1,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.5 + }, + "2,0", + { + "c": "#cccccc" + }, + "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, + "c": "#777777", + "w": 1.25, + "h": 2, + "w2": 1.5, + "h2": 1, + "x2": -0.25 + }, + "2,14", + { + "x": 0.25, + "c": "#aaaaaa" + }, + "2,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "2,16", + "2,17", + "2,18", + { + "h": 2 + }, + "2,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.75 + }, + "3,0", + { + "c": "#cccccc" + }, + "3,1", + "3,2", + "3,3", + "3,4", + "3,5", + "3,6", + "3,7", + "3,8", + "3,9", + "3,10", + "3,11", + { + "c": "#aaaaaa" + }, + "3,13", + { + "x": 1.5 + }, + "3,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "3,16", + "3,17", + "3,18" + ], + [ + { + "c": "#aaaaaa", + "w": 1.25 + }, + "4,0", + "4,1", + { + "c": "#cccccc" + }, + "4,2", + "4,3", + "4,4", + "4,5", + "4,6", + "4,7", + "4,8", + "4,9", + "4,10", + "4,11", + { + "c": "#aaaaaa", + "w": 1.75 + }, + "4,12", + { + "x": 0.25, + "c": "#777777" + }, + "4,14", + { + "x": 1.25, + "c": "#cccccc" + }, + "4,16", + "4,17", + "4,18", + { + "h": 2 + }, + "4,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.25 + }, + "5,0", + { + "w": 1.25 + }, + "5,1", + { + "w": 1.25 + }, + "5,2", + { + "c": "#cccccc", + "w": 6.25 + }, + "5,6", + { + "c": "#aaaaaa" + }, + "5,10", + "5,11", + "5,12", + { + "x": 0.25, + "c": "#777777" + }, + "5,13", + "5,14", + "5,15", + { + "x": 0.25, + "c": "#cccccc", + "w": 2 + }, + "5,16", + "5,18" + ] + ] + } +} diff --git a/keyboards/keychron/k17_pro/via_json/k17_pro_iso_encoder_white.json b/keyboards/keychron/k17_pro/via_json/k17_pro_iso_encoder_white.json new file mode 100644 index 0000000000..1775c82435 --- /dev/null +++ b/keyboards/keychron/k17_pro/via_json/k17_pro_iso_encoder_white.json @@ -0,0 +1,279 @@ +{ + "name": "Keychron K17 Pro ISO Knob White", + "vendorId": "0x3434", + "productId": "0x020A", + "keycodes": ["qmk_lighting"], + "customKeycodes": [ + {"name": "Misson Control", "title": "Misson Control, availabe in macOS", "shortName": "MCtrl"}, + {"name": "Launch pad", "title": "Launch pad, availabe in macOS", "shortName": "LPad"}, + {"name": "Left Option", "title": "Left Option", "shortName": "LOpt"}, + {"name": "Right Option", "title": "Right Option", "shortName": "ROpt"}, + {"name": "Left Cmd", "title": "Left Command", "shortName": "LCmd"}, + {"name": "Right Cmd", "title": "Right Command", "shortName": "RCmd"}, + {"name": "Task View", "title": "Task View in Windows", "shortName": "Task"}, + {"name": "File Explorer", "title": "File Explorer in Windows", "shortName": "File"}, + {"name": "Screen shot", "title": "Screenshot in macOS", "shortName": "SShot"}, + {"name": "Cortana", "title": "Cortana in Windows", "shortName": "Cortana"}, + {"name": "Siri", "title": "Siri in macOS", "shortName": "Siri"}, + {"name": "Bluetooth Host 1", "title": "Bluetooth Host 1", "shortName": "BTH1"}, + {"name": "Bluetooth Host 2", "title": "Bluetooth Host 2", "shortName": "BTH2"}, + {"name": "Bluetooth Host 3", "title": "Bluetooth Host 3", "shortName": "BTH3"}, + {"name": "Battery Level", "title": "Show battery level", "shortName": "Batt"} + ], + "matrix": {"rows": 6, "cols": 20}, + "layouts": { + "keymap": [ + [ + { + "c": "#777777" + }, + "0,0\nESC", + { + "c": "#cccccc" + }, + "0,1", + "0,2", + "0,3", + "0,4", + { + "c": "#aaaaaa" + }, + "0,5", + "0,6", + "0,7", + "0,8", + "0,9", + { + "c": "#cccccc" + }, + "0,10", + "0,11", + "0,12", + { + "c": "#aaaaaa" + }, + "0,13", + "0,14", + { + "x": 0.25 + }, + "0,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "0,16", + "0,17", + "0,18", + { + "c": "#aaaaaa" + }, + "0,19\n\n\n\n\n\n\n\n\ne0" + ], + [ + { + "y": 0.25 + }, + "1,0", + { + "c": "#cccccc" + }, + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11", + "1,12", + { + "c": "#aaaaaa", + "w": 2 + }, + "1,14", + { + "x": 0.25 + }, + "1,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "1,16", + "1,17", + "1,18", + "1,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.5 + }, + "2,0", + { + "c": "#cccccc" + }, + "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, + "c": "#777777", + "w": 1.25, + "h": 2, + "w2": 1.5, + "h2": 1, + "x2": -0.25 + }, + "2,14", + { + "x": 0.25, + "c": "#aaaaaa" + }, + "2,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "2,16", + "2,17", + "2,18", + { + "h": 2 + }, + "2,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.75 + }, + "3,0", + { + "c": "#cccccc" + }, + "3,1", + "3,2", + "3,3", + "3,4", + "3,5", + "3,6", + "3,7", + "3,8", + "3,9", + "3,10", + "3,11", + { + "c": "#aaaaaa" + }, + "3,13", + { + "x": 1.5 + }, + "3,15", + { + "x": 0.25, + "c": "#cccccc" + }, + "3,16", + "3,17", + "3,18" + ], + [ + { + "c": "#aaaaaa", + "w": 1.25 + }, + "4,0", + "4,1", + { + "c": "#cccccc" + }, + "4,2", + "4,3", + "4,4", + "4,5", + "4,6", + "4,7", + "4,8", + "4,9", + "4,10", + "4,11", + { + "c": "#aaaaaa", + "w": 1.75 + }, + "4,12", + { + "x": 0.25, + "c": "#777777" + }, + "4,14", + { + "x": 1.25, + "c": "#cccccc" + }, + "4,16", + "4,17", + "4,18", + { + "h": 2 + }, + "4,19" + ], + [ + { + "c": "#aaaaaa", + "w": 1.25 + }, + "5,0", + { + "w": 1.25 + }, + "5,1", + { + "w": 1.25 + }, + "5,2", + { + "c": "#cccccc", + "w": 6.25 + }, + "5,6", + { + "c": "#aaaaaa" + }, + "5,10", + "5,11", + "5,12", + { + "x": 0.25, + "c": "#777777" + }, + "5,13", + "5,14", + "5,15", + { + "x": 0.25, + "c": "#cccccc", + "w": 2 + }, + "5,16", + "5,18" + ] + ] + } +}