Skip to content

Commit

Permalink
[Keyboard] Add RK61 RGB dual mode & RK68 RGB dual mode keyboards (#363)
Browse files Browse the repository at this point in the history
* Added support for RK61-RGB

* Added readme.md

* Fixed some typos.

* Minor changes to VIA keymap

* Added support for RK68 (RK855) with VID 0C45 and PID 024F or 8008

* Moved RESET to Fn+CTRL on RK61-RGB

* Corrected RGB LED pin order

* Updated readme.md file

* Moved readme.md images to cloud

* Keymap changes

* Moved RGB coords and flags into info.json

* Removed unnecessary define for maximum brightness (default value is identical)

* Update keyboards/royal_kludge/rk61_rgb/config_led.h

Removed outdated defines not needed.

Co-authored-by: dexter93 <d3xter93@gmail.com>

* Removed outdated defines not needed.

* Removed NKRO force option

* Removed leftover flag

* Updated license header and added missing one

* Removed empty VIA layers as they are automatically added.

* Update keyboards/royal_kludge/rk61_rgb/config_led.h

Removed obsolete flags.

Co-authored-by: dexter93 <d3xter93@gmail.com>

* Moved Led coords and flags into info.json

* Cleanup

* Moved _user function into keymaps. Small corrections

* More cleanup

* Update keyboards/royal_kludge/rk68_rgb/rules.mk

removing file no longer needed

Co-authored-by: dexter93 <d3xter93@gmail.com>

* Code cleanup

* Moved layout limits into config.h

* Moved layer count limit to specific via keymap folder.

---------

Co-authored-by: dexter93 <d3xter93@gmail.com>
  • Loading branch information
fpb and dexter93 authored Nov 22, 2023
1 parent f5c0ba5 commit 7e8abdb
Show file tree
Hide file tree
Showing 17 changed files with 774 additions and 0 deletions.
27 changes: 27 additions & 0 deletions keyboards/royal_kludge/rk61_rgb/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Copyright (C) 2023 Benjamín Ausensi <bausensi@protonmail.com>
*
* 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/>.
*/

#pragma once

/* RGB matrix configuration can't be fully expressed in JSON as of now */
#define SN32_RGB_MATRIX_ROW_PINS { C5, C6, C4, C8, C9, C7, C11, C12, C10, C14, B13, C13, B15, B14, D3 }

/* Enable additional RGB effects */
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES

/* Configure the effects: */
#define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 50
191 changes: 191 additions & 0 deletions keyboards/royal_kludge/rk61_rgb/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"keyboard_name": "RK61-RGB",
"manufacturer": "Royal Kludge",
"url": "http://en.rkgaming.com",
"maintainer": "fpb",
"bootloader": "sn32-dfu",

"processor": "SN32F248BF",
"usb": {
"vid": "0x0C45",
"pid": "0x8016",
"device_version": "1.0.0"
},

"features": {
"audio": false,
"backlight": false,
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": false,
"nkro": true,
"rgb_matrix": true
},

"debounce": 5,
"diode_direction": "COL2ROW",
"matrix_pins": {
"cols": [ "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", "B0", "B1", "B2", "B3", "B4", "B5" ],
"rows": [ "D11", "D10", "D9", "D8", "D7" ]
},


"rgb_matrix": {
"animations": {
"band_val" : true,
"breathing" : true,
"cycle_left_right" : true,
"cycle_pinwheel" : true,
"cycle_spiral" : true,
"digital_rain" : true,
"gradient_left_right" : true,
"gradient_up_down" : true,
"raindrops" : true,
"solid_reactive_simple" : true,
"splash" : true,
"typing_heatmap" : true
},
"driver": "sn32f24xb",
"layout": [
{ "matrix":[0, 0], "flags":4, "x":0, "y":0 },
{ "matrix":[0, 1], "flags":4, "x":16, "y":0 },
{ "matrix":[0, 2], "flags":4, "x":32, "y":0 },
{ "matrix":[0, 3], "flags":4, "x":48, "y":0 },
{ "matrix":[0, 4], "flags":4, "x":64, "y":0 },
{ "matrix":[0, 5], "flags":4, "x":80, "y":0 },
{ "matrix":[0, 6], "flags":4, "x":96, "y":0 },
{ "matrix":[0, 7], "flags":4, "x":112, "y":0 },
{ "matrix":[0, 8], "flags":4, "x":128, "y":0 },
{ "matrix":[0, 9], "flags":4, "x":144, "y":0 },
{ "matrix":[0, 10], "flags":4, "x":160, "y":0 },
{ "matrix":[0, 11], "flags":4, "x":176, "y":0 },
{ "matrix":[0, 12], "flags":4, "x":192, "y":0 },
{ "matrix":[0, 13], "flags":4, "x":208, "y":0 },

{ "matrix":[1, 0], "flags":4, "x":4, "y":16 },
{ "matrix":[1, 1], "flags":4, "x":24, "y":16 },
{ "matrix":[1, 2], "flags":4, "x":40, "y":16 },
{ "matrix":[1, 3], "flags":4, "x":56, "y":16 },
{ "matrix":[1, 4], "flags":4, "x":72, "y":16 },
{ "matrix":[1, 5], "flags":4, "x":88, "y":16 },
{ "matrix":[1, 6], "flags":4, "x":104, "y":16 },
{ "matrix":[1, 7], "flags":4, "x":120, "y":16 },
{ "matrix":[1, 8], "flags":4, "x":136, "y":16 },
{ "matrix":[1, 9], "flags":4, "x":152, "y":16 },
{ "matrix":[1, 10], "flags":4, "x":168, "y":16 },
{ "matrix":[1, 11], "flags":4, "x":184, "y":16 },
{ "matrix":[1, 12], "flags":4, "x":200, "y":16 },
{ "matrix":[1, 13], "flags":4, "x":216, "y":16 },

{ "matrix":[2, 0], "flags":4, "x":6, "y":32 },
{ "matrix":[2, 1], "flags":4, "x":28, "y":32 },
{ "matrix":[2, 2], "flags":4, "x":44, "y":32 },
{ "matrix":[2, 3], "flags":4, "x":60, "y":32 },
{ "matrix":[2, 4], "flags":4, "x":76, "y":32 },
{ "matrix":[2, 5], "flags":4, "x":92, "y":32 },
{ "matrix":[2, 6], "flags":4, "x":108, "y":32 },
{ "matrix":[2, 7], "flags":4, "x":124, "y":32 },
{ "matrix":[2, 8], "flags":4, "x":140, "y":32 },
{ "matrix":[2, 9], "flags":4, "x":156, "y":32 },
{ "matrix":[2, 10], "flags":4, "x":172, "y":32 },
{ "matrix":[2, 11], "flags":4, "x":188, "y":32 },
{ "matrix":[2, 13], "flags":4, "x":204, "y":32 },

{ "matrix":[3, 0], "flags":4, "x":10, "y":48 },
{ "matrix":[3, 2], "flags":4, "x":36, "y":48 },
{ "matrix":[3, 3], "flags":4, "x":52, "y":48 },
{ "matrix":[3, 4], "flags":4, "x":68, "y":48 },
{ "matrix":[3, 5], "flags":4, "x":84, "y":48 },
{ "matrix":[3, 6], "flags":4, "x":100, "y":48 },
{ "matrix":[3, 7], "flags":4, "x":116, "y":48 },
{ "matrix":[3, 8], "flags":4, "x":132, "y":48 },
{ "matrix":[3, 9], "flags":4, "x":148, "y":48 },
{ "matrix":[3, 10], "flags":4, "x":164, "y":48 },
{ "matrix":[3, 11], "flags":4, "x":180, "y":48 },
{ "matrix":[3, 12], "flags":4, "x":196, "y":48 },

{ "matrix":[4, 0], "flags":4, "x":2, "y":64 },
{ "matrix":[4, 1], "flags":4, "x":22, "y":64 },
{ "matrix":[4, 2], "flags":4, "x":42, "y":64 },
{ "matrix":[4, 6], "flags":4, "x":102, "y":64 },
{ "matrix":[4, 9], "flags":4, "x":162, "y":64 },
{ "matrix":[4, 10], "flags":4, "x":182, "y":64 },
{ "matrix":[4, 11], "flags":4, "x":202, "y":64 },
{ "matrix":[4, 13], "flags":4, "x":222, "y":64 }
]
},

"layouts": {
"LAYOUT_60_ansi": {
"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":[0, 12], "x":12, "y":0 },
{ "matrix":[0, 13], "x":13, "y":0, "w":2 },

{ "matrix":[1, 0], "x":0, "y":1, "w":1.5 },
{ "matrix":[1, 1], "x":1.5, "y":1 },
{ "matrix":[1, 2], "x":2.5, "y":1 },
{ "matrix":[1, 3], "x":3.5, "y":1 },
{ "matrix":[1, 4], "x":4.5, "y":1 },
{ "matrix":[1, 5], "x":5.5, "y":1 },
{ "matrix":[1, 6], "x":6.5, "y":1 },
{ "matrix":[1, 7], "x":7.5, "y":1 },
{ "matrix":[1, 8], "x":8.5, "y":1 },
{ "matrix":[1, 9], "x":9.5, "y":1 },
{ "matrix":[1, 10], "x":10.5, "y":1 },
{ "matrix":[1, 11], "x":11.5, "y":1 },
{ "matrix":[1, 12], "x":12.5, "y":1 },
{ "matrix":[1, 13], "x":13.5, "y":1, "w":1.5 },

{ "matrix":[2, 0], "x":0, "y":2, "w":1.75 },
{ "matrix":[2, 1], "x":1.75, "y":2 },
{ "matrix":[2, 2], "x":2.75, "y":2 },
{ "matrix":[2, 3], "x":3.75, "y":2 },
{ "matrix":[2, 4], "x":4.75, "y":2 },
{ "matrix":[2, 5], "x":5.75, "y":2 },
{ "matrix":[2, 6], "x":6.75, "y":2 },
{ "matrix":[2, 7], "x":7.75, "y":2 },
{ "matrix":[2, 8], "x":8.75, "y":2 },
{ "matrix":[2, 9], "x":9.75, "y":2 },
{ "matrix":[2, 10], "x":10.75, "y":2 },
{ "matrix":[2, 11], "x":11.75, "y":2 },
{ "matrix":[2, 13], "x":12.75, "y":2, "w":2.25 },

{ "matrix":[3, 0], "x":0, "y":3, "w":2.25 },
{ "matrix":[3, 2], "x":2.25, "y":3 },
{ "matrix":[3, 3], "x":3.25, "y":3 },
{ "matrix":[3, 4], "x":4.25, "y":3 },
{ "matrix":[3, 5], "x":5.25, "y":3 },
{ "matrix":[3, 6], "x":6.25, "y":3 },
{ "matrix":[3, 7], "x":7.25, "y":3 },
{ "matrix":[3, 8], "x":8.25, "y":3 },
{ "matrix":[3, 9], "x":9.25, "y":3 },
{ "matrix":[3, 10], "x":10.25, "y":3 },
{ "matrix":[3, 11], "x":11.25, "y":3 },
{ "matrix":[3, 12], "x":12.25, "y":3, "w":2.75 },

{ "matrix":[4, 0], "x":0, "y":4, "w":1.25 },
{ "matrix":[4, 1], "x":1.25, "y":4, "w":1.25 },
{ "matrix":[4, 2], "x":2.5, "y":4, "w":1.25 },
{ "matrix":[4, 6], "x":3.75, "y":4, "w":6.25 },
{ "matrix":[4, 9], "x":10, "y":4, "w":1.25 },
{ "matrix":[4, 10], "x":11.25, "y":4, "w":1.25 },
{ "matrix":[4, 11], "x":12.5, "y":4, "w":1.25 },
{ "matrix":[4, 13], "x":13.75, "y":4, "w":1.25 }
]
}
}
}
42 changes: 42 additions & 0 deletions keyboards/royal_kludge/rk61_rgb/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Copyright (C) 2023 Benjamín Ausensi
*
* 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] = {
[0] = LAYOUT_60_ansi(
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_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
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_LCTL, KC_LALT, KC_LCMD, KC_SPC, KC_RCMD, KC_RALT, KC_RCTL, MO(1)
),
[1] = LAYOUT_60_ansi(
KC_GRV, 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_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_PSCR, KC_SCRL, KC_PAUS, RGB_HUD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_MOD,
KC_TRNS, AG_SWAP, AG_NORM, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, RGB_SPD, RGB_SPI, KC_TRNS,
KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, KC_DEL, KC_END, KC_PGDN, RGB_HUI, KC_UP, KC_TRNS,
QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS
)
};

bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (host_keyboard_led_state().caps_lock) {
// Set capslock key to orange (capslock is led number 30)
rgb_matrix_set_color(28, 255, 130, 15);
}
return false;
}
42 changes: 42 additions & 0 deletions keyboards/royal_kludge/rk61_rgb/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Copyright (C) 2023 Fernando Birra
*
* 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] = {
[0] = LAYOUT_60_ansi(
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_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
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_LCTL, KC_LALT, KC_LCMD, KC_SPC, KC_RCMD, KC_RALT, KC_RCTL, MO(1)
),
[1] = LAYOUT_60_ansi(
KC_GRV, 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_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_PSCR, KC_SCRL, KC_PAUS, RGB_HUD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_MOD,
KC_TRNS, AG_SWAP, AG_NORM, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, RGB_SPD, RGB_SPI, KC_TRNS,
KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, KC_DEL, KC_END, KC_PGDN, RGB_HUI, KC_UP, KC_TRNS,
QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS
)
};

bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (host_keyboard_led_state().caps_lock) {
// Set capslock key to orange (capslock is led number 30)
rgb_matrix_set_color(28, 255, 130, 15);
}
return false;
}
16 changes: 16 additions & 0 deletions keyboards/royal_kludge/rk61_rgb/keymaps/via/rk61-rgb_via.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Royal Kludge RK61 RGB",
"vendorId": "0x0C45",
"productId": "0x8016",
"menus": ["qmk_rgb_matrix"],
"matrix": {"rows": 5, "cols": 14},
"layouts": {
"keymap": [
[ "0,0", "0,1", "0,2", "0,3", "0,4", "0,5", "0,6", "0,7", "0,8", "0,9", "0,10", "0,11", "0,12", {"w":2}, "0,13" ],
[ {"w":1.5}, "1,0", "1,1", "1,2", "1,3", "1,4", "1,5", "1,6", "1,7", "1,8", "1,9", "1,10", "1,11", "1,12", {"w":1.5}, "1,13" ],
[ {"w":1.75}, "2,0", "2,1", "2,2", "2,3", "2,4", "2,5", "2,6", "2,7", "2,8", "2,9", "2,10", "2,11", {"w":2.25}, "2,13" ],
[ {"w":2.25}, "3,0", "3,2", "3,3", "3,4", "3,5", "3,6", "3,7", "3,8", "3,9", "3,10", "3,11", {"w":2.75}, "3,12" ],
[ {"w":1.25}, "4,0", {"w":1.25}, "4,1", {"w":1.25},"4,2", {"w":6.25}, "4,6", {"w":1.25},"4,9", {"w":1.25},"4,10", {"w":1.25},"4,11", {"w":1.25},"4,13" ]
]
}
}
1 change: 1 addition & 0 deletions keyboards/royal_kludge/rk61_rgb/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VIA_ENABLE = yes
39 changes: 39 additions & 0 deletions keyboards/royal_kludge/rk61_rgb/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# RK61 RGB

