Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bmbmbm
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Oct 16, 2023
2 parents d0966a7 + a9a53e6 commit 94d13d2
Show file tree
Hide file tree
Showing 74 changed files with 819 additions and 254 deletions.
9 changes: 9 additions & 0 deletions app/boards/shields/reviung34/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_REVIUNG34

config ZMK_KEYBOARD_NAME
default "REVIUNG34"

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

config SHIELD_REVIUNG34
def_bool $(shields_list_contains,reviung34)
13 changes: 13 additions & 0 deletions app/boards/shields/reviung34/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# REVIUNG34

REVIUNG34 is a 33-34 key unibody split keyboard by [gtips](https://github.com/gtips). An in-stock version can be found at [Little Keyboards](https://www.littlekeyboards.com/products/reviung34-analyst-keyboard-kit).

By default, the 2x1u layout is used. To use to the 1x2u layout, add the following to your keymap:

```
/ {
chosen {
zmk,matrix_transform = &single_2u_transform;
};
};
```
48 changes: 48 additions & 0 deletions app/boards/shields/reviung34/boards/nice_nano_v2.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <dt-bindings/led/led.h>

&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};

&spi3 {
compatible = "nordic,nrf-spim";
status = "okay";

pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";

/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;

/* WS2812 */
chain-length = <9>; /* number of LEDs */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};

/ {
chosen {
zmk,underglow = &led_strip;
};
};
3 changes: 3 additions & 0 deletions app/boards/shields/reviung34/reviung34.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
77 changes: 77 additions & 0 deletions app/boards/shields/reviung34/reviung34.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

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

/ {
chosen {
// 34 keys.
zmk,matrix_transform = &dual_1u_transform;

// 33 keys. Center two thumb keys replaced by a single 2u key. Remember to adjust your
// keymap accordingly!
// zmk,matrix_transform = &single_2u_transform;
};
};

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

base {
label = "Base";
bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI
&mt LSHFT Z &mt LCTRL X &mt LALT C &kp V &kp B &kp N &kp M &mt RALT COMMA &mt RCTRL DOT &mt RSHFT SLASH
&kp LGUI &lt 1 BSPC &lt 2 SPACE &mo 3
>;
};

lower {
label = "Lower";
bindings = <
&kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR
&trans &kp TILDE &kp DQT &kp PIPE &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &mo 4 &trans
>;
};

upper {
label = "Upper";
bindings = <
&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0
&trans &kp GRAVE &kp SQT &kp BSLH &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &mo 4 &trans &trans
>;
};

function {
label = "Function";
bindings = <
&kp TAB &trans &kp C_VOL_UP &trans &trans &trans &trans &trans &trans &kp ENTER
&kp ESC &kp C_BRI_DN &kp C_VOL_DN &kp C_BRI_UP &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &kp C_PWR &trans &trans
>;
};

meta {
label = "Meta";
bindings = <
&rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &rgb_ug RGB_SPI &rgb_ug RGB_EFF &none &none &none &none &none
&rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &rgb_ug RGB_SPD &rgb_ug RGB_EFR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4
&none &none &rgb_ug RGB_TOG &none &none &none &none &bt BT_CLR &none &none
&none &trans &trans &none
>;
};
};
};
63 changes: 63 additions & 0 deletions app/boards/shields/reviung34/reviung34.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

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

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

dual_1u_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <9>;
rows = <4>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(3,5)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(3,6)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(3,7)
RC(3,2) RC(3,3) RC(3,4) RC(3,8)
>;
};

single_2u_transform: keymap_transform_1 {
compatible = "zmk,matrix-transform";
columns = <9>;
rows = <4>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(3,5)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(3,6)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(3,7)
RC(3,2) RC(3,4) RC(3,8)
>;
};

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";

col-gpios
= <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
, <&pro_micro 7 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
, <&pro_micro 15 GPIO_ACTIVE_HIGH>
, <&pro_micro 14 GPIO_ACTIVE_HIGH>
, <&pro_micro 16 GPIO_ACTIVE_HIGH>
, <&pro_micro 10 GPIO_ACTIVE_HIGH>
;

row-gpios
= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};
9 changes: 9 additions & 0 deletions app/boards/shields/reviung34/reviung34.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
file_format: "1"
id: reviung34
name: REVIUNG34
type: shield
url: https://github.com/gtips/reviung/tree/master/reviung34
requires: [pro_micro]
features:
- keys
- underglow
43 changes: 34 additions & 9 deletions app/boards/shields/waterfowl/waterfowl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,53 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5)
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

