Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cstc40 #517

Merged
merged 18 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions keyboards/kprepublic/cstc40/daughterboard/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright 2022 Var (@itsvar8)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

/*
* 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

#define FORCE_NKRO
itsvar8 marked this conversation as resolved.
Show resolved Hide resolved

#define I2C1_SDA_PIN B9
#define I2C1_SCL_PIN B8
#define DRIVER_ADDR_1 0b1010000
#define DRIVER_COUNT 1
#define DRIVER_1_LED_TOTAL 47
#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
itsvar8 marked this conversation as resolved.
Show resolved Hide resolved
#define RGB_MATRIX_LED_COUNT DRIVER_1_LED_TOTAL

#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // Limit to vendor-recommended value

itsvar8 marked this conversation as resolved.
Show resolved Hide resolved
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES

// RGB Matrix Animation modes. Explicitly enabled
// For full list of effects, see:
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects

#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_RAIN
//#define ENABLE_RGB_MATRIX_PIXEL_FLOW
//#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL

// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN

// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
#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
115 changes: 115 additions & 0 deletions keyboards/kprepublic/cstc40/daughterboard/daughterboard.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/* 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[DRIVER_LED_TOTAL] = {
itsvar8 marked this conversation as resolved.
Show resolved Hide resolved
{ 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 }
};

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, 28, 29, 30, 31, 32, 33, 34, 35},
{36, 37, 38, 39, 40, 41, NO_LED, 42, 43, 44, 45, 46}
}, {
// LED Index to Physical Position
{ 0, 0}, { 20, 0}, { 40, 0}, {61, 0}, {81, 0}, {101, 0}, {122, 0}, {142, 0}, {162, 0}, {183, 0}, {203, 0}, {224, 0},
{ 0, 21}, { 20, 21}, { 40, 21}, {61, 21}, {81, 21}, {101, 21}, {122, 21}, {142, 21}, {162, 21}, {183, 21}, {203, 21}, {224, 21},
{ 0, 42}, { 20, 42}, { 40, 42}, {61, 42}, {81, 42}, {101, 42}, {122, 42}, {142, 42}, {162, 42}, {183, 42}, {203, 42}, {224, 42},
{ 0, 64}, { 20, 64}, { 40, 64}, {61, 64}, {81, 64}, {111, 64}, {142, 64}, {162, 64}, {183, 64}, {203, 64}, {224, 64},
}, {
// LED Index to Flag
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
}
};
#endif

// Alpha flagged layer indicator
//bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
// for (uint8_t i = led_min; i < led_max; i++) {
// if (g_led_config.flags[i] & LED_FLAG_MODIFIER) {
// switch(get_highest_layer(layer_state|default_layer_state)) {
// case 1:
// rgb_matrix_set_color(i, RGB_ORANGE);
// break;
// case 2:
// rgb_matrix_set_color(i, RGB_PURPLE);
// break;
// case 3:
// rgb_matrix_set_color(i, RGB_RED);
// break;
// default:
// break;
// }
// }
// }
// return false;
//}
itsvar8 marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 20 additions & 0 deletions keyboards/kprepublic/cstc40/daughterboard/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>
80 changes: 80 additions & 0 deletions keyboards/kprepublic/cstc40/daughterboard/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"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
itsvar8 marked this conversation as resolved.
Show resolved Hide resolved
},
"matrix_pins": {
"cols": ["B15", "B14", "B13", "B10", "B12", "A5", "C4", "A7", "A15", "C10", "C11", "C0"],
"rows": ["B1", "B0", "C5", "A6"]
},
itsvar8 marked this conversation as resolved.
Show resolved Hide resolved
"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 }
]
}
}
}
78 changes: 78 additions & 0 deletions keyboards/kprepublic/cstc40/daughterboard/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#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,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)

};
Loading