![RK61 RGB](https://i.pinimg.com/originals/01/e2/1f/01e21f1ba56526a0f2fe5047b6d25f11.png)

Royal Kludge RK61 non-hotswap rgb edition, original PID 0x24F.

Tested on the Royal Kludge RK61 non-hotswap RGB dual-mode edition, original PID 0x24F

- MCU: HFD2201KBA (rebrand SN32F248BF)
- PCB: RK61-JX-RGB-HFD; REV: 01; 2019/08/13
- Wired only, no bluetooth support.

Based on previous work by [euwbah](https://github.com/euwbah). Added VIA 3.0 support.

Keyboard Maintainer: [fpb](https://github.com/fpb)

For the white-backlit non-rgb version of the RK61, check out [Diff-fusion's repo](https://github.com/Diff-fusion/qmk_firmware)


Note: keymap differs slightly from stock firmware for FN combinations

See [keymap.c](keymaps/default/keymap.c), and refer to the [list
of QMK keycodes](https://beta.docs.qmk.fm/using-qmk/simple-keycodes/keycodes).

-----------------


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

make royal_kludge/rk61_rgb:default

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:

- Physical reset: short the two contacts to the left of the space bar switch with a wire/paperclip. Accessible from the front.
- Layout (after loading QMK): FN + Left Control
3 changes: 3 additions & 0 deletions keyboards/royal_kludge/rk61_rgb/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Data-driven structure doesn't support EEPROM yet
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = sn32_flash
Loading

0 comments on commit 7e8abdb

Please sign in to comment.