Browse Source

Merge remote-tracking branch 'origin/master' into develop

QMK Bot 1 year ago
parent
commit
9208fb5adb

+ 27 - 0
keyboards/cannonkeys/link/config.h

@@ -0,0 +1,27 @@
+/* Copyright 2024 CannonKeys */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#pragma once
+
+/* VBUS-routed pin for upstream detection */
+#define USB_VBUS_PIN GP27
+
+#define	SPLIT_HAND_PIN_LOW_IS_LEFT
+
+// Configure full duplex split comms over PIO
+#define SERIAL_USART_FULL_DUPLEX
+#define SERIAL_USART_TX_PIN GP28
+#define SERIAL_USART_RX_PIN GP29
+#define SERIAL_USART_PIN_SWAP
+
+/* RP2040- and hardware-specific config */
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U
+#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
+
+/* I2C for OLEDs */
+#define I2C_DRIVER I2CD1
+#define I2C1_SDA_PIN GP14
+#define I2C1_SCL_PIN GP15
+
+#define OLED_DISPLAY_64X128

+ 7 - 0
keyboards/cannonkeys/link/halconf.h

@@ -0,0 +1,7 @@
+// Copyright 2024 Andrew Kannan
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#define HAL_USE_I2C TRUE
+#include_next <halconf.h>

+ 135 - 0
keyboards/cannonkeys/link/keyboard.json

@@ -0,0 +1,135 @@
+{
+    "manufacturer": "CannonKeys",
+    "keyboard_name": "Link",
+    "maintainer": "awkannan",
+    "bootloader": "rp2040",
+    "bootmagic": {
+        "matrix": [0, 5]
+    },
+    "build": {
+        "debounce_type": "asym_eager_defer_pk"
+    },
+    "diode_direction": "COL2ROW",
+    "dynamic_keymap": {
+        "layer_count": 6
+    },
+    "encoder": {
+        "rotary": [
+            {"pin_a": "GP12", "pin_b": "GP13", "resolution": 2}
+        ]
+    },
+    "features": {
+        "bootmagic": true,
+        "encoder": true,
+        "extrakey": true,
+        "mousekey": true,
+        "nkro": true,
+        "oled": true
+    },
+    "matrix_pins": {
+        "cols": ["GP17", "GP18", "GP19", "GP20", "GP21", "GP24"],
+        "rows": ["GP25", "GP26", "GP16", "GP11", "GP10"]
+    },
+    "processor": "RP2040",
+    "qmk": {
+        "tap_keycode_delay": 10
+    },
+    "split": {
+        "bootmagic": {
+            "matrix": [5, 5]
+        },
+        "enabled": true,
+        "handedness": {
+            "pin": "GP8"
+        },
+        "matrix_pins": {
+            "right": {
+                "cols": ["GP16", "GP11", "GP10", "GP3", "GP2", "GP1"],
+                "rows": ["GP9", "GP0", "GP17", "GP18", "GP19"]
+            }
+        },
+        "serial": {
+            "driver": "vendor"
+        },
+        "transport": {
+            "sync": {
+                "layer_state": true,
+                "matrix_state": true,
+                "oled": true,
+                "wpm": true
+            }
+        }
+    },
+    "url": "https://cannonkeys.com/",
+    "usb": {
+        "device_version": "0.0.1",
+        "pid": "0x0038",
+        "vid": "0xCA04"
+    },
+    "layouts": {
+        "LAYOUT": {
+            "layout": [
+                {"matrix": [0, 5], "x": 0, "y": 0},
+                {"matrix": [0, 4], "x": 1, "y": 0},
+                {"matrix": [0, 3], "x": 2, "y": 0},
+                {"matrix": [0, 2], "x": 3, "y": 0},
+                {"matrix": [0, 1], "x": 4, "y": 0},
+                {"matrix": [0, 0], "x": 5, "y": 0},
+                {"matrix": [5, 0], "x": 11, "y": 0},
+                {"matrix": [5, 1], "x": 12, "y": 0},
+                {"matrix": [5, 2], "x": 13, "y": 0},
+                {"matrix": [5, 3], "x": 14, "y": 0},
+                {"matrix": [5, 4], "x": 15, "y": 0},
+                {"matrix": [5, 5], "x": 16, "y": 0},
+                {"matrix": [1, 5], "x": 0, "y": 1},
+                {"matrix": [1, 4], "x": 1, "y": 1},
+                {"matrix": [1, 3], "x": 2, "y": 1},
+                {"matrix": [1, 2], "x": 3, "y": 1},
+                {"matrix": [1, 1], "x": 4, "y": 1},
+                {"matrix": [1, 0], "x": 5, "y": 1},
+                {"matrix": [6, 0], "x": 11, "y": 1},
+                {"matrix": [6, 1], "x": 12, "y": 1},
+                {"matrix": [6, 2], "x": 13, "y": 1},
+                {"matrix": [6, 3], "x": 14, "y": 1},
+                {"matrix": [6, 4], "x": 15, "y": 1},
+                {"matrix": [6, 5], "x": 16, "y": 1},
+                {"matrix": [2, 5], "x": 0, "y": 2},
+                {"matrix": [2, 4], "x": 1, "y": 2},
+                {"matrix": [2, 3], "x": 2, "y": 2},
+                {"matrix": [2, 2], "x": 3, "y": 2},
+                {"matrix": [2, 1], "x": 4, "y": 2},
+                {"matrix": [2, 0], "x": 5, "y": 2},
+                {"matrix": [7, 0], "x": 11, "y": 2},
+                {"matrix": [7, 1], "x": 12, "y": 2},
+                {"matrix": [7, 2], "x": 13, "y": 2},
+                {"matrix": [7, 3], "x": 14, "y": 2},
+                {"matrix": [7, 4], "x": 15, "y": 2},
+                {"matrix": [7, 5], "x": 16, "y": 2},
+                {"matrix": [3, 5], "x": 0, "y": 3},
+                {"matrix": [3, 4], "x": 1, "y": 3},
+                {"matrix": [3, 3], "x": 2, "y": 3},
+                {"matrix": [3, 2], "x": 3, "y": 3},
+                {"matrix": [3, 1], "x": 4, "y": 3},
+                {"matrix": [3, 0], "x": 5, "y": 3},
+                {"matrix": [4, 5], "x": 6, "y": 3},
+                {"matrix": [9, 5], "x": 10, "y": 3},
+                {"matrix": [8, 0], "x": 11, "y": 3},
+                {"matrix": [8, 1], "x": 12, "y": 3},
+                {"matrix": [8, 2], "x": 13, "y": 3},
+                {"matrix": [8, 3], "x": 14, "y": 3},
+                {"matrix": [8, 4], "x": 15, "y": 3},
+                {"matrix": [8, 5], "x": 16, "y": 3},
+                {"matrix": [4, 4], "x": 2, "y": 4},
+                {"matrix": [4, 3], "x": 3, "y": 4},
+                {"matrix": [4, 2], "x": 4, "y": 4},
+                {"matrix": [4, 1], "x": 5, "y": 4},
+                {"matrix": [4, 0], "x": 6, "y": 4, "h": 1.5},
+                {"matrix": [9, 0], "x": 10, "y": 4, "h": 1.5},
+                {"matrix": [9, 1], "x": 11, "y": 4},
+                {"matrix": [9, 2], "x": 12, "y": 4},
+                {"matrix": [9, 3], "x": 13, "y": 4},
+                {"matrix": [9, 4], "x": 14, "y": 4}
+            ]
+        }
+    }
+}

+ 31 - 0
keyboards/cannonkeys/link/keymaps/default/keymap.c

@@ -0,0 +1,31 @@
+// Copyright 2025 Andrew Kannan (awkannan)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+[0] = LAYOUT(
+  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_ESC,  KC_Q,    KC_W,    KC_E,    KC_R,  KC_T,                     KC_Y,    KC_U,   KC_I,    KC_O,    KC_P,    KC_BSPC,
+  KC_TAB,  KC_A,    KC_S,    KC_D,    KC_F,  KC_G,                     KC_H,    KC_J,   KC_K,    KC_L,    KC_SCLN, KC_QUOT,
+  KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,  KC_B,   KC_MUTE, KC_MPLY, KC_N,    KC_M,   KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,
+           KC_LGUI, KC_LALT, KC_LCTL, MO(1), KC_ENT,                   KC_SPC,  MO(2),  KC_RCTL, KC_RALT, KC_RGUI
+),
+
+[1] = LAYOUT(
+  KC_TRNS,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,                     KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,
+  KC_GRV,   KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_F12,
+  KC_WREF,  KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC,                   KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE,
+  KC_TRNS,  KC_EQL,  KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_DOT,  KC_COLN, KC_BSLS, KC_TRNS,
+            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+),
+
+[2] = LAYOUT(
+  KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,                    KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
+  QK_BOOT, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,                    KC_PGUP,  KC_HOME,  KC_UP,    KC_END,   KC_INS,  KC_DEL,
+  KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,                    KC_PGDN,  KC_LEFT,  KC_DOWN,  KC_RIGHT, KC_TRNS, KC_TRNS,
+  KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS, KC_CAPS,  KC_PGUP,  KC_MPRV,  KC_MNXT,  KC_PSCR, KC_TRNS,
+           KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,                    KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS
+)
+};

