Skip to content

Commit

Permalink
Base Narfpad config (#2)
Browse files Browse the repository at this point in the history
Add a base keymap for the Narfpad 
 - check all connections
 - set up keys and encoders
 - get RGB indicator working
 - check Bluetooth

* Update build.yaml

* Create Kconfig.shield

* Create Kconfig.defconfig

* Create narfpad.overlay

faked -gpio numbers need to be set

* Update narfpad.overlay

add matrix

* Update narfpad.overlay

* Create narfpad.keymap

* Create narfpad.zmk.yml

* Create narfpad.conf

* Update narfpad.zmk.yml

* Update narfpad.conf

* Update narfpad.overlay

* Update narfpad.keymap

* Update narfpad.overlay

* Update narfpad.overlay

* Update narfpad.keymap

* Update narfpad.overlay

* Update build.yml

* Update build.yaml

* change file names

* fix Kconfigs

* added files

* more reconcile

* 3x3

* pruning

* add kpd

* fix kpd

* change to 3x3

* fix pin numbers on narfpad

* add encoder col

* fix layout

* rearrange

* letters

* rm pulldowns

* redo matrix, add rgb

* redo matrix, add rgb

* w wout

* encoder?

* just encoder

* encoder

* all working base

* add usb/bt toggle

* formatting

* nums

---------

Co-authored-by: Dane Evans <[email protected]>
  • Loading branch information
DaneEvans and Dane-2pi authored Sep 27, 2024
1 parent ddd6e9d commit 72e7b5b
Show file tree
Hide file tree
Showing 21 changed files with 290 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
Expand Down
Binary file modified boards/shields/.DS_Store
Binary file not shown.
Binary file added boards/shields/kpd/.DS_Store
Binary file not shown.
9 changes: 9 additions & 0 deletions boards/shields/kpd/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_KPD

config ZMK_KEYBOARD_NAME
default "KPD"

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

config SHIELD_KPD
def_bool $(shields_list_contains,kpd)
Empty file added boards/shields/kpd/kpd.conf
Empty file.
27 changes: 27 additions & 0 deletions boards/shields/kpd/kpd.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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;

};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <3>;
rows = <3>;
map = <

RC(0,0) RC(0,1) RC(0,2)
RC(1,0) RC(1,1) RC(1,2)
RC(2,0) RC(2,1) RC(2,2)
>;
};
};
22 changes: 22 additions & 0 deletions boards/shields/kpd/kpd.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

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

default_layer {
// -----------------------------------------------------------
// | 1 | 2 | 3 |
// | 4 | 5 | 6 |
// | 7 | 8 | 9 | 0
bindings = <
&kp 1 &kp 2 &kp 3
&kp 3 &kp 4 &kp 5
&kp 6 &kp 7 &kp 8
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};
};
};
28 changes: 28 additions & 0 deletions boards/shields/kpd/kpd.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "kpd.dtsi"

/ {
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "row2col";
row-gpios
=
<&xiao_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
,
<&xiao_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
,
<&xiao_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;


col-gpios
=
<&xiao_d 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
,
<&xiao_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
,
<&xiao_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

};
};
11 changes: 11 additions & 0 deletions boards/shields/kpd/kpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
file_format: "1"
id: kpd
name: kpd
type: shield
url: https://github.com/makgyber/zmk-config
requires: [seeeduino_xiao_ble]
features:
- keys
# siblings:
# - kiai_left
# - kiai_right
11 changes: 11 additions & 0 deletions boards/shields/kpd/west.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
self:
path: config
9 changes: 9 additions & 0 deletions boards/shields/narfpad/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


if SHIELD_NARFPAD

config ZMK_KEYBOARD_NAME
default "NARFPAD"

endif

6 changes: 6 additions & 0 deletions boards/shields/narfpad/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@



config SHIELD_NARFPAD
def_bool $(shields_list_contains,narfpad)

8 changes: 8 additions & 0 deletions boards/shields/narfpad/narfpad.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Uncomment to enable encoder
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y





45 changes: 45 additions & 0 deletions boards/shields/narfpad/narfpad.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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;

};

left_encoder: encoder_left {
compatible = "alps,ec11";
a-gpios = <&xiao_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&xiao_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
status = "disabled";
};



default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <4>;
rows = <3>;
map = <

RC(0,1) RC(0,2) RC(0,3)
RC(1,1) RC(1,2) RC(1,3)
RC(2,0) RC(2,1) RC(2,2) RC(2,3)
>;
};

sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};


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



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

default_layer {
// -----------------------------------------------------------
// | 1 | 2 | 3 |
// | 4 | 5 | 6 |
// 0 | 7 | 8 | 9 |
bindings = <
&kp N1 &kp N2 &kp N3
&kp N4 &kp N5 &kp N6
&out OUT_TOG &kp N7 &kp N8 &kp N9
>;

sensor-bindings = <&inc_dec_kp U D>;
};
};
};
32 changes: 32 additions & 0 deletions boards/shields/narfpad/narfpad.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

#include "narfpad.dtsi"

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


col-gpios
= <&xiao_d 3 (GPIO_ACTIVE_HIGH)>
, <&xiao_d 2 (GPIO_ACTIVE_HIGH)>
, <&xiao_d 1 (GPIO_ACTIVE_HIGH)>
, <&xiao_d 0 (GPIO_ACTIVE_HIGH)>

;

row-gpios
= <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};

&left_encoder {
status = "okay";
};


17 changes: 17 additions & 0 deletions boards/shields/narfpad/narfpad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
file_format: "1"
id: narfpad
name: Narfpad
type: shield
url: https://github.com/sebastian-stumpf/narfpad
# requires: [pro_micro]
requires: [seeeduino_xiao_ble]
# exposes: [i2c_oled]
features:
- keys
- encoder
# - underglow
# - backlight
# siblings:
# - corne_left
# - corne_right

17 changes: 17 additions & 0 deletions boards/shields/narfpad/west.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: caksoylar # RGBlight
url-base: https://github.com/caksoylar

projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
- name: zmk-rgbled-widget # RGBlight
remote: caksoylar
revision: main
self:
path: config
12 changes: 9 additions & 3 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
---
include:
- board: seeeduino_xiao_ble
shield: kiai_left
- board: seeeduino_xiao_ble
shield: kiai_right
shield: narfpad rgbled_adapter
# - board: seeeduino_xiao_ble
# shield: kiai_left
# - board: seeeduino_xiao_ble
# shield: kiai_right
# - board: seeeduino_xiao_ble
# shield: kpd
# - board: seeeduino_xiao_ble
# shield: narfpad
8 changes: 6 additions & 2 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
# Additional modules containing boards/shields/custom code can be listed here as well
# See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects
- name: caksoylar # RGBlight
url-base: https://github.com/caksoylar

projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
- name: zmk-rgbled-widget # RGBlight
remote: caksoylar
revision: main
self:
path: config

0 comments on commit 72e7b5b

Please sign in to comment.