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

[Keyboard] Add modded Razer Orbweaver with RP2040 #19711

Merged
merged 31 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1d6d7b2
Firmware for modded Razer Orbweaver
a-marmot Jan 29, 2023
93c32f8
Update readme.md
a-marmot Jan 29, 2023
08a661f
Delete keyboards/handwired/orbweaver/keymaps/NoRGB directory
a-marmot Jan 29, 2023
7e2ac85
Delete keyboards/handwired/orbweaver/keymaps/RGB144 directory
a-marmot Jan 29, 2023
4f9995b
Delete keyboards/handwired/orbweaver/keymaps/RGBtest directory
a-marmot Jan 29, 2023
d6d057e
Delete orbweaver144.c
a-marmot Jan 29, 2023
25713b8
Update readme.md
a-marmot Jan 29, 2023
1b5b67e
Add files via upload
a-marmot Jan 29, 2023
bc3ecf6
Delete keyboards/handwired/orbweaver/default directory
a-marmot Jan 29, 2023
8efc8f9
Delete keyboards/handwired/orbweaver/keymaps/orby directory
a-marmot Jan 29, 2023
99b152d
Add files via upload
a-marmot Jan 29, 2023
bdcffb9
Merge branch 'qmk:master' into master
a-marmot Jan 29, 2023
57aeb8a
Update keyboards/handwired/orbweaver/orbweaver.c
a-marmot Jan 30, 2023
cbd8c2f
Update keyboards/handwired/orbweaver/config.h
a-marmot Jan 30, 2023
ba7c9fd
Add files via upload
a-marmot Jan 30, 2023
3284829
Add files via upload
a-marmot Jan 30, 2023
49e1b83
Merge branch 'qmk:master' into master
a-marmot Jan 30, 2023
6d29d66
Update keyboards/handwired/orbweaver/keymaps/default/keymap.c
a-marmot Jan 30, 2023
ff08c0e
Add files via upload
a-marmot Jan 30, 2023
ed200e8
Add files via upload
a-marmot Jan 30, 2023
fed87d5
Update keyboards/handwired/orbweaver/readme.md
a-marmot Jan 30, 2023
a9a1751
Add files via upload
a-marmot Jan 30, 2023
d9c7be1
Add files via upload
a-marmot Jan 30, 2023
c21db01
Delete orbweaver.h
a-marmot Jan 30, 2023
b2853b3
Add files via upload
a-marmot Jan 30, 2023
998c0a3
Add files via upload
a-marmot Jan 30, 2023
6cf2920
Merge branch 'qmk:master' into master
a-marmot Feb 1, 2023
6b7593c
Update config.h
a-marmot Feb 1, 2023
cec3e06
Update keyboards/handwired/orbweaver/config.h
a-marmot Feb 1, 2023
ddfd5d8
Update keyboards/handwired/orbweaver/orbweaver.c
a-marmot Feb 1, 2023
cf92fe1
Update keyboards/handwired/orbweaver/readme.md
a-marmot Feb 1, 2023
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
26 changes: 26 additions & 0 deletions keyboards/handwired/orbweaver/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2023 a_marmot
//
// 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/>.
//
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define DRIVER_COUNT 1
#define DRIVER_ADDR_1 0b1110100
#define RGB_MATRIX_LED_COUNT 20
#define ISSI_TIMEOUT 100
#define ISSI_PERSISTENCE 0
a-marmot marked this conversation as resolved.
Show resolved Hide resolved
#define I2C1_CLOCK_SPEED 100000
#define RGB_MATRIX_CENTER { 40, 30 }
59 changes: 59 additions & 0 deletions keyboards/handwired/orbweaver/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"manufacturer": "a_marmot",
"keyboard_name": "orbweaver",
"maintainer": "a_marmot",
"bootloader": "rp2040",
"diode_direction": "ROW2COL",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"matrix_pins": {
"rows": ["GP4", "GP5", "GP6", "GP7", "GP8", "GP9"],
"cols": ["GP12", "GP13", "GP14", "GP15", "GP16"]
},
"processor": "RP2040",
"url": "https://geekhack.org/index.php?topic=119396.0",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
"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 },
{ "matrix": [5, 1], "w": 4, "x": 1, "y": 5 }
]
}
}
}
110 changes: 110 additions & 0 deletions keyboards/handwired/orbweaver/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/* Copyright 2023 a_marmot
*
* 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] = {

//generic default keymap with Razor defaults (+ mode toggle)

/*
* ┌───┬───┬───┬───┬───┐
* │Esc│ 1 │ 2 │ 3 │ 4 │
* ├───┼───┼───┼───┼───┤
* │Tab│ q │ w │ e │ r │
* ├───┼───┼───┼───┼───┤
* │Cap│ a │ s │ d │ f │
* ├───┼───┼───┼───┼───┤
* │Shi│ z │ x │ c │ v │
* ├───┼───┼───┼───┼───┤
* │Alt│ ↑ │ ↓ │ → │ ← │
* ├───────┴┬──┴───┴───┤
* │Spacebar│change map│
* └────────┴──────────┘
*/

