Ver Fonte

Add keyboard Cloak (#24858)

Co-authored-by: jack <jack@pngu.org>
Co-authored-by: Drashna Jaelre <drashna@live.com>
dnlnm há 1 ano atrás
pai
commit
f0a5db96c8

+ 115 - 0
keyboards/dnlnm/cloak/keyboard.json

@@ -0,0 +1,115 @@
+{
+    "manufacturer": "dnlnm",
+    "keyboard_name": "Cloak",
+    "maintainer": "dnlnm",
+    "bootloader": "stm32-dfu",
+    "diode_direction": "COL2ROW",
+    "encoder": {
+        "rotary": [
+            {"pin_a": "A9", "pin_b": "A10", "resolution": 2},
+            {"pin_a": "B4", "pin_b": "B6", "resolution": 2}
+        ]
+    },
+    "features": {
+        "bootmagic": true,
+        "encoder": true,
+        "extrakey": true,
+        "mousekey": true,
+        "nkro": true,
+        "rgblight": true
+    },
+    "matrix_pins": {
+        "cols": ["A8", "B15", "B14", "B13", "B11", "B10", "B2", "B1", "B0", "A7", "A6", "A5", "A4", "B8"],
+        "rows": ["B3", "B12", "A15", "B7", "B9"]
+    },
+    "processor": "STM32F072",
+    "rgblight": {
+        "default": {
+            "on": false
+        },
+        "driver": "ws2812",
+        "layers": {
+            "blink": true,
+            "enabled": true,
+            "override_rgb": true
+        },
+        "led_count": 12
+    },
+    "url": "https://github.com/dnlnm/cloak-xt-stm32",
+    "usb": {
+        "device_version": "1.0.0",
+        "pid": "0xFCD4",
+        "vid": "0x7E7E"
+    },
+    "ws2812": {
+        "pin": "B5"
+    },
+    "layouts": {
+        "LAYOUT": {
+            "layout": [
+                {"matrix": [0, 0], "x": 0, "y": 0},
+                {"matrix": [0, 1], "x": 1.25, "y": 0},
+                {"matrix": [0, 2], "x": 2.25, "y": 0},
+                {"matrix": [0, 3], "x": 3.25, "y": 0},
+                {"matrix": [0, 4], "x": 4.25, "y": 0},
+                {"matrix": [0, 5], "x": 5.63, "y": 0},
+                {"matrix": [0, 6], "x": 6.63, "y": 0},
+                {"matrix": [0, 7], "x": 7.63, "y": 0},
+                {"matrix": [0, 8], "x": 8.63, "y": 0},
+                {"matrix": [0, 9], "x": 10, "y": 0},
+                {"matrix": [0, 10], "x": 11, "y": 0},
+                {"matrix": [0, 11], "x": 12, "y": 0},
+                {"matrix": [0, 12], "x": 13, "y": 0},
+                {"matrix": [0, 13], "x": 14.25, "y": 0},
+                {"matrix": [1, 0], "x": 0, "y": 1.25, "w": 1.5},
+                {"matrix": [1, 1], "x": 1.5, "y": 1.25},
+                {"matrix": [1, 2], "x": 2.5, "y": 1.25},
+                {"matrix": [1, 3], "x": 3.5, "y": 1.25},
+                {"matrix": [1, 4], "x": 4.5, "y": 1.25},
+                {"matrix": [1, 5], "x": 5.5, "y": 1.25},
+                {"matrix": [1, 6], "x": 6.5, "y": 1.25},
+                {"matrix": [1, 7], "x": 7.5, "y": 1.25},
+                {"matrix": [1, 8], "x": 8.5, "y": 1.25},
+                {"matrix": [1, 9], "x": 9.5, "y": 1.25},
+                {"matrix": [1, 10], "x": 10.5, "y": 1.25},
+                {"matrix": [1, 11], "x": 11.5, "y": 1.25},
+                {"matrix": [1, 12], "x": 12.5, "y": 1.25, "w": 1.5},
+                {"matrix": [1, 13], "x": 14.25, "y": 1.25},
+                {"matrix": [2, 0], "x": 0, "y": 2.25, "w": 1.75},
+                {"matrix": [2, 1], "x": 1.75, "y": 2.25},
+                {"matrix": [2, 2], "x": 2.75, "y": 2.25},
+                {"matrix": [2, 3], "x": 3.75, "y": 2.25},
+                {"matrix": [2, 4], "x": 4.75, "y": 2.25},
+                {"matrix": [2, 5], "x": 5.75, "y": 2.25},
+                {"matrix": [2, 6], "x": 6.75, "y": 2.25},
+                {"matrix": [2, 7], "x": 7.75, "y": 2.25},
+                {"matrix": [2, 8], "x": 8.75, "y": 2.25},
+                {"matrix": [2, 9], "x": 9.75, "y": 2.25},
+                {"matrix": [2, 10], "x": 10.75, "y": 2.25},
+                {"matrix": [2, 11], "x": 11.75, "y": 2.25, "w": 2.25},
+                {"matrix": [2, 12], "x": 14.25, "y": 2.25},
+                {"matrix": [3, 0], "x": 0, "y": 3.25, "w": 2.25},
+                {"matrix": [3, 1], "x": 2.25, "y": 3.25},
+                {"matrix": [3, 2], "x": 3.25, "y": 3.25},
+                {"matrix": [3, 3], "x": 4.25, "y": 3.25},
+                {"matrix": [3, 4], "x": 5.25, "y": 3.25},
+                {"matrix": [3, 5], "x": 6.25, "y": 3.25},
+                {"matrix": [3, 6], "x": 7.25, "y": 3.25},
+                {"matrix": [3, 7], "x": 8.25, "y": 3.25},
+                {"matrix": [3, 8], "x": 9.25, "y": 3.25},
+                {"matrix": [3, 9], "x": 10.25, "y": 3.25},
+                {"matrix": [3, 10], "x": 11.25, "y": 3.25},
+                {"matrix": [3, 11], "x": 12.25, "y": 3.25, "w": 1.75},
+                {"matrix": [3, 12], "x": 14.25, "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, "w": 1.25},
+                {"matrix": [4, 6], "x": 3.5, "y": 4.25, "w": 7},
+                {"matrix": [4, 10], "x": 10.5, "y": 4.25, "w": 1.25},
+                {"matrix": [4, 11], "x": 11.75, "y": 4.25},
+                {"matrix": [4, 12], "x": 12.75, "y": 4.25, "w": 1.25},
+                {"matrix": [4, 13], "x": 14.25, "y": 4.25}
+            ]
+        }
+    }
+}

+ 68 - 0
keyboards/dnlnm/cloak/keymaps/default/keymap.c

@@ -0,0 +1,68 @@
+// Copyright (C) 2025 dnlnm
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+    [0] = LAYOUT(
+        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_MPLY,
+        KC_TAB,  KC_Q,    KC_W,    KC_E, KC_R,   KC_T, KC_Y,   KC_U, KC_I,   KC_O,    KC_P,    KC_DEL,  KC_BSPC,    KC_VOLU,
+        KC_CAPS, KC_A,    KC_S,    KC_D, KC_F,   KC_G, KC_H,   KC_J, KC_K,   KC_L,    KC_QUOT,          KC_ENT,     KC_VOLD,
+        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_MUTE,
+        KC_LCTL, KC_LGUI, MO(1),               KC_SPC,                              KC_RALT, KC_RGUI, KC_RCTL,    KC_PSCR),
+
+    [1] = LAYOUT(
+        QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
+        _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+        _______, _______, _______,                            _______,                            _______, _______, _______, _______),
+};
+
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
+    [0] = {ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
+    [1] = {ENCODER_CCW_CW(UG_HUED, UG_HUEU), ENCODER_CCW_CW(UG_SATD, UG_SATU)},
+};
+#endif
+
+#ifdef RGBLIGHT_ENABLE
+
+// Light LEDs 10 & 11 in blue when caps lock is active.
+const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
+    {10, 2, HSV_BLUE}       // Light 4 LEDs, starting with LED 6
+);
+// Light LEDs 0 & 1 in blue when keyboard layer 1 is active
+const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS(
+    {0, 2, HSV_BLUE}
+);
+// Light LEDs 4 & 5 in blue when keyboard layer 2 is active
+const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS(
+    {4, 2, HSV_BLUE}
+);
+
+// Now define the array of layers. Later layers take precedence
+const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
+    my_capslock_layer,
+    my_layer1_layer,    // Overrides caps lock layer
+    my_layer2_layer    // Overrides other layers
+);
+
+void keyboard_post_init_user(void) {
+    // Enable the LED layers
+    rgblight_layers = my_rgb_layers;
+}
+
+bool led_update_user(led_t led_state) {
+    rgblight_set_layer_state(0, led_state.caps_lock);
+    return true;
+}
+
+layer_state_t layer_state_set_user(layer_state_t state) {
+    rgblight_set_layer_state(1, layer_state_cmp(state, 1));
+    rgblight_set_layer_state(2, layer_state_cmp(state, 2));
+    return state;
+}
+
+#endif

+ 1 - 0
keyboards/dnlnm/cloak/keymaps/default/rules.mk

@@ -0,0 +1 @@
+ENCODER_MAP_ENABLE = yes

+ 25 - 0
keyboards/dnlnm/cloak/readme.md

@@ -0,0 +1,25 @@
+# dnlnm/cloak
+
+![dnlnm/cloak](https://i.imgur.com/eZCUPvK.jpeg)
+
+* Keyboard Maintainer: [Daniel Naim](https://github.com/dnlnm)
+* Hardware Supported: Cloak-XT
+* Hardware Availability: https://github.com/dnlnm/cloak-xt-stm32
+
+Make example for this keyboard (after setting up your build environment):
+
+    make dnlnm/cloak:default
+
+Flashing example for this keyboard:
+
+    make dnlnm/cloak:default:flash
+
+See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
+
+## Bootloader
+
+Enter the bootloader in 3 ways:
+
+* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
+* **Physical reset button**: Hold the boot button and tap the reset button on the back of the PCB
+* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available