Skip to content

Commit

Permalink
Add support for CSTC40 keyboard (#22154)
Browse files Browse the repository at this point in the history
Co-authored-by: jack <[email protected]>
Co-authored-by: lesshonor and waffle87
Co-authored-by: Drashna Jaelre <[email protected]>
Co-authored-by: lesshonor
Co-authored-by: itsvar <[email protected]>
  • Loading branch information
4 people authored Oct 12, 2023
1 parent b630df1 commit c67c9f1
Show file tree
Hide file tree
Showing 15 changed files with 602 additions and 0 deletions.
59 changes: 59 additions & 0 deletions keyboards/kprepublic/cstc40/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2022 Var (@itsvar8)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define I2C1_SDA_PIN B9
#define I2C1_SCL_PIN B8
#define DRIVER_ADDR_1 0b1010000
#define DRIVER_COUNT 1
#define RGB_MATRIX_LED_COUNT 47

#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES

#define ENABLE_RGB_MATRIX_ALPHAS_MODS
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_BREATHING
#define ENABLE_RGB_MATRIX_BAND_SAT
#define ENABLE_RGB_MATRIX_BAND_VAL
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
#define ENABLE_RGB_MATRIX_DUAL_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#define ENABLE_RGB_MATRIX_RAINDROPS
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
#define ENABLE_RGB_MATRIX_HUE_BREATHING
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
#define ENABLE_RGB_MATRIX_HUE_WAVE
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#define ENABLE_RGB_MATRIX_PIXEL_FLOW
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
#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_DISABLE_WHEN_USB_SUSPENDED
71 changes: 71 additions & 0 deletions keyboards/kprepublic/cstc40/daughterboard/daughterboard.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* Copyright 2022 bdtc123
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"

#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, L_1, K_1, J_1 },
{ 0, L_2, K_2, J_2 },
{ 0, L_3, K_3, J_3 },
{ 0, L_4, K_4, J_4 },
{ 0, L_5, K_5, J_5 },
{ 0, L_6, K_6, J_6 },
{ 0, L_7, K_7, J_7 },
{ 0, L_8, K_8, J_8 },
{ 0, L_9, K_9, J_9 },
{ 0, L_10, K_10, J_10 },
{ 0, L_11, K_11, J_11 },
{ 0, L_12, K_12, J_12 },

{ 0, I_1, H_1, G_1 },
{ 0, I_2, H_2, G_2 },
{ 0, I_3, H_3, G_3 },
{ 0, I_4, H_4, G_4 },
{ 0, I_5, H_5, G_5 },
{ 0, I_6, H_6, G_6 },
{ 0, I_7, H_7, G_7 },
{ 0, I_8, H_8, G_8 },
{ 0, I_9, H_9, G_9 },
{ 0, I_10, H_10, G_10 },
{ 0, I_11, H_11, G_11 },
{ 0, I_12, H_12, G_12 },

{ 0, F_1, E_1, D_1 },
{ 0, F_2, E_2, D_2 },
{ 0, F_3, E_3, D_3 },
{ 0, F_4, E_4, D_4 },
{ 0, F_5, E_5, D_5 },
{ 0, F_6, E_6, D_6 },
{ 0, F_7, E_7, D_7 },
{ 0, F_8, E_8, D_8 },
{ 0, F_9, E_9, D_9 },
{ 0, F_10, E_10, D_10 },
{ 0, F_11, E_11, D_11 },
{ 0, F_12, E_12, D_12 },

{ 0, C_1, B_1, A_1 },
{ 0, C_2, B_2, A_2 },
{ 0, C_3, B_3, A_3 },
{ 0, C_4, B_4, A_4 },
{ 0, C_5, B_5, A_5 },
{ 0, C_6, B_6, A_6 },
{ 0, C_8, B_8, A_8 },
{ 0, C_9, B_9, A_9 },
{ 0, C_10, B_10, A_10 },
{ 0, C_11, B_11, A_11 },
{ 0, C_12, B_12, A_12 }
};
#endif
6 changes: 6 additions & 0 deletions keyboards/kprepublic/cstc40/daughterboard/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"matrix_pins": {
"cols": ["B15", "B14", "B13", "B10", "B12", "A5", "C4", "A7", "A15", "C10", "C11", "C0"],
"rows": ["B1", "B0", "C5", "A6"]
}
}
1 change: 1 addition & 0 deletions keyboards/kprepublic/cstc40/daughterboard/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file intentionally left blank
20 changes: 20 additions & 0 deletions keyboards/kprepublic/cstc40/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* 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 3 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 <https://www.gnu.org/licenses/>.
*/
#pragma once

#define HAL_USE_I2C TRUE