[0] = 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, KC_V,
KC_LALT, KC_UP, KC_DOWN, KC_RIGHT, KC_LEFT,
KC_SPACE, TO(1)
),

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

/*
* ┌───┬───┬───┬───┬───┐
* │ 0 │ 1 │ 2 │ 3 │ 4 │
* ├───┼───┼───┼───┼───┤
* │ i │ q │ w │ e │ r │
* ├───┼───┼───┼───┼───┤
* │ j │ a │ s │ d │ f │
* ├───┼───┼───┼───┼───┤
* │ k │ z │ x │ c │ v │
* ├───┼───┼───┼───┼───┤
* │ l │ ↑ │ ↓ │ → │ ← │
* ├───────┴┬──┴───┴───┤
* │Spacebar│change map│
* └────────┴──────────┘
*/

[1] = 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, KC_V,
KC_L, KC_UP, KC_DOWN, KC_RIGHT, KC_LEFT,
KC_SPACE, TO(0)
)
//, add more keymaps here

};

static const uint8_t colormap[][20][3] = {

// colors for the default key map in hex RGB values
{
{0x00, 0x00, 0xFF},{0xE7, 0xFF, 0x00},{0xE7, 0xFF, 0x00},{0xE7, 0xFF, 0x00},{0xE7, 0xFF, 0x00},
{0xFF, 0x70, 0x00},{0x00, 0xFF, 0xFF},{0x80, 0x00, 0xFF},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},
{0xFF, 0x70, 0x00},{0x80, 0x00, 0xFF},{0x80, 0x00, 0xFF},{0x80, 0x00, 0xFF},{0x00, 0xFF, 0xFF},
{0xFF, 0x70, 0x00},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF}
},

// colors for the 2nd key map
{
{0xE7, 0xFF, 0x00},{0xE7, 0xFF, 0x00},{0xE7, 0xFF, 0x00},{0xE7, 0xFF, 0x00},{0xE7, 0xFF, 0x00},
{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},{0x80, 0x00, 0xFF},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},
{0x00, 0xFF, 0xFF},{0x80, 0x00, 0xFF},{0x80, 0x00, 0xFF},{0x80, 0x00, 0xFF},{0x00, 0xFF, 0xFF},
{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF},{0x00, 0xFF, 0xFF}
}
//, add more keymaps here

};


bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
for (uint8_t i = led_min; i < led_max; i++) {
rgb_matrix_set_color(i,
colormap[get_highest_layer(layer_state|default_layer_state)][i][0],
colormap[get_highest_layer(layer_state|default_layer_state)][i][1],
colormap[get_highest_layer(layer_state|default_layer_state)][i][2]);
}

return false;
}

