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

New Sheild Pteron36 #1364

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions app/boards/shields/pteron36/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if SHIELD_PTERON36_LEFT

config ZMK_KEYBOARD_NAME
default "Pteron36"

config ZMK_SPLIT_BLE_ROLE_CENTRAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config ZMK_SPLIT_BLE_ROLE_CENTRAL
config ZMK_SPLIT_ROLE_CENTRAL

default y

endif

if SHIELD_PTERON36_LEFT || SHIELD_PTERON36_RIGHT

config ZMK_SPLIT
default y

endif
5 changes: 5 additions & 0 deletions app/boards/shields/pteron36/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config SHIELD_PTERON36_LEFT
def_bool $(shields_list_contains,pteron36_left)

config SHIELD_PTERON36_RIGHT
def_bool $(shields_list_contains,pteron36_right)
10 changes: 10 additions & 0 deletions app/boards/shields/pteron36/pteron36.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT

# Uncomment the following line to enable the Lotus58 OLED Display
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to remove the display and encoder configs to not confuse users, if they aren't supported by the firmware yet.

# CONFIG_ZMK_DISPLAY=y

# Uncomment these two lines to add support for encoders
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
45 changes: 45 additions & 0 deletions app/boards/shields/pteron36/pteron36.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2020 Pete Johanson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to fix the copyright headers in this file and others to Copyright (c) 2022 The ZMK Contributors as well.

*
* 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 = <10>;
rows = <4>;
// SW5 | SW4 | SW3 | SW2 | SW1 | | SW1 | SW2 | SW3 | SW4 | SW5 |

// SW11 | SW10 | SW9 | SW8 | SW7 | | SW7 | SW8 | SW9 | SW10 | SW11 |
// SW17 | SW16 | SW15 | SW14 | SW13 | | SW13 | SW14 | SW15 | SW16 | SW17 |
// SW28 | SW27 | SW26 | | SW26 | SW27 | SW28 |
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(0,9)
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(1,9)
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(2,9)
RC(3,0) RC(3,1) RC(3,2) RC(3,7) RC(3,8) RC(3,9)
Comment on lines +25 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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(0,9)
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(1,9)
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(2,9)
RC(3,0) RC(3,1) RC(3,2) RC(3,7) RC(3,8) RC(3,9)
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,9) RC(0,8) RC(0,7) RC(0,6) RC(0,5)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,9) RC(1,8) RC(1,7) RC(1,6) RC(1,5)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,9) RC(2,8) RC(2,7) RC(2,6) RC(2,5)
RC(3,0) RC(3,1) RC(3,2) RC(3,7) RC(3,6) RC(3,5)

If you reorder the transform, you can use the same col-gpios for both sides.

>;
};

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

Comment on lines +34 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label = "KSCAN";

The label attribute has been deprecated here.

diode-direction = "row2col";
row-gpios
= <&pro_micro 7 (GPIO_ACTIVE_HIGH)>
, <&pro_micro 6 (GPIO_ACTIVE_HIGH )>
, <&pro_micro 8 (GPIO_ACTIVE_HIGH )>
, <&pro_micro 9 (GPIO_ACTIVE_HIGH )>
Comment on lines +39 to +41
Copy link
Contributor

@lesshonor lesshonor Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZMK's standard is to use spaces for indentation instead of tabs. Installing and running pre-commit will correct formatting issues.

Suggested change
, <&pro_micro 6 (GPIO_ACTIVE_HIGH )>
, <&pro_micro 8 (GPIO_ACTIVE_HIGH )>
, <&pro_micro 9 (GPIO_ACTIVE_HIGH )>
, <&pro_micro 6 (GPIO_ACTIVE_HIGH)>
, <&pro_micro 8 (GPIO_ACTIVE_HIGH)>
, <&pro_micro 9 (GPIO_ACTIVE_HIGH)>

;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
col-gpios
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

};
};
154 changes: 154 additions & 0 deletions app/boards/shields/pteron36/pteron36.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
#include <dt-bindings/zmk/outputs.h>

#define BASE 0
#define NAVR 1
#define MOUR 2
#define MEDR 3
#define NSL 4
#define NSSL 5
#define FUNL 6

