feat(shields): Add Eternal Keypad

* Add Eternal Keypad

Co-authored-by: Duccio <ducciobreschi@gmail.com>
This commit is contained in:
Elliot Pahl 2022-09-06 08:07:02 +10:00 committed by GitHub
parent 391f80f069
commit ce7a0e2b6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 271 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_ETERNAL_KEYPAD || SHIELD_ETERNAL_KEYPAD_LEFTY
config ZMK_KEYBOARD_NAME
default "Eternal Keypad"
endif

View file

@ -0,0 +1,8 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_ETERNAL_KEYPAD
def_bool $(shields_list_contains,eternal_keypad)
config SHIELD_ETERNAL_KEYPAD_LEFTY
def_bool $(shields_list_contains,eternal_keypad_lefty)

View file

@ -0,0 +1,10 @@
# Eternal Keypad
Eternal Keypad is an open-source input device for gaming that can be assembled for both right and left hand mouse users.
Firmware is described in the [Eternal Keypad](https://github.com/duckyb/eternal-keypad) repository [README](https://github.com/duckyb/eternal-keypad#firmware).
Two keymaps are included:
- eternal_keypad (default)
- eternal_keypad_lefty (for left handed users)

View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/led/led.h>
&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
status = "okay";
mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>;
miso-pin = <7>;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "SK6812mini";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <8>;
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;
};
};

View file

@ -0,0 +1,9 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
# Uncomment to turn on logging, and set ZMK logging to debug output
# CONFIG_ZMK_USB_LOGGING=y
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View file

@ -0,0 +1,53 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&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)>
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <8>;
rows = <5>;
map = <
RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7)
RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7)
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(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7)
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,5) RC(4,7)
>;
};
};

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>
#define BASE 0
#define ARROW 1
#define FUNC 2
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp N7
&kp F13 &kp ENTER &kp A &kp S &kp D &kp F &kp G &kp N8
&kp F14 &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N9
&kp F15 &kp LCTRL &sl FUNC &kp LALT &kp SPACE &lt ARROW N0
>;
};
arrow_layer {
bindings = <
&bt BT_SEL 0 &bt BT_SEL 1 &trans &trans &trans &out OUT_USB &out OUT_BLE
&trans &trans &kp UP &trans &rgb_ug RGB_TOG &rgb_ug RGB_HUI &rgb_ug RGB_HUD
&bt BT_CLR &trans &kp LEFT &kp DOWN &kp RIGHT &trans &rgb_ug RGB_BRI &rgb_ug RGB_BRD
&reset &trans &trans &trans &trans &trans &rgb_ug RGB_EFF &rgb_ug RGB_EFR
&bootloader &trans &trans &trans &trans &trans
>;
};
function_layer {
bindings = <
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6
&trans &kp P &kp O &kp I &kp U &kp Y &kp F7
&bt BT_CLR &kp BSPC &kp SEMI &kp L &kp K &kp J &kp H &kp F8
&reset &trans &kp LGUI &kp M &kp N &kp F12 &kp F11 &kp F9
&bootloader &trans &trans &trans &trans &kp F10
>;
};
};
};

View file

@ -0,0 +1,7 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "eternal_keypad.dtsi"

View file

@ -0,0 +1,9 @@
file_format: "1"
id: eternal_keypad
name: Eternal Keypad
type: shield
url: https://github.com/duckyb/eternal-keypad
requires: [pro_micro]
features:
- keys
- underglow

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>
#define BASE 0
#define ARROW 1
#define FUNC 2
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp N7
&kp F13 &kp ENTER &kp D &kp S &kp A &kp F &kp G &kp N8
&kp F14 &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N9
&kp F15 &kp LCTRL &sl FUNC &kp LALT &kp SPACE &lt ARROW N0
>;
};
arrow_layer {
bindings = <
&bt BT_SEL 0 &bt BT_SEL 1 &trans &trans &trans &out OUT_USB &out OUT_BLE
&trans &trans &kp UP &trans &rgb_ug RGB_TOG &rgb_ug RGB_HUI &rgb_ug RGB_HUD
&bt BT_CLR &trans &kp RIGHT &kp DOWN &kp RIGHT &trans &rgb_ug RGB_BRI &rgb_ug RGB_BRD
&reset &trans &trans &trans &trans &trans &rgb_ug RGB_EFF &rgb_ug RGB_EFR
&bootloader &trans &trans &trans &trans &trans
>;
};
function_layer {
bindings = <
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6
&trans &kp P &kp O &kp I &kp U &kp Y &kp F7
&bt BT_CLR &kp BSPC &kp SEMI &kp L &kp K &kp J &kp H &kp F8
&reset &trans &kp LGUI &kp M &kp N &kp F12 &kp F11 &kp F9
&bootloader &trans &trans &trans &trans &kp F10
>;
};
};
};

View file

@ -0,0 +1,7 @@
/*
* Copyright (c) 202 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "eternal_keypad.dtsi"

View file

@ -0,0 +1,9 @@
file_format: "1"
id: eternal_keypad_lefty
name: Eternal Keypad Lefty
type: shield
url: https://github.com/duckyb/eternal-keypad
requires: [pro_micro]
features:
- keys
- underglow