85 changes: 85 additions & 0 deletions keyboards/handwired/orbweaver/orbweaver.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright 2023 a_marmot
//
// 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;.
//
// SPDX-License-Identifier: GPL-2.0-or-later

// This IS31FL3731 configuration is for a Razer Orbweaver Chroma.
// It was reverse-engineered by testing all possible Cx_y combinations (144 total),
// and determining which ones addressed individual diodes (60 total). These were then
// placed in order R-G-B, sweeping left to right, and then top to bottom.

#include "config.h"
#include QMK_KEYBOARD_H
a-marmot marked this conversation as resolved.
Show resolved Hide resolved

const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
* | | G location
* | | | B location
* | | | | */
{0, C9_1, C8_1, C7_1}, //top left key.
{0, C9_2, C8_2, C7_2},
{0, C9_3, C8_3, C7_3},
{0, C9_4, C8_4, C7_4},
{0, C9_5, C8_5, C7_5}, //top right key.
{0, C9_6, C8_6, C7_6},
{0, C9_7, C8_7, C6_6},
{0, C9_8, C7_7, C6_7},
{0, C1_8, C2_8, C3_8},
{0, C1_7, C2_7, C3_7},
{0, C1_6, C2_6, C3_6},
{0, C1_5, C2_5, C3_5},
{0, C1_4, C2_4, C3_4},
{0, C1_3, C2_3, C3_3},
{0, C1_2, C2_2, C4_3},
{0, C1_1, C3_2, C4_2}, //lower left key
{0, C9_9, C8_9, C7_9},
{0, C9_10, C8_10, C7_10},
{0, C9_11, C8_11, C7_11},
{0, C9_12, C8_12, C7_12} //lower right key

};

led_config_t g_led_config = {
// Matrix location to LED index
{
{ 0, 2, 3, 4, 5 },
{ 6, 7, 8, 9, 10 },
{ 11, 12, 13, 14, 15 },
{ 16, 17, 18, 19, 19 },
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
{ NO_LED, NO_LED }
},

// LED index to physical location
{
{0,0}, {20,0}, {40,0}, {60,0}, {80,0},
{0,20}, {20,20}, {40,20}, {60,20}, {80,20},
{0,40}, {20,40}, {40,40}, {60,40}, {80,40},
{0,60}, {20,60}, {40,60}, {60,60}, {80,60}
},
a-marmot marked this conversation as resolved.
Show resolved Hide resolved

// LED index to flags
{
4, 4, 4, 4, 4,
4, 4, 4, 4, 4,
4, 4, 4, 4, 4,
4, 4, 4, 4, 4
}
};



40 changes: 40 additions & 0 deletions keyboards/handwired/orbweaver/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# orbweaver

This firmware is for a Razer Orbweaver Chroma keypad, modded to replace the stock MCU
with an Elite Pi RP2040 microcontroller. Mod instructions can be found on geekhack
https://geekhack.org/index.php?topic=119396.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. I 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).

The default key map (layer 0) is a generic layer based on the original Razer defaults.
You can change or add layers as needed, and change static colors in keymap.c

Many thanks to bomtarnes, Drashna, Dasky, sigprof, and casuanoob for helpful discussions
and coding suggestions and snippets.

* Keyboard Maintainer: [a_marmot](https://github.com/a-marmot)
* Hardware Supported: RP2040 + IS31FL3731
* Hardware Availability: https://geekhack.org/index.php?topic=119396.0

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

qmk compile -kb /handwired/orbweaver -km default

Flashing example for this keyboard:

When placed in bootloader mode, the RP2040 appears as an external flash drive. Just
copy the .uf2 file to the mounted drive.
a-marmot marked this conversation as resolved.
Show resolved Hide resolved

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 both reset buttons on the top of the RP2040 inside the modded unit.
3 changes: 3 additions & 0 deletions keyboards/handwired/orbweaver/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add support for 3731 RGB matrix controller
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = IS31FL3731