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

feat(shields): add redox shield #779

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
- quefrency_left
- quefrency_right
- reviung41
- redox_left
- redox_right
- romac
- romac_plus
- settings_reset
Expand Down
24 changes: 24 additions & 0 deletions app/boards/shields/redox/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if SHIELD_REDOX_LEFT

config ZMK_KEYBOARD_NAME
default "Redox"

config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y

endif


if SHIELD_REDOX_RIGHT

config ZMK_KEYBOARD_NAME
default "Redox Right"

endif

if SHIELD_REDOX_LEFT || SHIELD_REDOX_RIGHT

config ZMK_SPLIT
default y

endif
8 changes: 8 additions & 0 deletions app/boards/shields/redox/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_REDOX_LEFT
def_bool $(shields_list_contains,redox_left)

config SHIELD_REDOX_RIGHT
def_bool $(shields_list_contains,redox_right)
3 changes: 3 additions & 0 deletions app/boards/shields/redox/redox.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Uncomment the following lines to enable the Redox RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
46 changes: 46 additions & 0 deletions app/boards/shields/redox/redox.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <14>;
rows = <5>;
// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 |
// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | SW13 | | SW13 | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 |
// | SW14 | SW15 | SW16 | SW17 | SW18 | SW19 | SW20 | | SW20 | SW19 | SW18 | SW17 | SW16 | SW15 | SW14 |
// | SW21 | SW22 | SW23 | SW24 | SW25 | SW26 | SW27 | SW28 | | SW28 | SW27 | SW26 | SW25 | SW24 | SW23 | SW22 | SW21 |
// | SW29 | SW30 | SW31 | SW32 | SW33 | SW34 | SW35 | | SW35 | SW34 | SW33 | SW32 | SW31 | SW30 | SW29 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(0,6) RC(0,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(1,6) RC(1,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(2,6) RC(3,6) RC(3,7) RC(2,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12) RC(3,13)
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) RC(4,12) RC(4,13)
>;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "col2row";
row-gpios
= <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};
81 changes: 81 additions & 0 deletions app/boards/shields/redox/redox.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>

#define DEF 0
#define SYMB 1
#define NAV 2
#define ADJ 3

/ {
keymap {
compatible = "zmk,keymap";

default_layer {
// ---------------------------------------------------------------------------------------------------------------
// | NAV/` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | NAV/MINUS |
// | TAB | Q | W | E | R | T | SYMB | | SYMB | Y | U | I | O | P | = |
// | ESC | A | S | D | F | G | [ | | ] | H | J | K | L | ; | ' |
// | SHFT | Z | X | C | V | B | L3/PGUP | PGDN | | HOME | L3/END | N | M | , | . | / | SHFT |
// | LGUI | + | - | LALT/* | LCTRL/* | BKSP | DEL | | ENT | SPC | RALT | LEFT | DOWN | UP | RIGHT |
bindings = <
&lt NAV GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &lt 2 MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &mo SYMB &mo SYMB &kp Y &kp U &kp I &kp O &kp P &kp EQUAL
&kp ESC &kp A &kp S &kp D &kp F &kp G &kp LBKT &kp RBKT &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &lt ADJ PGUP &kp PGDN &kp HOME &lt ADJ END &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RSHFT
&kp LGUI &kp PLUS &kp MINUS &mt LALT KP_MULTIPLY &mt LCTL BSLH &kp BSPC &kp DEL &kp ENTER &kp SPACE &kp RALT &kp LEFT &kp DOWN &kp UP &kp RIGHT
>;
};
symbol_layer {
// -----------------------------------------------------------------------------
// | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | n/a |
// | | ! | @ | { | } | | | | | | / | 7 | 8 | 9 | - | n/a |
// | | # | $ | [ | ] | ` | | | | * | 4 | 5 | 6 | + | n/a |
// | | % | ^ | ( | ) | ~ | | | | | | n/a | 1 | 2 | 3 | ENTER | n/a |
// | | | | | | | | | | | 0 | 0 | . | ENTER | n/a |
bindings = <
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &none
&trans &kp EXCL &kp AT &kp LBRC &kp RBRC &kp PIPE &trans &trans &kp BSLH &kp N7 &kp N8 &kp N9 &kp MINUS &none
&trans &kp HASH &kp DOLLAR &kp LBKT &kp RBKT &kp GRAVE &trans &trans &kp STAR &kp N4 &kp N5 &kp N6 &kp PLUS &none
&trans &kp PERCENT &kp CARET &kp LPAR &kp RPAR &kp TILDE &trans &trans &trans &trans &none &kp N1 &kp N2 &kp N3 &kp ENTER &none
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp N0 &kp N0 &kp DOT &kp ENTER &none
>;
};
navigate_layer {
// ---------------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | |
// | n/a | n/a | (M_UP) | n/a | MW_UP | n/a | | | | n/a | n/a | n/a | n/a | n/a | n/a |
// | n/a | (M_LEFT) | (M_DOWN) | (M_RIGHT) | MW_DOWN | n/a | | | | LEFT | DOWN | UP | RIGHT | n/a | n/a |
// | n/a | n/a | n/a | n/a | n/a | n/a | | | | | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
// | n/a | n/a | n/a | n/a | M_1 | M_2 | | | | | n/a | n/a | n/a | n/a | n/a |
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&none &none &none &none &kp K_SCROLL_UP &none &trans &trans &none &none &none &none &none &none
&none &none &none &none &kp K_SCROLL_DOWN &none &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &none &none
&none &none &none &none &none &none &trans &trans &trans &none &none &none &none &none &none &none
&none &none &none &none &none &none &trans &trans &trans &none &none &none &none &none
>;
};
adjust_layer {
// ----------------------------------------------------------------------------------------------------------------------------
// | BTCLR | BT0 | BT1 | BT2 | BT3 | BT4 | | BT4 | BT3 | BT2 | BT1 | BT0 | BTCLR |
// | n/a | reset | bootloader | n/a | n/a | n/a | n/a | | n/a | n/a | n/a | n/a | bootloader | reset | n/a |
// | n/a | n/a | n/a | n/a | n/a | n/a | n/a | | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
// | n/a | n/a | n/a | n/a | n/a | n/a | | n/a | | n/a | | n/a | n/a | n/a | n/a | n/a | n/a |
// | n/a | n/a | n/a | n/a | n/a | n/a | n/a | | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
bindings = <
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR
&none &reset &bootloader &none &none &none &none &none &none &none &none &bootloader &reset &none
&none &none &none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &trans &none &none &trans &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none &none &none &none &none
>;
};
};
};
Empty file.
19 changes: 19 additions & 0 deletions app/boards/shields/redox/redox_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "redox.dtsi"

&kscan0 {
col-gpios
= <&pro_micro_a 2 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 16 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
;
};
Empty file.
23 changes: 23 additions & 0 deletions app/boards/shields/redox/redox_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "redox.dtsi"

&default_transform {
col-offset = <7>;
};

&kscan0 {
col-gpios
= <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 16 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 2 GPIO_ACTIVE_HIGH>
;
};