/ {
behaviors {
hm: homerow_mods {
compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS";
#binding-cells = <2>;
tapping-term-ms = <200>;
quick_tap_ms = <0>;
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
};
};
keymap {
compatible = "zmk,keymap";

default_layer {
// ------------------------------------------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd either correct the commented layer diagrams or remove them altogether.

// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` |
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | - |
// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHIFT | Z | X | C | V | B | "[" | | "]" | N | M | , | . | / | SHIFT |
// | ALT | GUI | LOWER| SPACE | | ENTER | RAISE| BSPC | GUI |
bindings = <

&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&hm LGUI A &hm LALT S &hm LCTRL D &hm LSHFT F &kp G &kp H &hm RSHFT J &hm LCTRL K &hm RALT L &hm RGUI APOS
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH
&lt MEDR ESC &lt NAVR SPACE &lt MOUR TAB &lt NSSL RET &lt NSL BSPC &lt FUNL DEL
>;


};

navr_layer {
// ------------------------------------------------------------------------------------------------------------
// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ |
// | | | | | | | | | | | _ | + | { | } | "|" |
// | | | | | | | | | |
bindings = <

&trans &trans &trans &trans &trans &kp C_AC_REDO &kp C_AC_PASTE &kp C_AC_COPY &kp C_AC_CUT &kp C_AC_UNDO
&trans &trans &trans &trans &trans &kp CAPS &kp LEFT &kp DOWN &kp UP &kp RIGHT
&trans &trans &trans &trans &trans &kp INS &kp HOME &kp PG_DN &kp PG_UP &kp END
&trans &trans &trans &trans &trans &trans
>;


};

mour_layer {
// ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | |
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | |
// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ |
// | | | | | | | | | |
bindings = <
&kp F12 &kp F7 &kp F8 &kp F9 &kp PSCRN &trans &trans &trans &trans &trans
&kp F11 &kp F4 &kp F5 &kp F6 &kp SLCK &trans &trans &trans &trans &trans
&kp F10 &kp F1 &kp F2 &kp F3 &kp PAUSE_BREAK &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans
>;


};

medr_layer {
// ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | |
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | |
// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ |
// | | | | | | | | | |
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_NEXT
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &kp C_STOP &kp C_PP &kp C_MUTE
>;


};

nsl_layer {
// ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | |
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | |
// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ |
// | | | | | | | | | |
bindings = <
&kp LBKT &kp N7 &kp N8 &kp N9 &kp RBKT &trans &trans &trans &trans &trans
&kp SEMICOLON &kp N4 &kp N5 &kp N6 &kp EQUAL &trans &trans &trans &trans &trans
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp BSLH &trans &trans &trans &trans &trans
&kp DOT &kp N0 &kp MINUS &trans &trans &trans
>;


};

nssl_layer {
// ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | |
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | |
// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ |
// | | | | | | | | | |
bindings = <
&kp LS(LBKT) &kp LS(N7) &kp LS(N8) &kp LS(N9) &kp LS(RBKT) &trans &trans &trans &trans &trans
&kp LS(SEMICOLON) &kp LS(N4) &kp LS(N5) &kp LS(N6) &kp LS(EQUAL) &trans &trans &trans &trans &trans
&kp LS(GRAVE) &kp LS(N1) &kp LS(N2) &kp LS(N3) &kp LS(BSLH) &trans &trans &trans &trans &trans
&kp LS(DOT) &kp LS(N0) &kp LS(MINUS) &trans &trans &trans
>;


};

funl_layer {
// ------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | |
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | |
// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ |
// | | | | | | | | | |
bindings = <
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this identical to the MOUR layer?


&kp F12 &kp F7 &kp F8 &kp F9 &kp PSCRN &trans &trans &trans &trans &trans
&kp F11 &kp F4 &kp F5 &kp F6 &kp SLCK &trans &trans &trans &trans &trans
&kp F10 &kp F1 &kp F2 &kp F3 &kp PAUSE_BREAK &trans &trans &trans &trans &trans
&kp K_APP &kp SPACE &kp TAB &trans &trans &trans
>;


};

};

};
10 changes: 10 additions & 0 deletions app/boards/shields/pteron36/pteron36.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file_format: "1"
id: pteron36
name: Pteron36
type: shield
requires: [pro_micro]
features:
- keys
siblings:
- pteron36_left
- pteron36_right
17 changes: 17 additions & 0 deletions app/boards/shields/pteron36/pteron36_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/

#include "pteron36.dtsi"

&kscan0 {
col-gpios
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
Comment on lines +8 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&kscan0 {
col-gpios
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

Moved to app/boards/shields/pteron36/pteron36.dtsi.

};
21 changes: 21 additions & 0 deletions app/boards/shields/pteron36/pteron36_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/

#include "pteron36.dtsi"

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

&kscan0 {
col-gpios
= <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
Comment on lines +12 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&kscan0 {
col-gpios
= <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

Moved to app/boards/shields/pteron36/pteron36.dtsi.

};