roller_left_encoder: encoder_left_roller {
compatible = "alps,ec11";
label = "ROLLER_LEFT_ENCODER";
a-gpios = <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
status = "disabled";
};

dial_left_encoder: encoder_left_dial {
compatible = "alps,ec11";
label = "DIAL_LEFT_ENCODER";
a-gpios = <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
status = "disabled";
};

left_encoder: encoder_left { //roller
roller_right_encoder: encoder_right_roller {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
label = "ROLLER_RIGHT_ENCODER";
a-gpios = <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};

right_encoder: encoder_right { //Standard encoder on left half
dial_right_encoder: encoder_right_dial {
compatible = "alps,ec11";
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <2>;
label = "DIAL_RIGHT_ENCODER";
a-gpios = <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
status = "disabled";
};

sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
sensors = <
&roller_left_encoder
&dial_left_encoder
&dial_right_encoder
&roller_right_encoder
>;
};

// TODO: RGB node(s)
Expand Down
30 changes: 25 additions & 5 deletions app/boards/shields/waterfowl/waterfowl.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
&kp N1 &lt 3 DEL &lt 1 SPACE &kp TAB &kp N2 &kp N3 &kp ESC &kp BSPC &lt 2 RET &kp N4
>;

sensor-bindings = <&inc_dec_kp PAGE_UP PAGE_DOWN &inc_dec_kp TAB LS(TAB)>;
sensor-bindings = <
&inc_dec_kp PAGE_DOWN PAGE_UP
&inc_dec_kp C_VOL_DN C_VOL_UP
&inc_dec_kp DOWN UP
&inc_dec_kp LEFT RIGHT
>;
};

navnum_layer {
Expand All @@ -57,7 +62,12 @@
&kp N1 &lt 3 DEL &lt 1 SPACE &kp TAB &kp N2 &kp N3 &kp ESC &kp BSPC &lt 2 RET &kp N4
>;

sensor-bindings = <&inc_dec_kp PAGE_UP PAGE_DOWN &inc_dec_kp TAB LS(TAB)>;
sensor-bindings = <
&inc_dec_kp PAGE_DOWN PAGE_UP
&inc_dec_kp C_VOL_DN C_VOL_UP
&inc_dec_kp DOWN UP
&inc_dec_kp LEFT RIGHT
>;
};

symbol_layer {
Expand All @@ -81,7 +91,12 @@
&kp N1 &lt 3 DEL &lt 1 SPACE &kp TAB &kp N2 &kp N3 &kp ESC &kp BSPC &lt 2 RET &kp N4
>;

sensor-bindings = <&inc_dec_kp PAGE_UP PAGE_DOWN &inc_dec_kp TAB LS(TAB)>;
sensor-bindings = <
&inc_dec_kp PAGE_DOWN PAGE_UP
&inc_dec_kp C_VOL_DN C_VOL_UP
&inc_dec_kp DOWN UP
&inc_dec_kp LEFT RIGHT
>;
};

function_layer {
Expand All @@ -105,8 +120,13 @@
&kp N1 &lt 3 DEL &lt 1 SPACE &kp TAB &kp N2 &kp N3 &kp ESC &kp BSPC &lt 2 RET &kp N4
>;

sensor-bindings = <&inc_dec_kp PAGE_UP PAGE_DOWN &inc_dec_kp TAB LS(TAB)>;
sensor-bindings = <
&inc_dec_kp PAGE_DOWN PAGE_UP
&inc_dec_kp C_VOL_DN C_VOL_UP
&inc_dec_kp DOWN UP
&inc_dec_kp LEFT RIGHT
>;
};

};
};
};
6 changes: 5 additions & 1 deletion app/boards/shields/waterfowl/waterfowl_left.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
;
};

&left_encoder {
&roller_left_encoder {
status = "okay";
};

&dial_left_encoder {
status = "okay";
};
5 changes: 4 additions & 1 deletion app/boards/shields/waterfowl/waterfowl_right.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
;
};

&roller_right_encoder {
status = "okay";
};

&right_encoder {
&dial_right_encoder {
status = "okay";
};
10 changes: 9 additions & 1 deletion app/boards/shields/zmk_uno/zmk_uno.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@
status = "okay";
};

&arduino_spi {
nice_view_spi: &arduino_spi {
status = "okay";

cs-gpios = <&arduino_header 16 GPIO_ACTIVE_HIGH>;

// Needed so the nice_view shield will enhance the existing node which falls *first*
// on the bus, properly picking up the first `cs-gpios` specifier.
ls0xx@0 {
reg = <0>;
};

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";

Expand Down
Loading

0 comments on commit 94d13d2

Please sign in to comment.