#include_next <halconf.h>
130 changes: 130 additions & 0 deletions keyboards/kprepublic/cstc40/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"manufacturer": "kprepublic",
"keyboard_name": "cstc40",
"maintainer": "itsvar8",
"bootloader": "stm32-dfu",
"diode_direction": "ROW2COL",
"debounce": 2,
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
},
"processor": "STM32F401",
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x0040",
"vid": "0x586A"
},
"layouts": {
"LAYOUT_planck_mit": {
"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": [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": [1, 4], "x": 4, "y": 1 },
{ "matrix": [1, 5], "x": 5, "y": 1 },
{ "matrix": [1, 6], "x": 6, "y": 1 },
{ "matrix": [1, 7], "x": 7, "y": 1 },
{ "matrix": [1, 8], "x": 8, "y": 1 },
{ "matrix": [1, 9], "x": 9, "y": 1 },
{ "matrix": [1, 10], "x": 10, "y": 1 },
{ "matrix": [1, 11], "x": 11, "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": [2, 4], "x": 4, "y": 2 },
{ "matrix": [2, 5], "x": 5, "y": 2 },
{ "matrix": [2, 6], "x": 6, "y": 2 },
{ "matrix": [2, 7], "x": 7, "y": 2 },
{ "matrix": [2, 8], "x": 8, "y": 2 },
{ "matrix": [2, 9], "x": 9, "y": 2 },
{ "matrix": [2, 10], "x": 10, "y": 2 },
{ "matrix": [2, 11], "x": 11, "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 },
{ "matrix": [3, 4], "x": 4, "y": 3 },
{ "matrix": [3, 5], "w": 2, "x": 5, "y": 3 },
{ "matrix": [3, 7], "x": 7, "y": 3 },
{ "matrix": [3, 8], "x": 8, "y": 3 },
{ "matrix": [3, 9], "x": 9, "y": 3 },
{ "matrix": [3, 10], "x": 10, "y": 3 },
{ "matrix": [3, 11], "x": 11, "y": 3 }
]
}
},
"rgb_matrix": {
"driver": "is31fl3733",
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 1},
{"matrix": [0, 1], "x": 20, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 40, "y": 0, "flags": 4},
{"matrix": [0, 3], "x": 61, "y": 0, "flags": 4},
{"matrix": [0, 4], "x": 81, "y": 0, "flags": 4},
{"matrix": [0, 5], "x": 101, "y": 0, "flags": 4},
{"matrix": [0, 6], "x": 122, "y": 0, "flags": 4},
{"matrix": [0, 7], "x": 142, "y": 0, "flags": 4},
{"matrix": [0, 8], "x": 162, "y": 0, "flags": 4},
{"matrix": [0, 9], "x": 183, "y": 0, "flags": 4},
{"matrix": [0, 10], "x": 203, "y": 0, "flags": 4},
{"matrix": [0, 11], "x": 224, "y": 0, "flags": 1},
{"matrix": [1, 0], "x": 0, "y": 21, "flags": 1},
{"matrix": [1, 1], "x": 20, "y": 21, "flags": 4},
{"matrix": [1, 2], "x": 40, "y": 21, "flags": 4},
{"matrix": [1, 3], "x": 61, "y": 21, "flags": 4},
{"matrix": [1, 4], "x": 81, "y": 21, "flags": 4},
{"matrix": [1, 5], "x": 101, "y": 21, "flags": 4},
{"matrix": [1, 6], "x": 122, "y": 21, "flags": 4},
{"matrix": [1, 7], "x": 142, "y": 21, "flags": 4},
{"matrix": [1, 8], "x": 162, "y": 21, "flags": 4},
{"matrix": [1, 9], "x": 183, "y": 21, "flags": 4},
{"matrix": [1, 10], "x": 203, "y": 21, "flags": 4},
{"matrix": [1, 11], "x": 224, "y": 21, "flags": 1},
{"matrix": [2, 0], "x": 0, "y": 42, "flags": 1},
{"matrix": [2, 1], "x": 20, "y": 42, "flags": 4},
{"matrix": [2, 2], "x": 40, "y": 42, "flags": 4},
{"matrix": [2, 3], "x": 61, "y": 42, "flags": 4},
{"matrix": [2, 4], "x": 81, "y": 42, "flags": 4},
{"matrix": [2, 5], "x": 101, "y": 42, "flags": 4},
{"matrix": [2, 6], "x": 122, "y": 42, "flags": 4},
{"matrix": [2, 7], "x": 142, "y": 42, "flags": 4},
{"matrix": [2, 8], "x": 162, "y": 42, "flags": 4},
{"matrix": [2, 9], "x": 183, "y": 42, "flags": 4},
{"matrix": [2, 10], "x": 203, "y": 42, "flags": 4},
{"matrix": [2, 11], "x": 224, "y": 42, "flags": 1},
{"matrix": [3, 0], "x": 0, "y": 64, "flags": 1},
{"matrix": [3, 1], "x": 20, "y": 64, "flags": 1},
{"matrix": [3, 2], "x": 40, "y": 64, "flags": 1},
{"matrix": [3, 3], "x": 61, "y": 64, "flags": 1},
{"matrix": [3, 4], "x": 81, "y": 64, "flags": 1},
{"matrix": [3, 5], "x": 111, "y": 64, "flags": 1},
{"matrix": [3, 7], "x": 142, "y": 64, "flags": 1},
{"matrix": [3, 8], "x": 162, "y": 64, "flags": 1},
{"matrix": [3, 9], "x": 183, "y": 64, "flags": 1},
{"matrix": [3, 10], "x": 203, "y": 64, "flags": 1},
{"matrix": [3, 11], "x": 224, "y": 64, "flags": 1}
],
"max_brightness": 200
}
}
94 changes: 94 additions & 0 deletions keyboards/kprepublic/cstc40/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/* Copyright 2023
*
* 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 <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | BLTog| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[0] = LAYOUT_planck_mit(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_ESC, 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
RGB_TOG, KC_LCTL, KC_LALT, KC_LGUI, TL_LOWR, KC_SPC, TL_UPPR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),

/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[1] = LAYOUT_planck_mit(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
_______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),

/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[2] = LAYOUT_planck_mit(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),

/* Adjust (Lower + Raise)
* v------------------------RGB CONTROL--------------------v
* ,-----------------------------------------------------------------------------------.
* | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[3] = LAYOUT_planck_mit(
_______, QK_BOOT, DB_TOGG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)

};
1 change: 1 addition & 0 deletions keyboards/kprepublic/cstc40/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TRI_LAYER_ENABLE = yes
Loading

0 comments on commit c67c9f1

Please sign in to comment.