summaryrefslogtreecommitdiff
path: root/keyboards/keychron/q2/iso_encoder
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/keychron/q2/iso_encoder')
-rw-r--r--keyboards/keychron/q2/iso_encoder/config.h8
-rw-r--r--keyboards/keychron/q2/iso_encoder/info.json93
-rw-r--r--keyboards/keychron/q2/iso_encoder/iso_encoder.c33
-rw-r--r--keyboards/keychron/q2/iso_encoder/keymaps/dhertz/keymap.c95
-rw-r--r--keyboards/keychron/q2/iso_encoder/keymaps/dhertz/rules.mk1
-rw-r--r--keyboards/keychron/q2/iso_encoder/rules.mk19
6 files changed, 84 insertions, 165 deletions
diff --git a/keyboards/keychron/q2/iso_encoder/config.h b/keyboards/keychron/q2/iso_encoder/config.h
index 376b92b6fa..b463f7886e 100644
--- a/keyboards/keychron/q2/iso_encoder/config.h
+++ b/keyboards/keychron/q2/iso_encoder/config.h
@@ -17,9 +17,7 @@
#pragma once
/* RGB Matrix Configuration */
-#define DRIVER_1_LED_TOTAL 34
-#define DRIVER_2_LED_TOTAL 34
-#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
+#define RGB_MATRIX_LED_COUNT 68
-/* Encoder used pins */
-#define ENCODER_DEFAULT_POS 0x3
+/* Enable caps-lock LED */
+#define CAPS_LOCK_LED_INDEX 29 \ No newline at end of file
diff --git a/keyboards/keychron/q2/iso_encoder/info.json b/keyboards/keychron/q2/iso_encoder/info.json
index 5030e6be42..b828c88931 100644
--- a/keyboards/keychron/q2/iso_encoder/info.json
+++ b/keyboards/keychron/q2/iso_encoder/info.json
@@ -1,28 +1,91 @@
{
- "keyboard_name": "Q2",
- "manufacturer": "Keychron",
- "url": "https://github.com/Keychron",
- "maintainer": "lalalademaxiya1",
"usb": {
- "vid": "0x3434",
"pid": "0x0113",
"device_version": "1.0.0"
},
- "rgb_matrix": {
- "driver": "ckled2001"
- },
- "matrix_pins": {
- "cols": ["C14", "C15", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "B0", "B1", "A8", "A9", "H3"],
- "rows": ["B4", "B3", "A15", "A14", "A13"]
- },
- "diode_direction": "ROW2COL",
"encoder": {
+ "enabled": true,
"rotary": [
{"pin_a": "A10", "pin_b": "B5"}
]
},
- "processor": "STM32L432",
- "bootloader": "stm32-dfu",
+ "rgb_matrix": {
+ "layout": [
+ {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1},
+ {"matrix": [0, 1], "x": 15, "y": 0, "flags": 4},
+ {"matrix": [0, 2], "x": 29, "y": 0, "flags": 4},
+ {"matrix": [0, 3], "x": 44, "y": 0, "flags": 4},
+ {"matrix": [0, 4], "x": 59, "y": 0, "flags": 4},
+ {"matrix": [0, 5], "x": 73, "y": 0, "flags": 4},
+ {"matrix": [0, 6], "x": 88, "y": 0, "flags": 4},
+ {"matrix": [0, 7], "x": 103, "y": 0, "flags": 4},
+ {"matrix": [0, 8], "x": 118, "y": 0, "flags": 4},
+ {"matrix": [0, 9], "x": 132, "y": 0, "flags": 4},
+ {"matrix": [0, 10], "x": 147, "y": 0, "flags": 4},
+ {"matrix": [0, 11], "x": 162, "y": 0, "flags": 4},
+ {"matrix": [0, 12], "x": 176, "y": 0, "flags": 4},
+ {"matrix": [0, 13], "x": 198, "y": 0, "flags": 1},
+ {"matrix": [0, 14], "x": 224, "y": 0, "flags": 1},
+
+ {"matrix": [1, 0], "x": 4, "y": 15, "flags": 1},
+ {"matrix": [1, 1], "x": 22, "y": 15, "flags": 4},
+ {"matrix": [1, 2], "x": 37, "y": 15, "flags": 4},
+ {"matrix": [1, 3], "x": 51, "y": 15, "flags": 4},
+ {"matrix": [1, 4], "x": 66, "y": 15, "flags": 4},
+ {"matrix": [1, 5], "x": 81, "y": 15, "flags": 4},
+ {"matrix": [1, 6], "x": 95, "y": 15, "flags": 4},
+ {"matrix": [1, 7], "x": 110, "y": 15, "flags": 4},
+ {"matrix": [1, 8], "x": 125, "y": 15, "flags": 4},
+ {"matrix": [1, 9], "x": 140, "y": 15, "flags": 4},
+ {"matrix": [1, 10], "x": 154, "y": 15, "flags": 4},
+ {"matrix": [1, 11], "x": 169, "y": 15, "flags": 4},
+ {"matrix": [1, 12], "x": 184, "y": 15, "flags": 4},
+ {"matrix": [1, 14], "x": 224, "y": 15, "flags": 1},
+
+ {"matrix": [2, 0], "x": 6, "y": 30, "flags": 1},
+ {"matrix": [2, 1], "x": 26, "y": 30, "flags": 4},
+ {"matrix": [2, 2], "x": 40, "y": 30, "flags": 4},
+ {"matrix": [2, 3], "x": 55, "y": 30, "flags": 4},
+ {"matrix": [2, 4], "x": 70, "y": 30, "flags": 4},
+ {"matrix": [2, 5], "x": 84, "y": 30, "flags": 4},
+ {"matrix": [2, 6], "x": 99, "y": 30, "flags": 4},
+ {"matrix": [2, 7], "x": 114, "y": 30, "flags": 4},
+ {"matrix": [2, 8], "x": 129, "y": 30, "flags": 4},
+ {"matrix": [2, 9], "x": 143, "y": 30, "flags": 4},
+ {"matrix": [2, 10], "x": 158, "y": 30, "flags": 4},
+ {"matrix": [2, 11], "x": 173, "y": 30, "flags": 4},
+ {"matrix": [2, 13], "x": 187, "y": 30, "flags": 4},
+ {"matrix": [1, 13], "x": 204, "y": 23, "flags": 1},
+ {"matrix": [2, 14], "x": 224, "y": 30, "flags": 1},
+
+ {"matrix": [3, 0], "x": 9, "y": 45, "flags": 1},
+ {"matrix": [3, 1], "x": 18, "y": 45, "flags": 4},
+ {"matrix": [3, 2], "x": 33, "y": 45, "flags": 4},
+ {"matrix": [3, 3], "x": 48, "y": 45, "flags": 4},
+ {"matrix": [3, 4], "x": 62, "y": 45, "flags": 4},
+ {"matrix": [3, 5], "x": 77, "y": 45, "flags": 4},
+ {"matrix": [3, 6], "x": 92, "y": 45, "flags": 4},
+ {"matrix": [3, 7], "x": 106, "y": 45, "flags": 4},
+ {"matrix": [3, 8], "x": 121, "y": 45, "flags": 4},
+ {"matrix": [3, 9], "x": 136, "y": 45, "flags": 4},
+ {"matrix": [3, 10], "x": 151, "y": 45, "flags": 4},
+ {"matrix": [3, 11], "x": 165, "y": 45, "flags": 4},
+ {"matrix": [3, 13], "x": 185, "y": 45, "flags": 1},
+ {"matrix": [3, 14], "x": 209, "y": 49, "flags": 1},
+
+ {"matrix": [4, 0], "x": 2, "y": 60, "flags": 1},
+ {"matrix": [4, 1], "x": 20, "y": 60, "flags": 1},
+ {"matrix": [4, 2], "x": 39, "y": 60, "flags": 1},
+ {"matrix": [4, 6], "x": 94, "y": 60, "flags": 4},
+ {"matrix": [4, 10], "x": 147, "y": 60, "flags": 1},
+ {"matrix": [4, 11], "x": 162, "y": 60, "flags": 1},
+ {"matrix": [4, 12], "x": 176, "y": 60, "flags": 1},
+ {"matrix": [4, 13], "x": 195, "y": 64, "flags": 1},
+ {"matrix": [2, 12], "x": 209, "y": 64, "flags": 1},
+ {"matrix": [4, 14], "x": 224, "y": 64, "flags": 1}
+
+ ]
+ },
"layouts": {
"LAYOUT_iso_68": {
"layout": [
diff --git a/keyboards/keychron/q2/iso_encoder/iso_encoder.c b/keyboards/keychron/q2/iso_encoder/iso_encoder.c
index 1f2c76468e..a54c90bc4b 100644
--- a/keyboards/keychron/q2/iso_encoder/iso_encoder.c
+++ b/keyboards/keychron/q2/iso_encoder/iso_encoder.c
@@ -17,8 +17,8 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
-const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = {
-/* Refer to IS31 manual for these locations
+const snled27351_led_t PROGMEM g_snled27351_leds[RGB_MATRIX_LED_COUNT] = {
+/* Refer to SNLED27351 manual for these locations
* driver
* | R location
* | | G location
@@ -98,33 +98,4 @@ const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = {
{1, F_16, D_16, E_16}
};
-#define __ NO_LED
-
-led_config_t g_led_config = {
- {
- // Key Matrix to LED Index
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
- { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 42, 28 },
- { 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 66, 41, 43 },
- { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, __, 56, 57 },
- { 58, 59, 60, __, __, __, 61, __, __, __, 62, 63, 64, 65, 67 }
- },
- {
- // LED Index to Physical Position
- {0,0}, {15,0}, {29,0}, {44,0}, {59,0}, {73,0}, {88,0}, {103,0}, {118,0}, {132,0}, {147,0}, {162,0}, {176,0}, {198,0}, {224,0},
- {4,15}, {22,15}, {37,15}, {51,15}, {66,15}, {81,15}, {95,15}, {110,15}, {125,15}, {140,15}, {154,15}, {169,15}, {184,15}, {224,15},
- {6,30}, {26,30}, {40,30}, {55,30}, {70,30}, {84,30}, {99,30}, {114,30}, {129,30}, {143,30}, {158,30}, {173,30}, {187,30}, {204,23}, {224,30},
- {2,45}, {18,45}, {33,45}, {48,45}, {62,45}, {77,45}, {92,45}, {106,45}, {121,45}, {136,45}, {151,45}, {165,45}, {185,45}, {209,49},
- {2,60}, {20,60}, {39,60}, {94,60}, {147,60}, {162,60}, {176,60}, {195,64}, {209,64}, {224,64}
- },
- {
- // RGB LED Index to Flag
- 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
- 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
- 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
- 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
- 1, 1, 1, 4, 1, 1, 1, 1, 1, 1
- }
-};
-
#endif // RGB_MATRIX_ENABLE
diff --git a/keyboards/keychron/q2/iso_encoder/keymaps/dhertz/keymap.c b/keyboards/keychron/q2/iso_encoder/keymaps/dhertz/keymap.c
deleted file mode 100644
index 0d4f7e6a22..0000000000
--- a/keyboards/keychron/q2/iso_encoder/keymaps/dhertz/keymap.c
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2022 Dan Hertz (@dhertz)
-// SPDX-License-Identifier: GPL-3.0
-
-#include QMK_KEYBOARD_H
-#include "dhertz.h"
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- /* Layer 0: Default Layer
- * ,---------------------------------------------------------------.
- * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp|( )|
- * |---------------------------------------------------------------|
- * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Enter|Del|
- * |------------------------------------------------------` |---|
- * |SrCtl | A| S| D| F| G| H| J| K| L| ;| '| \| |Hom|
- * |---------------------------------------------------------------|
- * |Shif| #| Z| X| C| V| B| N| M| ,| .| /|Shift |Up | |
- * |---------------------------------------------------------------|
- * |NcCtl| Alt| CTab| LyrSpc |CGv|Alt|CSL|Lef|Dow|Rig|
- * `---------------------------------------------------------------'
- */
- [0] = LAYOUT_iso_68(
- KC_ESC, 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_MUTE,
- 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_DEL,
- SRCH_CTL, 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_LSFT, HSH_TLD, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
- NC_CTL, KC_LALT, CMD_TAB_CMD, LYR_SPC, CMD_GRV_CMD, KC_RALT, CMD_SFT_ALT_A, KC_LEFT, KC_DOWN, KC_RIGHT
- ),
- /* Layer 1: Special
- * ,---------------------------------------------------------------.
- * | ยง| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |( )|
- * |---------------------------------------------------------------|
- * | | | | | | | | | | | | | | | |
- * |------------------------------------------------------` |---|
- * | | | | | | | | | |CSL| | | `| | |
- * |---------------------------------------------------------------|
- * | | `| | |CAC| | | | | | | | |PgU| |
- * |---------------------------------------------------------------|
- * | | | | | | | |Hom|PgD|End|
- * `---------------------------------------------------------------'
- */
- [1] = LAYOUT_iso_68(
- KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F10, KC_F11, KC_TRNS, CMD_SFT_A,
- KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
- KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CMD_SFT_L, KC_TRNS, KC_TRNS, KC_NUBS, KC_TRNS, KC_END,
- KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, CMD_ALT_C, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,
- KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END
- ),
-};
-
-void keyboard_post_init_user(void) {
- rgb_matrix_mode(RGB_MATRIX_NONE);
- rgb_matrix_set_color_all(RGB_BLACK);
-}
-
-uint32_t cancel_cmd(uint32_t trigger_time, void *cb_arg) {
- if (get_highest_layer(layer_state|default_layer_state) > 0) {
- return 20;
- }
- unregister_code(KC_LCMD);
- return 0;
-}
-
-bool encoder_update_user(uint8_t index, bool clockwise) {
- if (get_highest_layer(layer_state|default_layer_state) == 0) {
- if (clockwise) {
- tap_code_delay(KC_VOLU, 10);
- } else {
- tap_code_delay(KC_VOLD, 10);
- }
- } else {
- if ((get_mods() & MOD_BIT(KC_LCMD)) != MOD_BIT(KC_LCMD)) {
- register_code(KC_LCMD);
- defer_exec(20, cancel_cmd, NULL);
- }
- if (clockwise) {
- tap_code(KC_TAB);
- } else {
- tap_code16(S(KC_TAB));
- }
- }
- return false;
-}
-
-bool rgb_matrix_indicators_user(void) {
- switch(get_highest_layer(layer_state|default_layer_state)) {
- case 1:
- rgb_matrix_set_color_all(RGB_BLACK);
- rgb_matrix_set_color_all(25, 25, 112);
- break;
- default:
- rgb_matrix_set_color_all(RGB_BLACK);
- break;
- }
- return false;
-}
diff --git a/keyboards/keychron/q2/iso_encoder/keymaps/dhertz/rules.mk b/keyboards/keychron/q2/iso_encoder/keymaps/dhertz/rules.mk
deleted file mode 100644
index 199bad85f3..0000000000
--- a/keyboards/keychron/q2/iso_encoder/keymaps/dhertz/rules.mk
+++ /dev/null
@@ -1 +0,0 @@
-DEFERRED_EXEC_ENABLE = yes
diff --git a/keyboards/keychron/q2/iso_encoder/rules.mk b/keyboards/keychron/q2/iso_encoder/rules.mk
index aba76c0944..7ff128fa69 100644
--- a/keyboards/keychron/q2/iso_encoder/rules.mk
+++ b/keyboards/keychron/q2/iso_encoder/rules.mk
@@ -1,18 +1 @@
-# Build Options
-# change yes to no to disable
-#
-BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
-MOUSEKEY_ENABLE = no # Mouse keys
-EXTRAKEY_ENABLE = yes # Audio control and System control
-CONSOLE_ENABLE = no # Console for debug
-COMMAND_ENABLE = no # Commands for debug and configuration
-NKRO_ENABLE = yes # Enable N-Key Rollover
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
-AUDIO_ENABLE = no # Audio output
-ENCODER_ENABLE = yes # Enable Encoder
-DIP_SWITCH_ENABLE = yes
-RGB_MATRIX_ENABLE = yes
-EEPROM_DRIVER = wear_leveling
-WEAR_LEVELING_DRIVER = embedded_flash
-
+# This file intentionally left blank \ No newline at end of file