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

Add support for MCU PCB replacement for Razer Orbweaver gaming keypad #24692

Merged
merged 21 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
54 changes: 54 additions & 0 deletions keyboards/lostdotfish/rp2040_orbweaver/README.md
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# rp2040_orbweaver
QMK firmware for RP2040 based MCU replacement PCB for the Razer Orbweaver gaming keypad

![alt text](https://github.com/Lostdotfish/pcb_images/blob/main/Screenshot%202024-12-07%20163218.png?raw=true)
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved


This firmware is for the Razer Orbweaver Chroma keypad with a custom, plug and play, RP2040 MCU PCB. For installation instructions and board availability see [geekhack](https://geekhack.org/index.php?topic=124092.0).

The firmware controls a 6x5 key matrix (4x5 keypad + 6 additional keys
on the thumb pad and up to 4 additional keys added by user). It also controls a
IS31FL3731 RGB Matrix controller (on the Chroma model) via I2C interface. This requires
a single I2C Driver with 20 common anode RGB LEDs. a_marmot found that the I2C clock speed must be slowed down to 100 kHz for the IS31 chip to keep up (the default for RP2040 seems to
be 400 kHz unless specified otherwise).
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved

Key 20 (bottom right) is used to switch layers.

The default key map provides 3 preset layers.
(layer 0) is a generic layer based on the original Razer defaults.
(layer 1) replaces modifier keys with letter keys.
(layer 2) replaces the 2 top rows with RGB control keys.

The three LEDs on the thumb pad indicate the active layer.

Blue = layer 0
Green = layer 1
Yellow = layer 3

All LEDs will be off when any other (user added) layout is activated

A set of RGB animations are included in confg.h. These are controlled by activating the Yellow layer and using keys 01 - 11 (11 toggles the lighting on and off - see /keymaps/default/keymap.c for more information)

Many thanks to a_marmot. Without his original handwired project, this board would not have been possible. His original work can be found here. [geekhack](https://geekhack.org/index.php?topic=119396.0).

* Keyboard Maintainer: [Lostdotfish](https://github.com/Lostdotfish)
* Hardware Supported: RP2040 + IS31FL3731
* Hardware Availability: [https://geekhack.org/index.php?topic=124092.0](https://geekhack.org/index.php?topic=124092.0)

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

make lostdotfish/rp2040_orbweaver:default

Flashing example for this keyboard:

make lostdotfish/rp2040_orbweaver: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 2 ways:

* Press and hold the upper left hand key on the main keyboard while you plug in the USB.
* Press and release the boot button on the top of the RP2040_Orbweaver v2.0 inside the modded unit.
29 changes: 29 additions & 0 deletions keyboards/lostdotfish/rp2040_orbweaver/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Copyright 2024 lostdotfish
*
* 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
#define I2C_DRIVER I2CD0
#define I2C1_SDA_PIN GP12
#define I2C1_SCL_PIN GP13
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define I2C1_CLOCK_SPEED 100000
#define RGB_MATRIX_TIMEOUT 1000000 // number of milliseconds to wait until rgb automatically turns off
#define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
#define RGB_MATRIX_DEFAULT_VAL 200
#define RGB_MATRIX_DEFAULT_ON true // Sets the default enabled state, if none has been set
#define RGB_MATRIX_DEFAULT_HUE 0 // Sets the default hue value, if none has been set
#define RGB_MATRIX_DEFAULT_SAT 255 // Sets the default saturation value, if none has been set
#define RGB_MATRIX_DEFAULT_SPD 127 // Sets the default animation speed, if none has been set
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions keyboards/lostdotfish/rp2040_orbweaver/halconf.h
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2023 zzeneg (@zzeneg)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define HAL_USE_I2C TRUE

#include_next <halconf.h>
118 changes: 118 additions & 0 deletions keyboards/lostdotfish/rp2040_orbweaver/keyboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"manufacturer": "Lostdotfish",
"keyboard_name": "rp2040_orbweaver",
"maintainer": "Lostdotfish",
"url": "https://geekhack.org/index.php?topic=124092.0",
"bootloader": "rp2040",
"processor": "RP2040",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
"diode_direction": "ROW2COL",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
},
"rgb_matrix": {
"driver": "is31fl3731",
"led_flush_limit": 26,
"led_process_limit": 5,
"max_brightness": 220,
"sleep": true,
"center_point": [40, 30],
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved
"animations": {
"alphas_mods": true,
"gradient_up_down": true,
"gradient_left_right": true,
"breathing": true,
"band_sat": true,
"band_val": true,
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_up_down": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"rainbow_moving_chevron": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"dual_beacon": true,
"rainbow_beacon": true,
"rainbow_pinwheels": true,
"flower_blooming": true,
"raindrops": true,
"jellybean_raindrops": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"pixel_fractal": true,
"pixel_flow": true,
"pixel_rain": true,
"typing_heatmap": true,
"digital_rain": true,
"solid_reactive_simple": true,
"solid_reactive": true,
"solid_reactive_wide": true,
"solid_reactive_multiwide": true,
"solid_reactive_cross": true,
"solid_reactive_multicross": true,
"solid_reactive_nexus": true,
"solid_reactive_multinexus": true,
"splash": true,
"multisplash": true,
"solid_splash": true,
"solid_multisplash": true,
"starlight": true,
"starlight_dual_sat": true,
"starlight_dual_hue": true,
"riverflow": true
},
waffle87 marked this conversation as resolved.
Show resolved Hide resolved
},
"matrix_pins": {
"rows": ["GP0", "GP1", "GP2", "GP3", "GP10", "GP9"],
"cols": ["GP4", "GP5", "GP8", "GP7", "GP6"]
},

"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": [0, 4], "x": 4, "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": [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": [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": [4, 0], "x": 0, "y": 4},
{"matrix": [4, 1], "x": 1, "y": 4},
{"matrix": [4, 2], "x": 2, "y": 4},
{"matrix": [4, 3], "x": 3, "y": 4},
{"matrix": [4, 4], "x": 4, "y": 4},
{"matrix": [5, 0], "x": 0, "y": 5},
]
}
}
}
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved
78 changes: 78 additions & 0 deletions keyboards/lostdotfish/rp2040_orbweaver/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* Copyright 2024 lostdotfish
*
* 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 &lt;http://www.gnu.org/licenses/&gt;.
*/

