diff options
author | TerryMathews <terry@terrymathews.net> | 2021-07-20 00:01:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 21:01:36 -0700 |
commit | 9941cf00519349c8487ac18fee92f5114150194a (patch) | |
tree | d6df3cac6ae277f36084736f0a594949690b3b94 /keyboards/tkc/portico | |
parent | 8b0a996d5d4bec0ee5901ee217650d8f432b4f5a (diff) |
[Keyboard] PORTICO: add support for wt_rgb (#13241)
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/tkc/portico')
-rw-r--r-- | keyboards/tkc/portico/config.h | 60 | ||||
-rw-r--r-- | keyboards/tkc/portico/keymaps/default/keymap.c | 20 | ||||
-rw-r--r-- | keyboards/tkc/portico/keymaps/via/keymap.c | 20 | ||||
-rw-r--r-- | keyboards/tkc/portico/portico.c | 2 | ||||
-rw-r--r-- | keyboards/tkc/portico/portico.h | 4 | ||||
-rw-r--r-- | keyboards/tkc/portico/rules.mk | 11 |
6 files changed, 112 insertions, 5 deletions
diff --git a/keyboards/tkc/portico/config.h b/keyboards/tkc/portico/config.h index 4a7da833f7..bd4d096257 100644 --- a/keyboards/tkc/portico/config.h +++ b/keyboards/tkc/portico/config.h @@ -70,4 +70,62 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. # define DRIVER_1_LED_TOTAL 36 # define DRIVER_2_LED_TOTAL 31 # define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) -#endif + +#else +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 67 + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for Dawn60 specifics +#define RGB_BACKLIGHT_PORTICO + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 1 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b1111111111111111 + +// Backlight config starts after VIA's EEPROM usage, +// dynamic keymaps start after this. +#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 31 + +// VIA lighting is handled by the keyboard-level code +#define VIA_CUSTOM_LIGHTING_ENABLE +#endif
\ No newline at end of file diff --git a/keyboards/tkc/portico/keymaps/default/keymap.c b/keyboards/tkc/portico/keymaps/default/keymap.c index bbc68c3b93..3442067011 100644 --- a/keyboards/tkc/portico/keymaps/default/keymap.c +++ b/keyboards/tkc/portico/keymaps/default/keymap.c @@ -17,6 +17,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include QMK_KEYBOARD_H +// RGB-specific keys: +// EF_INC, EF_DEC, // next/previous backlight effect +// H1_INC, H1_DEC, // Color 1 hue increase/decrease +// S1_INC, S1_DEC, // Color 1 saturation increase/decrease +// H2_INC, H2_DEC, // Color 2 hue increase/decrease +// S2_INC, S2_DEC, // Color 2 saturation increase/decrease +// BR_INC, BR_DEC, // backlight brightness increase/decrease + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_65_ansi_blocker( KC_GESC, 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_BSPC, KC_HOME, @@ -25,13 +33,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_UP, KC_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), +#ifdef RGB_BACKLIGHT_PORTICO + [1] = LAYOUT_65_ansi_blocker( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, + _______, EF_INC, EF_DEC, BR_INC, BR_DEC, H1_INC, H1_DEC, S1_INC, S1_DEC, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, + KC_CAPS, _______, _______, _______, _______, H2_INC, H2_DEC, S2_INC, S2_DEC, _______, _______, _______, _______, KC_PGDN, + KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT + ), +#else [1] = LAYOUT_65_ansi_blocker( KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, - KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, KC_PGDN, + KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT ), +#endif [2] = LAYOUT_65_ansi_blocker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/tkc/portico/keymaps/via/keymap.c b/keyboards/tkc/portico/keymaps/via/keymap.c index bbc68c3b93..3442067011 100644 --- a/keyboards/tkc/portico/keymaps/via/keymap.c +++ b/keyboards/tkc/portico/keymaps/via/keymap.c @@ -17,6 +17,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include QMK_KEYBOARD_H +// RGB-specific keys: +// EF_INC, EF_DEC, // next/previous backlight effect +// H1_INC, H1_DEC, // Color 1 hue increase/decrease +// S1_INC, S1_DEC, // Color 1 saturation increase/decrease +// H2_INC, H2_DEC, // Color 2 hue increase/decrease +// S2_INC, S2_DEC, // Color 2 saturation increase/decrease +// BR_INC, BR_DEC, // backlight brightness increase/decrease + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_65_ansi_blocker( KC_GESC, 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_BSPC, KC_HOME, @@ -25,13 +33,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_UP, KC_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), +#ifdef RGB_BACKLIGHT_PORTICO + [1] = LAYOUT_65_ansi_blocker( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, + _______, EF_INC, EF_DEC, BR_INC, BR_DEC, H1_INC, H1_DEC, S1_INC, S1_DEC, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, + KC_CAPS, _______, _______, _______, _______, H2_INC, H2_DEC, S2_INC, S2_DEC, _______, _______, _______, _______, KC_PGDN, + KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT + ), +#else [1] = LAYOUT_65_ansi_blocker( KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, - KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, KC_PGDN, + KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT ), +#endif [2] = LAYOUT_65_ansi_blocker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/tkc/portico/portico.c b/keyboards/tkc/portico/portico.c index e4fd741078..a65a85d242 100644 --- a/keyboards/tkc/portico/portico.c +++ b/keyboards/tkc/portico/portico.c @@ -136,4 +136,4 @@ void rgb_matrix_indicators_kb(void) { rgb_matrix_driver.flush(); } } -#endif +#endif
\ No newline at end of file diff --git a/keyboards/tkc/portico/portico.h b/keyboards/tkc/portico/portico.h index 7add429432..71b28074dd 100644 --- a/keyboards/tkc/portico/portico.h +++ b/keyboards/tkc/portico/portico.h @@ -18,6 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #pragma once #include "quantum.h" +#ifdef RGB_BACKLIGHT_PORTICO +#include "keyboards/wilba_tech/wt_rgb_backlight_keycodes.h" +#include "via.h" +#endif #define XXX KC_NO diff --git a/keyboards/tkc/portico/rules.mk b/keyboards/tkc/portico/rules.mk index 1cbcd95d6a..84a65370e3 100644 --- a/keyboards/tkc/portico/rules.mk +++ b/keyboards/tkc/portico/rules.mk @@ -20,7 +20,16 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output -RGB_MATRIX_ENABLE = yes # Use RGB matrix +RGB_MATRIX_ENABLE = no RGB_MATRIX_DRIVER = IS31FL3731 +CIE1931_CURVE = yes + +# project specific files +SRC += keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c + +QUANTUM_LIB_SRC += i2c_master.c LAYOUTS = 65_ansi_blocker |