+ 93 - 0
keyboards/cannonkeys/link/link.c

@@ -0,0 +1,93 @@
+// Copyright 2025 Andrew Kannan (awkannan)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "quantum.h"
+
+#ifdef OLED_ENABLE
+oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
+    if (is_keyboard_master()) {
+        return OLED_ROTATION_0;
+    } else {
+        return OLED_ROTATION_90;
+    }
+    return rotation;
+}
+
+static void render_logo(void) {
+    static const char PROGMEM qmk_logo[] = {
+        0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
+        0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
+        0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
+    };
+    oled_write_P(qmk_logo, false);
+}
+
+void print_status_narrow(void) {
+    oled_write_P(PSTR("\n\n"), false);
+    switch (get_highest_layer(layer_state)) {
+        case 0:
+            oled_write_ln_P(PSTR("Qwrt"), false);
+            break;
+        case 1:
+            oled_write_ln_P(PSTR("Clmk"), false);
+            break;
+        default:
+            oled_write_P(PSTR("Mod\n"), false);
+            break;
+    }
+    oled_write_P(PSTR("\n\n"), false);
+    oled_write_ln_P(PSTR("LAYER"), false);
+    switch (get_highest_layer(layer_state)) {
+        case 0:
+        case 1:
+            oled_write_P(PSTR("Base\n"), false);
+            break;
+        case 2:
+            oled_write_P(PSTR("Raise"), false);
+            break;
+        case 3:
+            oled_write_P(PSTR("Lower"), false);
+            break;
+        default:
+            oled_write_ln_P(PSTR("Undef"), false);
+    }
+    oled_write_P(PSTR("\n\n"), false);
+    led_t led_usb_state = host_keyboard_led_state();
+    oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
+}
+
+bool oled_task_kb(void) {
+    if (!oled_task_user()) {
+        return false;
+    }
+    if (is_keyboard_master()) {
+        print_status_narrow();
+    } else {
+        render_logo();
+    }
+    return true;
+}
+
+#endif
+
+#ifdef ENCODER_ENABLE
+bool encoder_update_kb(uint8_t index, bool clockwise) {
+    if (!encoder_update_user(index, clockwise)) {
+        return false;
+    }
+    if (index == 0) {
+        if (clockwise) {
+            tap_code(KC_VOLU);
+        } else {
+            tap_code(KC_VOLD);
+        }
+    } else if (index == 1) {
+        if (clockwise) {
+            tap_code(KC_PGDN);
+        } else {
+            tap_code(KC_PGUP);
+        }
+    }
+    return true;
+}
+#endif

+ 27 - 0
keyboards/cannonkeys/link/readme.md

@@ -0,0 +1,27 @@
+# Link
+
+The Link is a Sofle58 inspired Ergo Split keyboard from CannonKeys.
+It uses 1.3" SH1107 screens and ALPS EC11 compatible encoders.
+
+* Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan)
+* Hardware Supported: RP2040
+* Hardware Availability: [CannonKeys](https://cannonkeys.com)
+
+
+Make example for this keyboard (after setting up your build environment):
+
+    make cannonkeys/link:default
+    
+Flashing example for this keyboard:
+
+    make cannonkeys/link:default:flash
+
+See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
+
+## Bootloader
+
+Enter the bootloader in 3 ways:
+
+* **Bootmagic reset**: Hold down the top-most and outer-most key in the matrix and plug in the keyboard
+* **Physical reset button**: Hold the "BOOTMODE" button on the back of the PCB and briefly press the "RESET" button on the back of the PCB
+* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available