#include QMK_KEYBOARD_H


enum orbweaver_layers {
_DEFAULT,
_LETTERS,
_CONTROL
};

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

//generic default keymap with Razor defaults (+ 20 shifts layer)

[_DEFAULT] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4,
KC_TAB, KC_Q, KC_W, KC_E, KC_R,
KC_CAPS, KC_A, KC_S, KC_D, KC_F,
KC_LSFT, KC_Z, KC_X, KC_C, TO(1),
KC_LALT, KC_UP, KC_DOWN, KC_RIGHT, KC_LEFT,
KC_SPACE
),

//Second example keymap with all modifier keys replaced with numbers or letters

[_LETTERS] = LAYOUT(
KC_0, KC_1, KC_2, KC_3, KC_4,
KC_I, KC_Q, KC_W, KC_E, KC_R,
KC_J, KC_A, KC_S, KC_D, KC_F,
KC_K, KC_Z, KC_X, KC_C, TO(2),
KC_L, KC_UP, KC_DOWN, KC_RIGHT, KC_LEFT,
KC_SPACE
),

//, RGB Contol Keymap
[_CONTROL] = LAYOUT(
RM_NEXT, RM_HUEU, RM_SATU, RM_VALU, RM_SPDU,
RM_PREV, RM_HUED, RM_SATD, RM_VALD, RM_SPDD,
RM_TOGG, KC_A, KC_S, KC_D, KC_F,
KC_K, KC_Z, KC_X, KC_C, TO(0),
KC_L, KC_UP, KC_DOWN, KC_RIGHT, KC_LEFT,
KC_SPACE
)

};

layer_state_t layer_state_set_user(layer_state_t state) {
gpio_write_pin_high(GP23);
gpio_write_pin_high(GP24);
gpio_write_pin_high(GP25);
switch (get_highest_layer(state)) {
case _DEFAULT:
gpio_write_pin_low(GP23);
break;
case _LETTERS:
gpio_write_pin_low(GP25);
break;
case _CONTROL:
gpio_write_pin_low(GP24);
break;
}
return state;
}
12 changes: 12 additions & 0 deletions keyboards/lostdotfish/rp2040_orbweaver/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2023 zzeneg (@zzeneg)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include_next <mcuconf.h>

#undef RP_I2C_USE_I2C0
#define RP_I2C_USE_I2C0 TRUE

#undef RP_I2C_USE_I2C1
#define RP_I2C_USE_I2C1 FALSE
Lostdotfish marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading