~ruther/qmk_firmware

462ab3c4d23615b0a80a19b18ab7c69cf8904313 — Colin Kinloch 2 years ago 1b3b142
[Keyboard] Add CXT Studio (#19531)

Co-authored-by: jack <0x6a73@protonmail.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Colin Kinloch <colin.kinloch@collabora.com>
A keyboards/cxt_studio/config.h => keyboards/cxt_studio/config.h +48 -0
@@ 0,0 1,48 @@
// Copyright 2023 Colin Kinloch (@ColinKinloch)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define RGB_MATRIX_LED_COUNT 12
#define RGB_DI_PIN F7

#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_TYPING_HEATMAP

#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS

#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE

#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_SPLASH
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH

#define RGB_MATRIX_TYPING_HEATMAP_SPREAD 9

/*
 * Feature disable options
 *  These options are also useful to firmware size reduction.
 */

/* disable debug print */
//#define NO_DEBUG

/* disable print */
//#define NO_PRINT

/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT

A keyboards/cxt_studio/cxt_studio.c => keyboards/cxt_studio/cxt_studio.c +55 -0
@@ 0,0 1,55 @@
// Copyright 2023 Colin Kinloch (@ColinKinloch)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

static uint8_t anim = 0;

#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) {
        return false;
    }
    switch (index) {
      case 0: {
        if (clockwise) {
            tap_code_delay(KC_VOLU, 10);
        } else {
            tap_code_delay(KC_VOLD, 10);
        }
      }
      break;
      case 1: {
        if (clockwise) {
            rgblight_increase_hue();
        } else {
            rgblight_decrease_hue();
        }
      }
      break;
      case 2: {
        if (clockwise) {
            rgblight_increase_val();
        } else {
            rgblight_decrease_val();
        }
      }
      break;
      case 3: {
        if (clockwise) {
            anim++;
        } else {
            anim--;
        }
	if (anim >= RGB_MATRIX_EFFECT_MAX) {
		anim = 0;
	} else if (anim < 0) {
		anim = RGB_MATRIX_EFFECT_MAX - 1;
	}
	rgblight_mode(anim);
      }
      break;
    }
    return true;
}
#endif

A keyboards/cxt_studio/info.json => keyboards/cxt_studio/info.json +76 -0
@@ 0,0 1,76 @@
{
    "manufacturer": "CXT",
    "keyboard_name": "cxt_studio",
    "maintainer": "ColinKinloch",
    "bootloader": "atmel-dfu",
    "diode_direction": "ROW2COL",
    "features": {
        "bootmagic": true,
        "command": false,
        "console": true,
        "extrakey": true,
        "mousekey": true,
        "nkro": true,
        "encoder": true,
        "rgb_matrix": true
    },
    "matrix_pins": {
        "cols": ["D4", "D7", "B4", "B5"],
        "rows": ["C7", "C6", "D6", "F4"]
    },
    "encoder": {
        "rotary": [
            { "pin_a": "D5", "pin_b": "D3" },
            { "pin_a": "B2", "pin_b": "B3" },
            { "pin_a": "F5", "pin_b": "F6" },
            { "pin_a": "E6", "pin_b": "F0" }
        ]
    },
    "processor": "atmega32u4",
    "rgb_matrix": {
       "driver": "WS2812",
       "layout": [
         { "flags": 4, "matrix": [0, 3], "x": 3, "y": 0 },
         { "flags": 4, "matrix": [0, 2], "x": 2, "y": 0 },
         { "flags": 4, "matrix": [0, 1], "x": 1, "y": 0 },
         { "flags": 4, "matrix": [0, 0], "x": 0, "y": 0 },
         { "flags": 4, "matrix": [1, 0], "x": 0, "y": 1 },
         { "flags": 4, "matrix": [1, 1], "x": 1, "y": 1 },
         { "flags": 4, "matrix": [1, 2], "x": 2, "y": 1 },
         { "flags": 4, "matrix": [1, 3], "x": 3, "y": 1 },
         { "flags": 4, "matrix": [2, 3], "x": 3, "y": 2 },
         { "flags": 4, "matrix": [2, 2], "x": 2, "y": 2 },
         { "flags": 4, "matrix": [2, 1], "x": 1, "y": 2 },
         { "flags": 4, "matrix": [2, 0], "x": 0, "y": 2 }
       ]
    },
    "url": "",
    "usb": {
        "device_version": "1.0.0",
        "pid": "0x0000",
        "vid": "0xFEED"
    },
    "layouts": {
        "LAYOUT": {
            "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": [1, 0], "x": 0, "y": 1 },
                { "matrix": [1, 1], "x": 1, "y": 1 },
                { "matrix": [1, 2], "x": 2, "y": 1 },
                { "matrix": [1, 3], "x": 3, "y": 1 },
                { "matrix": [2, 0], "x": 0, "y": 2 },
                { "matrix": [2, 1], "x": 1, "y": 2 },
                { "matrix": [2, 2], "x": 2, "y": 2 },
                { "matrix": [2, 3], "x": 3, "y": 2 },

                { "matrix": [3, 0], "x": 0, "y": 3 },
                { "matrix": [3, 1], "x": 1, "y": 3 },
                { "matrix": [3, 2], "x": 2, "y": 3 },
                { "matrix": [3, 3], "x": 3, "y": 3 }
            ]
        }
    }
}

A keyboards/cxt_studio/keymaps/default/keymap.json => keyboards/cxt_studio/keymaps/default/keymap.json +13 -0
@@ 0,0 1,13 @@
{
    "keyboard": "cxt_studio",
    "keymap": "default",
    "layout": "LAYOUT",
    "layers": [
        [
            "KC_ESC",  "KC_F11",  "KC_NO",   "KC_MSTP",
            "KC_NO",   "KC_NO",   "KC_MRWD", "KC_MFFD",
            "KC_NO",   "KC_MPLY", "KC_MPLY", "KC_MNXT",
            "KC_MUTE", "KC_NO",   "KC_NO",   "RGB_TOG"
        ]
    ]
}

A keyboards/cxt_studio/readme.md => keyboards/cxt_studio/readme.md +27 -0
@@ 0,0 1,27 @@
# cxt_studio

![cxt_studio](https://i.imgur.com/AMCTioSh.jpeg)

3x4 ortho rgb lighting 4 knobs.

* Keyboard Maintainer: [Colin Kinloch](https://github.com/ColinKinloch)
* Hardware Supported: CXT-Studio
* Hardware Availability: AliExpress. I think the manufacturer is on Taobao.

Make example for this keyboard (after setting up your build environment):

    make cxt_studio:default

Flashing example for this keyboard:

    make cxt_studio: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**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

A keyboards/cxt_studio/rules.mk => keyboards/cxt_studio/rules.mk +1 -0
@@ 0,0 1,1 @@
# This file intentionally left blank